diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-05-19 09:25:38 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-05-19 09:29:27 +0000 |
commit | 66417d5e0c7870c269104b633e9d82c4554a8380 (patch) | |
tree | a45cca19ab25b844b25513d4973c5db460a04e13 /main/syslinux/update-extlinux | |
parent | df68969b81691b765f7bc224cc40bd648bb457de (diff) | |
download | aports-66417d5e0c7870c269104b633e9d82c4554a8380.tar.bz2 aports-66417d5e0c7870c269104b633e9d82c4554a8380.tar.xz |
main/syslinux: make trigger not fail on lxc
on lxc we dont have the boot device available so extlinux will fail.
We cannot check for `openrc --sys` because apk run the trigger in chroot
and grsecurity will prevent openrc access /proc/1/environment.
So we simply add a --warn-only option and use that from trigger.
Diffstat (limited to 'main/syslinux/update-extlinux')
-rwxr-xr-x | main/syslinux/update-extlinux | 35 |
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 |