aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/earlyinit
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/earlyinit')
-rw-r--r--cmd/earlyinit/main.go20
1 files changed, 12 insertions, 8 deletions
diff --git a/cmd/earlyinit/main.go b/cmd/earlyinit/main.go
index f0baa265..ed07cc3e 100644
--- a/cmd/earlyinit/main.go
+++ b/cmd/earlyinit/main.go
@@ -94,6 +94,8 @@ const (
flagStrict = "strict"
// flagNoRecover sets [report.DNoRecover] on r.
flagNoRecover = "no_recover"
+ // flagNoRemount arranges for / to remain writable.
+ flagNoRemount = "no_remount"
// flagMountTmp arranges for /tmp/ to be made available.
flagMountTmp = "mount_tmp"
// flag9P arranges for a host directory to be mounted at /host/.
@@ -282,14 +284,16 @@ func main() {
}
// after top level has been set up
- mustSyscall("remount root", Mount(
- "",
- "/",
- "",
- MS_REMOUNT|MS_BIND|
- MS_RDONLY|MS_NODEV|MS_NOSUID|MS_NOEXEC,
- "",
- ))
+ if !slices.Contains(flags, flagNoRemount) {
+ mustSyscall("remount root", Mount(
+ "",
+ "/",
+ "",
+ MS_REMOUNT|MS_BIND|
+ MS_RDONLY|MS_NODEV|MS_NOSUID|MS_NOEXEC,
+ "",
+ ))
+ }
must(os.WriteFile(
"/sys/module/firmware_class/parameters/path",