diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-03-14 15:13:52 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-03-14 15:13:52 +0900 |
| commit | bc031181421282339a16769f52f6cbdc5f604cba (patch) | |
| tree | 5ad9831c4deb101447d85934cdd58dedaf7d3ca9 /cmd | |
| parent | 74c213264a8a95bbf04bff6f62dec31d954b0674 (diff) | |
cmd/earlyinit: handle args from cmdline
These are set by the bootloader.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/earlyinit/main.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/cmd/earlyinit/main.go b/cmd/earlyinit/main.go index 53017835..6dc08035 100644 --- a/cmd/earlyinit/main.go +++ b/cmd/earlyinit/main.go @@ -4,6 +4,7 @@ import ( "log" "os" "runtime" + "strings" . "syscall" ) @@ -12,6 +13,22 @@ func main() { log.SetFlags(0) log.SetPrefix("earlyinit: ") + var ( + option map[string]string + flags []string + ) + if len(os.Args) > 1 { + option = make(map[string]string) + for _, s := range os.Args[1:] { + key, value, ok := strings.Cut(s, "=") + if !ok { + flags = append(flags, s) + continue + } + option[key] = value + } + } + if err := Mount( "devtmpfs", "/dev/", |
