Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootloader: use ForGadget when installing boot config #9643

Conversation

bboozzoo
Copy link
Collaborator

Address TODO added during UC20 development and use a ForGadget helper when
installing boot configs of a bootloader.

Address TODO added during UC20 development and use a ForGadget helper when
installing boot configs of a bootloader.

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 UC20 Run nested The PR also runs tests inluded in nested suite labels Nov 13, 2020
Copy link
Member

@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, thanks for this

Comment on lines 99 to 100
// given gadgetDir to rootdir. If no boot config for this bootloader
// is found ok is false.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// given gadgetDir to rootdir. If no boot config for this bootloader
// is found ok is false.
// given gadgetDir to rootdir.

Comment on lines +249 to +251
bl, err := ForGadget(gadgetDir, rootDir, opts)
if err != nil {
return fmt.Errorf("cannot find boot config in %q", gadgetDir)
Copy link
Member

Choose a reason for hiding this comment

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

ah nice, this does look much better, thanks

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, this is nice!

@@ -2642,28 +2641,32 @@ func (s *imageSuite) TestSetupSeedCore20(c *C) {

// check boot config
grubCfg := filepath.Join(prepareDir, "system-seed", "EFI/ubuntu/grub.cfg")
seedGrubenv := filepath.Join(prepareDir, "system-seed", "EFI/ubuntu/grubenv")
grubRecoveryCfgAsset := assets.Internal("grub-recovery.cfg")
c.Assert(grubRecoveryCfgAsset, NotNil)
c.Check(grubCfg, testutil.FileEquals, string(grubRecoveryCfgAsset))
// make sure that grub.cfg is the only file present inside the directory
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// make sure that grub.cfg is the only file present inside the directory
// make sure that grub.cfg and grubenv are the only files present inside the directory

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Copy link
Contributor

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

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

Thank you

Comment on lines +249 to +251
bl, err := ForGadget(gadgetDir, rootDir, opts)
if err != nil {
return fmt.Errorf("cannot find boot config in %q", gadgetDir)
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, this is nice!

Copy link
Collaborator

@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.

thank you

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
4 participants