Skip to content

Commit 3be92ce

Browse files
SludgeGirlmartinpitt
authored andcommitted
lib: Add Suse support to kernelopt.sh
1 parent 263f616 commit 3be92ce

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pkg/lib/kernelopt.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ error() {
1515
grub() {
1616
key="${2%=*}" # split off optional =value
1717

18-
# For the non-BLS case, or if someone overrides those with grub2-mkconfig
19-
# or update-grub, change it in /etc/default/grub
18+
# For the non-BLS case, or if someone overrides those with grub2-mkconfig,
19+
# update-grub or update-bootloader, change it in /etc/default/grub
2020
if [ -e /etc/default/grub ]; then
2121
if [ "$1" = set ]; then
2222
# replace existing argument, otherwise append it
@@ -38,6 +38,11 @@ grub() {
3838
elif [ -e /etc/default/grub ] && type update-grub >/dev/null 2>&1; then
3939
update-grub
4040

41+
# on Suse platforms, use update-bootloader
42+
# Since earlier we updated /etc/default/grub we can just run update-bootloader
43+
elif type update-bootloader >/dev/null 2>&1; then
44+
update-bootloader
45+
4146
# on OSTree, the kernel config is inside the image
4247
elif cur=$(rpm-ostree kargs 2>&1); then
4348
if [ "$1" = set ]; then
@@ -51,7 +56,7 @@ grub() {
5156
rpm-ostree kargs --delete="$key"
5257
fi
5358
else
54-
error "No supported grub update mechanism found (grubby, update-grub, or rpm-ostree)"
59+
error "No supported grub update mechanism found (grubby, update-grub, update-bootloader or rpm-ostree)"
5560
fi
5661
}
5762

0 commit comments

Comments
 (0)