Commit cb5d66df authored by Natanael Copa's avatar Natanael Copa

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
parent ee1955b8
......@@ -2,7 +2,7 @@
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=grub
pkgver=2.02
pkgrel=12
pkgrel=13
pkgdesc="Bootloader with support for Linux, Multiboot and more"
url="https://www.gnu.org/software/grub/"
arch="all !s390x"
......@@ -12,7 +12,7 @@ triggers="grub.trigger=/boot"
depends_dev=""
makedepends="$depends_dev bison flex linux-headers xz-dev lvm2-dev
automake autoconf libtool python3 freetype-dev unifont"
install=""
install="$pkgname.post-upgrade"
# strip handled by grub Makefiles, abuild strip breaks xen pv-grub
options="!check !strip" # Cannot test boot loader.
subpackages="$pkgname-dev $pkgname-doc"
......@@ -124,6 +124,14 @@ package() {
rm -f "$pkgdir"/usr/lib/charset.alias
# remove grub-install warning of missing directory
mkdir -p "$pkgdir"/usr/share/locale
mkdir -p "$pkgdir"/etc/default/
cat >"$pkgdir"/etc/default/grub <<-EOF
GRUB_DISTRIBUTOR="Alpine"
GRUB_TIMEOUT=2
GRUB_DISABLE_SUBMENU=y
GRUB_DISABLE_RECOVERY=true
EOF
}
bios() {
......
#!/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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment