wok diff syslinux/stuff/iso2exe/init @ rev 21801

linld/iso2exe: remove non slitaz dos boot
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Aug 10 18:47:30 2019 +0200 (2 months ago)
parents 04ffefac5707
children 2ca609c01117
line diff
     1.1 --- a/syslinux/stuff/iso2exe/init	Thu Aug 01 15:16:29 2019 +0200
     1.2 +++ b/syslinux/stuff/iso2exe/init	Sat Aug 10 18:47:30 2019 +0200
     1.3 @@ -4,7 +4,7 @@
     1.4  
     1.5  ddq()
     1.6  {
     1.7 -	dd $@ 2> /dev/null
     1.8 +	dd $@ 2>/dev/null
     1.9  }
    1.10  
    1.11  get()
    1.12 @@ -41,15 +41,15 @@
    1.13  	while [ "$1" ]; do
    1.14  		case "$1" in
    1.15  		--title) title="   \x1B[30;47m$2\x1B[37;40m\n"
    1.16 -			 echo -e $title; shift ;;
    1.17 -		--yes-label) label="$2" ; shift ;;
    1.18 +			 echo -e $title; shift;;
    1.19 +		--yes-label) label="$2"; shift;;
    1.20  		--textbox)
    1.21  			xless "$2" "\nPress RETURN to continue."
    1.22  			break;;
    1.23  		--gauge)
    1.24  			t="        "
    1.25  			echo -e "$t$2\n"
    1.26 -			while read pct ; do
    1.27 +			while read pct; do
    1.28  				s="                              "
    1.29  				s="$s$pct%$s"
    1.30  				pct=$((($pct*63)/100))
    1.31 @@ -66,7 +66,7 @@
    1.32  				''|Y*|y*|1) return 0;;
    1.33  				N*|n*|2|0) return 1;;
    1.34  				esac
    1.35 -			done ;;
    1.36 +			done;;
    1.37  		--menu|--radiolist)
    1.38  			[ "$1" = "--menu" ] && shft=2 || shft=3
    1.39  			label=""
    1.40 @@ -79,12 +79,12 @@
    1.41  				echo "$((n++))	$2"
    1.42  				shift $shft
    1.43  			done >> /tmp/data
    1.44 -			while ! grep -q "^$n	" /tmp/data ; do
    1.45 +			while ! grep -q "^$n	" /tmp/data; do
    1.46  				clear
    1.47  				xless /tmp/data
    1.48  				echo -en "\n   <- Enter the selection number\r"
    1.49  				read n
    1.50 -			done 2> /dev/null
    1.51 +			done 2>/dev/null
    1.52  			rm -f /tmp/data
    1.53  			[ $n -eq 0 ] && return 1
    1.54  			eval echo -n \$key_$n 1>&2
    1.55 @@ -98,27 +98,27 @@
    1.56  {
    1.57  	mount -t proc /proc /proc
    1.58  	mount -t sysfs /sys /sys
    1.59 -	udevd --daemon 2> /dev/null && udevadm trigger && sleep 5
    1.60 +	udevd --daemon 2>/dev/null && udevadm trigger && sleep 5
    1.61  }
    1.62  
    1.63  umount_proc()
    1.64  {
    1.65 -	killall udevd 2> /dev/null
    1.66 -	umount /sys/fs/fuse/connections 2> /dev/null
    1.67 +	killall udevd 2>/dev/null
    1.68 +	umount /sys/fs/fuse/connections 2>/dev/null
    1.69  	umount /sys
    1.70  	umount /proc
    1.71  }
    1.72  
    1.73  bytes2bin()
    1.74  {
    1.75 -	for i in $@ ; do
    1.76 +	for i in $@; do
    1.77  		printf '\\\\x%02X' $(($i&255))
    1.78  	done | xargs echo -en
    1.79  }
    1.80  
    1.81  words2bin()
    1.82  {
    1.83 -	for i in $@ ; do
    1.84 +	for i in $@; do
    1.85  		printf '\\\\x%02X\\\\x%02X' $(($i&255)) $((($i>>8)&255))
    1.86  	done | xargs echo -en
    1.87  }
    1.88 @@ -146,7 +146,7 @@
    1.89  getiso()
    1.90  {
    1.91  	mkdir -p /media/cdrom
    1.92 -	for dev in /sys/block/?d?/?d??* ; do
    1.93 +	for dev in /sys/block/?d?/?d??*; do
    1.94  		mount /dev/$(basename $dev) /mnt
    1.95  		if checkmagic /mnt/$ISO; then
    1.96  			mount -o loop,ro /mnt/$ISO /media/cdrom
    1.97 @@ -154,20 +154,22 @@
    1.98  			return 0
    1.99  		fi
   1.100  		umount /mnt
   1.101 -	done 2> /dev/null
   1.102 +	done 2>/dev/null
   1.103  	return 1
   1.104  }
   1.105  
   1.106  uncpio()
   1.107  {
   1.108 -	[ -s "$1" ] || return
   1.109 -	echo -en "\n Extracting $(basename $1) ..."
   1.110 -	case $(get 0 $1) in
   1.111 -	*35615)	( zcat || gunzip ) ;;
   1.112 -	*14333) unxz ;;
   1.113 -	*\ 93)	unlzma ;;
   1.114 -	*)	cat ;;
   1.115 -	esac < $1 | ( cd ${2:-/} ; cpio -idmu > /dev/null 2>&1 )
   1.116 +	i=$1
   1.117 +	grep -q ' lm ' /proc/cpuinfo && [ -s ${i}64 ] && i=${i}64
   1.118 +	[ -s "$i" ] || return
   1.119 +	echo -en "\n Extracting $(basename $i) ..."
   1.120 +	case $(get 0 $i) in
   1.121 +	*35615)	( zcat || gunzip );;
   1.122 +	*14333) unxz;;
   1.123 +	*\ 93)	unlzma;;
   1.124 +	*)	cat;;
   1.125 +	esac < $i | ( cd ${2:-/}; cpio -idmu > /dev/null 2>&1 )
   1.126  }
   1.127  
   1.128  dotwait()
   1.129 @@ -191,7 +193,7 @@
   1.130  	PAD=$(($(stat -c %s $1) % 4))
   1.131  	[ $PAD -ne 0 ] && ddq if=/dev/zero bs=1 count=$((4 - $PAD)) >> $1
   1.132  	mkdir -p /tmp/fs/etc /tmp/fs/lib /tmp/fs/home
   1.133 -	cp /etc/keymap.conf /etc/locale.conf /tmp/fs/etc 2> /dev/null
   1.134 +	cp /etc/keymap.conf /etc/locale.conf /tmp/fs/etc 2>/dev/null
   1.135  	cat > /tmp/fs/init1 <<EOT
   1.136  #!/bin/sh
   1.137  sed -i 's|sbin/init|init2|' /init
   1.138 @@ -201,11 +203,11 @@
   1.139  #!/bin/sh
   1.140  
   1.141  mount -t proc /proc /proc
   1.142 -for i in /lib/modules/*.ko* ; do insmod \$i 2> /dev/null ; done; sleep 2
   1.143 -v=\$(sed '/\\/home=/!d;s|.*/home=\\([^ ]*\\).*|\\1|' /proc/cmdline /cmdline 2> /dev/null)
   1.144 +for i in /lib/modules/*.ko*; do insmod \$i 2>/dev/null; done; sleep 2
   1.145 +v=\$(sed '/\\/home=/!d;s|.*/home=\\([^ ]*\\).*|\\1|' /proc/cmdline /cmdline 2>/dev/null)
   1.146  mount / -o remount,rw
   1.147  mkdir /mnt/dos
   1.148 -rm -f /cmdline 2> /dev/null
   1.149 +rm -f /cmdline 2>/dev/null
   1.150  mount / -o remount,ro
   1.151  mnt=/mnt/dos/\${v#*/}
   1.152  dev=\$( (blkid /dev/[sh]d* || blkid) | grep \${v%%/*} | sed 's/:.*//;q')
   1.153 @@ -219,18 +221,18 @@
   1.154  EOT
   1.155  	chmod 755 /tmp/fs/init?
   1.156  	cp -a /tmp/fs/* /
   1.157 -	ln -s /sqfs/bin/gzip /bin 2> /dev/null
   1.158 -	( cd /tmp/fs ; find * | cpio -o -H newc ) | gzip -9 >> $1
   1.159 +	ln -s /sqfs/bin/gzip /bin 2>/dev/null
   1.160 +	( cd /tmp/fs; find * | cpio -o -H newc ) | gzip -9 >> $1
   1.161  }
   1.162  
   1.163  mkinitrd()
   1.164  {
   1.165  	echo
   1.166  	dotwait "Creating $(basename $1) "
   1.167 -	for i in bin lib dev proc tmp mnt etc ; do
   1.168 +	for i in bin lib dev proc tmp mnt etc; do
   1.169  		mkdir -p /tmp/fs/$i
   1.170  	done
   1.171 -	for i in /dev/console /dev/null /dev/tty /dev/tty[012] /dev/fuse /dev/[hs]d* ; do
   1.172 +	for i in /dev/console /dev/null /dev/tty /dev/tty[012] /dev/fuse /dev/[hs]d*; do
   1.173  		cp -a $i /tmp/fs$i
   1.174  	done
   1.175  	for i in /bin/busybox $(which mount.posixovl) $(which blkid); do
   1.176 @@ -238,13 +240,13 @@
   1.177  		sed 's|.*=> \(.*/lib/l[^ ]*\).*|\1|;/^\//!d') /tmp/fs/lib
   1.178  		cp $i /tmp/fs/bin
   1.179  	done
   1.180 -	cp -a /sqfs/lib/ld-* /tmp/fs/lib 2> /dev/null ||
   1.181 +	cp -a /sqfs/lib/ld-* /tmp/fs/lib 2>/dev/null ||
   1.182  	cp -a /lib/ld-* /tmp/fs/lib
   1.183  	for i in $(busybox | sed '/Current/,$!d'); do
   1.184  		[ -e /tmp/fs/bin/${i%,} ] || ln -s busybox /tmp/fs/bin/${i%,}
   1.185  	done
   1.186  	ln -s /proc/mounts /tmp/fs/etc/mtab
   1.187 -	sed 's/ .*//' /proc/modules | while read mod ; do
   1.188 +	sed 's/ .*//' /proc/modules | while read mod; do
   1.189  		find /lib/modules/ | grep $mod.ko | \
   1.190  			sed 's|.*|cp & /tmp/fs/lib|' | sh
   1.191  	done
   1.192 @@ -259,7 +261,7 @@
   1.193  }
   1.194  
   1.195  mount -t proc /proc /proc
   1.196 -for i in /lib/*.ko* ; do insmod \$i 2> /dev/null ; done; sleep 2
   1.197 +for i in /lib/*.ko*; do insmod \$i 2>/dev/null; done; sleep 2
   1.198  arg mount "Mount device"
   1.199  mount \$( (blkid /dev/[sh]d* || blkid) | grep \$val | sed 's/:.*//;q') /mnt
   1.200  arg subroot "Change root to directory"
   1.201 @@ -272,7 +274,7 @@
   1.202  exec /bin/switch_root /mnt \${LDSO#/mnt/} \$val/usr/sbin/chroot \$val /sbin/init
   1.203  EOT
   1.204  	chmod +x /tmp/fs/init
   1.205 -	( cd /tmp/fs ; find * | cpio -o -H newc ) | lzma e $1 -si 2> /dev/null
   1.206 +	( cd /tmp/fs; find * | cpio -o -H newc ) | lzma e $1 -si 2>/dev/null
   1.207  	rm -rf /tmp/fs /tmp/wait
   1.208  }
   1.209  
   1.210 @@ -283,7 +285,7 @@
   1.211  
   1.212  ls_r()
   1.213  {
   1.214 -	ls -r $@ 2> /dev/null || ls $@
   1.215 +	ls -r $@ 2>/dev/null || ls $@
   1.216  }
   1.217  
   1.218  doinstall()
   1.219 @@ -300,7 +302,7 @@
   1.220  		if [ -d /media/cdrom/fs ]; then
   1.221  			( cd /mnt/slitaz/fs; find | cpio -o -H newc ) | gzip -9
   1.222  		else
   1.223 -			ls_r /media/cdrom/boot/rootfs*gz | xargs cat
   1.224 +			ls_r /media/cdrom/boot/rootfs* | xargs cat
   1.225  		fi > /mnt/slitaz/boot/rootfs.gz
   1.226  		tazusbinitfs /mnt/slitaz/boot/rootfs.gz
   1.227  		initrd=rootfs.gz
   1.228 @@ -308,8 +310,8 @@
   1.229  	else
   1.230  		if [ -d /media/cdrom/fs ]; then
   1.231  			cp -a /media/cdrom/fs/. /mnt/slitaz
   1.232 -		elif is_loram ; then
   1.233 -			for i in $(ls_r /media/cdrom/boot/rootfs*gz); do
   1.234 +		elif is_loram; then
   1.235 +			for i in $(ls_r /media/cdrom/boot/rootfs*); do
   1.236  				losetup -o 124 /dev/loop7 $i
   1.237  				mount -t squashfs -o ro /dev/loop7 /sqfs/mnt
   1.238  				cp -a /sqfs/mnt/. /mnt/slitaz
   1.239 @@ -317,7 +319,7 @@
   1.240  				losetup -d /dev/loop7
   1.241  			done
   1.242  		else
   1.243 -			for i in $(ls_r /media/cdrom/boot/rootfs*gz); do
   1.244 +			for i in $(ls_r /media/cdrom/boot/rootfs*); do
   1.245  				uncpio $i /mnt/slitaz
   1.246  			done
   1.247  		fi
   1.248 @@ -328,14 +330,14 @@
   1.249  	echo -en "\nInstall boot files..."
   1.250  	for i in /media/cdrom/boot/bzImage /media/cdrom/boot/*pxe* \
   1.251  		/media/cdrom/boot/isolinux/he* /media/cdrom/boot/isolinux/opt* \
   1.252 -		/media/cdrom/README /media/cdrom/boot/memtest* ; do
   1.253 +		/media/cdrom/README /media/cdrom/boot/memtest*; do
   1.254  		[ -s $i ] && cp $i /mnt/slitaz/boot
   1.255  	done
   1.256 -	for i in /mnt/slitaz/boot/memtest /mnt/slitaz/boot/*pxe ; do
   1.257 -		[ $(get 0 $i 2> /dev/null || echo 0) -eq 23117 ] &&
   1.258 +	for i in /mnt/slitaz/boot/memtest /mnt/slitaz/boot/*pxe; do
   1.259 +		[ $(get 0 $i 2>/dev/null || echo 0) -eq 23117 ] &&
   1.260  		mv $i $i.exe
   1.261  	done
   1.262 -	cp /etc/keymap.conf /etc/locale.conf /mnt/slitaz/etc 2> /dev/null
   1.263 +	cp /etc/keymap.conf /etc/locale.conf /mnt/slitaz/etc 2>/dev/null
   1.264  	gettazboot /mnt/slitaz/boot/tazboot.exe
   1.265  	unix2dos > /mnt/slitaz/boot/tazboot.cmd <<EOT
   1.266  kernel=/slitaz/boot/bzimage
   1.267 @@ -413,11 +415,11 @@
   1.268  	if [ -d /media/cdrom/fs ]; then
   1.269  		cp -a /media/cdrom/fs/. /
   1.270  	else
   1.271 -		for i in $(ls_r /media/cdrom/boot/rootfs*gz); do
   1.272 +		for i in $(ls_r /media/cdrom/boot/rootfs*); do
   1.273  			uncpio $i
   1.274  		done
   1.275  	fi
   1.276 -	cp /tmp/fs/etc/* /etc 2> /dev/null
   1.277 +	cp /tmp/fs/etc/* /etc 2>/dev/null
   1.278  	echo "/home=$(getuuid)/slitaz" > /cmdline
   1.279  	rm -f /tmp/wait
   1.280  	[ -x /init1 ] || return
   1.281 @@ -454,7 +456,7 @@
   1.282  md5()
   1.283  {
   1.284  	dotwait "Checking files"
   1.285 -	( cd /media/cdrom ; ${1:-md5sum -c md5sum*} | sort ) > /tmp/data
   1.286 +	( cd /media/cdrom; ${1:-md5sum -c md5sum*} | sort ) > /tmp/data
   1.287  	rm -f /tmp/wait
   1.288  	$DIALOG --clear --title " Checked files " --textbox /tmp/data 24 78
   1.289  	rm -f /tmp/data
   1.290 @@ -463,8 +465,8 @@
   1.291  gotcdfile()
   1.292  {
   1.293  	for i in "/media/cdrom/$1" "/media/cdrom/*/$1" \
   1.294 -			"/media/cdrom/*/isolinux/$1" ; do
   1.295 -		file=$(ls $i 2> /dev/null | sed q)
   1.296 +			"/media/cdrom/*/isolinux/$1"; do
   1.297 +		file=$(ls $i 2>/dev/null | sed q)
   1.298  		[ -s "$file" ] && break
   1.299  	done
   1.300  }
   1.301 @@ -529,7 +531,7 @@
   1.302  		0 2 2 $(($R%256)) $(($R/256)) 2 64 0 64 11 0xF0 $F 0 \
   1.303  		$G | ddq bs=1 of=/dev/fd0
   1.304  	ddq if=/dev/zero bs=512 count=$((4+$F+$F)) seek=$R of=/dev/fd0
   1.305 -	for i in $R $(($R+$F)) ; do
   1.306 +	for i in $R $(($R+$F)); do
   1.307  		bytes2bin 0xF0 0xFF 0xFF | ddq bs=512 seek=$i of=/dev/fd0
   1.308  	done
   1.309  	echo -n $(basename $1) | ddq bs=1 seek=3 count=8 of=/dev/fd0
   1.310 @@ -624,13 +626,13 @@
   1.311  fddata()
   1.312  {
   1.313  	[ -e /sys/block/fd0 ] &&
   1.314 -	[ $(get 26 /mnt/$ISO 1 2> /dev/null || echo 0) -ne 0 ] &&
   1.315 +	[ $(get 26 /mnt/$ISO 1 2>/dev/null || echo 0) -ne 0 ] &&
   1.316  	echo -en "\"$1\"	\"$2\""
   1.317  }
   1.318  
   1.319  ishybrid()
   1.320  {
   1.321 -	[ $(get 510 $ISO 2> /dev/null || echo 0) -eq 43605 ] || return
   1.322 +	[ $(get 510 $ISO 2>/dev/null || echo 0) -eq 43605 ] || return
   1.323  	C=$((2048*$(get $(((17*2048) + 71)) /mnt/$ISO 4)))
   1.324  	[ $(get $C /mnt/$ISO 4) -eq 1 ] || return
   1.325  	[ $(get $(($C+30)) /mnt/$ISO 4) -eq $((0x88AA55)) ] || return
   1.326 @@ -641,13 +643,13 @@
   1.327  
   1.328  burnable()
   1.329  {
   1.330 -	[ "$(sed '/Can wr.*1$/!d' /proc/sys/dev/cdrom/info 2> /dev/null)" ] &&
   1.331 +	[ "$(sed '/Can wr.*1$/!d' /proc/sys/dev/cdrom/info 2>/dev/null)" ] &&
   1.332  	[ "$(which wodim)" ] && echo -en "\"$1\"	\"$2\""
   1.333  }
   1.334  
   1.335  blankable()
   1.336  {
   1.337 -	[ "$(sed '/Can wr.*RW.*1$/!d' /proc/sys/dev/cdrom/info 2> /dev/null)" ] &&
   1.338 +	[ "$(sed '/Can wr.*RW.*1$/!d' /proc/sys/dev/cdrom/info 2>/dev/null)" ] &&
   1.339  	[ "$(which wodim)" ] && echo -en "\"$1\"	\"$2\""
   1.340  }
   1.341  
   1.342 @@ -683,14 +685,14 @@
   1.343  	cd ${1:-/mnt}
   1.344  	ddq bs=2k skip=$(customsector) if="/mnt/$ISO" | while read line; do
   1.345  		case "$line" in
   1.346 -		\#!boot*) ;;
   1.347 -		append=*) echo ${line#append=} > cmdline && ls -l cmdline ;;
   1.348 +		\#!boot*);;
   1.349 +		append=*) echo ${line#append=} > cmdline && ls -l cmdline;;
   1.350  		initrd:*) cnt=${line#initrd:}
   1.351  			  { ddq bs=512 count=$(($cnt / 512));
   1.352  			    ddq bs=1 count=$(($cnt % 512)); } > initrd &&
   1.353  			  ls -l initrd
   1.354 -			  break ;;
   1.355 -		*)	  break ;;
   1.356 +			  break;;
   1.357 +		*)	  break;;
   1.358  		esac
   1.359  	done
   1.360  	cd - > /dev/null
   1.361 @@ -699,7 +701,7 @@
   1.362  
   1.363  gotisomd5()
   1.364  {
   1.365 -	[ "$(which md5sum 2> /dev/null)" ] &&
   1.366 +	[ "$(which md5sum 2>/dev/null)" ] &&
   1.367  	[ $(get 0 /mnt/$ISO) -eq 23117 ] &&
   1.368  	[ $(get 18 /mnt/$ISO) -ne 0 ] && echo -en "\"$1\"	\"$2\""
   1.369  }
   1.370 @@ -723,14 +725,14 @@
   1.371  		TMP=/tmp/$(basename $0)$$md5
   1.372  		md5="$(ddq bs=2k skip=$(customsector) if=/mnt/$ISO | while read line; do
   1.373  			case "$line" in
   1.374 -			\#!boot*) echo ${line#*boot } > $TMP ;;
   1.375 -			append=*) echo $line ;;
   1.376 +			\#!boot*) echo ${line#*boot } > $TMP;;
   1.377 +			append=*) echo $line;;
   1.378  			initrd:*) echo $line
   1.379  				  cnt=${line#initrd:}
   1.380  				  ddq bs=512 count=$((cnt / 512))
   1.381  				  ddq bs=1 count=$((cnt % 512))
   1.382 -				  break ;;
   1.383 -			*)	  break ;;
   1.384 +				  break;;
   1.385 +			*)	  break;;
   1.386  			esac
   1.387  		done | md5sum | cut -c1-32)"
   1.388  		[ "$md5" = "$(cat $TMP)" ] && echo "OK" || echo "ERROR"
   1.389 @@ -877,7 +879,7 @@
   1.390  		bytes2bin 154 $(($p%256)) $(($p/256)) 0 144 | \
   1.391  		ddq bs=1 conv=notrunc seek=60 of=/tmp/fd$$
   1.392  	fi
   1.393 -	for r in $len ; do
   1.394 +	for r in $len; do
   1.395  		words2bin $(($r & 0xFFFF)) $(($r >> 16)) | ddq conv=notrunc \
   1.396  			bs=1 seek=$i count=4 of=/tmp/fd$$
   1.397  		i=$(($i + 4))
   1.398 @@ -886,7 +888,7 @@
   1.399  	rm -f /tmp/fd$$
   1.400  	n=1; i=0; r=0
   1.401  	set -- $len
   1.402 -	ls fd$$* | while read file ; do
   1.403 +	ls fd$$* | while read file; do
   1.404  		if [ $i -gt $(($1+$base)) ]; then
   1.405  			shift
   1.406  			r=$(($r+100)); n=0; i=0; base=0
   1.407 @@ -931,8 +933,8 @@
   1.408  $DIALOG --clear --title " Select your USB key " \
   1.409  	--menu "\nPlease select the USB key according to its known size.\n\n" \
   1.410  	14 70 4 \
   1.411 -	$(for i in $DEV ; do
   1.412 -		echo -n "/dev/$i \"$(($(cat /sys/block/$i/size)/2048))MB $(cat /sys/block/$i/device/model 2> /dev/null)\" "
   1.413 +	$(for i in $DEV; do
   1.414 +		echo -n "/dev/$i \"$(($(cat /sys/block/$i/size)/2048))MB $(cat /sys/block/$i/device/model 2>/dev/null)\" "
   1.415  	done)
   1.416  EOT
   1.417  	exec 3>&1
   1.418 @@ -944,7 +946,7 @@
   1.419  
   1.420  tazusbmsg()
   1.421  {
   1.422 -	[ "$(which tazusb 2> /dev/null)" ] || return
   1.423 +	[ "$(which tazusb 2>/dev/null)" ] || return
   1.424  	echo "You should choose 'USB key read/write installation' to be
   1.425  able to save the package updates or your own configuration and data files.\n\n"
   1.426  }
   1.427 @@ -963,7 +965,7 @@
   1.428  	### perform dd in progress bar
   1.429  	max=$(($(cat /sys/block/loop0/size)/2048))
   1.430  	i=0; ddq if=/mnt/$ISO bs=1024k | (
   1.431 -	while ddq bs=1024k count=1 ; do
   1.432 +	while ddq bs=1024k count=1; do
   1.433  		i=$(($i + 1))
   1.434  		[ $i -gt $max ] && break
   1.435  		echo $((($i*100)/$max)) | dialog --gauge \
   1.436 @@ -985,7 +987,7 @@
   1.437  		words2bin 0 $((0x101+$cx)) 0x3F0B $((32+$m)) \
   1.438  			$ll $lh $(($n & 0xFFFF)) $(($n >> 16)) | \
   1.439  			ddq bs=1 seek=$((462-$p)) of=$device
   1.440 -		if [ "$(which mkdosfs 2> /dev/null)" ]; then
   1.441 +		if [ "$(which mkdosfs 2>/dev/null)" ]; then
   1.442  			losetup -o $((512*$ofs)) /dev/loop2 $device
   1.443  			mkdosfs -n "SLITAZ BOOT" /dev/loop2
   1.444  			words2bin $(($ofs & 0xFFFF)) $(($ofs >> 16)) | \
   1.445 @@ -1034,17 +1036,18 @@
   1.446  mount_loram()
   1.447  {
   1.448  	is_loram || return
   1.449 -	insmod /lib/modules/squashfs.ko* 2> /dev/null
   1.450 +	insmod /lib/modules/squashfs.ko* 2>/dev/null
   1.451  	if [ -d /media/cdrom/fs ]; then
   1.452  		ln -s /media/cdrom/fs /sqfs
   1.453  	else
   1.454  		mkdir /sqfs
   1.455 -		mount -o loop,ro -t squashfs /rootfs*.gz /sqfs
   1.456 +		losetup -o 124 /dev/loop6 $(ls_r /media/cdrom/boot/rootfs?*.* | sed q)
   1.457 +		mount -r /dev/loop6 /sqfs
   1.458  	fi
   1.459  	cp -a /sqfs/dev/fuse /sqfs/dev/tty[12] /sqfs/dev/[hs]d* /dev
   1.460 -	ln -s /sqfs/lib/* lib
   1.461 +	ln -s /sqfs/lib/* lib 2>/dev/null
   1.462  	ln -fs /sqfs/usr /sqfs/var /
   1.463 -	mkdir /etc && cp /sqfs/etc/dialogrc /etc 2> /dev/null
   1.464 +	mkdir /etc && cp /sqfs/etc/dialogrc /etc 2>/dev/null
   1.465  }
   1.466  
   1.467  umount_loram()
   1.468 @@ -1052,7 +1055,8 @@
   1.469  	is_loram || return
   1.470  	rm /var /usr
   1.471  	umount -d /sqfs
   1.472 -	rmdir /sqfs 2> /dev/null || rm -f /sqfs
   1.473 +	rmdir /sqfs 2>/dev/null || rm -f /sqfs
   1.474 +	rm -rf /etc
   1.475  }
   1.476  
   1.477  dosync()
   1.478 @@ -1067,6 +1071,7 @@
   1.479  
   1.480  text()
   1.481  {
   1.482 +	uncpio $(ls_r /media/cdrom/boot/rootfs?*.* | sed q)
   1.483  	init=
   1.484  	cmdline="$(cat /proc/cmdline)"
   1.485  	if hascustomconf; then
   1.486 @@ -1078,7 +1083,6 @@
   1.487  	fi
   1.488  	dosync
   1.489  	sed -i 's/ || exit//' /init
   1.490 -	[ -s /etc/inittab ] || rm -rf /etc
   1.491  	exec ${init:-/init} $cmdline
   1.492  }
   1.493  
   1.494 @@ -1086,8 +1090,7 @@
   1.495  {
   1.496  	n=0
   1.497  	dotwait "Extract filesystem..."
   1.498 -	for i in $(ls_r /media/cdrom/boot/rootfs*gz); do
   1.499 -		grep -q ' lm ' /proc/cpuinfo && [ -s ${i}64 ] && i=${i}64
   1.500 +	for i in $(ls_r /media/cdrom/boot/rootfs*); do
   1.501  		[ $((n++)) -eq 0 ] || uncpio $i
   1.502  	done
   1.503  	rm -f /tmp/wait
   1.504 @@ -1141,10 +1144,10 @@
   1.505  showfavinfo()
   1.506  {
   1.507  	mkdir -p /tmp/data
   1.508 -	flavdata | ( cd /tmp/data ; cpio -i )
   1.509 +	flavdata | ( cd /tmp/data; cpio -i )
   1.510  	file=/tmp/data/info
   1.511  	cat /tmp/data/*desc > $file
   1.512 -	for i in /tmp/data/*list* ; do
   1.513 +	for i in /tmp/data/*list*; do
   1.514  		echo "=== extra ${i#*list} files"
   1.515  		cat $i
   1.516  	done >> $file
   1.517 @@ -1155,47 +1158,47 @@
   1.518  flavor()
   1.519  {
   1.520  	cd /mnt
   1.521 -	name="$(flavdata | cpio -t 2> /dev/null | sed 's/.[a-z]*$//;q')"
   1.522 +	name="$(flavdata | cpio -t 2>/dev/null | sed 's/.[a-z]*$//;q')"
   1.523  	echo "Create ${name:=flavor}.flavor..."
   1.524  	tazlito iso2flavor "/mnt/$ISO" $name
   1.525 -	ls -l $name.flavor 2> /dev/null || sleep 5
   1.526 +	ls -l $name.flavor 2>/dev/null || sleep 5
   1.527  	cd - > /dev/null
   1.528  }
   1.529  
   1.530  shell()
   1.531  {
   1.532  	trap text 2
   1.533 -	getty -n -l /bin/ash 38400 tty1 2> /dev/null || sh
   1.534 +	getty -n -l /bin/ash 38400 tty1 2>/dev/null || sh
   1.535  }
   1.536  
   1.537  BIN=bin/mount.posixovl
   1.538  [ -x /usr/s$BIN ] || mv /bin/mount.posixovl.iso2exe \
   1.539 -/usr/s$BIN 2> /dev/null || mv /bin/mount.posixovl.iso2exe /$BIN 2> /dev/null
   1.540 +/usr/s$BIN 2>/dev/null || mv /bin/mount.posixovl.iso2exe /$BIN 2>/dev/null
   1.541  mount_proc
   1.542 -for i in /sys/block/*/dev /sys/block/*/*/dev ; do
   1.543 +for i in /sys/block/*/dev /sys/block/*/*/dev; do
   1.544  	[ -s "$i" ] || continue
   1.545  	n=${i%/dev}
   1.546  	n=/dev/${n##*/}
   1.547  	[ -e $n ] && continue
   1.548  	mknod $n b $(sed 's/:/ /' < $i)
   1.549 -done
   1.550 +done 2>/dev/null
   1.551  ISO="$(getarg bootfrom | sed 's/.://;s|\\|/|g')"
   1.552 -getiso || text 2> /dev/null
   1.553 +getiso 2>/dev/null || text
   1.554  mount_loram
   1.555  case "${ISO##*/}$(getarg mode)" in
   1.556 -*install*|*INSTALL*)	install ;;
   1.557 -*live*|*LIVE*)		live ;;
   1.558 -*text*|*TEXT*)		text ;;
   1.559 +*install*|*INSTALL*)	install;;
   1.560 +*live*|*LIVE*)		live;;
   1.561 +*text*|*TEXT*)		text;;
   1.562  esac
   1.563 -which $DIALOG 2> /dev/null || DIALOG=tinydialog
   1.564 +which $DIALOG 2>/dev/null || DIALOG=tinydialog
   1.565  dmesg > /tmp/dmesg
   1.566  
   1.567  isotitle="$(blkid /mnt/$ISO | sed 's/.*LABEL="\([^"]*\).*/\1/')  $(stat \
   1.568  	 -c %y /media/cdrom | sed 's/ .*//')  $(basename $ISO)"
   1.569  while true; do
   1.570  	trap shell 2
   1.571 -	keymap="$(cat /etc/keymap.conf 2> /dev/null)"
   1.572 -	locale="$(sed '/^LANG=/!d;s/.*=//' /etc/locale.conf 2> /dev/null)"
   1.573 +	keymap="$(cat /etc/keymap.conf 2>/dev/null)"
   1.574 +	locale="$(sed '/^LANG=/!d;s/.*=//' /etc/locale.conf 2>/dev/null)"
   1.575  	cat > /tmp/dialog <<EOT
   1.576  $DIALOG --clear --title " ${isotitle:-Welcome to Linux} " \
   1.577  	--menu "" 23 70 17 \