NSLU2-Linux
view · edit · print · history

DS101.Debian History

Hide minor edits - Show changes to markup

December 20, 2006, at 07:19 PM by czh -- deboostrap link update
Changed lines 42-43 from:

pc$ wget http://ftp.de.debian.org/debian/pool/main/d/debootstrap/debootstrap_0.3.3_all.deb pc$ dpkg --install debootstrap_0.3.3_all.deb

to:

pc$ wget http://ftp.de.debian.org/debian/pool/main/d/debootstrap/debootstrap_0.3.3.1_all.deb pc$ dpkg --install debootstrap_0.3.3.1_all.deb

July 01, 2006, at 08:56 AM by czh -- warning to avoid a problem
Added lines 64-65:

tar should not display any errors or warning like "convert sym links to ...". The best to transfert archive is to do it from the local PC under linux, not from windows.

January 07, 2006, at 04:39 PM by tman --
Changed lines 1-16 from:

If you have ds101g+, you have a platform with a PowerPC? processor which is supported in mainstream port of debian. Playing around with debian on the box could be done without compilation, flashing and installing other things in the base system.

Later on, i show you how to create a debian chroot which is capable of running any debian package on this system within minutes.

For People with a non-g (ds101, j) with arm architecture, i expect, there's no standard debian port usable. The arm port of debian is little endian, while the ds runs under big endian. Thus, you need to replace the kernel and drive the box in little endian mode to be able to use the arm port. As an alternative you may consider using the compiled armeb packages of http://www.debonaras.org to reproduce the chroot approach or upgrade completely to debonaras (i have no experience in this since i don't get such a ds).

The team is also working on making armeb a standard debian port, but this will take some time to finish.

to:

If you have a DS101g+, you have a PowerPC architecture which is supported in mainstream Debian. You can either replace the entire distribution with Debian or as the instructions here show you, run it all in a chroot jail and therefore not need to modify anything else.

Changed lines 4-9 from:

The standard way to install a debian system on a non-debian platform is to use debootstrap. Since i expect you have a non PowerPC?-platform, building the chroot-environment means cross-building. Debootstrap describes to be cross-platform'able but as of my testing, you need to run debootstrap on target. (running debootstrap wants to chroot into target and execute some stuff even in cross-build mode which couldn't work!)

to:

The standard way to install a Debian system on a non-Debian platform is to use debootstrap. Since it is most likely that you are not using a PowerPC platform, building the chroot-environment requires cross compilation.

Debootstrap is designed to be cross-platform'able but in my experience, you must run debootstrap on the target. Running debootstrap wants to chroot into the target and execute stuff even in cross-build mode which obviously won't work!

Changed lines 10-28 from:
  • No Flashing
  • No modification of stock Systemfiles
  • Sandbox-like environment on the ds with real production functionality!
  • Full access to 16'000 debian packages within minutes

This update already has been updated, since the first release did a workaround for cross-platform issues which isn't needed anymore!

You need to have console access to the ds (with attached /volume1), which means one of the following:

These types of access i simply name console and of course you need the client programs on the pc. ;)

Lines beginning with ds# need to be executed on target ds console, while lines with leading pc$ are to be executed on your pc.

Now we create folders for the debian project and roots under project home.

to:
  • No flashing of the firmware required
  • No modification of stock system files required.
  • Sandbox-like environment on the DS101g+ with real production functionality!
  • Full access to over 16,000 debian packages within minutes

You need to have console access to the DS101g+ (with attached /volume1), which means one of the following:

The rest of this howto will refer to all types of access as using the console.

Lines beginning with ds# need to be executed on target DS101g+ console, while lines with leading pc$ are to be executed on your local PC.

Now we create folders for the Debian project and roots under project home.

Changed lines 40-41 from:

Get debootstrap, but even if you install sarge and stable, i recommend the newest version of the debootstrap script due to updated cross-platform implementation. For debian users:

to:

