summaryrefslogtreecommitdiffstats
path: root/main/syslinux/update-extlinux
diff options
context:
space:
mode:
Diffstat (limited to 'main/syslinux/update-extlinux')
-rwxr-xr-xmain/syslinux/update-extlinux39
1 files changed, 23 insertions, 16 deletions
diff --git a/main/syslinux/update-extlinux b/main/syslinux/update-extlinux
index d96713ae3..728886193 100755
--- a/main/syslinux/update-extlinux
+++ b/main/syslinux/update-extlinux
@@ -1,5 +1,6 @@
#!/bin/sh
+version=
default=0
timeout=5
verbose=0
@@ -60,12 +61,6 @@ if [ "x$root" = "x" ]; then
everbose "Root device is: $root"
fi
-everbose "Installing mboot.c32 to /boot."
-cp /usr/share/syslinux/mboot.c32 /boot
-
-everbose "Installing menu.c32 to /boot."
-cp /usr/share/syslinux/menu.c32 /boot
-
rtimeout=$((${timeout}\*10))
syslinux_menu=menu.c32
menu_hidden=
@@ -75,12 +70,9 @@ if [ "$vesa_menu" = "1" ]; then
syslinux_menu=vesamenu.c32
fi
-everbose "Installing $syslinux_menu to /boot."
-cp /usr/share/syslinux/vesamenu.c32 /boot
-
umask 0022
rm -f $conf.new
-echo "# Generated by update-extlinux" > $conf.new
+echo "# Generated by update-extlinux $version" > $conf.new
echo "DEFAULT $syslinux_menu" >> $conf.new
echo "PROMPT 0" >> $conf.new
echo "MENU TITLE Alpine/$(uname -s) Boot Menu" >> $conf.new
@@ -156,12 +148,27 @@ for entry in /etc/update-extlinux.d/*; do
[ -f "$entry" ] && cat $entry >> $conf.new
done
-if [ "$overwrite" = "1" ]; then
- # keep a backup just in case
- if [ -f "$conf" ]; then
- mv $conf $conf.old
- fi
+if [ "$overwrite" != "1" ]; then
+ exit 0
+fi
- mv $conf.new $conf
+# keep a backup just in case
+if [ -f "$conf" ]; then
+ mv $conf $conf.old
fi
+mv $conf.new $conf
+
+everbose "Installing mboot.c32 to /boot."
+cp /usr/share/syslinux/mboot.c32 /boot
+
+everbose "Installing menu.c32 to /boot."
+cp /usr/share/syslinux/menu.c32 /boot
+
+everbose "Installing $syslinux_menu to /boot."
+cp /usr/share/syslinux/vesamenu.c32 /boot
+
+case "$(stat -f -c '%T' /boot)" in
+ext*) extlinux --update /boot;;
+esac
+