-
Notifications
You must be signed in to change notification settings - Fork 295
Add kernel parameters to bootloader section #23057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add kernel parameters to bootloader section #23057
Conversation
2d6612b
to
9ab6b37
Compare
Please, rebase, there has been changes recently for bootloader timeout. |
9ab6b37
to
4559d8f
Compare
42d8c3c
to
08e35c6
Compare
08e35c6
to
7eb1101
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine.
d78371f
to
0ec20e5
Compare
0ec20e5
to
c7555ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
I have been discussing with @okynos different solutions, he will share with you regarding to have more compact libraries and not spreading value (not even keys) in the template. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion, discuss with @jknphy
we should test further this, but a solution to have single function is this:
template.libsonnet:
Notice |
3d7ae0c
to
568647b
Compare
Add kernel parameters to bootloader section.
568647b
to
3154479
Compare
sub run { | ||
select_console 'root-console'; | ||
my $output = script_output('cat /proc/cmdline'); | ||
my ($parameters) = get_var('AGAMA_PROFILE_OPTIONS') =~ /bootloader_extra_kernel_params="([^"]*)"/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a named regex without escaping the quotes twice (as you are escaping it after the equal and at the end):
get_var('AGAMA_PROFILE_OPTIONS', '') =~ /bootloader_extra_kernel_params="(?<kernel_params>.*)"/;
And then use it with:
$+{kernel_params}
my $output = script_output('cat /proc/cmdline'); | ||
my ($parameters) = get_var('AGAMA_PROFILE_OPTIONS') =~ /bootloader_extra_kernel_params="([^"]*)"/; | ||
|
||
unless ($output =~ /\Q$parameters\E/) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need \Q and \E, might be too much I think.
it would be read more naturally in one line:
die "$parameters not found in kernel command line!" unless $output =~ /$+{kernel_params}/);
sub run { | ||
select_console 'root-console'; | ||
my $output = script_output('cat /proc/cmdline'); | ||
my ($parameters) = get_var('AGAMA_PROFILE_OPTIONS') =~ /bootloader_extra_kernel_params="([^"]*)"/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this operation is a parsing, it should go before running api call, like script_output, it is kind of an initialization (by extraction), although select_console might be an exception, you could put it after select_console, one line above.
@@ -8,6 +8,7 @@ schedule: | |||
- yam/agama/agama | |||
- boot/reconnect_mgmt_console | |||
- installation/first_boot | |||
- yam/validate/validate_extra_kernel_params |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure where I have seen this before, but please add your check on the bottom always, not on top, only for your debugging you could have it there while the PR is in WIP. It is not always the same rule, but when we are talking about specific checks, it applies, if we were doing some really generic check we would like to have it right after booting probably.
Additionally in theory it should match the order here: https://gitlab.suse.de/qe-yam/openqa-job-groups/-/merge_requests/563/diffs#5d8fe6da111ccf64f032b338d77178a533febb54_50_50 so it could easy guide us where things are.
Uh oh!
There was an error while loading. Please reload this page.