Get debootstrap. Even if you intend to install sarge and stable, it is recommended that you use the newest version of the debootstrap script due to updates. For debian users:

Changed lines 46-47 from:

Execute debootstraps first stage to fetch all packages for target platform:

to:

Execute debootstraps first stage to fetch all packages for the target platform:

Changed lines 52-53 from:

Now we move this folder root to target!

to:

Now we move this folder root to target...

Changed lines 58-59 from:

Move the tar with your preferred way to target (ftp, smb, sftp, ...) /volume1/public/debian and untar

to:

Copy the tar file using your preferred method (SMB, NFS, SFTP etc...) to the target in /volume1/public/debian and untar.

Changed lines 70-71 from:

Some things to configure before running chroot debian!

to:

Some things to configure before running chroot debian:

Changed lines 78-79 from:

Setup hostname

to:

Setup the hostname

Changed lines 107-108 from:

And finally update and upgrade apt repository

to:

And finally update and upgrade the apt repository

Changed lines 114-120 from:

If you start services, you need to know that they still run remaining and jailed, after leaving chroots interactive bash with exit. But if you want to run persistent services, you have to execute chroot with mount proc and start service. Sure, don't forget that each service only have access to the jailed root!

Simple sample on running some service (execute not on chrooted!):

to:

If you start any services now, they will be running within the jail. If you want certain services to autostart without requiring you to login then you must use chroot. Remember, any services running in the chroot jail is not able to access anything outside of the jail in the filesystem.

Example of how to run a service which starts within the jail:

Changed line 126 from:

Have Fun! Miro Dietiker

to:

Have Fun! Miro Dietiker

January 02, 2006, at 05:11 PM by Miro Dietiker -- ds#, pc$
Changed line 39 from:

Lines beginning with ds$ need to be executed on target ds console, while lines with leading pc#

to:

Lines beginning with ds# need to be executed on target ds console, while lines with leading pc$

January 02, 2006, at 05:10 PM by Miro Dietiker -- Release 2, updated debootstrap cross-platform support (much more simple to do)
Added lines 30-31:

This update already has been updated, since the first release did a workaround for cross-platform issues which isn't needed anymore!

Changed lines 42-43 from:

Now we create folders for the debian project

to:

Now we create folders for the debian project and roots under project home.

Changed lines 45-46 from:

pc$ mkdir -p ~/ds101g/debian ds# mkdir -p /volume1/public/debian

to:

pc$ mkdir -p ~/ds101g/debian/chroottarget ds# mkdir -p /volume1/public/debian/chroottarget

Changed lines 56-57 from:

We need a place for the target root

to:

Get debootstrap, but even if you install sarge and stable, i recommend the newest version of the debootstrap script due to updated cross-platform implementation. For debian users:

Changed lines 59-60 from:

ds# mkdir -p /volume1/public/debian/root

to:

pc$ wget http://ftp.de.debian.org/debian/pool/main/d/debootstrap/debootstrap_0.3.3_all.deb pc$ dpkg --install debootstrap_0.3.3_all.deb

Changed lines 63-66 from:

