slitaz-boot-scripts rev 315 5.2
init: fix suboot
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Aug 26 18:01:46 2012 +0200 (2012-08-26) |
parents | afd4941fd376 |
children | 41a7bf957ee3 |
files | init |
line diff
1.1 --- a/init Sun Aug 26 15:09:53 2012 +0200 1.2 +++ b/init Sun Aug 26 18:01:46 2012 +0200 1.3 @@ -8,7 +8,7 @@ 1.4 quit() 1.5 { 1.6 [ -d /mnt$4/etc ] || return 1.7 -mount /mnt -o remount,ro 1.8 +[ -n "$4" ] || mount /mnt -o remount,ro 1.9 mount --move /run /mnt/${1:-run} 1.10 cat>/run/init<<EOT 1.11 $2 1.12 @@ -36,7 +36,7 @@ 1.13 1.14 use() 1.15 { 1.16 -got $1 && echo msg "$1 $root" 1.17 +got $1 && msg "$1 $root" 1.18 } 1.19 1.20 mnt() 1.21 @@ -140,7 +140,8 @@ 1.22 trylvm 1.23 if got mount 1.24 then dev=$root 1.25 - root=$(blkid|grep $root|sed 's/:.*//;q') 1.26 + x=$(blkid|grep $dev|sed 's/:.*//;q') 1.27 + root=${x:-$dev} 1.28 [ "$dev" = "$root" ] || dev="$root ($dev)" 1.29 echo "Mount $dev..." 1.30 mnt /mnt 1.31 @@ -156,7 +157,7 @@ 1.32 's|.*=> \(/lib/l[^ ]*\).*|\1|;/^\//!d') /usr/sbin/chroot /run 1.33 r=$root/run 1.34 quit $r "export LD_LIBRARY_PATH=$r:/lib"\ 1.35 - "$(cd /mnt; ls $r/ld-*) $r/chroot $root" "/$root" 1.36 + "$root$(ls /run/ld-*) $r/chroot $root" "/$root" 1.37 fi 1.38 msg tmpfs 1.39 root=100