aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/earlyinit/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/earlyinit/main.go')
-rw-r--r--cmd/earlyinit/main.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/cmd/earlyinit/main.go b/cmd/earlyinit/main.go
index fff80bd8..62f87833 100644
--- a/cmd/earlyinit/main.go
+++ b/cmd/earlyinit/main.go
@@ -102,6 +102,8 @@ const (
flagMountTmp = "mount_tmp"
// flag9P arranges for a host directory to be mounted at /host/.
flag9P = "9p"
+ // flagEarlyHsu arranges for hardcoded hsurc pairings to be set early.
+ flagEarlyHsu = "early_hsurc"
)
func main() {
@@ -280,6 +282,30 @@ func main() {
must(os.MkdirAll("/usr/bin", 0555))
must(os.Symlink("../../system/bin/env", "/usr/bin/env"))
+ must(os.Mkdir("/misc", 0))
+ mustSyscall("mount misc", Mount(
+ "misc",
+ "/misc",
+ "tmpfs",
+ MS_NOATIME|MS_NODEV|MS_NOEXEC|MS_NOSUID,
+ "size=16M,mode=0555,noswap",
+ ))
+ mustSyscall("set misc MS_UNBINDABLE", Mount(
+ "",
+ "/misc",
+ "",
+ MS_UNBINDABLE,
+ "",
+ ))
+
+ // for testsuite
+ if slices.Contains(flags, flagEarlyHsu) {
+ must(updateHsu([][2]uint32{
+ {1000, 0},
+ {9999, 10},
+ }))
+ }
+
if slices.Contains(flags, flag9P) {
// avoid having to wait for the uevent loop
modprobe("-a", "9p", "9pnet_virtio", "virtio_pci")