-
Notifications
You must be signed in to change notification settings - Fork 246
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
Add automatically some important kernel parameters to KERNEL_CMDLINE #1495
Conversation
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.
@schabrolles
I think this is a very good enhancement.
Could you perhaps implement it via
generically working code in the script
(i.e. avoid hardcoded values in the scripts)
plus a config array in default.conf that
contains those kernel commandline options
that are checked if present on the original system
and if yes also used for the recovery system?
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.
@schabrolles @jsmeix @schlomo Woudln't it not be better to make an array of KERNEL_CMDLINE?
@gdha It was my thought.... I was starting this scipt by considering KERNEL_CMDLINE was an array ... but it was not ;-) May be @jsmeix or @schlomo could tell us why it is a variable and not an array. @jsmeix, I've just made some adjustments (using a Array CHECK_KERNEL_PARAMETER in default.conf). Does it fit your expectation ? (not sure I understand what you mean by "implement it via |
FWIW: # strings=( first 'second thing' last ) # for string in "${strings[@]}" ; do echo "'$string'" ; done 'first' 'second thing' 'last' works. # words=" first second third " # for word in $words ; do echo "'$word'" ; done 'first' 'second' 'third' already works. |
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 perfect!
With generically working code in the actual scripts
(regardless that default.conf and local.conf
are sourced and executed as scripts
I do not count them as actual scripts)
I mean to avoid hardcoded values in the actual scripts.
Now the user has final power because
he can - if needed - specify the actual behaiour
via config varaiables - e.g with
CHECK_KERNEL_PARAMETER=()
he can disable this functionality if
he wants that.
@schabrolles
is perhaps CHECK_KERNEL_PARAMETERS
(with a plural 'S' at the end) a better name?
Or even COPY_KERNEL_PARAMETERS
because in ReaR we often use the
word 'copy' when we mean to
"have the same in the ReaR recovery system".
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.
@schabrolles looks good albeit I have seen persistence naming being used without these kernel parameters being set.
For sure, it is a nice enhancement, but it is not full proof, but I don't know how to make it full proof either.
OK to commit.
Looks good to me. Did you check it with kernel options that are bare words without a |
@gdha, Yes I have some system (in PowerVM) where even if you put
That's why we need to copy this option into the rescue image. |
@schlomo, Yes it also works with parameters without |
Thanks, go ahead and merge. |
I propose to check the current kernel parameters used (in
/proc/cmdline
) to detect some important parameter we should use when booting in rescue mode (means add them in KERNEL_CMDLINE variable).Based on the discussion with @gdha in #1400, I started to detect
net.ifnames
orbiosdevname
parameter in order to preserve interface naming between rescue mode and real system after migration.