diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-07 21:29:16 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-07 21:29:16 +0900 |
| commit | 5d18af00077ae6ba8ef686d1fd93d888f69681b2 (patch) | |
| tree | eff32422fe3ef095c6a915ccb41c2a10a06990f7 /container/autoetc.go | |
| parent | 0e6c1a50260de141c50bb50fd3f2b2bcf9a3fe64 (diff) | |
container/fhs: move pathname constants
This allows referencing FHS pathnames without importing container.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/autoetc.go')
| -rw-r--r-- | container/autoetc.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/container/autoetc.go b/container/autoetc.go index 295bdf71..65ab9a2c 100644 --- a/container/autoetc.go +++ b/container/autoetc.go @@ -5,6 +5,7 @@ import ( "fmt" "hakurei.app/container/check" + "hakurei.app/container/fhs" ) func init() { gob.Register(new(AutoEtcOp)) } @@ -13,7 +14,7 @@ func init() { gob.Register(new(AutoEtcOp)) } // This is not a generic setup op. It is implemented here to reduce ipc overhead. func (f *Ops) Etc(host *check.Absolute, prefix string) *Ops { e := &AutoEtcOp{prefix} - f.Mkdir(AbsFHSEtc, 0755) + f.Mkdir(fhs.AbsEtc, 0755) f.Bind(host, e.hostPath(), 0) *f = append(*f, e) return f @@ -29,7 +30,7 @@ func (e *AutoEtcOp) apply(state *setupState, k syscallDispatcher) error { } state.nonrepeatable |= nrAutoEtc - const target = sysrootPath + FHSEtc + const target = sysrootPath + fhs.Etc rel := e.hostRel() + "/" if err := k.mkdirAll(target, 0755); err != nil { @@ -44,7 +45,7 @@ func (e *AutoEtcOp) apply(state *setupState, k syscallDispatcher) error { case ".host", "passwd", "group": case "mtab": - if err = k.symlink(FHSProc+"mounts", target+n); err != nil { + if err = k.symlink(fhs.Proc+"mounts", target+n); err != nil { return err } @@ -59,7 +60,7 @@ func (e *AutoEtcOp) apply(state *setupState, k syscallDispatcher) error { return nil } -func (e *AutoEtcOp) hostPath() *check.Absolute { return AbsFHSEtc.Append(e.hostRel()) } +func (e *AutoEtcOp) hostPath() *check.Absolute { return fhs.AbsEtc.Append(e.hostRel()) } func (e *AutoEtcOp) hostRel() string { return ".host/" + e.Prefix } func (e *AutoEtcOp) Is(op Op) bool { |
