wok rev 7845

busybox-static: add chroot
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Dec 28 16:44:48 2010 +0100 (2010-12-28)
parents 7b3b7e2a569d
children 97f1b9b66b3d
files busybox/stuff/busybox-1.18.1.config-static busybox/stuff/init
line diff
     1.1 --- a/busybox/stuff/busybox-1.18.1.config-static	Tue Dec 28 14:29:53 2010 +0100
     1.2 +++ b/busybox/stuff/busybox-1.18.1.config-static	Tue Dec 28 16:44:48 2010 +0100
     1.3 @@ -1,7 +1,7 @@
     1.4  #
     1.5  # Automatically generated make config: don't edit
     1.6  # Busybox version: 1.18.1
     1.7 -# Sat Dec 25 13:25:30 2010
     1.8 +# Tue Dec 28 16:41:45 2010
     1.9  #
    1.10  CONFIG_HAVE_DOT_CONFIG=y
    1.11  
    1.12 @@ -181,7 +181,7 @@
    1.13  CONFIG_CHMOD=y
    1.14  # CONFIG_CHOWN is not set
    1.15  # CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set
    1.16 -# CONFIG_CHROOT is not set
    1.17 +CONFIG_CHROOT=y
    1.18  # CONFIG_CKSUM is not set
    1.19  # CONFIG_COMM is not set
    1.20  CONFIG_CP=y
     2.1 --- a/busybox/stuff/init	Tue Dec 28 14:29:53 2010 +0100
     2.2 +++ b/busybox/stuff/init	Tue Dec 28 16:44:48 2010 +0100
     2.3 @@ -124,10 +124,10 @@
     2.4  	mount /dev/loop0 /mnt 2> /dev/null
     2.5  fi
     2.6  grep -q cryptoroot= /proc/cmdline && try_init
     2.7 +umount /sys
     2.8  grep -q subroot= /proc/cmdline &&
     2.9 -subroot="/$(sed 's/.*subroot=\([^ ]*\).*/\1/' < /proc/cmdline)"
    2.10 -[ -d /mnt$subroot/etc ] && try_init
    2.11 -umount /sys
    2.12 +	subroot="/$(sed 's/.*subroot=\([^ ]*\).*/\1/' < /proc/cmdline)" &&
    2.13 +	exec chroot /mnt$subroot /sbin/init
    2.14  echo -n "Switching / to tmpfs..."
    2.15  size="$(grep rootfssize= < /proc/cmdline | \
    2.16  	sed 's/.*rootfssize=\([0-9]*[kmg%]\).*/-o size=\1/')"