container: enter init path early

There is generally no use case where any setup is required before init, and requiring the explicit function call is error-prone and unnecessary. It also causes trouble with packages using a similar trick. This change moves argv0 check early and makes it an import side effect. The stub will be removed in v0.5.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
cat
2026-08-25 14:53:29 +09:00
parent ac7abbbe3f
commit 1c3761bb53
22 changed files with 32 additions and 72 deletions
-3
View File
@@ -1,7 +1,6 @@
package container
import (
"encoding/gob"
"fmt"
"path/filepath"
. "syscall"
@@ -10,8 +9,6 @@ import (
"hakurei.app/fhs"
)
func init() { gob.Register(new(MountDevOp)) }
// Dev appends an [Op] that mounts a subset of host /dev.
func (f *Ops) Dev(target *check.Absolute, mqueue bool) *Ops {
*f = append(*f, &MountDevOp{target, mqueue, false})