aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/autoetc.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-08-03 20:46:41 +0900
committerOphestra <cat@gensokyo.uk>2025-08-03 21:16:45 +0900
commitc6be82bcf91fc4b6e61d9df40213e80367addbd8 (patch)
treeee245cf214ff845f0d8a3eac0cc1a6064107112d /container/autoetc.go
parent38245559dca0833dc078b982d59490eee53e168c (diff)
container/path: fhs path constants
This increases readability since this can help disambiguate absolute paths from similarly named path segments. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/autoetc.go')
-rw-r--r--container/autoetc.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/container/autoetc.go b/container/autoetc.go
index 103bd35b..3e23c160 100644
--- a/container/autoetc.go
+++ b/container/autoetc.go
@@ -12,7 +12,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, prefix string) *Ops {
e := &AutoEtcOp{prefix}
- f.Mkdir("/etc", 0755)
+ f.Mkdir(FHSEtc, 0755)
f.Bind(host, e.hostPath(), 0)
*f = append(*f, e)
return f
@@ -22,7 +22,7 @@ type AutoEtcOp struct{ Prefix string }
func (e *AutoEtcOp) early(*Params) error { return nil }
func (e *AutoEtcOp) apply(*Params) error {
- const target = sysrootPath + "/etc/"
+ const target = sysrootPath + FHSEtc
rel := e.hostRel() + "/"
if err := os.MkdirAll(target, 0755); err != nil {
@@ -40,7 +40,7 @@ func (e *AutoEtcOp) apply(*Params) error {
case "group":
case "mtab":
- if err = os.Symlink("/proc/mounts", target+n); err != nil {
+ if err = os.Symlink(FHSProc+"mounts", target+n); err != nil {
return wrapErrSelf(err)
}
@@ -54,7 +54,7 @@ func (e *AutoEtcOp) apply(*Params) error {
return nil
}
-func (e *AutoEtcOp) hostPath() string { return "/etc/" + e.hostRel() }
+func (e *AutoEtcOp) hostPath() string { return FHSEtc + e.hostRel() }
func (e *AutoEtcOp) hostRel() string { return ".host/" + e.Prefix }
func (e *AutoEtcOp) Is(op Op) bool {