wok-6.x rev 15530

busybox-boot: fix root=device|UUID|LABEL cmdline (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Nov 21 20:08:27 2013 +0000 (2013-11-21)
parents 9e0af4aa7665
children 80c2116a3ab3
files busybox-boot/receipt
line diff
     1.1 --- a/busybox-boot/receipt	Thu Nov 21 21:20:50 2013 +0100
     1.2 +++ b/busybox-boot/receipt	Thu Nov 21 20:08:27 2013 +0000
     1.3 @@ -76,14 +76,16 @@
     1.4  
     1.5  arg init
     1.6  init=\${root:-/sbin/init}
     1.7 +[ -n "\$(sed 's/\$/ /;s/^/ /;/ ro /!d' /proc/cmdline)" ] && ro="-o ro"
     1.8 +[ -n "\$(sed 's/\$/ /;s/^/ /;/ rw /!d' /proc/cmdline)" ] && ro="-o rw"
     1.9  arg root && root="\$(echo \$root | sed 's|/|\\\\/|g')" &&
    1.10 -	mount \$(busybox blkid | sed "s/\"//g;/\$root/!d;s/:.*//;q") /mnt
    1.11 +	mount \$ro \$(busybox blkid | sed "s/\"//g;/\$root/!d;s/:.*//;q") /mnt
    1.12  arg loopfs && busybox losetup /dev/loop /mnt/\$root && mount /dev/loop /mnt
    1.13  arg subroot && cp /bin/busybox /mnt/\$root/dev/shm &&
    1.14  	chroot="\$root/dev/shm/busybox chroot \$root"
    1.15  busybox [ -x /mnt/\$root\$init ] && exec busybox switch_root mnt \$chroot \$init
    1.16  
    1.17 -for i in \$(busybox --list) ; do busybox ln /bin/busybox /bin/\$i; done
    1.18 +for i in \$(busybox --list) ; do ln /bin/busybox /bin/\$i 2> /dev/null ; done
    1.19  
    1.20  [ -d /proc/bus/usb ] && mount -t usbfs usbfs /proc/bus/usb
    1.21  while read type dir ; do