Simple shell script for making managing final kernel boot parameters a bit easier... #123
Matthew-Tate-Scarbrough
started this conversation in
General
Replies: 1 comment
-
Thank you for taking the time to both write this helper and to write up the detailed discussion on it! I like the ability to append parameters to the command line, as well as being able to edit it easily in vi/$EDITOR. If you're open to a few suggestions on small changes to the script:
With some small changes (BASH-isms are fine, ZFSBootMenu has a hard dependency on Bash), this would fit nicely in the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
So anyway, after asking the other day on how to actually manage the kernel boot parameters, I knew I would be doing it a lot, so I figured I would write a script for me to be able to do that much easier. Even if it is a one-liner, if you have to do it twice, you may thrice, so it is best to write a script and document it.
I only have a year on *NIX, in general's, experience. I tried to keep the script as POSIX as I know how. It's probably not the best. Here is the link to it on my repo in which I keep my scripts: zbm_kernel_params.
In short, it reads
/proc/cmdline
to get the current kernel parameters. If you simply run the shell script as a oneliner, it appends the new kernel parameters:zbm_kernel_params new_param1
— or —
zbm_kernel_params "new_param1 new_param2"
Alternatively, it has an interactive mode, ie.
And it can create a temporary file,
/tmp/old_kern_params_tmp
, and which it then forces the end user to edit withvi
. Upon exit, these are applied and the temporary file is deleted.And lastly, it can display the current boot parameters that should take effect (or remain in effect) at next reboot:
I doubt it would be something you would be interested in cloning (and perhaps making a bit more straight-forward) for the project, but I am at least throwing it out there. I have tested it how I could think to, I used
shellcheck
. It should work as-is. The only manual intervention required would be for the end user to define their ZFS root dataset. The guide for Void on the wiki useszroot/ROOT
. I usedzroot/ROOT
. I think FreeBSD useszroot/ROOT
(last time I played with FBSD 12.)Beta Was this translation helpful? Give feedback.
All reactions