# HG changeset patch # User Pascal Bellard # Date 1360148722 -3600 # Node ID e487d594117fd4703673366c5cf441627793c925 # Parent 3dd8f0cfd04bc06d1b510b67d1e3d0ec950cb2e3 syslinux/iso2exe: fix checksum diff -r 3dd8f0cfd04b -r e487d594117f syslinux/stuff/iso2exe/bootiso.S --- a/syslinux/stuff/iso2exe/bootiso.S Wed Feb 06 02:13:32 2013 +0000 +++ b/syslinux/stuff/iso2exe/bootiso.S Wed Feb 06 12:05:22 2013 +0100 @@ -171,7 +171,7 @@ movw (%si), %cx jcxz is386 #endif - movw $0x7FE0/2, %cx + movw $(EXESTR(0x8000))/2, %cx chklp: lodsw addw %ax, %dx diff -r 3dd8f0cfd04b -r e487d594117f syslinux/stuff/iso2exe/iso2exe.sh --- a/syslinux/stuff/iso2exe/iso2exe.sh Wed Feb 06 02:13:32 2013 +0000 +++ b/syslinux/stuff/iso2exe/iso2exe.sh Wed Feb 06 12:05:22 2013 +0100 @@ -44,8 +44,6 @@ *5a4d) echo "The file $1 is already an EXE file." 1>&2 && exit 1;; *0000) [ -x /usr/bin/isohybrid ] && isohybrid $1 esac - [ ! -x /usr/sbin/mount.posixovl ] && - echo "No file mount.posixovl. Aborting." 1>&2 && exit 1 echo "Moving syslinux hybrid boot record..." ddq if=$1 bs=512 count=1 | ddq of=$1 bs=512 count=1 seek=1 conv=notrunc @@ -56,10 +54,11 @@ # keep the largest room for the tazlito info file TMP=/tmp/iso2exe$$ mkdir -p $TMP/bin $TMP/dev - cp /usr/sbin/mount.posixovl $TMP/bin/mount.posixovl.iso2exe cp -a /dev/?d?* $TMP/dev $0 --get init > $TMP/init.exe - chmod +x $TMP/init.exe $TMP/bin/mount.posixov* + grep -q mount.posixovl.iso2exe $TMP/init.exe && + cp /usr/sbin/mount.posixovl $TMP/bin/mount.posixovl.iso2exe + find $TMP -type f | xargs chmod +x ( cd $TMP ; find * | cpio -o -H newc ) | \ lzma e $TMP/rootfs.gz -si 2> /dev/null SIZE=$(wc -c < $TMP/rootfs.gz) @@ -73,19 +72,21 @@ printf "Adding DOS boot file at %04X...\n" $OFS $0 --get boot.com | ddq of=$1 bs=1 seek=$OFS conv=notrunc store 66 $(($OFS+0xC0)) $1 - SIZE=$($0 --get win32.exe | tee /tmp/exe$$ | wc -c) - OFS=$(( 128 + ( ($OFS - $SIZE + 128) & 0xFE00 ) )) - printf "Adding WIN32 file at %04X...\n" $OFS - LOC=$((0xAC+$(get 0x94 /tmp/exe$$))) - for i in $(seq 1 $(get 0x86 /tmp/exe$$)); do - store $LOC $(($(get $LOC /tmp/exe$$)+$OFS-128)) /tmp/exe$$ - LOC=$(($LOC+40)) - done - ddq if=/tmp/exe$$ of=$1 bs=1 skip=128 seek=$OFS conv=notrunc + SIZE=$($0 --get win32.exe 2> /dev/null | tee /tmp/exe$$ | wc -c) + if [ $SIZE -ne 0 ]; then + OFS=$(( 128 + ( ($OFS - $SIZE + 128) & 0xFE00 ) )) + printf "Adding WIN32 file at %04X...\n" $OFS + LOC=$((0xAC+$(get 0x94 /tmp/exe$$))) + for i in $(seq 1 $(get 0x86 /tmp/exe$$)); do + store $LOC $(($(get $LOC /tmp/exe$$)+$OFS-128)) /tmp/exe$$ + LOC=$(($LOC+40)) + done + ddq if=/tmp/exe$$ of=$1 bs=1 skip=128 seek=$OFS conv=notrunc + fi rm -f /tmp/exe$$ store 60 $OFS $1 store 26 ${RANDOM:-0} $1 - i=34 + i=66 n=0 echo -n "Adding checksum..." while [ $i -lt 32768 ]; do diff -r 3dd8f0cfd04b -r e487d594117f syslinux/stuff/iso2exe/win32.c --- a/syslinux/stuff/iso2exe/win32.c Wed Feb 06 02:13:32 2013 +0000 +++ b/syslinux/stuff/iso2exe/win32.c Wed Feb 06 12:05:22 2013 +0100 @@ -1,6 +1,6 @@ -#include +#include int main() { - printf("No support for Windows yet.\n"); + MessageBox(NULL,"No support for Windows yet.","Sorry",MB_OK); }