mkwinpeimg: Make compatible with Syslinux version 6
authorEric Biggers <ebiggers3@gmail.com>
Tue, 31 Dec 2013 19:36:39 +0000 (13:36 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 31 Dec 2013 19:36:39 +0000 (13:36 -0600)
programs/mkwinpeimg.in

index 5316efa8f79fa44ba31a047ca6c0c5b763588643..42b4a1c5c409e3d6885bb5f176e56d8ce2a862c0 100755 (executable)
@@ -473,11 +473,26 @@ make_disk_img() {
 
        export MTOOLSRC="$mtool_conf"
 
-       mformat -h 255 -s 63 -T $(( image_size / 512)) s:
-       mcopy -s "$tmp_dir"/* s:
+       mformat -h 255 -s 63 -T $(( image_size / 512)) s: || stat_fail
+       mcopy -s "$tmp_dir"/* s: || stat_fail
 
        syslinux --install "$image"
-       mcopy /usr/lib/syslinux/chain.c32 s:
+
+       syslinuxdir="/usr/lib/syslinux"
+
+       if [ -d "$syslinuxdir/bios" ]; then
+               biosdir="$syslinuxdir/bios"
+       else
+               biosdir="$syslinuxdir"
+       fi
+
+       mcopy "$biosdir/chain.c32" s: || stat_fail
+       if [ -e "$biosdir/libcom32.c32" ]; then
+               mcopy "$biosdir/libcom32.c32" s:
+       fi
+       if [ -e "$biosdir/libutil.c32" ]; then
+               mcopy "$biosdir/libutil.c32" s:
+       fi
        mcopy - 's:syslinux.cfg' <<- EOF
                DEFAULT winpe
                LABEL   winpe