mirror of
https://github.com/kairos-io/immucore.git
synced 2025-09-01 05:08:44 +00:00
Fixes recovery
- Add isRecovery to state - Get the TargetImage from cmdline - Add isrecovery to conditions Signed-off-by: Itxaka <itxaka@spectrocloud.com>
This commit is contained in:
@@ -32,20 +32,16 @@ func BootStateToLabel() string {
|
||||
}
|
||||
}
|
||||
|
||||
func BootStateToImage() string {
|
||||
func IsRecovery() bool {
|
||||
runtime, err := state.NewRuntime()
|
||||
if err != nil {
|
||||
return ""
|
||||
return false
|
||||
}
|
||||
switch runtime.BootState {
|
||||
case "active_boot":
|
||||
return "/cOS/active.img"
|
||||
case "passive_boot":
|
||||
return "/cOS/passive.img"
|
||||
case "recovery_boot":
|
||||
return "/cOS/recovery.img"
|
||||
return true
|
||||
default:
|
||||
return ""
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user