Skip to main content

parse_rootflags

Function parse_rootflags 

Source
pub fn parse_rootflags(command_line: &str) -> Vec<String>
Expand description

What: The values of the rootflags= words of a kernel command line, as written there (a quoted value keeps its quotes). Why: The persistent command on an ostree host replaces that exact value, so it is read from the running system and never guessed. The value is everything after the first =, because the value itself contains =. A word quoted as a whole ("rootflags=a b") is unwrapped first, as the kernel does.

In TS you’d write (pseudocode):

const rootflags = (cmdline: string) => words(cmdline).map(unwrap).filter((w) => w.startsWith('rootflags=')).map((w) => w.slice(10));