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
bootloader: use ForGadget when installing boot config #9643
Conversation
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>
There was a problem hiding this 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
bootloader/bootloader.go
Outdated
// given gadgetDir to rootdir. If no boot config for this bootloader | ||
// is found ok is false. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// given gadgetDir to rootdir. If no boot config for this bootloader | |
// is found ok is false. | |
// given gadgetDir to rootdir. |
bl, err := ForGadget(gadgetDir, rootDir, opts) | ||
if err != nil { | ||
return fmt.Errorf("cannot find boot config in %q", gadgetDir) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is nice!
image/image_test.go
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 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 |
…tloader-install-boot-config-cleanup
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
bl, err := ForGadget(gadgetDir, rootDir, opts) | ||
if err != nil { | ||
return fmt.Errorf("cannot find boot config in %q", gadgetDir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you
Address TODO added during UC20 development and use a ForGadget helper when
installing boot configs of a bootloader.