Merge ~mfo/charm-sysconfig:fix-grub-cmdline-linux-default into charm-sysconfig:master
Status: | Merged |
---|---|
Approved by: | Xav Paice |
Approved revision: | 0d9a37e6508e4c7744505ec443397efe8f9e32fd |
Merged at revision: | 237ca16bb97e18334d02b13814e1a512732f4a8b |
Proposed branch: | ~mfo/charm-sysconfig:fix-grub-cmdline-linux-default |
Merge into: | charm-sysconfig:master |
Diff against target: |
35 lines (+12/-8) 1 file modified
src/templates/grub.j2 (+12/-8) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Xav Paice (community) | Approve | ||
Adam Dyess (community) | Approve | ||
Zachary Zehring (community) | Approve | ||
Review via email: mp+386280@code.launchpad.net |
Commit message
grub.j2: fix grub-config-flags that use $GRUB_CMDLINE_
Description of the change
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:
$ 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-
This merge proposal is being monitored by mergebot. Change the status to Approved to merge.