aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/early.go
diff options
context:
space:
mode:
authorOphestra Umiker <cat@ophivana.moe>2024-09-17 13:48:42 +0900
committerOphestra Umiker <cat@ophivana.moe>2024-09-17 13:48:42 +0900
commit4b7d616862dc7d8c73561b85deb0ca1fabf30781 (patch)
treed069af086d1fcfeca2f9a629e0f3eb3e2f19500f /internal/early.go
parent6a6f62efa672bdb439c2f9056055193a53c1df01 (diff)
exit: move final and early code to internal package
Exit cleanup state information is now stored in a dedicated struct and built up using methods of that struct. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'internal/early.go')
-rw-r--r--internal/early.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/early.go b/internal/early.go
new file mode 100644
index 00000000..48dfcd54
--- /dev/null
+++ b/internal/early.go
@@ -0,0 +1,16 @@
+package internal
+
+import (
+ "fmt"
+
+ "git.ophivana.moe/cat/fortify/internal/util"
+)
+
+var SdBootedV = func() bool {
+ if v, err := util.SdBooted(); err != nil {
+ fmt.Println("warn: read systemd marker:", err)
+ return false
+ } else {
+ return v
+ }
+}()