Get all debian debootstrap related packages (note there's much more dependencies than listed on apt-cache show debootstrap. On a debian pc one could create a file with pathes to these downloads this way:

to:

Execute debootstraps first stage to fetch all packages for target platform:

Changed lines 66-72 from:

pc$ apt-cache show base-files base-passwd bash binutils coreutils debianutils debootstrap gawk grep gzip libacl1 libattr1 libc6 libcap1 libdb1-compat libdb3 libgcc1 libncurses5 libpam0g libpam-modules libpam-runtime libssl0.9.7 login passwd sed tar wget | grep Filename: | sed "s/Filename: //" | sed "s/i386.deb/powerpc.deb/" > debootstrap-packages

to:

pc$ debootstrap --foreign --arch powerpc sarge chroottarget "http://ftp.de.debian.org/debian"

Changed lines 69-70 from:

For non-debian users:

to:

Now we move this folder root to target!

Changed lines 72-100 from:

pc$ cat << EOF > debootstrap-packages pool/main/b/base-files/base-files_3.1.2_arm.deb pool/main/b/base-passwd/base-passwd_3.5.9_arm.deb pool/main/b/bash/bash_2.05b-26_arm.deb pool/main/b/binutils/binutils_2.15-6_arm.deb pool/main/c/coreutils/coreutils_5.2.1-2_arm.deb pool/main/d/debianutils/debianutils_2.8.4_arm.deb pool/main/d/debootstrap/debootstrap_0.2.45-0.2_arm.deb pool/main/g/gawk/gawk_3.1.4-2_arm.deb pool/main/g/grep/grep_2.5.1.ds1-4_arm.deb pool/main/g/gzip/gzip_1.3.5-10sarge1_arm.deb pool/main/a/acl/libacl1_2.2.23-1_arm.deb pool/main/a/attr/libattr1_2.4.16-1_arm.deb pool/main/g/glibc/libc6_2.3.2.ds1-22_arm.deb pool/main/libc/libcap/libcap1_1.10-14_arm.deb pool/main/d/db1-compat/libdb1-compat_2.1.3-7_arm.deb pool/main/d/db3/libdb3_3.2.9-22_arm.deb pool/main/g/gcc-3.4/libgcc1_3.4.3-13_arm.deb pool/main/n/ncurses/libncurses5_5.4-4_arm.deb pool/main/p/pam/libpam0g_0.76-22_arm.deb pool/main/p/pam/libpam-modules_0.76-22_arm.deb pool/main/p/pam/libpam-runtime_0.76-22_all.deb pool/main/o/openssl/libssl0.9.7_0.9.7e-3sarge1_arm.deb pool/main/s/shadow/login_4.0.3-31sarge5_arm.deb pool/main/s/shadow/passwd_4.0.3-31sarge5_arm.deb pool/main/s/sed/sed_4.1.2-8_arm.deb pool/main/t/tar/tar_1.14-2_arm.deb pool/main/w/wget/wget_1.9.1-12_arm.deb EOF

to:

pc$ tar -czf chroottarget.tar.gz chroottarget

Changed lines 75-76 from:

Now one could download all these packages:

to:

Move the tar with your preferred way to target (ftp, smb, sftp, ...) /volume1/public/debian and untar

Changed line 78 from:

pc$ wget -r -P download -B "http://ftp.de.debian.org/debian/" -i debootstrap-packages

to:

ds# tar -xzf chroottarget.tar.gz

Changed lines 81-84 from:

Wait some seconds to download all this stuff!

Next step is to extract the base chroot from those files!

to:

Finish debootstrap second stage on target platform.

Changed lines 84-90 from:

pc$ mkdir root tmp pc$ for i in `find download -name *.deb` do

  (cd tmp && ar -xf "../$i")
  (cd root && tar -xzf "../tmp/data.tar.gz")

done pc$ rm tmp

to:

ds# chroot chroottarget /debootstrap/debootstrap --second-stage

Changed lines 87-88 from:

Now we move this folder root to target!

to:

Some things to configure before running chroot debian! Make name resolving available

Changed line 91 from:

pc$ tar -czf root.tar.gz root

to:

ds# cp /etc/resolv.conf chroottarget/etc/

Changed lines 94-95 from:

Move the tar with your preferred way to target (ftp, smb, sftp, ...) /volume1/public/debian and untar

to:

Setup hostname

Changed line 97 from:

ds# tar -xzf root.tar.gz

to:

ds# cp /etc/hostname chroottarget/etc/

Changed lines 100-102 from:

Some things to configure before running chroot debian! Make name resolving available

to:

Copy passwd, group shadow files

Changed lines 103-105 from:

ds# cp /etc/resolv.conf root/etc/resolv.conf

to:

ds# cp /etc/passwd chroottarget/etc/ ds# cp /etc/shadow chroottarget/etc/ ds# cp /etc/group chroottarget/etc/

Changed lines 108-109 from:

Make md5sum available for debootstrap

to:

The minimal system setup is there and debootstrap can setup debian tools:

Changed lines 111-112 from:

ds# ln -fs /usr/bin/md5sum.textutils root/usr/bin/md5sum

to:

ds# chroot chroottarget /bin/bash chroot-ds# mount -t proc proc /proc

Changed lines 115-116 from:

Setup hostname

to:

Now configure debian completely (show dialogs) as you like. The base-system is already fully functional. E.g.

Changed lines 119-120 from:

ds# cp /etc/hostname root/etc/

to:

chroot-ds# base-config chroot-ds# dpkg-reconfigure --priority low --all

Changed lines 123-124 from:

Copy passwd, group shadow files

to:

And finally update and upgrade apt repository

Changed lines 126-129 from:

ds# cp /etc/passwd root/etc/ ds# cp /etc/shadow root/etc/ ds# cp /etc/group root/etc/ ds# cp /etc/gshadow root/etc/

to:

chroot-ds# apt-get update && apt-get upgrade

Changed lines 129-130 from:

The minimal system setup is there and debootstrap can setup debian tools:

to:

Now you have access to any debian package you want! If you start services, you need to know that they still run remaining and jailed, after leaving chroots interactive bash with exit. But if you want to run persistent services, you have to execute chroot with mount proc and start service. Sure, don't forget that each service only have access to the jailed root!

Simple sample on running some service (execute not on chrooted!):

Changed lines 138-140 from:

ds# chroot root /bin/bash chroot-ds# mount -t proc proc /proc chroot-ds# /usr/sbin/debootstrap --arch powerpc sarge . "http://ftp.de.debian.org/debian"

to:

ds# chroot /volume1/public/debian/chroottarget /bin/bash -c "mount -t proc proc /proc" ds# chroot /volume1/public/debian/chroottarget /bin/bash -c "/etc/init.d/ssh start"

Deleted lines 141-167:

This may take some time to finish!

Configure debian completely (show dialogs)

chroot-ds# base-config

And finally update and upgrade apt repository

chroot-ds# apt-get update && apt-get upgrade

Now you have access to any debian package you want! If you start services, you need to know that they still run remaining and jailed, after leaving chroots interactive bash with exit. But if you want to run persistent services, you have to execute chroot with mount proc and start service. Sure, don't forget that each service only have access to the jailed root!

Simple sample on running some service (execute not on chrooted!):

ds# chroot root /bin/bash -c "mount -t proc proc /proc"
ds# chroot root /bin/bash -c "/etc/init.d/ssh start"
December 30, 2005, at 07:16 PM by Miro Dietiker -- sure base-config instead of dpkg-reconfigure -a
Changed lines 178-179 from:

Reconfigure debian sompletely (show dialogs)

to:

Configure debian completely (show dialogs)

Changed line 181 from:

chroot-ds# dpkg-reconfigure -a

to:

chroot-ds# base-config

December 30, 2005, at 06:20 PM by Miro Dietiker -- formatting and minimal corrections
Changed lines 134-135 from:

Move it with your preferred way to target (ftp, smb, sftp, ...) /volume1/public/debian

to:

Move the tar with your preferred way to target (ftp, smb, sftp, ...) /volume1/public/debian and untar

December 30, 2005, at 06:13 PM by Miro Dietiker -- Initial debian chroot release (corrected formatting)
Changed lines 1-4 from:

If you have ds101g+, you have a platform with a PowerPC? processor which is supported in mainstream port of debian. Playing around with debian on the box could be done without compilation, flashing and installing other things in the base system. Later on, i show you how to create a debian chroot which is capable of running any debian package on this system within minutes.

For People with a non-g (ds101, j) with arm architecture, i expect, there's no standard debian port usable. The arm port of debian is little endian, while the ds runs under big endian. Thus, you need to replace the kernel and drive the box in little endian mode to be able to use the arm port. As an alternative you may consider using the compiled armeb packages of http://www.debonaras.org to reproduce the chroot approach or upgrade completely to debonaras (i have no experience in this since i don't get such a ds).

