From 7b416d47dcb830aab5daa432cf79af5f8bbacaef Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sun, 3 Aug 2025 18:34:55 +0900 Subject: container/ops: merge mqueue and dev Ops There is no reason to mount mqueue anywhere else, and these Ops usually follow each other. This change merges them. This helps decrease IPC overhead and also enables mounting dev readonly. Signed-off-by: Ophestra --- internal/app/app_nixos_linux_test.go | 2 +- internal/app/app_pd_linux_test.go | 4 ++-- internal/app/container_linux.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'internal') diff --git a/internal/app/app_nixos_linux_test.go b/internal/app/app_nixos_linux_test.go index c11fbd81..2db3bf8a 100644 --- a/internal/app/app_nixos_linux_test.go +++ b/internal/app/app_nixos_linux_test.go @@ -118,7 +118,7 @@ var testCasesNixos = []sealTestCase{ Ops: new(container.Ops). Proc("/proc"). Tmpfs(hst.Tmp, 4096, 0755). - Dev("/dev").Mqueue("/dev/mqueue"). + Dev("/dev", true). Bind("/bin", "/bin", 0). Bind("/usr/bin", "/usr/bin", 0). Bind("/nix/store", "/nix/store", 0). diff --git a/internal/app/app_pd_linux_test.go b/internal/app/app_pd_linux_test.go index 66cebe4f..b3d03f03 100644 --- a/internal/app/app_pd_linux_test.go +++ b/internal/app/app_pd_linux_test.go @@ -46,7 +46,7 @@ var testCasesPd = []sealTestCase{ Root("/", "4a450b6596d7bc15bd01780eb9a607ac", container.BindWritable). Proc("/proc"). Tmpfs(hst.Tmp, 4096, 0755). - Dev("/dev").Mqueue("/dev/mqueue"). + Dev("/dev", true). Bind("/dev/kvm", "/dev/kvm", container.BindWritable|container.BindDevice|container.BindOptional). Readonly("/var/run/nscd", 0755). Tmpfs("/run/user/1971", 8192, 0755). @@ -180,7 +180,7 @@ var testCasesPd = []sealTestCase{ Root("/", "ebf083d1b175911782d413369b64ce7c", container.BindWritable). Proc("/proc"). Tmpfs(hst.Tmp, 4096, 0755). - Dev("/dev").Mqueue("/dev/mqueue"). + Dev("/dev", true). Bind("/dev/dri", "/dev/dri", container.BindWritable|container.BindDevice|container.BindOptional). Bind("/dev/kvm", "/dev/kvm", container.BindWritable|container.BindDevice|container.BindOptional). Readonly("/var/run/nscd", 0755). diff --git a/internal/app/container_linux.go b/internal/app/container_linux.go index ce3a5154..35483018 100644 --- a/internal/app/container_linux.go +++ b/internal/app/container_linux.go @@ -85,7 +85,7 @@ func newContainer(s *hst.ContainerConfig, os sys.State, prefix string, uid, gid Tmpfs(hst.Tmp, 1<<12, 0755) if !s.Device { - params.Dev("/dev").Mqueue("/dev/mqueue") + params.Dev("/dev", true) } else { params.Bind("/dev", "/dev", container.BindWritable|container.BindDevice) } -- cgit v1.3.1