mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-08-22 18:19:32 +00:00
Try to get the flavor on EFI installs (#568)
This commit is contained in:
parent
0f85a2c9d4
commit
a3452b4cfa
@ -176,6 +176,18 @@ func (g Grub) Install(target, rootDir, bootDir, grubConf, tty string, efi bool,
|
||||
if err != nil {
|
||||
g.config.Logger.Warnf("Failed reading os-release from %s: %v", filepath.Join(cnst.ActiveDir, "etc/os-release"), err)
|
||||
}
|
||||
if flavor == "" {
|
||||
// If os-release is gone with our vars, we dont know what flavor are we in, we should know if we are on ubuntu as we need
|
||||
// a workaround for the grub efi install
|
||||
// So lets try to get the info from the normal keys shipped with the os
|
||||
flavorFromId, err := utils.OSRelease("ID", filepath.Join(cnst.ActiveDir, "etc/os-release"))
|
||||
if err != nil {
|
||||
g.config.Logger.Logger.Err(err).Msg("Getting flavor")
|
||||
}
|
||||
if strings.Contains(strings.ToLower(flavorFromId), "ubuntu") {
|
||||
flavor = "ubuntu"
|
||||
}
|
||||
}
|
||||
g.config.Logger.Debugf("Detected Flavor: %s", flavor)
|
||||
// Copy needed files for efi boot
|
||||
// This seems like a chore while we could provide a package for those bundled files as they are just a shim and a grub efi
|
||||
|
Loading…
Reference in New Issue
Block a user