mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-08-19 08:47:03 +00:00
Fix boot selection on uki
Seems like systemd-boot identifies entries by the ID whcih doesnt show anywhere, and that Id is the entry conf name minus the boot assesment Signed-off-by: Itxaka <itxaka@kairos.io>
This commit is contained in:
parent
694cdff23e
commit
c8f49a432e
@ -133,13 +133,9 @@ func selectBootEntrySystemd(cfg *config.Config, entry string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
assessment, err := utils.ReadAssessmentFromEntry(cfg.Fs, bootFileName, cfg.Logger)
|
bootName := fmt.Sprintf("%s.conf", bootFileName)
|
||||||
if err != nil {
|
|
||||||
cfg.Logger.Logger.Err(err).Str("entry", entry).Str("boot file name", bootFileName).Msg("could not read assessment from entry")
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
bootName := fmt.Sprintf("%s%s.conf", bootFileName, assessment)
|
|
||||||
// Set the default entry to the selected entry
|
// Set the default entry to the selected entry
|
||||||
|
// This is the file name of the entry to be set as default, boot assesment doesnt seem to count as it uses the ID which is the config name
|
||||||
systemdConf["default"] = bootName
|
systemdConf["default"] = bootName
|
||||||
err = utils.SystemdBootConfWriter(cfg.Fs, filepath.Join(efiPartition.MountPoint, "loader/loader.conf"), systemdConf)
|
err = utils.SystemdBootConfWriter(cfg.Fs, filepath.Join(efiPartition.MountPoint, "loader/loader.conf"), systemdConf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user