Re: Debian Interix chroot?
On Mon, 19 Apr 2010, Sinbios Li wrote:
On 18/04/2010 6:05 AM, Martin Koeppe wrote:
Hi Sin,
On Thu, 15 Apr 2010, Sinbios Li wrote:
Hi, I've been trying out your Debian Interix port but I would like to
preserve the Interix environment at the same time. I saw some mentions of
a chroot bootstrap mode in the setup scripts and was wondering if you
wouldn't mind walking me through the procedure to set up a chrooted Debian
environment.
first of all sorry for the late reply. I was busy with other things the
last days.
Thanks for your interest in debian-interix. I'll send a copy of this mail
to the mailing list for archiving.
To your question: A complete chroot install (without modifying anything
outside the chroot) is not supported. I created the chroot options for
creating another debian-interix installation on top of an existing one for
automated package building.
Such a build chroot only works on Vista and above, because the chroot()
syscall is unfortunately broken on older versions,
see http://debian-interix.net/bugs/kernel/#chroot for details.
Another limitation even on Vista and above exists: there is no /proc file
system within a chroot which makes some programs fail. And you can't
connect to network shares from within the chroot either, because /dev/fs
and /net work only in the main system.
I have scripts to set up such a build chroot, but these scripts require
several files/programs of debian-interix in the main system to run
correctly (debootstrap, apt-get, etc.).
If you don't want to modify anything outside the chroot, you might look at
the gentoo prefix. If you just need a backup to return to after testing,
you can copy all files of C:\WINDOWS\SUA to a backup dir, and then test
install debian-interix. If you need to revert, you can rename the copy.
debian-interix doesn't install anything outside of C:\WINDOWS\SUA.
If you want to do a normal debian-interix install and have difficulties
with it or if you have a running debian-interix install and want to set up
a chroot within it, I'll help you with it.
Hope this helps
Martin
Hi Martin,
I've set up a base Debian Interix system, what's the next step? The main
reason I wanted to do a chroot was to avoid conflicts with Interop packages.
Hi Sin,
here is my script to setup a chroot environment.
Most of the work is done by debootstrap, only little tweaking is
necessary. You need to adapt the script to your environment, however.
Martin
#! /bin/sh -e
CHROOT=/srv/build/chroot-unstable
rm -rf $CHROOT
mkdir -p $CHROOT/bin
mkdir -p $CHROOT/usr/bin
mkdir -p $CHROOT/usr/lib
mkdir -p $CHROOT/usr/sbin
mkdir -p $CHR21OOT/usr/local/bin
mkdir -p $CHROOT/build/$USER
mkdir -p $CHROOT/var/lib/sbuild/srcdep-lock
ln -sf /bin/true $CHROOT/usr/sbin/update-rc.d
cp /bin/kill $CHROOT/bin/
#hack for vista
cp /lib/libc.so.3.5 $CHROOT/usr/lib/
KEEP_DEBOOTSTRAP_DIR=true debootstrap \
--verbose \
--variant=buildd \
unreleased35 $CHROOT \
file:///misc/pub/debian-interix \
/misc/pub/debian-interix/interix-chroot-script
cp -f /usr/bin/getopt $CHROOT/usr/bin/
cp -f /etc/apt/sources.list.chroot $CHROOT/etc/apt/sources.list
cp -f /etc/apt/preferences $CHROOT/etc/apt/
cp -f /etc/resolv.conf $CHROOT/etc/
cp -f /usr/lib/libcrypt.a $CHROOT/usr/lib/
cp -f /usr/lib/libpthread.a $CHROOT/usr/lib/
cp -f /opt/gcc.3.3/include/dlfcn.h $CHROOT/usr/include/
ln -s /lib/libdl.so.3.5 $CHROOT/usr/lib/libdl.so
touch $CHROOT/etc/ld.so.conf
touch $CHROOT/etc/passwd
chrapt-get update
chrapt-get --yes -f upgrade
# changed --yes below to --force-yes for grep, no more necessary, grep now in unreleased35
chrapt-get --yes install \
perl-modules/unreleased35 \
perl \
dpkg-dev/unreleased35 \
debhelper/unreleased35 \
debian-archive-keyring \
build-essential \
ms-libc3.5-sfu3.5-dev \
binutils \
binutils-sfu3.5 \
g++ \
libm-newlib-dev \
libiconv-dev \
gettext \
cdbs \
texi2html \
# patch texi2html
t2h=$CHROOT/usr/bin/texi2html
mv $t2h $t2h.orig
echo '#! /usr/bin/perl' > $t2h
cat $t2h.orig >> $t2h
chmod 0755 $t2h
Reply to: