mkwinpeimg: syslinux modules may be in /usr/lib/syslinux/modules/bios
authorEric Biggers <ebiggers3@gmail.com>
Mon, 3 Jul 2017 21:07:09 +0000 (14:07 -0700)
committerEric Biggers <ebiggers3@gmail.com>
Mon, 3 Jul 2017 21:16:20 +0000 (14:16 -0700)
programs/mkwinpeimg.in

index 42b4779..a46f72b 100755 (executable)
@@ -485,13 +485,15 @@ make_disk_img() {
 
        syslinux --install "$image"
 
-       syslinuxdir="/usr/lib/syslinux"
-
-       if [ -d "$syslinuxdir/bios" ]; then
-               biosdir="$syslinuxdir/bios"
-       else
-               biosdir="$syslinuxdir"
-       fi
+       for biosdir in                          \
+               /usr/lib/syslinux/modules/bios  \
+               /usr/lib/syslinux/bios          \
+               /usr/lib/syslinux
+       do
+               if [ -e "$biosdir/chain.c32" ]; then
+                       break
+               fi
+       done
 
        mcopy "$biosdir/chain.c32" s: || stat_fail
        if [ -e "$biosdir/libcom32.c32" ]; then