boot: introduce good recovery systems, provide compatibility handling#9943
Conversation
Add a new modeenv entry to tracking recovery systems that have been verified to work. Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
…being removed Auto labeler seems to be removing the labels unexpectedly, see: - canonical#9940 (comment) label was added manually when opening a PR and later removed by bot - canonical#9943 (comment) modified files match the label, but labeler removed 'Run nested' label Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
anonymouse64
left a comment
There was a problem hiding this comment.
lgtm, one naming question though that is probably irrelevant
boot/bootstate20.go
Outdated
| dev Device | ||
| } | ||
|
|
||
| func (ba20 *bootState20RecoverySystem) markSuccessful(update bootStateUpdate) (bootStateUpdate, error) { |
There was a problem hiding this comment.
| func (ba20 *bootState20RecoverySystem) markSuccessful(update bootStateUpdate) (bootStateUpdate, error) { | |
| func (brs20 *bootState20RecoverySystem) markSuccessful(update bootStateUpdate) (bootStateUpdate, error) { |
?
but again the acronym short hands for all the bootstate things are getting a bit unreadable anyways so maybe it doesn't matter so much
There was a problem hiding this comment.
I think ba20 comes from bootState20BootAssets. So yes brs20 here, and bcl20 for the commandline previously landed would be better.
boot/modeenv.go
Outdated
| Mode string `key:"mode"` | ||
| RecoverySystem string `key:"recovery_system"` | ||
| // CurrentRecoverySystems is a list of labels corresponding to recovery | ||
| // systems have been verified or are in the process of being tried, thus |
There was a problem hiding this comment.
| // systems have been verified or are in the process of being tried, thus | |
| // systems that have been verified or are in the process of being tried, thus |
| // clear kernel command lines list | ||
| modeenv2.CurrentKernelCommandLines = nil | ||
| c.Assert(modeenv1.DeepEqual(modeenv2), Equals, false) | ||
|
|
There was a problem hiding this comment.
thanks for updating this test
pedronis
left a comment
There was a problem hiding this comment.
thanks, some small comments, some bits that that were reused need some tweaks
boot/boot_test.go
Outdated
| b := bootloadertest.Mock("mock", s.bootdir) | ||
| s.forceBootloader(b) | ||
|
|
||
| // a pending kernel command line change |
boot/boot_test.go
Outdated
| b := bootloadertest.Mock("mock", s.bootdir) | ||
| s.forceBootloader(b) | ||
|
|
||
| // a pending kernel command line change |
| // check the modeenv | ||
| m2, err := boot.ReadModeenv("") | ||
| c.Assert(err, IsNil) | ||
| // good recovery systems has been populated |
boot/modeenv.go
Outdated
| Mode string `key:"mode"` | ||
| RecoverySystem string `key:"recovery_system"` | ||
| // CurrentRecoverySystems is a list of labels corresponding to recovery | ||
| // systems have been verified or are in the process of being tried, thus |
boot/modeenv.go
Outdated
| BrandID string `key:"model,secondary"` | ||
| Grade string `key:"grade"` | ||
| // GoodRecoverySystems is a list of labels corresponding to recovery | ||
| // systems were verified and we are prepared to use for recovering. The |
boot/bootstate20.go
Outdated
| dev Device | ||
| } | ||
|
|
||
| func (ba20 *bootState20RecoverySystem) markSuccessful(update bootStateUpdate) (bootStateUpdate, error) { |
There was a problem hiding this comment.
I think ba20 comes from bootState20BootAssets. So yes brs20 here, and bcl20 for the commandline previously landed would be better.
…eenv-good-recovery-systems
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Introduce good_recover_systems into modeev. Provide basic compatibility handling.