Try to copy extlinux to .exe if it is not executable

pull/40/head
Tomas-M 2017-12-19 17:52:24 +01:00 committed by GitHub
parent 0682d53c1f
commit 6532e6f566
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -94,7 +94,7 @@ if [ "$(fdisk -l "$DEV" | fgrep "$DEV" | fgrep "*")" != "" ]; then
echo ""
echo "Partition $PART seems to be located on a physical disk,"
echo "which is already bootable. If you continue, your drive $DEV"
echo "will boot only Linux by default."
echo "will boot only Slax by default."
echo "Press [Enter] to continue, or [Ctrl+C] to abort..."
read junk
fi
@ -107,8 +107,16 @@ if [ ! -x ./$EXTLINUX ]; then
# extlinux is not executable. There are two possible reasons:
# either the fs is mounted with noexec, or file perms are wrong.
# Try to fix both, no fail on error yet
chmod a+x ./$EXTLINUX
mount -o remount,exec $DEV
chmod a+x ./$EXTLINUX
fi
if [ ! -x ./$EXTLINUX ]; then
# extlinux is still not executable. As a last try, copy it to .exe
# because the partition may be mounted with showexec option, from which
# we probably can't escape by remount
cp -f ./$EXTLINUX ./extlinux.exe
EXTLINUX=extlinux.exe
fi
# install syslinux bootloader