mirror of
https://github.com/kairos-io/immucore.git
synced 2025-09-21 18:27:57 +00:00
Fix recovery (#54)
* Fix recovery - change TargetLabel into TargetDevice to hav ethe full device instead of just the label - log error if we cant mount - Get state partition to mount depending on recovery or active/passive - Get state patition fs on the fly - Set proper label device to mount on sysroot based on our boot state Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com> * Fix test Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com> --------- Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
This commit is contained in:
@@ -48,21 +48,21 @@ Sends a generic event payload with the configuration found in the scanned direct
|
||||
g := herd.DAG(herd.EnableInit)
|
||||
|
||||
// Get targets and state
|
||||
targetLabel, targetDevice := utils.GetTarget(c.Bool("dry-run"))
|
||||
targetImage, targetDevice := utils.GetTarget(c.Bool("dry-run"))
|
||||
|
||||
s := &mount.State{
|
||||
Logger: log.Logger,
|
||||
Rootdir: utils.GetRootDir(),
|
||||
TargetLabel: targetDevice,
|
||||
TargetImage: targetLabel,
|
||||
TargetDevice: targetDevice,
|
||||
TargetImage: targetImage,
|
||||
RootMountMode: utils.RootRW(),
|
||||
}
|
||||
|
||||
if utils.DisableImmucore() {
|
||||
log.Logger.Info().Msg("Stanza rd.cos.disable on the cmdline or booting from CDROM/Netboot/recovery. Disabling immucore.")
|
||||
log.Logger.Info().Msg("Stanza rd.cos.disable on the cmdline or booting from CDROM/Netboot/Squash recovery. Disabling immucore.")
|
||||
err = s.RegisterLiveMedia(g)
|
||||
} else {
|
||||
log.Logger.Info().Msg("Booting on active/passive.")
|
||||
log.Logger.Info().Msg("Booting on active/passive/recovery.")
|
||||
err = s.RegisterNormalBoot(g)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user