wok diff syslinux/stuff/iso2exe/iso2exe.sh @ rev 17810

syslinux/iso2exe: one boot checksum only
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Mar 21 11:15:53 2015 +0100 (2015-03-21)
parents 639e963885dd
children 7a2963fc6f46
line diff
     1.1 --- a/syslinux/stuff/iso2exe/iso2exe.sh	Tue Feb 17 09:13:31 2015 +0000
     1.2 +++ b/syslinux/stuff/iso2exe/iso2exe.sh	Sat Mar 21 11:15:53 2015 +0100
     1.3 @@ -71,7 +71,7 @@
     1.4  	OFS=$(( $OFS - $SIZE ))
     1.5  	printf "Adding DOS boot file at %04X (%d bytes) ...\n" $OFS $SIZE
     1.6  	$0 --get boot.com | ddq of=$1 bs=1 seek=$OFS conv=notrunc
     1.7 -	store 66 $(($OFS+0xC0)) $1
     1.8 +	store 64 $(($OFS+0xC0)) $1
     1.9  }
    1.10  
    1.11  add_win32exe()
    1.12 @@ -86,9 +86,9 @@
    1.13  	store $((0xF4)) $((16 - 12)) $1
    1.14  	ddq if=$1 of=/tmp/coff$$ bs=1 skip=$((0x178)) count=$((0x88))
    1.15  	ddq if=/tmp/coff$$ of=$1 conv=notrunc bs=1 seek=$((0x178 - 12*8))
    1.16 -	ddq if=/tmp/exe$$ of=$1 bs=1 count=30 seek=$((0x1A0)) skip=$((0x1A0)) conv=notrunc
    1.17 -	ddq if=$2 bs=1 skip=$((0x1BE)) seek=$((0x1BE)) count=66 of=$1 conv=notrunc
    1.18 -	store 69 $(($SIZE/512)) $1 8
    1.19 +	ddq if=/tmp/exe$$ of=$1 bs=1 count=24 seek=$((0x1A0)) skip=$((0x1A0)) conv=notrunc
    1.20 +	ddq if=$2 bs=1 skip=$((0x1B8)) seek=$((0x1B8)) count=72 of=$1 conv=notrunc
    1.21 +	store 417 $(($SIZE/512)) $1 8
    1.22  	store 510 $((0xAA55)) $1
    1.23  	rm -f /tmp/exe$$ /tmp/coff$$
    1.24  	printf "Moving syslinux hybrid boot record at %04X (512 bytes) ...\n" $SIZE
    1.25 @@ -107,7 +107,7 @@
    1.26  		ddq of=$1 bs=1 count=512 seek=$OFS conv=notrunc
    1.27  		$0 --get bootfd.bin | \
    1.28  		ddq of=$1 bs=1 skip=1024 seek=$((512 + $OFS)) conv=notrunc
    1.29 -		store 28 $(($SIZE/512)) $1 8
    1.30 +		store 26 $(($SIZE/512)) $1 8
    1.31  	fi
    1.32  }
    1.33  case "$1" in
    1.34 @@ -211,7 +211,7 @@
    1.35  		fi
    1.36  	done <<EOT
    1.37  READSECTORERR	Read sector failure.
    1.38 -USAGE		Usage: isohybrid.exe file.iso [--forced|--undo|--md5]
    1.39 +USAGE		Usage: isohybrid.exe file.iso [--forced|--undo|--quick]
    1.40  OPENERR		Can't open r/w the iso file.
    1.41  ELTORITOERR	No EL TORITO SPECIFICATION signature.
    1.42  CATALOGERR	Invalid boot catalog.
    1.43 @@ -258,7 +258,7 @@
    1.44  	-u*|-r*|-w*)
    1.45  	    case "$(get 0 $1)" in
    1.46  	    23117)
    1.47 -		ddq if=$1 bs=512 count=2 skip=$(get 69 $1 1) of=$1 conv=notrunc
    1.48 +		ddq if=$1 bs=512 count=2 skip=$(get 417 $1 1) of=$1 conv=notrunc
    1.49  		ddq if=/dev/zero bs=1k seek=1 count=31 of=$1 conv=notrunc ;;
    1.50  	    *)  ddq if=/dev/zero bs=1k count=32 of=$1 conv=notrunc ;;
    1.51  	    esac
    1.52 @@ -284,7 +284,7 @@
    1.53  	add_doscom $1
    1.54  	add_fdbootstrap $1
    1.55  	printf "%d free bytes in %04X..%04X\n" $(($OFS-$HOLE)) $HOLE $OFS
    1.56 -	store 26 ${RANDOM:-0} $1
    1.57 +	store 440 $(date +%s) $1 32
    1.58  	[ "$2" ] && echo "$2               " | \
    1.59  		ddq bs=1 seek=$((0x7FDE)) count=15 conv=notrunc of=$1
    1.60  	if [ $(stat -c %s $1) -gt 34816 ]; then
    1.61 @@ -294,8 +294,6 @@
    1.62  			ddq bs=16 seek=2047 conv=notrunc of=$1
    1.63  	fi
    1.64  	echo -n "Adding boot checksum..."
    1.65 -	store 64 $(od -v -j 66 -N 32702 -t u2 -w2 -An $1 | \
    1.66 -		   awk '{ i+= $0 } END { print -(i % 65536) }') $1
    1.67  	if [ $(stat -c %s $1) -gt 32768 ]; then
    1.68  		n=$(($(get 2 $1) - 1 + ($(get 4 $1) - 1)*512))
    1.69  		n=$(($(od -v -N $n -t u2 -w2 -An $1 | \