wok diff syslinux/stuff/iso2exe/iso2exe.sh @ rev 19827
syslinux/iso2exe: follow boot flag
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Mar 08 15:32:40 2017 +0100 (2017-03-08) |
parents | 40ec0fa2f1d5 |
children | fd4b65b5c1de |
line diff
1.1 --- a/syslinux/stuff/iso2exe/iso2exe.sh Thu Feb 02 13:21:13 2017 +0100 1.2 +++ b/syslinux/stuff/iso2exe/iso2exe.sh Wed Mar 08 15:32:40 2017 +0100 1.3 @@ -118,12 +118,17 @@ 1.4 ddq if=/tmp/exe$$ of=$1 bs=1 count=24 seek=$((0x1A0)) skip=$((0x1A0)) conv=notrunc 1.5 ddq if=$2 bs=1 skip=$((0x1B8)) seek=$((0x1B8)) count=72 of=$1 conv=notrunc 1.6 store 510 $((0xAA55)) $1 1.7 - rm -f /tmp/exe$$ /tmp/coff$$ 1.8 i=$SIZE; OFS=$(($SIZE+512)) 1.9 [ -n "$mac" ] && OFS=$SIZE && i=1536 1.10 store 417 $(($i/512)) $1 8 1.11 printf "Moving syslinux hybrid boot record at %04X (512 bytes) ...\n" $i 1.12 ddq if=$2 bs=1 count=512 of=$1 seek=$i conv=notrunc 1.13 + if [ $(get $((0x7C00)) /tmp/exe$$) -eq 60649 ]; then 1.14 + ddq if=/tmp/exe$$ bs=1 count=66 skip=$((0x7DBE)) of=$1 seek=$(($i + 0x1BE)) conv=notrunc 1.15 + ddq if=$1 bs=1 count=3 skip=$i of=$1 seek=$(($i + 0x1BE)) conv=notrunc 1.16 + ddq if=/tmp/exe$$ bs=1 count=3 skip=$((0x7C00)) of=$1 seek=$i conv=notrunc 1.17 + fi 1.18 + rm -f /tmp/exe$$ /tmp/coff$$ 1.19 if [ -z "$RECURSIVE_PARTITION" ]; then 1.20 store 464 $((1+$i/512)) $1 8 1.21 store 470 $(($i/512)) $1 8 1.22 @@ -265,6 +270,11 @@ 1.23 fileofs $f 1.24 [ $SIZE -eq 0 ] || 1.25 ddq bs=1 count=$SIZE skip=$OFFSET if="$ISO" >$f 1.26 + if [ "$f" == "syslinux.mbr" ] && [ $(get 0 "$f") -eq 60649 ]; then 1.27 + ddq bs=1 conv=notrunc if="$f" of="$f" skip=$((0x1BE)) seek=0 count=3 1.28 + ddq bs=1 skip=$((0x1BE)) count=66 if="$ISO" | \ 1.29 + ddq bs=1 seek=$((0x1BE)) count=66 of="$f" conv=notrunc 1.30 + fi 1.31 done 1.32 } 1.33 1.34 @@ -522,7 +532,7 @@ 1.35 esac 1.36 case "$(get 0 $1)" in 1.37 23117) echo "The file $1 is already an EXE file." 1>&2 && exit 1;; 1.38 - 0) [ -x /usr/bin/isohybrid ] && isohybrid $1;; 1.39 + 0) [ -x /usr/bin/isohybrid ] && isohybrid -entry 2 $1;; 1.40 esac 1.41 1.42 gpt= ; [ $(get 466 $1) -eq 65263 ] && gpt=1