to:

If you have ds101g+, you have a platform with a PowerPC? processor which is supported in mainstream port of debian. Playing around with debian on the box could be done without compilation, flashing and installing other things in the base system.

Later on, i show you how to create a debian chroot which is capable of running any debian package on this system within minutes.

For People with a non-g (ds101, j) with arm architecture, i expect, there's no standard debian port usable. The arm port of debian is little endian, while the ds runs under big endian. Thus, you need to replace the kernel and drive the box in little endian mode to be able to use the arm port. As an alternative you may consider using the compiled armeb packages of http://www.debonaras.org to reproduce the chroot approach or upgrade completely to debonaras (i have no experience in this since i don't get such a ds).

Changed lines 19-20 from:

Since i expect you have a non PowerPC?-platform, building the chroot-environment means cross-building. Debootstrap describes to be cross-platform'able but as of my testing, you need to run debootstrap on target. (running debootstrap wants to chroot into target and execute some stuff even in cross-build mode which couldn't work!)

to:

Since i expect you have a non PowerPC?-platform, building the chroot-environment means cross-building. Debootstrap describes to be cross-platform'able but as of my testing, you need to run debootstrap on target. (running debootstrap wants to chroot into target and execute some stuff even in cross-build mode which couldn't work!)

Changed line 27 from:
  • Sandbox like environment on the ds
