wok-next rev 19510

syslinux/taziso: hide some error messages
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Nov 21 13:31:22 2016 +0100 (2016-11-21)
parents 3f33b4b50b30
children 3301bbdbd5fa
files syslinux/stuff/iso2exe/init syslinux/stuff/iso2exe/taziso
line diff
     1.1 --- a/syslinux/stuff/iso2exe/init	Mon Nov 21 09:32:06 2016 +0100
     1.2 +++ b/syslinux/stuff/iso2exe/init	Mon Nov 21 13:31:22 2016 +0100
     1.3 @@ -149,10 +149,11 @@
     1.4  		if checkmagic /mnt/$ISO; then
     1.5  			mount -o loop,ro /mnt/$ISO /media/cdrom
     1.6  			echo "Found $ISO on $(basename $dev)"
     1.7 -			break
     1.8 +			return 0
     1.9  		fi
    1.10  		umount /mnt
    1.11 -	done
    1.12 +	done 2> /dev/null
    1.13 +	return 1
    1.14  }
    1.15  
    1.16  uncpio()
    1.17 @@ -646,7 +647,7 @@
    1.18  
    1.19  ishybrid()
    1.20  {
    1.21 -	[ $(get 510 $ISO) -eq 43605 ] || return
    1.22 +	[ $(get 510 $ISO 2> /dev/null || echo 0) -eq 43605 ] || return
    1.23  	C=$((2048*$(get $(((17*2048) + 71)) /mnt/$ISO 4)))
    1.24  	[ $(get $C /mnt/$ISO 4) -eq 1 ] || return
    1.25  	[ $(get $(($C+30)) /mnt/$ISO 4) -eq $((0x88AA55)) ] || return
    1.26 @@ -657,13 +658,13 @@
    1.27  
    1.28  burnable()
    1.29  {
    1.30 -	[ "$(sed '/Can wr.*1$/!d' /proc/sys/dev/cdrom/info)" ] &&
    1.31 +	[ "$(sed '/Can wr.*1$/!d' /proc/sys/dev/cdrom/info 2> /dev/null)" ] &&
    1.32  	[ "$(which wodim)" ] && echo -en "\"$1\"	\"$2\""
    1.33  }
    1.34  
    1.35  blankable()
    1.36  {
    1.37 -	[ "$(sed '/Can wr.*RW.*1$/!d' /proc/sys/dev/cdrom/info)" ] &&
    1.38 +	[ "$(sed '/Can wr.*RW.*1$/!d' /proc/sys/dev/cdrom/info 2> /dev/null)" ] &&
    1.39  	[ "$(which wodim)" ] && echo -en "\"$1\"	\"$2\""
    1.40  }
    1.41  
    1.42 @@ -1146,14 +1147,14 @@
    1.43  
    1.44  flavdata()
    1.45  {
    1.46 -	dd if=/mnt/$ISO bs=512 skip=$((1+$(get 417 /mnt/$ISO 1))) \
    1.47 -		count=20 2>/dev/null | zcat 2>/dev/null
    1.48 +	ddq if=/mnt/$ISO bs=512 skip=$((1+$(get 417 /mnt/$ISO 1))) \
    1.49 +		count=20 | zcat 2>/dev/null
    1.50  }
    1.51  
    1.52  hasflavinfo()
    1.53  {
    1.54 -	[ "$(flavdata | dd bs=1 count=8 2> /dev/null | strings)" == \
    1.55 -	  "07070100" ] && echo -en "\"$1\"	\"$2\""
    1.56 +	[ "$(flavdata | ddq bs=1 count=8)" == "07070100" ] &&
    1.57 +	echo -en "\"$1\"	\"$2\""
    1.58  }
    1.59  
    1.60  showfavinfo()
    1.61 @@ -1200,7 +1201,7 @@
    1.62  	mknod $n b $(sed 's/:/ /' < $i)
    1.63  done
    1.64  ISO="$(getarg bootfrom | sed 's/.://;s|\\|/|g')"
    1.65 -getiso
    1.66 +getiso || text 2> /dev/null
    1.67  mount_loram
    1.68  case "${ISO##*/}$(getarg mode)" in
    1.69  *install*|*INSTALL*)	install ;;
     2.1 --- a/syslinux/stuff/iso2exe/taziso	Mon Nov 21 09:32:06 2016 +0100
     2.2 +++ b/syslinux/stuff/iso2exe/taziso	Mon Nov 21 13:31:22 2016 +0100
     2.3 @@ -839,12 +839,14 @@
     2.4  
     2.5  burnable()
     2.6  {
     2.7 -	[ "$(sed '/Can wr.*1$/!d' /proc/sys/dev/cdrom/info)" ] && menuitem "$@"
     2.8 +	[ "$(sed '/Can wr.*1$/!d' /proc/sys/dev/cdrom/info 2> /dev/null)" ] &&
     2.9 +	menuitem "$@"
    2.10  }
    2.11  
    2.12  blankable()
    2.13  {
    2.14 -	[ "$(sed '/Can wr.*RW.*1$/!d' /proc/sys/dev/cdrom/info)" ] && menuitem "$@"
    2.15 +	[ "$(sed '/Can wr.*RW.*1$/!d' /proc/sys/dev/cdrom/info 2> /dev/null)" ] &&
    2.16 +	menuitem "$@"
    2.17  }
    2.18  
    2.19  burniso()
    2.20 @@ -1093,12 +1095,12 @@
    2.21  {
    2.22  	[ $(get 1024 "$ISO") -eq 35615 ] && n=2 || n=$((1+$(get 417 "$ISO" 1)))
    2.23  	[ $n -eq 4 ] && n=20
    2.24 -	dd if="$ISO" bs=512 skip=$n count=20 2>/dev/null | zcat 2>/dev/null
    2.25 +	ddq if="$ISO" bs=512 skip=$n count=20 | zcat 2>/dev/null
    2.26  }
    2.27  
    2.28  hasflavinfo()
    2.29  {
    2.30 -	[ "$(flavdata | dd bs=1 count=8 2> /dev/null | strings)" == \
    2.31 +	[ "$(flavdata | ddq bs=1 count=8 | strings)" == \
    2.32  	  "07070100" ] && menuitem "$@"
    2.33  }
    2.34