diff --git a/Slax/debian/bootfiles/bootinst.sh b/Slax/debian/bootfiles/bootinst.sh index 9755534..1c6a57e 100644 --- a/Slax/debian/bootfiles/bootinst.sh +++ b/Slax/debian/bootfiles/bootinst.sh @@ -99,24 +99,21 @@ if [ "$(fdisk -l "$DEV" | fgrep "$DEV" | fgrep "*")" != "" ]; then read junk fi -if [ ! -x ./extlinux.exe ]; then +ARCH=$(uname -m) +if [ "$ARCH" = "x86_64" ]; then ARCH=64; else ARCH=32; fi +EXTLINUX=extlinux.x$ARCH + +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.exe + chmod a+x ./$EXTLINUX mount -o remount,exec $DEV fi # install syslinux bootloader echo "* attempting to install bootloader to $BOOT..." -# Try to use installed extlinux binary and fallback to extlinux.exe only -# if no installed extlinux is not found at all. -EXTLINUX="$(which extlinux 2>/dev/null)" -if [ "$EXTLINUX" = "" ]; then - EXTLINUX="./extlinux.exe" -fi - "$EXTLINUX" --install "$BOOT" if [ $? -ne 0 ]; then diff --git a/bootfiles/bootinst.sh b/bootfiles/bootinst.sh index 15abdcc..3eb88e4 100755 --- a/bootfiles/bootinst.sh +++ b/bootfiles/bootinst.sh @@ -11,12 +11,9 @@ cd "$BOOT" PART="$(df . | tail -n 1 | tr -s " " | cut -d " " -f 1)" DEV="$(echo "$PART" | sed -r "s:[0-9]+\$::" | sed -r "s:([0-9])[a-z]+\$:\\1:i")" #" -# Try to use installed extlinux binary and fallback to extlinux.exe only -# if no installed extlinux is not found at all. -EXTLINUX="$(which extlinux 2>/dev/null)" -if [ "$EXTLINUX" = "" ]; then - EXTLINUX="./extlinux.exe" -fi +ARCH=$(uname -m) +if [ "$ARCH" = "x86_64" ]; then ARCH=64; else ARCH=32; fi +EXTLINUX=extlinux.x$ARCH "$EXTLINUX" --install "$BOOT"