1
0
forked from rosa/hakurei

cmd/earlyinit: handle args from cmdline

These are set by the bootloader.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-03-14 15:13:52 +09:00
parent 74c213264a
commit bc03118142

View File

@@ -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/",