wok-next rev 18062
syslinux/iso2exe: tazlito data may be more than 512 bytes
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun May 17 23:17:58 2015 +0200 (2015-05-17) |
parents | 05e8a6b1bd47 |
children | 41c93f510464 |
files | syslinux/stuff/iso2exe/iso2exe.sh |
line diff
1.1 --- a/syslinux/stuff/iso2exe/iso2exe.sh Sun May 17 00:09:41 2015 +0200 1.2 +++ b/syslinux/stuff/iso2exe/iso2exe.sh Sun May 17 23:17:58 2015 +0200 1.3 @@ -74,6 +74,20 @@ 1.4 store 64 $(($OFS+0xC0)) $1 1.5 } 1.6 1.7 +add_tazlito_info() 1.8 +{ 1.9 + HOLE=$OFS 1.10 + [ $(get 0 $2) -eq 35615 ] || return 1.11 + zcat $2 | gzip -9 > /tmp/rezipped$$.gz 1.12 + [ "$(which advdef 2> /dev/null)" ] && 1.13 + advdef -z4 /tmp/rezipped$$.gz > /dev/null 1.14 + n=$(stat -c %s /tmp/rezipped$$.gz) 1.15 + printf "Moving tazlito data record at %04X ($n bytes) ...\n" $OFS 1.16 + ddq if=/tmp/rezipped$$.gz bs=1 of=$1 seek=$OFS conv=notrunc 1.17 + HOLE=$(($HOLE+$n)) 1.18 + rm -f /tmp/rezipped$$.gz 1.19 +} 1.20 + 1.21 add_win32exe() 1.22 { 1.23 SIZE=$($0 --get win32.exe 2> /dev/null | tee /tmp/exe$$ | wc -c) 1.24 @@ -273,10 +287,8 @@ 1.25 ddq if=$1 bs=512 count=1 of=/tmp/hybrid$$ 1.26 ddq if=$1 bs=512 skip=2 count=20 of=/tmp/tazlito$$ 1.27 add_win32exe $1 /tmp/hybrid$$ 1.28 - printf "Moving tazlito data record at %04X (512 bytes) ...\n" $OFS 1.29 - ddq if=/tmp/tazlito$$ bs=1 count=512 of=$1 seek=$OFS conv=notrunc 1.30 + add_tazlito_info $1 /tmp/tazlito$$ 1.31 rm -f /tmp/tazlito$$ /tmp/hybrid$$ 1.32 - HOLE=$(($OFS+512)) 1.33 1.34 # keep the largest room for the tazlito info file 1.35 add_dosexe $1