diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2019-01-24 17:55:24 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-01-24 18:01:30 +0000 |
commit | cb5d66dfdf57d13714e111eda2ef7f9f552d380d (patch) | |
tree | 5217ea85825d6c5a3796b363f81ec7a61898ab9a /main/grub/grub.post-upgrade | |
parent | ee1955b85cff0d912c7c3c96d58b807541e48082 (diff) | |
download | aports-cb5d66dfdf57d13714e111eda2ef7f9f552d380d.tar.bz2 aports-cb5d66dfdf57d13714e111eda2ef7f9f552d380d.tar.xz |
main/grub: add post-ugprade to import default config
import boot options to /etc/default/grub on upgrade to make sure we can
still boot.
ref #9903
Diffstat (limited to 'main/grub/grub.post-upgrade')
-rw-r--r-- | main/grub/grub.post-upgrade | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/main/grub/grub.post-upgrade b/main/grub/grub.post-upgrade new file mode 100644 index 0000000000..2489fc13b6 --- /dev/null +++ b/main/grub/grub.post-upgrade @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ -f /etc/grub/default ]; then + . /etc/grub/default +fi + +if [ -z "$GRUB_CMDLINE_LINUX_DEFAULT" ]; then + set -- $(cat /proc/cmdline) + bootopts= + for opt; do + case "$opt" in + initrd=*|BOOT_IMAGE=*|root=*|rootflags=*) ;; + *) bootopts="$bootopts $opt";; + esac + done + mkdir -p /etc/default + echo "GRUB_CMDLINE_LINUX_DEFAULT=\"$bootopts\"" >> /etc/default/grub +fi + |