slitaz-boot-scripts rev 373 5.6.3
init: fix last commit. It was double definition of mnt() as well.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sun Jun 15 17:16:22 2014 +0300 (2014-06-15) |
parents | 5a38b2dd68a6 |
children | 015b7db52be4 |
files | init |
line diff
1.1 --- a/init Tue Jun 10 10:34:47 2014 +0200 1.2 +++ b/init Sun Jun 15 17:16:22 2014 +0300 1.3 @@ -53,21 +53,11 @@ 1.4 echo -e '\033[70G[ \033[1;3'${1:-1mFailed}'\033[0;39m ]' 1.5 } 1.6 1.7 -mnt() 1.8 -{ 1.9 -busybox mount $@ 1.10 -} 1.11 - 1.12 -umnt() 1.13 -{ 1.14 -busybox umount $@ 1.15 -} 1.16 - 1.17 quit() 1.18 { 1.19 [ -d /mnt$4/etc ] || return 1.20 -[ -n "$4" ] || mnt /mnt -o remount,ro 1.21 -mnt --move /run /mnt/${1:-run} 1.22 +[ -n "$4" ] || busybox mount /mnt -o remount,ro 1.23 +busybox mount --move /run /mnt/${1:-run} 1.24 cat>/run/init<<EOT 1.25 $2 1.26 x=/sbin/switch_root 1.27 @@ -104,27 +94,26 @@ 1.28 r=${r#/dev/} 1.29 r=/dev/${r%%/*} 1.30 d=${root#*$r} 1.31 -mnt $r $1 && return 1.32 +busybox mount $r $1 && return 1.33 w=$(cat /sys/module/usb_storage/parameters/delay_use) 1.34 w=$((1+${w:-2})) 1.35 echo -n "Sleep $w seconds..." 1.36 sleep $w 1.37 -mnt $r $1 1.38 +busybox mount $r $1 1.39 } 1.40 1.41 mod() 1.42 { 1.43 -for i in $@ 1.44 -do echo "Loading module: $i" 1.45 - modprobe $i 2>/dev/null || 1.46 - busybox insmod $(find /lib/modules|sed "/$i.ko/!dq") 1.47 +for i in $@; do 1.48 + echo "Loading module: $i" 1.49 + modprobe $i 2>/dev/null || busybox insmod $(find /lib/modules|sed "/$i.ko/!dq") 1.50 done 1.51 } 1.52 1.53 try() 1.54 { 1.55 -if [ ! -d /mnt/etc ] && got cryptoroot 1.56 -then mod dm-mod dm-crypt aes-256 1.57 +if [ ! -d /mnt/etc ] && got cryptoroot; then 1.58 + mod dm-mod dm-crypt aes-256 1.59 d=${root#/dev/} 1.60 l=crypto-$d 1.61 if cryptsetup isLuks $root 2>/dev/null; then 1.62 @@ -139,8 +128,10 @@ 1.63 fi 1.64 got subroot && return 1.65 got loopfs && return 1.66 -if [ -d /mnt/etc ] 1.67 -then for i in $@; do cp -a $i /mnt$(dirname $i); done 1.68 +if [ -d /mnt/etc ]; then 1.69 + for i in $@; do 1.70 + cp -a $i /mnt$(dirname $i) 1.71 + done 1.72 quit 1.73 fi 1.74 fail 1.75 @@ -152,7 +143,7 @@ 1.76 mod dm-mod 1.77 vgscan --ignorelockingfailure 1.78 vgchange -ay --ignorelockingfailure 1.79 -mnt /dev/mapper/$root /mnt 1.80 +busybox mount /dev/mapper/$root /mnt 1.81 try /dev/mapper $1 1.82 } 1.83 1.84 @@ -169,14 +160,14 @@ 1.85 done 1.86 } 1.87 1.88 -if [ "$1" != "log" ] 1.89 -then mnt -t proc proc /proc 1.90 - mnt -t sysfs sys /sys 1.91 - mnt -t tmpfs tmpfs /run 1.92 +if [ "$1" != "log" ]; then 1.93 + busybox mount -t proc proc /proc 1.94 + busybox mount -t sysfs sys /sys 1.95 + busybox mount -t tmpfs tmpfs /run 1.96 x=/sbin/init; echo "[ -x $x ] && exec $x" >/run/init 1.97 $0 log 2>&1 | tee /run/boot.log 1.98 - umnt /proc 1.99 - umnt /sys 1.100 + busybox umount /proc 1.101 + busybox umount /sys 1.102 . /run/init 1.103 sh 1.104 fi 1.105 @@ -212,9 +203,9 @@ 1.106 mount.posixovl -F /mnt -- -oallow_other -odefault_permissions -osuid 1.107 fi 1.108 got loopfs && echo "Into file $root..." && 1.109 - losetup /dev/loop0 /mnt/$root && mnt /dev/loop0 /mnt 1.110 + losetup /dev/loop0 /mnt/$root && busybox mount /dev/loop0 /mnt 1.111 got bindfs && echo "Bind ${root/,/ to }..." && 1.112 - mnt --bind /mnt/${root%,*} /mnt/${root/,//} 1.113 + busybox mount --bind /mnt/${root%,*} /mnt/${root/,//} 1.114 arg cryptoroot= && try 1.115 if use subroot 1.116 then cp $(LD_TRACE_LOADED_OBJECTS=1 /lib/ld*.so /usr/sbin/chroot | sed\ 1.117 @@ -231,7 +222,7 @@ 1.118 root=90% 1.119 got rootfssize 1.120 [ $(busybox free|busybox awk '/Mem:/{print int(($4*100)/$3)}') -ge $r ] && 1.121 -mnt -t tmpfs -o size=$root tmpfs /mnt && 1.122 +busybox mount -t tmpfs -o size=$root tmpfs /mnt && 1.123 for i in $(ls -ar /) 1.124 do case "$i" in 1.125 .*|cdrom) ;; 1.126 @@ -239,7 +230,7 @@ 1.127 usr|var|rootfs*) mv /$i /mnt;; 1.128 *) cp -a /$i /mnt 2>/dev/null && continue 1.129 fail 1.130 - umnt /mnt 1.131 + busybox umount /mnt 1.132 exit 1.133 esac 1.134 done || fail 3mSkipped 1.135 @@ -268,8 +259,8 @@ 1.136 r=$r:/mnt/.$fs 1.137 mkdir -p /mnt/.rw/mnt/.$fs /mnt/.$fs 1.138 losetup $o /dev/loop$l $i 1.139 - mnt -o ro -t squashfs /dev/loop$((l++)) /mnt/.$fs 1.140 + busybox mount -o ro -t squashfs /dev/loop$((l++)) /mnt/.$fs 1.141 done 1.142 mod aufs 1.143 -mnt -t aufs -o br=$br${r:-:$c} none /mnt 1.144 +busybox mount -t aufs -o br=$br${r:-:$c} none /mnt 1.145 quit