to:
  • Sandbox-like environment on the ds with real production functionality!
Changed lines 37-38 from:

Lines beginning with ds$ need to be executed on target ds console, while lines with leading pc# are to be executed on your pc.

to:

Lines beginning with ds$ need to be executed on target ds console, while lines with leading pc# are to be executed on your pc.

Added line 41:
Added line 46:
Added lines 48-49:

[@

Changed lines 52-53 from:
to:

@]

Added lines 55-56:

[@

Changed lines 58-62 from:

get all debian debootstrap related packages (note there's much more dependencies than listed on apt-cache show debootstrap. We need the following debs in powerpc architecture (download only):

to:

@]

Get all debian debootstrap related packages (note there's much more dependencies than listed on apt-cache show debootstrap.

Changed lines 63-66 from:

pc$ apt-cache show base-files base-passwd bash binutils coreutils debianutils debootstrap

gawk grep gzip libacl1 libattr1 libc6 libcap1 libdb1-compat libdb3 libgcc1 libncurses5

to:

[@ pc$ apt-cache show base-files base-passwd bash binutils coreutils debianutils debootstrap gawk grep gzip libacl1 libattr1 libc6 libcap1 libdb1-compat libdb3 libgcc1 libncurses5 \

Changed lines 72-73 from:
to:

@]

Added lines 75-76:

[@

Changed lines 106-107 from:
to:

@]

Added lines 109-110:

[@

Added lines 112-113:

@]

Added lines 117-118:

[@

Changed lines 120-122 from:

pc$ for i in `find download -name *.deb`; do (cd tmp && ar -xf "../$i"); (cd root && tar

-xzf "../tmp/data.tar.gz"); done

to:

pc$ for i in `find download -name *.deb` do

  (cd tmp && ar -xf "../$i")
  (cd root && tar -xzf "../tmp/data.tar.gz")

done

Changed lines 126-127 from:
to:

@]

Added lines 129-130:

[@

Added lines 132-133:

@]

Added lines 135-136:

[@

Changed lines 138-139 from:
to:

@]

Added lines 142-143:

[@

Added lines 145-146:

@]

Added lines 148-149:

[@

Added lines 151-152:

@]

Added lines 154-155:

[@

Added lines 157-158:

@]

Added lines 160-161:

[@

Changed lines 166-167 from:
to:

@]

Added lines 169-170:

[@

Added lines 174-175:

@]

Added lines 179-180:

[@

Added lines 182-183:

@]

Added line 186:

[@

Changed lines 188-189 from:
to:

@]

Changed lines 191-195 from:

If you start services, you need to know that they still run remaining and jailed, after

leaving chroots interactive bash with exit. But if you want to run persistent services, you

have to execute chroot with mount proc and start service.

to:

If you start services, you need to know that they still run remaining and jailed, after leaving chroots interactive bash with exit. But if you want to run persistent services, you have to execute chroot with mount proc and start service.

Added lines 197-198:

[@

Changed lines 201-202 from:
to:

@]

December 30, 2005, at 06:02 PM by Miro Dietiker --
Added lines 1-139:

If you have ds101g+, you have a platform with a PowerPC? processor which is supported in mainstream port of debian. Playing around with debian on the box could be done without compilation, flashing and installing other things in the base system. Later on, i show you how to create a debian chroot which is capable of running any debian package on this system within minutes.

For People with a non-g (ds101, j) with arm architecture, i expect, there's no standard debian port usable. The arm port of debian is little endian, while the ds runs under big endian. Thus, you need to replace the kernel and drive the box in little endian mode to be able to use the arm port. As an alternative you may consider using the compiled armeb packages of http://www.debonaras.org to reproduce the chroot approach or upgrade completely to debonaras (i have no experience in this since i don't get such a ds). The team is also working on making armeb a standard debian port, but this will take some time to finish.

Crossbuilding chroot

The standard way to install a debian system on a non-debian platform is to use debootstrap. Since i expect you have a non PowerPC?-platform, building the chroot-environment means cross-building. Debootstrap describes to be cross-platform'able but as of my testing, you need to run debootstrap on target. (running debootstrap wants to chroot into target and execute some stuff even in cross-build mode which couldn't work!)

