aboutsummaryrefslogtreecommitdiffstats
path: root/main/syslinux/update-extlinux
diff options
context:
space:
mode:
Diffstat (limited to 'main/syslinux/update-extlinux')
-rwxr-xr-xmain/syslinux/update-extlinux35
1 files changed, 32 insertions, 3 deletions
diff --git a/main/syslinux/update-extlinux b/main/syslinux/update-extlinux
index 2efb7cb6f4..10e2feb5b0 100755
--- a/main/syslinux/update-extlinux
+++ b/main/syslinux/update-extlinux
@@ -30,6 +30,30 @@ eerror() {
return 1
}
+usage() {
+ echo "usage: $0 [-v|--verbose] [--warn-only]"
+}
+
+while [ $# -gt 0 ]; do
+ opt="$1"
+ shift
+ case "$opt" in
+ -v|--verbose)
+ verbose=1
+ ;;
+ --warn-only)
+ warn_only=1
+ ;;
+ --)
+ break
+ ;;
+ -*)
+ usage
+ exit 1
+ ;;
+ esac
+done
+
everbose "Updating extlinux configuration."
if [ "x$root" = "x" ]; then
@@ -50,8 +74,13 @@ if [ "x$root" = "x" ]; then
fi
if [ -z "$UUID" ]; then
if [ -z "$dev" ]; then
- eerror "Failed to detect root device"
- exit 1
+ if [ -n "$warn_only" ]; then
+ ewarn "Failed to detect root device. extlinux.conf is not updated"
+ exit 0
+ else
+ eerror "Failed to detect root device"
+ exit 1
+ fi
else
root=$dev
fi
@@ -218,6 +247,6 @@ cp /usr/share/syslinux/libutil.c32 \
/boot
case "$(stat -f -c '%T' /boot)" in
-ext*) extlinux --update /boot;;
+ext*) extlinux --update /boot || [ -n "$warn_only" ];;
esac