changeset 1351:c41de203f9b8

Update FAQ now that setup-chroot is in the system images.
author Rob Landley <>
date Mon, 18 Apr 2011 19:34:48 -0500
parents 7eabfa815c90
children 6da94a74a8a9
files www/FAQ.html
diffstat 1 files changed, 33 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/www/FAQ.html	Mon Apr 18 18:41:04 2011 -0500
+++ b/www/FAQ.html	Mon Apr 18 19:34:48 2011 -0500
@@ -140,9 +140,37 @@
 <hr /><a name=add_package /><h2>Q: How do I add $PACKAGE to my system image's root filesystem?</h2>
-<p>A: Either build a writeable system image (SYSIMAGE_TYPE=ext2 or ext3 instead
-of the default squashfs), or copy the squashfs contents into a writeable chroot
+<p>A: Either use setup-chroot to copy the root filesystem into a writeable
+chroot, or run the build scripts with SYSIMAGE_TYPE=ext2 (and probably
+HDA_MEGS=2048) to create a writeable ext2 system image instead of the default
+read-only squashfs.</p>
+<p>The setup-chroot command is a shell script in each system image's /sbin
+directory which copies the squashfs contents into a writeable chroot
+directory, and chroots into that directory.  Since
+creates a 2 gigabyte ext3 image and mounts it on /home, you should have
+plenty of space under there to do:</p>
+setup-chroot /home/work /bin/ash
+<p>The first time you run this (I.E. when the directory you want to chroot into
+doesn't exist), setup-chroot copies the root filesystem into it.</p>
+<p>Afterwards, setup-chroot uses "mount --bind" to copy the host filesystem's
+mounts (/proc, /sys, /tmp, and so on), then chroots into the new directory
+to run your command.  When the chroot exits, setup-chroot calls "zapchroot"
+to unmount all those sub-mounts.</p>
+<p>If you don't specify which command to run, chroot runs /bin/sh, which by
+default points to bash 2.04b built without ncurses.  This is good for running
+scripts but is not the world's friendliest interactive shell.</p>
+<p>The other thing you could do is go back to the build scripts and
+build a writeable system image by specifying the environment variable
+"SYSIMAGE_TYPE=ext2" instead of the default squashfs.  You may also want
+to set "SYSIMAGE_HDA_MEGS=2048".</p>
 <p>Aboriginal Linux builds squashfs images by default, and the prebuilt binary
 tarballs in
@@ -165,36 +193,11 @@
 <p>That creates a 2 gigabyte ext2 image, which you can boot into and install
 packages natively under, using the "./ $TARGET" script.
 If you've already built a system image, you can repackage the existing root
-filesystem by just running (instead of the whole
+filesystem by re-running (instead of the whole
 As always, your new system image is created in the "build" subdirectory.</p>
 <p>Note: since this is a writeable image, you'll have to fsck it.  You can
-also use "tune2fs -j" to turn it into an ext3 image.</p>
-<p>Alternately, you can boot from squashfs using the 
-script and copy it to a writeable chroot in the /home directory.  The
-gentoo-stage1 build in sources/native-builds does this like so:</p>
-mkdir gentoo-stage1
-find / -xdev | cpio -m -v -p /home/gentoo-stage1
-echo Restarting init script in chroot
-for i in mnt proc sys dev
-  mount --bind /$i gentoo-stage1/$i
-chroot gentoo-stage1 /mnt/init
-for i in mnt proc sys dev
-  umount gentoo-stage1/$i
-tar cvjf gentoo-stage1.tar.bz2 gentoo-stage1
+use "tune2fs -j" to turn it into an ext3 image to reduce the need for this.</p>
 <hr /><a name=case_sensitive_patch /><h2>Q: I added a uClibc patch to sources/patches but it didn't do anything, what's wrong?</h2>