summaryrefslogtreecommitdiffstats
path: root/main/syslinux/update-extlinux
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-02-22 12:48:10 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-02-22 12:48:10 +0000
commite69409a284e7a3d08bbbe363c7cc8d596edc482a (patch)
tree8b06a32dd5e7656e59b63106dd05f05bfc60a59d /main/syslinux/update-extlinux
parentbcfeb8c51075c4c0ae092d88f558deeb9311ef0d (diff)
downloadaports-e69409a284e7a3d08bbbe363c7cc8d596edc482a.tar.bz2
aports-e69409a284e7a3d08bbbe363c7cc8d596edc482a.tar.xz
main/syslinux: run extlinux --update
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
+