system: move sd_booted implementation to os abstraction

This implements lazy loading of the systemd marker (they are not accessed in init and shim) and ensures consistent behaviour when running with a stub.

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
2024-10-27 12:08:17 +09:00
parent 6d8bcb63f2
commit 7df9d8d01d
6 changed files with 51 additions and 77 deletions

View File

@@ -30,7 +30,7 @@ func main() {
flag.Parse()
fmsg.SetVerbose(flagVerbose)
if internal.SdBootedV {
if os.SdBooted() {
fmsg.VPrintln("system booted with systemd as init system")
}