wok-next rev 19425
syslinux/isohybrid: boot efi support
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Sep 30 21:29:58 2016 +0200 (2016-09-30) |
parents | ca1cc546e49c |
children | a7b7c18d4133 |
files | syslinux/stuff/iso2exe/iso2exe.sh syslinux/stuff/iso2exe/taziso syslinux/stuff/tools/isohybrid.sh tazlito/receipt |
line diff
1.1 --- a/syslinux/stuff/iso2exe/iso2exe.sh Fri Sep 30 21:17:41 2016 +0200 1.2 +++ b/syslinux/stuff/iso2exe/iso2exe.sh Fri Sep 30 21:29:58 2016 +0200 1.3 @@ -21,11 +21,9 @@ 1.4 compress() 1.5 { 1.6 if [ "$1" ]; then 1.7 - [ "$(which zopfli 2> /dev/null)" ] && 1.8 - zopfli --i100 -c /dev/stdin > $1 || 1.9 gzip -9 > $1 1.10 [ "$(which advdef 2> /dev/null)" ] && 1.11 - advdef -z4 $1 > /dev/null 1.12 + advdef -z4 -i100 $1 > /dev/null 1.13 elif [ "$(which xz 2> /dev/null)" ]; then 1.14 xz -z -e --format=lzma --lzma1=mode=normal --stdout 1.15 else 1.16 @@ -88,13 +86,28 @@ 1.17 ddq if=/tmp/rezipped$$.gz bs=1 of=$1 seek=$OFS conv=notrunc 1.18 HOLE=$(($HOLE+$n)) 1.19 rm -f /tmp/rezipped$$.gz 1.20 + if [ -n "$gpt" ]; then 1.21 + store $((0x25E)) $n $1 1.22 + store $((0x25C)) $OFS $1 1.23 + fi 1.24 } 1.25 1.26 add_win32exe() 1.27 { 1.28 SIZE=$($0 --get win32.exe 2> /dev/null | tee /tmp/exe$$ | wc -c) 1.29 + [ -n "$gpt" ] && SIZE=$(($SIZE+1024)) 1.30 + [ -n "$mac" ] && SIZE=$(($SIZE+3072)) 1.31 printf "Adding WIN32 file at %04X (%d bytes) ...\n" 0 $SIZE 1.32 ddq if=/tmp/exe$$ of=$1 conv=notrunc 1.33 + if [ -n "$gpt" ]; then 1.34 + printf "Adding GPT at %04X (1024 bytes) ...\n" 512 1.35 + ddq if=$2 bs=512 skip=1 of=$1 seek=1 conv=notrunc 1.36 + i=3; [ -n "$mac" ] && i=9 1.37 + ddq if=/tmp/exe$$ bs=512 skip=1 of=$1 seek=$i conv=notrunc 1.38 + for i in 12C 154 17C ; do # always 3 UPX sections 1.39 + store $((0x$i)) $((1024 + $(get 0x$i $1))) $1 2 1.40 + done 1.41 + fi 1.42 printf "Adding bootiso head at %04X...\n" 0 1.43 $0 --get bootiso.bin 2> /dev/null > /tmp/exe$$ 1.44 ddq if=/tmp/exe$$ of=$1 bs=128 count=1 conv=notrunc 1.45 @@ -104,12 +117,13 @@ 1.46 ddq if=/tmp/coff$$ of=$1 conv=notrunc bs=1 seek=$((0x178 - 12*8)) 1.47 ddq if=/tmp/exe$$ of=$1 bs=1 count=24 seek=$((0x1A0)) skip=$((0x1A0)) conv=notrunc 1.48 ddq if=$2 bs=1 skip=$((0x1B8)) seek=$((0x1B8)) count=72 of=$1 conv=notrunc 1.49 - store 417 $(($SIZE/512)) $1 8 1.50 store 510 $((0xAA55)) $1 1.51 rm -f /tmp/exe$$ /tmp/coff$$ 1.52 - printf "Moving syslinux hybrid boot record at %04X (512 bytes) ...\n" $SIZE 1.53 - ddq if=$2 bs=1 count=512 of=$1 seek=$SIZE conv=notrunc 1.54 - OFS=$(($SIZE+512)) 1.55 + i=$SIZE; OFS=$(($SIZE+512)) 1.56 + [ -n "$mac" ] && OFS=$SIZE && i=1536 1.57 + store 417 $(($i/512)) $1 8 1.58 + printf "Moving syslinux hybrid boot record at %04X (512 bytes) ...\n" $i 1.59 + ddq if=$2 bs=1 count=512 of=$1 seek=$i conv=notrunc 1.60 } 1.61 1.62 add_fdbootstrap() 1.63 @@ -141,16 +155,21 @@ 1.64 1.65 fileofs() 1.66 { 1.67 - [ $(get 1024 "$ISO") -eq 35615 ] && i=1024 || 1.68 - i=$((512*(1+$(get 417 "$ISO" 1)))) 1.69 + [ $(get 1024 "$ISO") -eq 35615 ] && x=1024 || 1.70 + x=$((512*(1+$(get 417 "$ISO" 1)))) 1.71 stub=$(($(get 20 "$ISO") - 0xC0)) 1.72 c=$(custom_config_sector "$ISO") 1.73 SIZE=0; OFFSET=0 1.74 case "$1" in 1.75 - win32.exe) [ $i -eq 1024 ] || SIZE=$(($i - 512));; 1.76 - syslinux.mbr) [ $i -eq 1024 ] || OFFSET=$(($i - 512)); SIZE=512;; 1.77 - flavor.info) OFFSET=$i 1.78 - SIZE=$(ddq bs=512 skip=$(($i/512)) if="$ISO" | gzsize);; 1.79 + win32.exe) [ $x -eq 2048 ] && x=10752 1.80 + [ $x -eq 1024 ] || SIZE=$(($x - 512));; 1.81 + syslinux.mbr) [ $x -eq 1024 ] || OFFSET=$(($x - 512)); SIZE=512;; 1.82 + flavor.info) [ $(get 22528 "$ISO") -eq 35615 ] && OFFSET=22528 1.83 + [ $x -eq 2048 ] && x=$(get 0x25C "$ISO") && 1.84 + SIZE=$(get 0x25E "$ISO") 1.85 + [ $(get $x "$ISO") -eq 35615 ] && OFFSET=$x 1.86 + [ $OFFSET -ne 0 ] && [ $SIZE -eq 0 ] && 1.87 + SIZE=$(ddq bs=512 skip=$(($OFFSET/512)) if="$ISO" | gzsize);; 1.88 floppy.boot) SIZE=$(($(get 26 "$ISO" 1)*512)) 1.89 OFFSET=$(($(get 64 "$ISO") - 0xC0 - $SIZE));; 1.90 rootfs.gz) SIZE=$(get 24 "$ISO"); OFFSET=$(($stub - $SIZE));; 1.91 @@ -168,7 +187,7 @@ 1.92 sed '/^append=/!d;s/^[^=]*=.//' | wc -c);; 1.93 custom.initrd) i=$(ddq bs=2k skip=$c if="$ISO" count=1 | \ 1.94 sed '/^append=\|^initrd:/!d' | wc -c) 1.95 - OFFSET=$((2048*$c+$i+40)) 1.96 + OFFSET=$((2048*$c+$x+40)) 1.97 SIZE=$(($(ddq bs=2k skip=$c if="$ISO" count=1 | \ 1.98 sed '/^initrd:/!d;s/.*://') + 0));; 1.99 esac 1.100 @@ -193,6 +212,46 @@ 1.101 OFFSET=$(stat -c %s "$ISO") 1.102 [ $OFFSET -gt $HEAP ] && 1.103 printf "%d free bytes in %04X..%04X\n" $(($OFFSET - $HEAP)) $HEAP $OFFSET 1.104 + if [ $(get 510 "$ISO") -eq 43605 ]; then 1.105 + echo "MBR partitions :" 1.106 + for i in 0 1 2 3; do 1.107 + SIZE=$(get $((446+12+16*i)) "$ISO" 4) 1.108 + [ $SIZE -eq 0 ] && continue 1.109 + OFFSET=$(get $((446+8+16*i)) "$ISO" 4) 1.110 + printf " $i:%08X %08X %02X\n" $OFFSET $SIZE \ 1.111 + $(get $((446+4+16*i)) "$ISO" 1) 1.112 + done 1.113 + if [ $(get 466 "$ISO") -eq 65263 ]; then 1.114 + echo "EFI partitions :" 1.115 + n=$(get 584 "$ISO" 1) 1.116 + s=$(get 596 "$ISO") 1.117 + o=$((($(get 552 "$ISO" 1)*512)-($(get 592 "$ISO")*$s))) 1.118 + i=0 1.119 + while [ $n -gt $i ]; do 1.120 + f=$(get $(($o+0x20)) "$ISO" 4) 1.121 + l=$(($(get $(($o+0x28)) "$ISO" 4)-$f)) 1.122 + [ $l -eq 0 ] && break 1.123 + printf " $i:%08X %08X %s\n" $f $(($l+1)) \ 1.124 + "$(od -An -N 36 -w -j $(($o+0x38)) -t a "$ISO" \ 1.125 + | sed 's/\( nul\)*//g;s/ //g;s/ sp//')" 1.126 + o=$(($o+$s)) 1.127 + i=$(($i+1)) 1.128 + done 1.129 + fi 1.130 + fi 1.131 + o=2048 1.132 + if [ $(get $o "$ISO") -eq 19792 ]; then 1.133 + echo "Apple partitions :" 1.134 + i=0 1.135 + while [ $(get $o "$ISO") -eq 19792 ]; do 1.136 + f=$((0x$(od -An -N 4 -j $(($o+8)) -t x1 "$ISO" | sed 's/ //g'))) 1.137 + l=$((0x$(od -An -N 4 -j $(($o+0x54)) -t x1 "$ISO" | sed 's/ //g'))) 1.138 + printf " $i:%08X %08X %s\n" $f $l \ 1.139 + "$(ddq bs=1 skip=$(($o+16)) count=32 if="$ISO")" 1.140 + o=$(($o+2048)) 1.141 + i=$(($i+1)) 1.142 + done 1.143 + fi 1.144 } 1.145 1.146 extract() 1.147 @@ -211,10 +270,10 @@ 1.148 1.149 clear_custom_config() 1.150 { 1.151 - start=$(custom_config_sector $1) 1.152 - cnt=$((512 - ($start % 512))) 1.153 - [ $cnt -ne 512 ] && 1.154 - ddq if=/dev/zero of=$1 bs=2k seek=$start count=$cnt 1.155 + start=$(custom_config_sector $1) 1.156 + cnt=$((512 - ($start % 512))) 1.157 + [ $cnt -ne 512 ] && 1.158 + ddq if=/dev/zero of=$1 bs=2k seek=$start count=$cnt 1.159 } 1.160 case "$1" in 1.161 --build) 1.162 @@ -408,6 +467,7 @@ 1.163 [ $(id -u) -ne 0 ] && cmd="$0 $@" && exec su -c "$cmd" < /dev/tty 1.164 append= 1.165 initrd= 1.166 + 1.167 while [ "$1" ]; do 1.168 case "${1/--/-}" in 1.169 -get) shift 1.170 @@ -434,9 +494,16 @@ 1.171 b=$(get 417 $1 1) 1.172 n=$(($(get 64 $1) + 0xC0 - ($(get 26 $1 1)*512) - ($b+1)*512)) 1.173 ddq if=$1 bs=512 count=1 skip=$b of=$1 conv=notrunc 1.174 - ddq if=/dev/zero bs=512 seek=1 count=1 of=$1 conv=notrunc 1.175 - ddq if=$1 bs=512 seek=2 count=30 skip=$(($b+1)) of=$1 conv=notrunc 1.176 - ddq if=/dev/zero bs=1 seek=$n count=$((0x8000 - $n)) of=$1 conv=notrunc ;; 1.177 + if [ $(get 512 $1) -eq 17989 ]; then 1.178 + n=$(($(get 0x25C $1)/512)) 1.179 + ddq if=$1 bs=512 seek=44 count=20 skip=$n of=$1 conv=notrunc 1.180 + ddq if=/dev/zero bs=512 seek=9 count=35 of=$1 conv=notrunc 1.181 + ddq if=/dev/zero bs=512 seek=3 count=1 of=$1 conv=notrunc 1.182 + else 1.183 + ddq if=/dev/zero bs=512 seek=1 count=1 of=$1 conv=notrunc 1.184 + ddq if=$1 bs=512 seek=2 count=30 skip=$(($b+1)) of=$1 conv=notrunc 1.185 + ddq if=/dev/zero bs=1 seek=$n count=$((0x8000 - $n)) of=$1 conv=notrunc 1.186 + fi ;; 1.187 *) ddq if=/dev/zero bs=1k count=32 of=$1 conv=notrunc ;; 1.188 esac 1.189 case "${2/--/-}" in 1.190 @@ -452,10 +519,19 @@ 1.191 23117) echo "The file $1 is already an EXE file." 1>&2 && exit 1;; 1.192 0) [ -x /usr/bin/isohybrid ] && isohybrid $1;; 1.193 esac 1.194 - 1.195 + 1.196 + gpt= ; [ $(get 466 $1) -eq 65263 ] && gpt=1 1.197 + mac= ; [ $(get 2048 $1) -eq 19792 ] && mac=1 1.198 echo "Read hybrid & tazlito data..." 1.199 - ddq if=$1 bs=512 count=1 of=/tmp/hybrid$$ 1.200 - ddq if=$1 bs=512 skip=2 count=20 of=/tmp/tazlito$$ 1.201 + if [ -n "gpt" ]; then 1.202 + echo "GUID Partition Table..." 1.203 + n=3; [ -n "mac" ] && n=9 && echo "Apple Partition Table..." 1.204 + ddq if=$1 bs=512 count=$n of=/tmp/hybrid$$ 1.205 + ddq if=$1 bs=512 skip=44 count=20 of=/tmp/tazlito$$ 1.206 + else 1.207 + ddq if=$1 bs=512 count=1 of=/tmp/hybrid$$ 1.208 + ddq if=$1 bs=512 skip=2 count=20 of=/tmp/tazlito$$ 1.209 + fi 1.210 add_win32exe $1 /tmp/hybrid$$ 1.211 add_tazlito_info $1 /tmp/tazlito$$ 1.212 rm -f /tmp/tazlito$$ /tmp/hybrid$$
2.1 --- a/syslinux/stuff/iso2exe/taziso Fri Sep 30 21:17:41 2016 +0200 2.2 +++ b/syslinux/stuff/iso2exe/taziso Fri Sep 30 21:29:58 2016 +0200 2.3 @@ -756,7 +756,8 @@ 2.4 2.5 gotposixovl() 2.6 { 2.7 - mount.posixovl 2>&1 | grep -qi usage && menuitem "$@" 2.8 + mount.posixovl 2>&1 | grep -qi usage && gotcdfile 'rootfs*.gz' && 2.9 + menuitem "$@" 2.10 } 2.11 2.12 gotposixovlzip() 2.13 @@ -774,6 +775,11 @@ 2.14 gotcdfile "$1" && menuitem "$@" 2.15 } 2.16 2.17 +gottazusb() 2.18 +{ 2.19 + gotcdfile 'rootfs*.gz' && xfile tazusb "$@" 2.20 +} 2.21 + 2.22 isbzImage() 2.23 { 2.24 [ $(get 514 $file 4) -eq 1400005704 ] && 2.25 @@ -869,6 +875,11 @@ 2.26 hascustomconf && menuitem "$@" 2.27 } 2.28 2.29 +hasflavor() 2.30 +{ 2.31 + [ -x /usr/bin/tazlito ] && [ -s $media/boot/bzImage ] && menuitem "$@" 2.32 +} 2.33 + 2.34 gotisomd5() 2.35 { 2.36 [ "$(which md5sum 2> /dev/null)" ] && 2.37 @@ -1081,6 +1092,7 @@ 2.38 flavdata() 2.39 { 2.40 [ $(get 1024 "$ISO") -eq 35615 ] && n=2 || n=$((1+$(get 417 "$ISO" 1))) 2.41 + [ $n -eq 4 ] && n=20 2.42 dd if="$ISO" bs=512 skip=$n count=20 2>/dev/null | zcat 2>/dev/null 2.43 } 2.44 2.45 @@ -1191,9 +1203,10 @@ 2.46 2.47 floppyset() 2.48 { 2.49 - gotcdfile isolinux.cfg 2.50 + gotcdfile 'isolinux.cfg' 2.51 parse_isolinux < $file > /tmp/var$$ 2.52 . /tmp/var$$ 2.53 + [ -z "$KERNEL" ] && echo "Can't parse isolinux.cfg" && return 2.54 for i in $media/$KERNEL $(dirname $file)/$KERNEL $media/$(locase $KERNEL) \ 2.55 $(dirname $file)/$(locase $KERNEL); do 2.56 [ -s $i ] && KERNEL=$i && break 2.57 @@ -1356,10 +1369,10 @@ 2.58 $(gotposixovl "installtaz" "Hard disk installation (TAZUSB way)") \ 2.59 $(gotposixovlzip "inst2zip" "ZIP installation archive (UMSDOS way)") \ 2.60 $(gotposixovlzip "insttaz2zip" "ZIP installation archive (TAZUSB way)") \ 2.61 -$(xfile tazusb "usbkey" "USB key read/write installation") \ 2.62 +$(gottazusb "usbkey" "USB key read/write installation") \ 2.63 $(ishybrid "usbbootkey" "USB boot key (read only)") \ 2.64 $(hasflavinfo "showfavinfo" "Show flavor extra info") \ 2.65 -$(xfile tazlito "flavor" "Get flavor file") \ 2.66 +$(hasflavor "flavor" "Get flavor file") \ 2.67 $(cdfile isolinux.cfg "floppyset" "Boot floppy set") \ 2.68 $(hastazboot "tazboot" "Get tazboot.exe Linux loader") \ 2.69 $(cdexe boot/bzImage "bzimage" "Get linux DOS/EXE file") \
3.1 --- a/syslinux/stuff/tools/isohybrid.sh Fri Sep 30 21:17:41 2016 +0200 3.2 +++ b/syslinux/stuff/tools/isohybrid.sh Fri Sep 30 21:29:58 2016 +0200 3.3 @@ -14,7 +14,7 @@ 3.4 heads=64 # zipdrive-style geometry 3.5 sectors=32 3.6 partype=23 # "Windows hidden IFS" 3.7 -entry=1 3.8 +entry= 3.9 id=$(( ($RANDOM <<16) + $RANDOM)) 3.10 offset=0 3.11 partok=0 3.12 @@ -74,15 +74,111 @@ 3.13 readiso $1 $2 4 | od -N 4 -t u4 -An 3.14 } 3.15 3.16 +# read a 16 bits data 3.17 +read16() 3.18 +{ 3.19 + readiso $1 $2 2 | od -N 2 -t u2 -An 3.20 +} 3.21 + 3.22 +# read a 8 bits data 3.23 +read8() 3.24 +{ 3.25 + readiso $1 $2 1 | od -N 1 -t u1 -An 3.26 +} 3.27 + 3.28 # write a 32 bits data 3.29 store32() 3.30 { 3.31 - n=$2; for i in 1 2 3 4; do 3.32 - printf '\\\\x%02X' $(($n & 255)) 3.33 - n=$(($n >> 8)) 3.34 + n=$2; for i in 0 8 16 24; do 3.35 + printf '\\\\x%02X' $((($n >> $i) & 255)) 3.36 done | xargs echo -en | ddq bs=1 conv=notrunc of=$iso seek=$(($1)) 3.37 } 3.38 3.39 +store32sw() 3.40 +{ 3.41 + n=$2; for i in 24 16 8 0; do 3.42 + printf '\\\\x%02X' $((($n >> $i) & 255)) 3.43 + done | xargs echo -en | ddq bs=1 conv=notrunc of=$iso seek=$(($1)) 3.44 +} 3.45 + 3.46 +crc32() 3.47 +{ 3.48 + t0=00000000; t1=77073096; t2=EE0E612C; t3=990951BA; 3.49 + t4=076DC419; t5=706AF48F; t6=E963A535; t7=9E6495A3; 3.50 + t8=0EDB8832; t9=79DCB8A4; t10=E0D5E91E; t11=97D2D988; 3.51 + t12=09B64C2B; t13=7EB17CBD; t14=E7B82D07; t15=90BF1D91; 3.52 + t16=1DB71064; t17=6AB020F2; t18=F3B97148; t19=84BE41DE; 3.53 + t20=1ADAD47D; t21=6DDDE4EB; t22=F4D4B551; t23=83D385C7; 3.54 + t24=136C9856; t25=646BA8C0; t26=FD62F97A; t27=8A65C9EC; 3.55 + t28=14015C4F; t29=63066CD9; t30=FA0F3D63; t31=8D080DF5; 3.56 + t32=3B6E20C8; t33=4C69105E; t34=D56041E4; t35=A2677172; 3.57 + t36=3C03E4D1; t37=4B04D447; t38=D20D85FD; t39=A50AB56B; 3.58 + t40=35B5A8FA; t41=42B2986C; t42=DBBBC9D6; t43=ACBCF940; 3.59 + t44=32D86CE3; t45=45DF5C75; t46=DCD60DCF; t47=ABD13D59; 3.60 + t48=26D930AC; t49=51DE003A; t50=C8D75180; t51=BFD06116; 3.61 + t52=21B4F4B5; t53=56B3C423; t54=CFBA9599; t55=B8BDA50F; 3.62 + t56=2802B89E; t57=5F058808; t58=C60CD9B2; t59=B10BE924; 3.63 + t60=2F6F7C87; t61=58684C11; t62=C1611DAB; t63=B6662D3D; 3.64 + t64=76DC4190; t65=01DB7106; t66=98D220BC; t67=EFD5102A; 3.65 + t68=71B18589; t69=06B6B51F; t70=9FBFE4A5; t71=E8B8D433; 3.66 + t72=7807C9A2; t73=0F00F934; t74=9609A88E; t75=E10E9818; 3.67 + t76=7F6A0DBB; t77=086D3D2D; t78=91646C97; t79=E6635C01; 3.68 + t80=6B6B51F4; t81=1C6C6162; t82=856530D8; t83=F262004E; 3.69 + t84=6C0695ED; t85=1B01A57B; t86=8208F4C1; t87=F50FC457; 3.70 + t88=65B0D9C6; t89=12B7E950; t90=8BBEB8EA; t91=FCB9887C; 3.71 + t92=62DD1DDF; t93=15DA2D49; t94=8CD37CF3; t95=FBD44C65; 3.72 + t96=4DB26158; t97=3AB551CE; t98=A3BC0074; t99=D4BB30E2; 3.73 + t100=4ADFA541; t101=3DD895D7; t102=A4D1C46D; t103=D3D6F4FB; 3.74 + t104=4369E96A; t105=346ED9FC; t106=AD678846; t107=DA60B8D0; 3.75 + t108=44042D73; t109=33031DE5; t110=AA0A4C5F; t111=DD0D7CC9; 3.76 + t112=5005713C; t113=270241AA; t114=BE0B1010; t115=C90C2086; 3.77 + t116=5768B525; t117=206F85B3; t118=B966D409; t119=CE61E49F; 3.78 + t120=5EDEF90E; t121=29D9C998; t122=B0D09822; t123=C7D7A8B4; 3.79 + t124=59B33D17; t125=2EB40D81; t126=B7BD5C3B; t127=C0BA6CAD; 3.80 + t128=EDB88320; t129=9ABFB3B6; t130=03B6E20C; t131=74B1D29A; 3.81 + t132=EAD54739; t133=9DD277AF; t134=04DB2615; t135=73DC1683; 3.82 + t136=E3630B12; t137=94643B84; t138=0D6D6A3E; t139=7A6A5AA8; 3.83 + t140=E40ECF0B; t141=9309FF9D; t142=0A00AE27; t143=7D079EB1; 3.84 + t144=F00F9344; t145=8708A3D2; t146=1E01F268; t147=6906C2FE; 3.85 + t148=F762575D; t149=806567CB; t150=196C3671; t151=6E6B06E7; 3.86 + t152=FED41B76; t153=89D32BE0; t154=10DA7A5A; t155=67DD4ACC; 3.87 + t156=F9B9DF6F; t157=8EBEEFF9; t158=17B7BE43; t159=60B08ED5; 3.88 + t160=D6D6A3E8; t161=A1D1937E; t162=38D8C2C4; t163=4FDFF252; 3.89 + t164=D1BB67F1; t165=A6BC5767; t166=3FB506DD; t167=48B2364B; 3.90 + t168=D80D2BDA; t169=AF0A1B4C; t170=36034AF6; t171=41047A60; 3.91 + t172=DF60EFC3; t173=A867DF55; t174=316E8EEF; t175=4669BE79; 3.92 + t176=CB61B38C; t177=BC66831A; t178=256FD2A0; t179=5268E236; 3.93 + t180=CC0C7795; t181=BB0B4703; t182=220216B9; t183=5505262F; 3.94 + t184=C5BA3BBE; t185=B2BD0B28; t186=2BB45A92; t187=5CB36A04; 3.95 + t188=C2D7FFA7; t189=B5D0CF31; t190=2CD99E8B; t191=5BDEAE1D; 3.96 + t192=9B64C2B0; t193=EC63F226; t194=756AA39C; t195=026D930A; 3.97 + t196=9C0906A9; t197=EB0E363F; t198=72076785; t199=05005713; 3.98 + t200=95BF4A82; t201=E2B87A14; t202=7BB12BAE; t203=0CB61B38; 3.99 + t204=92D28E9B; t205=E5D5BE0D; t206=7CDCEFB7; t207=0BDBDF21; 3.100 + t208=86D3D2D4; t209=F1D4E242; t210=68DDB3F8; t211=1FDA836E; 3.101 + t212=81BE16CD; t213=F6B9265B; t214=6FB077E1; t215=18B74777; 3.102 + t216=88085AE6; t217=FF0F6A70; t218=66063BCA; t219=11010B5C; 3.103 + t220=8F659EFF; t221=F862AE69; t222=616BFFD3; t223=166CCF45; 3.104 + t224=A00AE278; t225=D70DD2EE; t226=4E048354; t227=3903B3C2; 3.105 + t228=A7672661; t229=D06016F7; t230=4969474D; t231=3E6E77DB; 3.106 + t232=AED16A4A; t233=D9D65ADC; t234=40DF0B66; t235=37D83BF0; 3.107 + t236=A9BCAE53; t237=DEBB9EC5; t238=47B2CF7F; t239=30B5FFE9; 3.108 + t240=BDBDF21C; t241=CABAC28A; t242=53B39330; t243=24B4A3A6; 3.109 + t244=BAD03605; t245=CDD70693; t246=54DE5729; t247=23D967BF; 3.110 + t248=B3667A2E; t249=C4614AB8; t250=5D681B02; t251=2A6F2B94; 3.111 + t252=B40BBE37; t253=C30C8EA1; t254=5A05DF1B; t255=2D02EF8D; 3.112 + crc=$((0xFFFFFFFF)) 3.113 + dd if=$iso bs=1 skip=$(($1)) count=$(($2)) 2> /dev/null | \ 3.114 + od -v -w1 -t u1 -An | { 3.115 + while read n; do 3.116 + local x=$((($crc ^ $n) & 255)) 3.117 + eval x=0x\$t$x 3.118 + crc=$(((($crc >> 8) & 0x00FFFFFF) ^ $x)) 3.119 + done 3.120 + echo $(($crc ^ 0xFFFFFFFF)) 3.121 + } 3.122 +} 3.123 + 3.124 main() 3.125 { 3.126 uudecode | gunzip | ddq bs=512 count=1 of=$iso conv=notrunc \ 3.127 @@ -90,13 +186,44 @@ 3.128 store32 432 $(($lba * 4)) 3.129 store32 440 $id 3.130 store32 508 0xAA550000 3.131 - e=$(( (($entry -1) % 4) *16 +446)) 3.132 + e=$(( ((${entry:-1} -1) % 4) *16 +446)) 3.133 store32 $e 0x10080 3.134 esect=$(( ($sectors + ((($cylinders -1) & 0x300) >>2)) <<16)) 3.135 ecyl=$(( (($cylinders -1) & 0xff) <<24)) 3.136 store32 $(($e + 4)) $(($partype + (($heads - 1) <<8) +$esect +$ecyl)) 3.137 store32 $(($e + 8)) $offset 3.138 store32 $(($e + 12)) $(($cylinders * $heads * $sectors)) 3.139 + if [ -n "$efi_ofs" ]; then 3.140 + [ $(read16 0 1024) -eq 35615 -a $(read16 11 0) -ne 35615 ] && 3.141 + ddq bs=512 conv=notrunc skip=2 seek=44 count=20 if=$iso of=$iso 3.142 + store32 $((446+16)) $((0xFFFFFE00)) 3.143 + store32 $((446+16+4)) $((0xFFFFFEEF)) 3.144 + store32 $((446+16+8)) $efi_ofs 3.145 + store32 $((446+16+12)) $efi_len 3.146 + uudecode <<EOT | unlzma | ddq bs=512 seek=1 of=$iso conv=notrunc 3.147 +begin-base64 644 - 3.148 +XQAAgAD//////////wAikYVN1N2VY3JXMnUMJn1RCdQOHHdkT27O1I77zn8t 3.149 +AiDDPDQv3ovn0t2ksyOkm/KVCwPcaMYXgukPNUeg8Tbavo+kXx/HVFkHHHB+ 3.150 +c4gUdeTmJ31kL/btVwMG38di4lFL7bpUU61H7P0wJfcUrv0LYsPoW28D5f8s 3.151 +kaLvWB73gnnsIUYI9VNL4S9txwz2cCL67LZYGGAqMBdtdnp8Jv9qm36wvqJZ 3.152 +Bne0qEprzeTBrUFK74YLSrVbxK/fa6rz5pQxkLvyOVz4VfRMsVEA1G9IjF// 3.153 +BXwoAA== 3.154 +==== 3.155 +EOT 3.156 + lastlba=$((($cylinders * $heads * $sectors) -1)) 3.157 + usablelba=34 3.158 + store32 $((0x218)) 1 3.159 + store32 $((0x220)) $lastlba 3.160 + store32 $((0x228)) $usablelba 3.161 + store32 $((0x230)) $(($lastlba-$usablelba+1)) 3.162 + store32 $((0x428)) $(($lastlba-0x800)) 3.163 + store32 $((0x4A0)) $efi_ofs 3.164 + store32 $((0x4A8)) $(($efi_ofs+$efi_len-1)) 3.165 + store32 $((0x258)) $(crc32 0x400 0x4000) 3.166 + store32 $((0x210)) $(crc32 0x200 $(read32 0 $((0x20C)))) 3.167 + store32sw $((0x1008)) $(($efi_ofs/4)) 3.168 + store32sw $((0x1054)) $(($efi_len/4)) 3.169 + fi 3.170 } 3.171 3.172 abort() 3.173 @@ -110,6 +237,13 @@ 3.174 cat=$(read32 17 71) 3.175 [ $(read32 $cat 0) -eq 1 -a $(read32 $cat 30) -eq $(( 0x88AA55 )) ] || 3.176 abort "invalid boot catalog." 3.177 +efi_ofs= 3.178 +if [ $(read8 $cat 65) -eq 239 ]; then 3.179 + [ -n "$entry" ] && echo "$iso: efi boot ignore --entry $entry" && entry= 3.180 + partype=0 3.181 + efi_len=$(read16 $cat 102) 3.182 + efi_ofs=$((4*$(read32 $cat 104))) 3.183 +fi 3.184 lba=$(read32 $cat 40) 3.185 [ $(read32 $lba 64) -eq 1886961915 ] || 3.186 abort "no isolinux.bin hybrid signature in bootloader."
4.1 --- a/tazlito/receipt Fri Sep 30 21:17:41 2016 +0200 4.2 +++ b/tazlito/receipt Fri Sep 30 21:29:58 2016 +0200 4.3 @@ -1,7 +1,7 @@ 4.4 # SliTaz package receipt. 4.5 4.6 PACKAGE="tazlito" 4.7 -VERSION="435" 4.8 +VERSION="436" 4.9 CATEGORY="base-system" 4.10 SHORT_DESC="SliTaz Live Tool." 4.11 MAINTAINER="pascal.bellard@slitaz.org"