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
|
read junk
|
||||||
fi
|
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:
|
# extlinux is not executable. There are two possible reasons:
|
||||||
# either the fs is mounted with noexec, or file perms are wrong.
|
# either the fs is mounted with noexec, or file perms are wrong.
|
||||||
# Try to fix both, no fail on error yet
|
# Try to fix both, no fail on error yet
|
||||||
chmod a+x ./extlinux.exe
|
chmod a+x ./$EXTLINUX
|
||||||
mount -o remount,exec $DEV
|
mount -o remount,exec $DEV
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# install syslinux bootloader
|
# install syslinux bootloader
|
||||||
echo "* attempting to install bootloader to $BOOT..."
|
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"
|
"$EXTLINUX" --install "$BOOT"
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,9 @@ cd "$BOOT"
|
||||||
PART="$(df . | tail -n 1 | tr -s " " | cut -d " " -f 1)"
|
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")" #"
|
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
|
ARCH=$(uname -m)
|
||||||
# if no installed extlinux is not found at all.
|
if [ "$ARCH" = "x86_64" ]; then ARCH=64; else ARCH=32; fi
|
||||||
EXTLINUX="$(which extlinux 2>/dev/null)"
|
EXTLINUX=extlinux.x$ARCH
|
||||||
if [ "$EXTLINUX" = "" ]; then
|
|
||||||
EXTLINUX="./extlinux.exe"
|
|
||||||
fi
|
|
||||||
|
|
||||||
"$EXTLINUX" --install "$BOOT"
|
"$EXTLINUX" --install "$BOOT"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue