grub-config-flags usage of $GRUB_CMDLINE_LINUX_DEFAULT does not work to keep previously configured kernel parameters
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
charm-sysconfig |
Fix Released
|
Medium
|
Unassigned |
Bug Description
The sysconfig charm's README.md says:
"""
To add or keep kernel parameters you had previously configured see the grub-config-flags option below.
...
For instance, if you need to set the kernel parameter "nvme_core.
juju config sysconfig grub-config-
"""
But it does not work.
Without the charm:
$ cat /etc/default/grub
GRUB_CMDLINE_
$ sudo update-grub
$ grep -w -m1 ' linux' /boot/grub/grub.cfg
linux /vmlinuz-
Now with the charm, but grub-config-flags option unset: (overrides it, as documented.)
$ grep -w -m1 ' linux' /boot/grub/grub.cfg
linux /vmlinuz-
Now with the charm, AND grub-config-flags option set as suggested:
$ juju config sysconfig-ubuntu grub-config-
$ grep -w -m1 ' linux' /boot/grub/grub.cfg
linux /vmlinuz-
Note that the 'important=option' is lost.
With this fix:
@ https:/
$ juju upgrade-charm --path .../sysconfig sysconfig-ubuntu
$ grep -w -m1 ' linux' /boot/grub/grub.cfg
linux /vmlinuz-
Now all options are there:
- previously configured 'important=option'
- newly configured 'something=else'
- charm configured options.
And if we reset the option (keep current behavior)
$ juju config sysconfig-ubuntu --reset grub-config-flags
$ grep -w -m1 ' linux' /boot/grub/grub.cfg
linux /vmlinuz-
Related branches
- Xav Paice (community): Approve
- Adam Dyess (community): Approve
- Zachary Zehring (community): Approve
-
Diff: 35 lines (+12/-8)1 file modifiedsrc/templates/grub.j2 (+12/-8)
Thanks for the detailed bug report and associated MR. We'll get this change through our MR process.