container/comp: rename from bits
All checks were successful
Test / Create distribution (push) Successful in 32s
Test / Sandbox (push) Successful in 2m19s
Test / Hakurei (push) Successful in 3m9s
Test / Hpkg (push) Successful in 3m53s
Test / Sandbox (race detector) (push) Successful in 4m2s
Test / Hakurei (race detector) (push) Successful in 4m43s
Test / Flake checks (push) Successful in 1m23s

This package will also hold syscall lookup tables for seccomp.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-10-21 20:54:03 +09:00
parent b1a4d801be
commit e94acc424c
25 changed files with 219 additions and 220 deletions

View File

@@ -4,8 +4,8 @@ import (
"encoding/gob"
"strings"
"hakurei.app/container/bits"
"hakurei.app/container/check"
"hakurei.app/container/comp"
"hakurei.app/container/fhs"
)
@@ -97,16 +97,16 @@ func (b *FSBind) Apply(z *ApplyState) {
}
var flags int
if b.Write {
flags |= bits.BindWritable
flags |= comp.BindWritable
}
if b.Device {
flags |= bits.BindDevice | bits.BindWritable
flags |= comp.BindDevice | comp.BindWritable
}
if b.Ensure {
flags |= bits.BindEnsure
flags |= comp.BindEnsure
}
if b.Optional {
flags |= bits.BindOptional
flags |= comp.BindOptional
}
switch {

View File

@@ -4,7 +4,7 @@ import (
"testing"
"hakurei.app/container"
"hakurei.app/container/bits"
"hakurei.app/container/comp"
"hakurei.app/hst"
)
@@ -24,7 +24,7 @@ func TestFSBind(t *testing.T) {
}, true, container.Ops{&container.BindMountOp{
Source: m("/mnt/dev"),
Target: m("/dev"),
Flags: bits.BindWritable | bits.BindDevice | bits.BindOptional,
Flags: comp.BindWritable | comp.BindDevice | comp.BindOptional,
}}, m("/dev"), ms("/mnt/dev"),
"d+/mnt/dev:/dev"},
@@ -36,7 +36,7 @@ func TestFSBind(t *testing.T) {
}, true, container.Ops{&container.BindMountOp{
Source: m("/mnt/dev"),
Target: m("/dev"),
Flags: bits.BindWritable | bits.BindDevice | bits.BindEnsure,
Flags: comp.BindWritable | comp.BindDevice | comp.BindEnsure,
}}, m("/dev"), ms("/mnt/dev"),
"d-/mnt/dev:/dev"},
@@ -48,7 +48,7 @@ func TestFSBind(t *testing.T) {
}, true, container.Ops{&container.BindMountOp{
Source: m("/mnt/dev"),
Target: m("/dev"),
Flags: bits.BindWritable | bits.BindDevice,
Flags: comp.BindWritable | comp.BindDevice,
}}, m("/dev"), ms("/mnt/dev"),
"d*/mnt/dev:/dev"},
@@ -59,7 +59,7 @@ func TestFSBind(t *testing.T) {
}, true, container.Ops{&container.BindMountOp{
Source: m("/mnt/tmp"),
Target: m("/tmp"),
Flags: bits.BindWritable,
Flags: comp.BindWritable,
}}, m("/tmp"), ms("/mnt/tmp"),
"w*/mnt/tmp:/tmp"},
@@ -98,7 +98,7 @@ func TestFSBind(t *testing.T) {
Special: true,
}, true, container.Ops{&container.AutoRootOp{
Host: m("/"),
Flags: bits.BindWritable,
Flags: comp.BindWritable,
}}, m("/"), ms("/"), "autoroot:w"},
{"autoroot silly", &hst.FSBind{
@@ -108,7 +108,7 @@ func TestFSBind(t *testing.T) {
Special: true,
}, true, container.Ops{&container.AutoRootOp{
Host: m("/etc"),
Flags: bits.BindWritable,
Flags: comp.BindWritable,
}}, m("/"), ms("/etc"), "autoroot:w:/etc"},
{"autoetc", &hst.FSBind{