From 818c28cf1d2b4d486adc2ddd671e472f6c97ce4c Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 10 Nov 2026 03:29:13 +0900 Subject: cmd/earlyinit: optionally make misc bindable This is only used by the test suite. Autoroot is generally never used. Signed-off-by: Ophestra --- cmd/earlyinit/main.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'cmd/earlyinit') diff --git a/cmd/earlyinit/main.go b/cmd/earlyinit/main.go index 02841620..4df46cfc 100644 --- a/cmd/earlyinit/main.go +++ b/cmd/earlyinit/main.go @@ -107,6 +107,8 @@ const ( flagKmsg = "kmsg" // flagNoRemount arranges for / to remain writable. flagNoRemount = "no_remount" + // flagBindableMisc skips making /misc/ unbindable. + flagBindableMisc = "bindable_misc" // flagMountTmp arranges for /tmp/ to be made available. flagMountTmp = "mount_tmp" // flag9P arranges for a host directory to be mounted at /host/. @@ -145,7 +147,6 @@ func main() { if !slices.Contains(flags, flagTrivial) { flag |= report.DIgnoreTrivial } - log.Printf("reporting flags %x", flag) r.SetFlags(flag) } @@ -299,13 +300,15 @@ func main() { MS_NOATIME|MS_NODEV|MS_NOEXEC|MS_NOSUID, "size=16M,mode=0555,noswap", )) - mustSyscall("set misc MS_UNBINDABLE", Mount( - "", - "/misc", - "", - MS_UNBINDABLE, - "", - )) + if !slices.Contains(flags, flagBindableMisc) { + mustSyscall("set misc MS_UNBINDABLE", Mount( + "", + "/misc", + "", + MS_UNBINDABLE, + "", + )) + } // for testsuite if slices.Contains(flags, flagEarlyHsu) { -- cgit v1.3.1