From 0dbe6757f8a0f2a562b39b7a45309f8732100afd Mon Sep 17 00:00:00 2001 From: Tomas M Date: Fri, 28 Dec 2012 10:19:04 -0900 Subject: [PATCH] prefer installed extlinux --- bootfiles/bootinst.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bootfiles/bootinst.sh b/bootfiles/bootinst.sh index 628c3d4..5cc9f48 100755 --- a/bootfiles/bootinst.sh +++ b/bootfiles/bootinst.sh @@ -11,8 +11,14 @@ 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")" #" -# install syslinux bootloader -./extlinux.exe --install $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 echo "Error installing boot loader."