1
0
mirror of https://github.com/kairos-io/immucore.git synced 2025-05-11 01:26:35 +00:00

measure PCR phase ()

This commit is contained in:
Itxaka 2023-12-15 16:20:34 +01:00 committed by GitHub
parent ec9aaa12ed
commit 424392b390
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -462,6 +462,12 @@ func (s *State) UKIMountBaseSystem(g *herd.Graph) error {
internalUtils.Log.Err(e).Str("what", m.what).Str("where", m.where).Str("type", m.fs).Msg("Mounting")
}
}
output, err := internalUtils.CommandWithPath("/usr/lib/systemd/systemd-pcrphase --graceful enter-initrd")
if err != nil {
internalUtils.Log.Err(err).Msg("running systemd-pcrphase")
return err
}
internalUtils.Log.Debug().Str("out", output).Msg("systemd-pcrphase enter-initrd")
return err
},
),
@ -476,6 +482,12 @@ func (s *State) UKIBootInitDagStep(g *herd.Graph) error {
herd.WeakDeps,
herd.WithWeakDeps(cnst.OpRemountRootRO, cnst.OpRootfsHook, cnst.OpInitramfsHook, cnst.OpWriteFstab),
herd.WithCallback(func(ctx context.Context) error {
output, err := internalUtils.CommandWithPath("/usr/lib/systemd/systemd-pcrphase --graceful leave-initrd")
if err != nil {
internalUtils.Log.Err(err).Msg("running systemd-pcrphase")
return err
}
internalUtils.Log.Debug().Str("out", output).Msg("systemd-pcrphase leave-initrd")
// Print dag before exit, otherwise its never printed as we never exit the program
internalUtils.Log.Info().Msg(s.WriteDAG(g))
internalUtils.Log.Debug().Msg("Executing init callback!")