Aims of chroot

  • No Flashing
  • No modification of stock Systemfiles
  • Sandbox like environment on the ds
  • Full access to 16'000 debian packages within minutes

You need to have console access to the ds (with attached /volume1), which means one of the following:

These types of access i simply name console and of course you need the client programs on the pc. ;)

Lines beginning with ds$ need to be executed on target ds console, while lines with leading pc# are to be executed on your pc.

Now we create folders for the debian project

pc$ mkdir -p ~/ds101g/debian
ds# mkdir -p /volume1/public/debian

From now on, all commands need to be executed in this directory! pc$ cd ~/ds101g/debian ds# cd /volume1/public/debian

We need a place for the target root ds# mkdir -p /volume1/public/debian/root

get all debian debootstrap related packages (note there's much more dependencies than listed on apt-cache show debootstrap. We need the following debs in powerpc architecture (download only):

On a debian pc one could create a file with pathes to these downloads this way: pc$ apt-cache show base-files base-passwd bash binutils coreutils debianutils debootstrap

gawk grep gzip libacl1 libattr1 libc6 libcap1 libdb1-compat libdb3 libgcc1 libncurses5

libpam0g libpam-modules libpam-runtime libssl0.9.7 login passwd sed tar wget | grep Filename: | sed "s/Filename: //" | sed "s/i386.deb/powerpc.deb/" > debootstrap-packages

For non-debian users: pc$ cat << EOF > debootstrap-packages pool/main/b/base-files/base-files_3.1.2_arm.deb pool/main/b/base-passwd/base-passwd_3.5.9_arm.deb pool/main/b/bash/bash_2.05b-26_arm.deb pool/main/b/binutils/binutils_2.15-6_arm.deb pool/main/c/coreutils/coreutils_5.2.1-2_arm.deb pool/main/d/debianutils/debianutils_2.8.4_arm.deb pool/main/d/debootstrap/debootstrap_0.2.45-0.2_arm.deb pool/main/g/gawk/gawk_3.1.4-2_arm.deb pool/main/g/grep/grep_2.5.1.ds1-4_arm.deb pool/main/g/gzip/gzip_1.3.5-10sarge1_arm.deb pool/main/a/acl/libacl1_2.2.23-1_arm.deb pool/main/a/attr/libattr1_2.4.16-1_arm.deb pool/main/g/glibc/libc6_2.3.2.ds1-22_arm.deb pool/main/libc/libcap/libcap1_1.10-14_arm.deb pool/main/d/db1-compat/libdb1-compat_2.1.3-7_arm.deb pool/main/d/db3/libdb3_3.2.9-22_arm.deb pool/main/g/gcc-3.4/libgcc1_3.4.3-13_arm.deb pool/main/n/ncurses/libncurses5_5.4-4_arm.deb pool/main/p/pam/libpam0g_0.76-22_arm.deb pool/main/p/pam/libpam-modules_0.76-22_arm.deb pool/main/p/pam/libpam-runtime_0.76-22_all.deb pool/main/o/openssl/libssl0.9.7_0.9.7e-3sarge1_arm.deb pool/main/s/shadow/login_4.0.3-31sarge5_arm.deb pool/main/s/shadow/passwd_4.0.3-31sarge5_arm.deb pool/main/s/sed/sed_4.1.2-8_arm.deb pool/main/t/tar/tar_1.14-2_arm.deb pool/main/w/wget/wget_1.9.1-12_arm.deb EOF

Now one could download all these packages: pc$ wget -r -P download -B "http://ftp.de.debian.org/debian/" -i debootstrap-packages Wait some seconds to download all this stuff!

Next step is to extract the base chroot from those files! pc$ mkdir root tmp pc$ for i in `find download -name *.deb`; do (cd tmp && ar -xf "../$i"); (cd root && tar

-xzf "../tmp/data.tar.gz"); done pc$ rm tmp

Now we move this folder root to target! pc$ tar -czf root.tar.gz root Move it with your preferred way to target (ftp, smb, sftp, ...) /volume1/public/debian ds# tar -xzf root.tar.gz

Some things to configure before running chroot debian! Make name resolving available ds# cp /etc/resolv.conf root/etc/resolv.conf Make md5sum available for debootstrap ds# ln -fs /usr/bin/md5sum.textutils root/usr/bin/md5sum Setup hostname ds# cp /etc/hostname root/etc/ Copy passwd, group shadow files ds# cp /etc/passwd root/etc/ ds# cp /etc/shadow root/etc/ ds# cp /etc/group root/etc/ ds# cp /etc/gshadow root/etc/

The minimal system setup is there and debootstrap can setup debian tools: ds# chroot root /bin/bash chroot-ds# mount -t proc proc /proc chroot-ds# /usr/sbin/debootstrap --arch powerpc sarge . "http://ftp.de.debian.org/debian" This may take some time to finish!

Reconfigure debian sompletely (show dialogs) chroot-ds# dpkg-reconfigure -a And finally update and upgrade apt repository

chroot-ds# apt-get update && apt-get upgrade

Now you have access to any debian package you want! If you start services, you need to know that they still run remaining and jailed, after

leaving chroots interactive bash with exit. But if you want to run persistent services, you

have to execute chroot with mount proc and start service. Sure, don't forget that each service only have access to the jailed root!

Simple sample on running some service (execute not on chrooted!): ds# chroot root /bin/bash -c "mount -t proc proc /proc" ds# chroot root /bin/bash -c "/etc/init.d/ssh start"

Already this is it! Chroot into the debian and work with it or just play around!

Have Fun! Miro Dietiker

view · edit · print · history · Last edited by czh.
Based on work by czh, tman, and Miro Dietiker.
Originally by Miro Dietiker.
Page last modified on December 20, 2006, at 07:19 PM