Add KernelCommandLine to OperatingSystemStatus#244
Conversation
Add KernelCommandLine []string field to OperatingSystemStatus to report kernel boot parameters from /proc/cmdline, split by whitespace.
Merging this branch will not change overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. |
fwiesel
left a comment
There was a problem hiding this comment.
I'd rather keep it as a string, because that is how it is passed.
This implies parsing the string, and the implementation proposed ("split by whitespace") is too simple, and raises the question, how do you pass parameters with white-spaces? How they are quoted, and how are the quotes escaped?
Either way, something one probably really doesn't want to solve, as you're likely fine with a regexp to search the argument that you are interested in out.
|
Fine by me. If we want them as separate values reliably, we could simply imitate the kernels (admittedly rather trivial) parsing in next_arg(): The only supported whitespace containing-args are quoted with single
|
|
Well, but what the kernel understands is not the same as what the kernel gets passed (i.e. KernelCommandLine).
So, yes, you can implement that parsing, and but essentially it is a free for all. |
Add KernelCommandLine []string field to OperatingSystemStatus to report kernel boot parameters from /proc/cmdline, split by whitespace.