# HG changeset patch # User Pascal Bellard # Date 1293551088 -3600 # Node ID e33ea4c4b37036351d47e421824e026ea31ccd06 # Parent 7b3b7e2a569dc4165a742cf7696995a73e73608e busybox-static: add chroot diff -r 7b3b7e2a569d -r e33ea4c4b370 busybox/stuff/busybox-1.18.1.config-static --- a/busybox/stuff/busybox-1.18.1.config-static Tue Dec 28 14:29:53 2010 +0100 +++ b/busybox/stuff/busybox-1.18.1.config-static Tue Dec 28 16:44:48 2010 +0100 @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Busybox version: 1.18.1 -# Sat Dec 25 13:25:30 2010 +# Tue Dec 28 16:41:45 2010 # CONFIG_HAVE_DOT_CONFIG=y @@ -181,7 +181,7 @@ CONFIG_CHMOD=y # CONFIG_CHOWN is not set # CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set -# CONFIG_CHROOT is not set +CONFIG_CHROOT=y # CONFIG_CKSUM is not set # CONFIG_COMM is not set CONFIG_CP=y diff -r 7b3b7e2a569d -r e33ea4c4b370 busybox/stuff/init --- a/busybox/stuff/init Tue Dec 28 14:29:53 2010 +0100 +++ b/busybox/stuff/init Tue Dec 28 16:44:48 2010 +0100 @@ -124,10 +124,10 @@ mount /dev/loop0 /mnt 2> /dev/null fi grep -q cryptoroot= /proc/cmdline && try_init +umount /sys grep -q subroot= /proc/cmdline && -subroot="/$(sed 's/.*subroot=\([^ ]*\).*/\1/' < /proc/cmdline)" -[ -d /mnt$subroot/etc ] && try_init -umount /sys + subroot="/$(sed 's/.*subroot=\([^ ]*\).*/\1/' < /proc/cmdline)" && + exec chroot /mnt$subroot /sbin/init echo -n "Switching / to tmpfs..." size="$(grep rootfssize= < /proc/cmdline | \ sed 's/.*rootfssize=\([0-9]*[kmg%]\).*/-o size=\1/')"