aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/path.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/path.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/path.go')
-rw-r--r--container/path.go44
1 files changed, 42 insertions, 2 deletions
diff --git a/container/path.go b/container/path.go
index 632892af..b1126fdd 100644
--- a/container/path.go
+++ b/container/path.go
@@ -14,9 +14,49 @@ import (
)
const (
- hostPath = "/" + hostDir
+ // FHSRoot points to the file system root.
+ FHSRoot = "/"
+ // FHSEtc points to the directory for system-specific configuration.
+ FHSEtc = "/etc/"
+ // FHSTmp points to the place for small temporary files.
+ FHSTmp = "/tmp/"
+
+ // FHSRun points to a "tmpfs" file system for system packages to place runtime data, socket files, and similar.
+ FHSRun = "/run/"
+ // FHSRunUser points to a directory containing per-user runtime directories,
+ // each usually individually mounted "tmpfs" instances.
+ FHSRunUser = FHSRun + "user/"
+
+ // FHSUsr points to vendor-supplied operating system resources.
+ FHSUsr = "/usr/"
+ // FHSUsrBin points to binaries and executables for user commands that shall appear in the $PATH search path.
+ FHSUsrBin = FHSUsr + "bin/"
+
+ // FHSVar points to persistent, variable system data. Writable during normal system operation.
+ FHSVar = "/var/"
+ // FHSVarLib points to persistent system data.
+ FHSVarLib = FHSVar + "lib/"
+ // FHSVarEmpty points to a nonstandard directory that is usually empty.
+ FHSVarEmpty = FHSVar + "empty/"
+
+ // FHSDev points to the root directory for device nodes.
+ FHSDev = "/dev/"
+ // FHSProc points to a virtual kernel file system exposing the process list and other functionality.
+ FHSProc = "/proc/"
+ // FHSProcSys points to a hierarchy below /proc/ that exposes a number of kernel tunables.
+ FHSProcSys = FHSProc + "sys/"
+ // FHSSys points to a virtual kernel file system exposing discovered devices and other functionality.
+ FHSSys = "/sys/"
+)
+
+const (
+ // Nonexistent is a path that cannot exist.
+ // /proc is chosen because a system with covered /proc is unsupported by this package.
+ Nonexistent = FHSProc + "nonexistent"
+
+ hostPath = FHSRoot + hostDir
hostDir = "host"
- sysrootPath = "/" + sysrootDir
+ sysrootPath = FHSRoot + sysrootDir
sysrootDir = "sysroot"
)