slitaz-boot-scripts rev 288

init/subroot: do not need busybox-static
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Mar 22 12:02:05 2012 +0100 (2012-03-22)
parents 84129ba21c66
children 244e4aba431e
files init
line diff
     1.1 --- a/init	Wed Mar 21 13:28:35 2012 +0100
     1.2 +++ b/init	Thu Mar 22 12:02:05 2012 +0100
     1.3 @@ -159,16 +159,12 @@
     1.4  	mount --move /dev/pts /mnt$subroot/dev/pts
     1.5  	shm=$subroot/dev/shm
     1.6  	mount --move /dev/shm /mnt$shm
     1.7 -	bb="/usr/share/boot/busybox-static /mnt$shm 2> /dev/null"
     1.8 -	if mv $bb || cp /mnt$subroot$bb ; then
     1.9 -		success <<EOT
    1.10 -exec /sbin/switch_root mnt $shm/busybox-static chroot $subroot /sbin/init
    1.11 +	cp $(LD_TRACE_LOADED_OBJECTS=1 /lib/ld*.so /usr/sbin/chroot | sed \
    1.12 +	     's|.*=> \(/lib/l[^ ]*\).*|\1|;/^\//!d') /usr/sbin/chroot /mnt$shm
    1.13 +	success <<EOT
    1.14 +export LD_LIBRARY_PATH=$shm:/lib
    1.15 +exec /sbin/switch_root mnt $shm/$(cd /mnt$shm ; ls ld-*) $shm/chroot $subroot /sbin/init
    1.16  EOT
    1.17 -	else
    1.18 -		success <<EOT
    1.19 -exec chroot /mnt$subroot /sbin/init
    1.20 -EOT
    1.21 -	fi
    1.22  fi
    1.23  echo -n "Switching / to tmpfs"
    1.24  size="$(grep rootfssize= < /proc/cmdline | \