diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-05-07 15:40:47 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-05-07 15:55:19 +0900 |
| commit | 575ef307ad5cedb13a514cd038a4880ab8c91242 (patch) | |
| tree | 71c0bd20e32e08c56ce1be6824f8dbe0f1a091ed /container/container.go | |
| parent | d4144fcf7f9217d2a2dcec21202421d5fa9d4928 (diff) | |
container: binfmt registration
This arranges for binfmt entries to be registered for the container.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/container.go')
| -rw-r--r-- | container/container.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/container/container.go b/container/container.go index 85e6596f..8af77315 100644 --- a/container/container.go +++ b/container/container.go @@ -100,6 +100,11 @@ type ( Gid int // Hostname value in UTS namespace. Hostname string + // Register binfmt_misc entries. + Binfmt []BinfmtEntry + // Alternative pathname to attach binfmt_misc filesystem. The zero value + // requires [FstypeProc] to be made available at [fhs.Proc]. + BinfmtPath *check.Absolute // Sequential container setup ops. *Ops @@ -219,6 +224,9 @@ func (p *Container) Start() error { if p.cmd.Process != nil { return errors.New("container: already started") } + if !p.InitAsRoot && len(p.Binfmt) > 0 { + return errors.New("container: init as root required, but not enabled") + } if err := ensureCloseOnExec(); err != nil { return err |
