run extlinux binary based on arch (32/64)
parent
c5d74b186c
commit
5d06eb0335
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue