wok-next rev 18034

syslinux/taziso: add burn
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat May 09 21:54:15 2015 +0200 (2015-05-09)
parents 3942f06994e2
children 2f76ffd0c441
files cups/stuff/var/www/tazpanel/menu.d/hardware/cups ppp/stuff/ppp.cgi syslinux/stuff/iso2exe/init syslinux/stuff/iso2exe/taziso
line diff
     1.1 --- a/cups/stuff/var/www/tazpanel/menu.d/hardware/cups	Fri May 08 19:30:55 2015 +0200
     1.2 +++ b/cups/stuff/var/www/tazpanel/menu.d/hardware/cups	Sat May 09 21:54:15 2015 +0200
     1.3 @@ -1,3 +1,3 @@
     1.4  cat <<EOT
     1.5 -<li><a data-icon="text" href="http://${HTTP_HOST%:*}:631/">CUPS</a></li>
     1.6 +<li><a data-icon="text" href="http://${HTTP_HOST%:*}:631/">$(_ "Printer") (CUPS)</a></li>
     1.7  EOT
     2.1 --- a/ppp/stuff/ppp.cgi	Fri May 08 19:30:55 2015 +0200
     2.2 +++ b/ppp/stuff/ppp.cgi	Sat May 09 21:54:15 2015 +0200
     2.3 @@ -324,7 +324,7 @@
     2.4  	</tr>
     2.5  	<tr>
     2.6  		<td>$(_ 'Remote PPP options')</td>
     2.7 -		<td><input type="text" name="remotepppopt" size="50" value="${REMOTEPPP:-proxyarp}" title="$(_ "You may 'proxyarp' to use the new routes")" /></td>
     2.8 +		<td><input type="text" name="remotepppopt" size="50" value="${REMOTEPPP:-proxyarp}" title="$(_ "You may need 'proxyarp' to use the new routes")" /></td>
     2.9  	</tr>
    2.10  	<tr>
    2.11  		<td>$(_ 'Peer routes')</td>
     3.1 --- a/syslinux/stuff/iso2exe/init	Fri May 08 19:30:55 2015 +0200
     3.2 +++ b/syslinux/stuff/iso2exe/init	Sat May 09 21:54:15 2015 +0200
     3.3 @@ -655,6 +655,29 @@
     3.4  	echo -en "\"$1\"	\"$2\""
     3.5  }
     3.6  
     3.7 +burnable()
     3.8 +{
     3.9 +	[ "$(sed '/Can wr.*1$/!d' /proc/sys/dev/cdrom/info)" ] &&
    3.10 +	[ "$(which wodim)" ] && echo -en "\"$1\"	\"$2\""
    3.11 +}
    3.12 +
    3.13 +blankable()
    3.14 +{
    3.15 +	[ "$(sed '/Can wr.*RW.*1$/!d' /proc/sys/dev/cdrom/info)" ] &&
    3.16 +	[ "$(which wodim)" ] && echo -en "\"$1\"	\"$2\""
    3.17 +}
    3.18 +
    3.19 +burniso()
    3.20 +{
    3.21 +	wodim -v speed=$(fgrep "drive speed" /proc/sys/dev/cdrom/info | cut -f3) \
    3.22 +		-eject -multi "$ISO"
    3.23 +}
    3.24 +
    3.25 +blankcd()
    3.26 +{
    3.27 +	wodim -v -blank=fast
    3.28 +}
    3.29 +
    3.30  gotisomd5()
    3.31  {
    3.32  	[ "$(which md5sum 2> /dev/null)" ] &&
    3.33 @@ -968,6 +991,8 @@
    3.34  $(gotisomd5		"isomd5"	"Check the ISO image") \
    3.35  $(cdfile "md5sum*"	"md5"		"Check the ISO files") \
    3.36  $(cdfile "sha*sum*"	"sha"		"Check the ISO files") \
    3.37 +$(burnable		"burniso"	"Burn the ISO image") \
    3.38 +$(blankable		"blankcd"	"Blank the CD/DVD") \
    3.39  $(gotposixovl		"install"	"Hard disk installation (UMSDOS way)") \
    3.40  $(gotposixovl		"installtaz"	"Hard disk installation (TAZUSB way)") \
    3.41  $(xfile tazusb		"usbkey"	"USB key read/write installation") \
     4.1 --- a/syslinux/stuff/iso2exe/taziso	Fri May 08 19:30:55 2015 +0200
     4.2 +++ b/syslinux/stuff/iso2exe/taziso	Sat May 09 21:54:15 2015 +0200
     4.3 @@ -32,15 +32,15 @@
     4.4  gettazboot()
     4.5  {
     4.6  	echo "Creating $(basename $1) ..."
     4.7 -	if [ $(get 0 $ISO) -eq 23117 ]; then
     4.8 -		O=$(($(get 64 $ISO) - 0xC0))
     4.9 -		L=$(($(get 20 $ISO) - 0xC0 - $(get 24 $ISO) - $O))
    4.10 +	if [ $(get 0 "$ISO") -eq 23117 ]; then
    4.11 +		O=$(($(get 64 "$ISO") - 0xC0))
    4.12 +		L=$(($(get 20 "$ISO") - 0xC0 - $(get 24 "$ISO") - $O))
    4.13  		S=$((32+$L))
    4.14  		P=$((($S+511)/512))
    4.15  		E=$((4096-(32*$P)))
    4.16  		words2bin 0x5A4D $(($S%512)) $P 0 2 $E -1 $((${2:-0}-16)) \
    4.17  				-2 0 256 -16 28 0x6C53 0x5469 0x7A61 > $1
    4.18 -		ddq bs=1 count=$L skip=$(echo $O) if=$ISO >> $1
    4.19 +		ddq bs=1 count=$L skip=$(echo $O) if="$ISO" >> $1
    4.20  	else
    4.21  		wget -O $1 http://mirror.slitaz.org/boot/tazboot.exe
    4.22  	fi
    4.23 @@ -462,10 +462,10 @@
    4.24  
    4.25  See http://diddy.boot-land.net/grub4dos/files/README_GRUB4DOS.txt
    4.26  EOT
    4.27 -	( cd $mnt ; zip -r9 $(basename $ISO .iso).zip slitaz )
    4.28 +	( cd $mnt ; zip -r9 $(basename "$ISO" .iso).zip slitaz )
    4.29  	[ "$(which advzip)" ] && advzip -z4 $mnt/*.zip
    4.30  	mv $mnt/*.zip .
    4.31 -	ls -l $PWD/$(basename $ISO .iso).zip
    4.32 +	ls -l $PWD/$(basename "$ISO" .iso).zip
    4.33  	umount $mnt
    4.34  	rm -rf $mnt
    4.35  }
    4.36 @@ -791,7 +791,7 @@
    4.37  
    4.38  misspkg()
    4.39  {
    4.40 -	for i in zip kexec-tools posixovl ; do
    4.41 +	for i in zip kexec-tools posixovl cdrkit ; do
    4.42  		[ -d /var/lib/tazpkg/installed/$i/ ] && continue
    4.43  		[ "$1" != "install" ] && menuitem "$@" && return
    4.44  		tazpkg get-install $i
    4.45 @@ -805,38 +805,59 @@
    4.46  
    4.47  ishybrid()
    4.48  {
    4.49 -	[ $(get 510 $ISO) -eq 43605 ] || return
    4.50 -	C=$((2048*$(get $(((17*2048) + 71)) $ISO 4)))
    4.51 -	[ $(get $C $ISO 4) -eq 1 ] || return
    4.52 -	[ $(get $(($C+30)) $ISO 4) -eq $((0x88AA55)) ] || return
    4.53 -	C=$((2048*$(get $(($C+40)) $ISO 4)))
    4.54 -	[ $(get $(($C+64)) $ISO 4) -eq 1886961915 ] && menuitem "$@"
    4.55 +	[ $(get 510 "$ISO") -eq 43605 ] || return
    4.56 +	C=$((2048*$(get $(((17*2048) + 71)) "$ISO" 4)))
    4.57 +	[ $(get $C "$ISO" 4) -eq 1 ] || return
    4.58 +	[ $(get $(($C+30)) "$ISO" 4) -eq $((0x88AA55)) ] || return
    4.59 +	C=$((2048*$(get $(($C+40)) "$ISO" 4)))
    4.60 +	[ $(get $(($C+64)) "$ISO" 4) -eq 1886961915 ] && menuitem "$@"
    4.61  }
    4.62  
    4.63  isiso()
    4.64  {
    4.65 -	[ $(get 32769 $ISO 4) -eq 808469571 ] && menuitem "$@"
    4.66 +	[ $(get 32769 "$ISO" 4) -eq 808469571 ] && menuitem "$@"
    4.67 +}
    4.68 +
    4.69 +burnable()
    4.70 +{
    4.71 +	[ "$(sed '/Can wr.*1$/!d' /proc/sys/dev/cdrom/info)" ] && menuitem "$@"
    4.72 +}
    4.73 +
    4.74 +blankable()
    4.75 +{
    4.76 +	[ "$(sed '/Can wr.*RW.*1$/!d' /proc/sys/dev/cdrom/info)" ] && menuitem "$@"
    4.77 +}
    4.78 +
    4.79 +burniso()
    4.80 +{
    4.81 +	wodim -v speed=$(fgrep "drive speed" /proc/sys/dev/cdrom/info | cut -f3) \
    4.82 +		-eject -multi "$ISO"
    4.83 +}
    4.84 +
    4.85 +blankcd()
    4.86 +{
    4.87 +	wodim -v -blank=fast
    4.88  }
    4.89  
    4.90  gotisomd5()
    4.91  {
    4.92  	[ "$(which md5sum 2> /dev/null)" ] &&
    4.93 -	[ $(get 0 $ISO) -eq 23117 ] &&
    4.94 -	[ $(get 18 $ISO) -ne 0 ] && menuitem "$@"
    4.95 +	[ $(get 0 "$ISO") -eq 23117 ] &&
    4.96 +	[ $(get 18 "$ISO") -ne 0 ] && menuitem "$@"
    4.97  }
    4.98  
    4.99  isomd5()
   4.100  {
   4.101  	dotwait "Checking iso image"
   4.102 -	[ "$(ddq if=$ISO bs=2k skip=16 \
   4.103 -	     count=$(echo $(get 32848 $ISO 4)) | md5sum)" == \
   4.104 -	  "$(ddq if=$ISO bs=16 count=1 skip=2047 | od -N 16 -t x1 -An | \
   4.105 +	[ "$(ddq if="$ISO" bs=2k skip=16 \
   4.106 +	     count=$(echo $(get 32848 "$ISO" 4)) | md5sum)" == \
   4.107 +	  "$(ddq if="$ISO" bs=16 count=1 skip=2047 | od -N 16 -t x1 -An | \
   4.108  	     sed 's/ //g')  -" ] && echo "OK" || echo "ERROR"
   4.109  	echo -en "\rChecking iso hybrid boot..."
   4.110 -	n=$(($(get 2 $ISO)-1+($(get 4 $ISO)-1)*512))
   4.111 +	n=$(($(get 2 "$ISO")-1+($(get 4 "$ISO")-1)*512))
   4.112  	if [ $n -lt 40000 -a $n -gt 32768 ]; then
   4.113 -		s=$(get 0 $ISO 2 $n | awk '{ i+= $0 } END { print i }')
   4.114 -		[ $(((1+$s+$(get $(($n+1)) $ISO 1)) % 65536)) -eq 0 ] &&
   4.115 +		s=$(get 0 "$ISO" 2 $n | awk '{ i+= $0 } END { print i }')
   4.116 +		[ $(((1+$s+$(get $(($n+1)) "$ISO" 1)) % 65536)) -eq 0 ] &&
   4.117  		echo "OK" || echo "ERROR"
   4.118  	fi
   4.119  	rm -f /tmp/wait
   4.120 @@ -900,8 +921,8 @@
   4.121  		usbdev || return
   4.122  	
   4.123  		# perform dd in progress bar
   4.124 -		max=$(($(stat -c %s $ISO)/2048))
   4.125 -		i=0; ddq if=$ISO bs=1024k | ( 
   4.126 +		max=$(($(stat -c %s "$ISO")/2048))
   4.127 +		i=0; ddq if="$ISO" bs=1024k | ( 
   4.128  		while ddq bs=1024k count=1 ; do 
   4.129  			i=$(($i + 1))
   4.130  			[ $i -gt $max ] && break
   4.131 @@ -971,7 +992,7 @@
   4.132  	exec 3>&-
   4.133  	[ $retval -eq 0 ] || return
   4.134  	[ "$format" != "none" ] && tazusb format $device "SliTaz" $format
   4.135 -	tazusb gen-iso2usb $ISO $device
   4.136 +	tazusb gen-iso2usb "$ISO" $device
   4.137  }
   4.138  
   4.139  dokexec()
   4.140 @@ -993,8 +1014,8 @@
   4.141  
   4.142  flavdata()
   4.143  {
   4.144 -	[ $(get 512 $ISO) -eq 35615 ] && n=1 || n=$((1+$(get 417 $ISO 1)))
   4.145 -	dd if=$ISO bs=512 skip=$n count=20 2>/dev/null | zcat 2>/dev/null
   4.146 +	[ $(get 512 "$ISO") -eq 35615 ] && n=1 || n=$((1+$(get 417 "$ISO" 1)))
   4.147 +	dd if="$ISO" bs=512 skip=$n count=20 2>/dev/null | zcat 2>/dev/null
   4.148  }
   4.149  
   4.150  hasflavinfo()
   4.151 @@ -1029,9 +1050,9 @@
   4.152  	exit
   4.153  }
   4.154  
   4.155 -ISO="$1"
   4.156 +ISO="${1:-/dev/null}"
   4.157  [ -z "$(isiso 2> /dev/null)" ] && echo "Usage : $0 file.iso" && exit 1
   4.158 -mount -o loop,ro $ISO /media/cdrom
   4.159 +mount -o loop,ro "$ISO" /media/cdrom
   4.160  
   4.161  if [ "$2" == "list" ]; then
   4.162  	sed '/^\$(.*") \\/!d;s/^\$(\(.*\)").*/\1"/' $0 | while read line; do
   4.163 @@ -1061,6 +1082,8 @@
   4.164  $(cdfile 'md5sum*'	"md5"		"Check the ISO files") \
   4.165  $(cdfile 'sha*sum*'	"sha"		"Check the ISO files") \
   4.166  $(cdfilex boot/bzImage	"bootiso"	"Boot the ISO image") \
   4.167 +$(burnable		"burniso"	"Burn the ISO image") \
   4.168 +$(blankable		"blankcd"	"Blank the CD/DVD") \
   4.169  $(gotposixovl		"install"	"Hard disk installation (UMSDOS way)") \
   4.170  $(gotposixovl		"installtaz"	"Hard disk installation (TAZUSB way)") \
   4.171  $(gotposixovlzip	"inst2zip"	"ZIP installation archive (UMSDOS way)") \