From bc031181421282339a16769f52f6cbdc5f604cba Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 14 Mar 2026 15:13:52 +0900 Subject: [PATCH] cmd/earlyinit: handle args from cmdline These are set by the bootloader. Signed-off-by: Ophestra --- cmd/earlyinit/main.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cmd/earlyinit/main.go b/cmd/earlyinit/main.go index 5301783..6dc0803 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/",