diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-11-08 18:55:19 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-11-08 19:17:35 +0900 |
| commit | 8c15959571568b231afe1eb3358ca3da7c00b026 (patch) | |
| tree | b4d1b33e2fc06da00cc47beadad740b86113acca /cmd/earlyinit/main.go | |
| parent | 085498b62ca37414d7c97fca9063526032c1f36e (diff) | |
cmd/hsu: move Rosa OS hsurc
This file is generated by the operating system. Pointing it to /system
requires ugly tricks to bind mount over it.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/earlyinit/main.go')
| -rw-r--r-- | cmd/earlyinit/main.go | 26 |
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") |
