mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-19 14:56:46 +02:00
When grub is updated we may need to re-run grub-install or we may end up with an unbootable system. Instead of trying to figure out what the exact args are we simply execute the /etc/grub-autoinstall if it exists. ref: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/53133 ref: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/58567
22 lines
442 B
Bash
22 lines
442 B
Bash
#!/bin/sh
|
|
|
|
if [ -f /etc/default/grub ]; then
|
|
. /etc/default/grub
|
|
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
|
|
|
|
if [ -e /etc/grub-autoinstall ]; then
|
|
. /etc/grub-autoinstall
|
|
fi
|