Skip to content

boot: introduce good recovery systems, provide compatibility handling#9943

Merged
mvo5 merged 6 commits intocanonical:masterfrom
bboozzoo:bboozzoo/uc20-modeenv-good-recovery-systems
Feb 22, 2021
Merged

boot: introduce good recovery systems, provide compatibility handling#9943
mvo5 merged 6 commits intocanonical:masterfrom
bboozzoo:bboozzoo/uc20-modeenv-good-recovery-systems

Conversation

@bboozzoo
Copy link
Contributor

Introduce good_recover_systems into modeev. Provide basic compatibility handling.

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>
@bboozzoo bboozzoo added the Run nested The PR also runs tests inluded in nested suite label Feb 18, 2021
@github-actions github-actions bot removed the Run nested The PR also runs tests inluded in nested suite label Feb 18, 2021
@bboozzoo bboozzoo added the Run nested The PR also runs tests inluded in nested suite label Feb 18, 2021
bboozzoo added a commit to bboozzoo/snapd that referenced this pull request Feb 18, 2021
…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>
Copy link
Contributor

@anonymouse64 anonymouse64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, one naming question though that is probably irrelevant

dev Device
}

func (ba20 *bootState20RecoverySystem) markSuccessful(update bootStateUpdate) (bootStateUpdate, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/verified/tested/

// clear kernel command lines list
modeenv2.CurrentKernelCommandLines = nil
c.Assert(modeenv1.DeepEqual(modeenv2), Equals, false)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for updating this test

Copy link
Contributor

@pedronis pedronis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, some small comments, some bits that that were reused need some tweaks

b := bootloadertest.Mock("mock", s.bootdir)
s.forceBootloader(b)

// a pending kernel command line change
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this comment correct?

b := bootloadertest.Mock("mock", s.bootdir)
s.forceBootloader(b)

// a pending kernel command line change
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

// check the modeenv
m2, err := boot.ReadModeenv("")
c.Assert(err, IsNil)
// good recovery systems has been populated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

has not been modified ?

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/verified/tested/

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/verified/tested/

dev Device
}

func (ba20 *bootState20RecoverySystem) markSuccessful(update bootStateUpdate) (bootStateUpdate, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ba20 comes from bootState20BootAssets. So yes brs20 here, and bcl20 for the commandline previously landed would be better.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
@mvo5 mvo5 merged commit 700a56b into canonical:master Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Run nested The PR also runs tests inluded in nested suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants