Fix Linux kernel arguments for Grub command line#123
Fix Linux kernel arguments for Grub command line#123ghost wants to merge 1 commit intodevelopmentfrom unknown repository
Conversation
Before, the code generating the Grub command calling the Linux kernel ignored the WWKARGS variable when no CONSOLE was given. Furthermore, even if an additional CONSOLE was given, the arguments were passed as a comma separated list, while the kernel expects them to be separated by spaces. Signed-off-by: Wolfgang Hoelzl <wolfgang.hoelzl(at)tum.de>
|
Hi Wolfgang, Thanks for finding this issue and the pull request.
We should figure out a way to parse WWKARGS so we can handle this case. I can think of a few places where one could need commas in the parameter of a kernel cmdline arguments. I'm not sure how we could actually go about parsing this as-is, however... There would be no way to tell a bare argument versus an argument with comma separated parameters.
The output from nodeconfig.pl joins arrays with commas here: https://github.com/warewulf/warewulf3/blob/master/provision/cgi-bin/nodeconfig.pl#L67 KARGS is stored as an array here: https://github.com/warewulf/warewulf3/blob/master/provision/lib/Warewulf/Provision.pm#L165 |
|
Isn't it enough to simply join However, I'm not proficient enough with warewulf in particular and perl in general to detect Best regards, |
This pull request addresses two things:
Before, the code in
80-mkbootablethat generated the Grub command line which finally starts the Linux kernel in a stateful setup, ignored the contents of the variableWWKARGSas long as the variableCONSOLEwas empty.In fact, the command line was build via
thus people had to specify an additional console other than
tty0.This threw away even useful kernel arguments such as
net.ifnames=0oripv6.disable=1as there was noGRUB_CMDLINE_LINUXin the file$GRUBDEFAULTCONF, if one was not aware that an additional console was necessary.Now, kernel arguments are added properly, even if
CONSOLEis empty, as long asWWKARGSis not.The latter is usually the case, as the script
80-mkbootableadds the argumentquietas a default value.The kernel expects its arguments to be separated by spaces.
However, the moment the script
80-mkbootableis executed, the variableWWKARGScontains the kernel arguments as a comma separated list.This is true, even if the kernel arguments are explicitly specified as separated by spaces while configuring a cluster.
Thus, the function
update_default_grubdid not work properly before.I do not know where the commas are finally added, I just observed that they are there, so the new code strips them away and replaces them with spaces.
Note, however, that this might introduce subtle bugs, where kernel arguments take a comma separated list themselve as a parameter.
I do not know how to solve this, as I can not figure out where
WWKARGSis populated with commas.Best regards
Wolfgang