Closed dashmage closed 8 months ago
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.multipath=0" you would add:
juju config sysconfig grub-config-flags='GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT nvme_core.multipath=0" """
But it does not work.
Without the charm:
$ cat /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="important=option"
$ sudo update-grub
$ grep -w -m1 ' linux' /boot/grub/grub.cfg linux /vmlinuz-4.15.0-106-generic root=... ro important=option
Now with the charm, but grub-config-flags option unset: (overrides it, as documented.)
$ grep -w -m1 ' linux' /boot/grub/grub.cfg linux /vmlinuz-4.15.0-106-generic root=... ro console=tty0 console=ttyS0,115200 console=ttyS1,115200 pti=off
Now with the charm, AND grub-config-flags option set as suggested:
$ juju config sysconfig-ubuntu grub-config-flags='GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT something=else"'
$ grep -w -m1 ' linux' /boot/grub/grub.cfg linux /vmlinuz-4.15.0-106-generic root=... ro console=tty0 console=ttyS0,115200 console=ttyS1,115200 pti=off something=else
Note that the 'important=option' is lost.
With this fix:
@ https://code.launchpad.net/~mfo/charm-sysconfig/+git/charm-sysconfig/+merge/386280
$ juju upgrade-charm --path .../sysconfig sysconfig-ubuntu
$ grep -w -m1 ' linux' /boot/grub/grub.cfg linux /vmlinuz-4.15.0-106-generic root=... ro important=option something=else console=tty0 console=ttyS0,115200 console=ttyS1,115200 pti=off
Now all options are there:
And if we reset the option (keep current behavior)
$ juju config sysconfig-ubuntu --reset grub-config-flags
Imported from Launchpad using lp2gh.
date created: 2020-06-23T20:17:06Z
owner: mfo
assignee: None
the launchpad url
(by zzehring) Thanks for the detailed bug report and associated MR. We'll get this change through our MR process.
(by xavpaice) cs:~bootstack-charmers-next/sysconfig-4 has this merged.
(by mfo) Hi Xav / Bootstack Charmers,
Could you please clarify whether there is an ETA on landing this fix to the stable charms, and/or how your release process works?
Thank you! Mauricio
(by arif-ali) cs:sysconfig now has the fix
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.multipath=0" you would add:
juju config sysconfig grub-config-flags='GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT nvme_core.multipath=0" """
But it does not work.
Without the charm:
$ cat /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="important=option"
$ sudo update-grub
$ grep -w -m1 ' linux' /boot/grub/grub.cfg linux /vmlinuz-4.15.0-106-generic root=... ro important=option
Now with the charm, but grub-config-flags option unset: (overrides it, as documented.)
$ grep -w -m1 ' linux' /boot/grub/grub.cfg linux /vmlinuz-4.15.0-106-generic root=... ro console=tty0 console=ttyS0,115200 console=ttyS1,115200 pti=off
Now with the charm, AND grub-config-flags option set as suggested:
$ juju config sysconfig-ubuntu grub-config-flags='GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT something=else"'
$ grep -w -m1 ' linux' /boot/grub/grub.cfg linux /vmlinuz-4.15.0-106-generic root=... ro console=tty0 console=ttyS0,115200 console=ttyS1,115200 pti=off something=else
Note that the 'important=option' is lost.
With this fix:
@ https://code.launchpad.net/~mfo/charm-sysconfig/+git/charm-sysconfig/+merge/386280
$ juju upgrade-charm --path .../sysconfig sysconfig-ubuntu
$ grep -w -m1 ' linux' /boot/grub/grub.cfg linux /vmlinuz-4.15.0-106-generic root=... ro important=option something=else console=tty0 console=ttyS0,115200 console=ttyS1,115200 pti=off
Now all options are there:
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-4.15.0-106-generic root=... ro console=tty0 console=ttyS0,115200 console=ttyS1,115200 pti=off
Imported from Launchpad using lp2gh.
date created: 2020-06-23T20:17:06Z
owner: mfo
assignee: None
the launchpad url