Skip to content

Commit 04aabf0

Browse files
committed
Fix disk configuration loading for graphical EFI boot order setup
- Improve disk configuration handling for graphical EFI boot order in EMT ISO installs. - Use configuration.SystemBootType() in updateBootOrder for reliable boot type detection. - Add fallback in runBootEntryCreationCommand to reload disks from /etc/calamares/unattended_config.json if empty. Signed-off-by: kinatli jayanth <jayanthx.kintali@intel.com>
1 parent 74493b2 commit 04aabf0

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

toolkit/tools/liveinstaller/liveinstaller.go

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ func installerFactory(forceAttended bool, configFile, templateConfigFile string)
142142
}
143143

144144
func updateBootOrder(installDetails installationDetails) (err error) {
145-
if installDetails.finalConfig.DefaultSystemConfig.BootType != "efi" {
145+
bootType := configuration.SystemBootType()
146+
if bootType != "efi" {
146147
logger.Log.Info("No BootType of 'efi' detected. Not attempting to set EFI boot order.")
147148
return
148149
}
@@ -177,7 +178,28 @@ func runBootEntryCreationCommand(installDetails installationDetails) (err error)
177178
return fmt.Errorf("Kickstart parsed disk list is empty")
178179
}
179180
cfg.Disks = disks
181+
} else {
182+
if len(cfg.Disks) == 0 {
183+
logger.Log.Info("No disks found in finalConfig, reloading from /etc/calamares/unattended_config.json")
184+
configFile := "/etc/calamares/unattended_config.json"
185+
tempConfig, err := configuration.Load(configFile)
186+
if err != nil {
187+
logger.Log.Errorf("Failed to reload configuration from %s: %v", configFile, err)
188+
return err
189+
}
190+
if len(tempConfig.Disks) == 0 {
191+
logger.Log.Errorf("No disks found in reloaded configuration from %s", configFile)
192+
// Log contents for debugging
193+
if content, err := os.ReadFile(configFile); err == nil {
194+
logger.Log.Debugf("Contents of unattended_config.json: %s", string(content))
195+
}
196+
return err
197+
}
198+
// Copy disk contents to cfg.Disks
199+
cfg.Disks = tempConfig.Disks
200+
}
180201
}
202+
181203
bootPartIdx, bootPart := cfg.GetBootPartition()
182204
bootDisk := cfg.GetDiskContainingPartition(bootPart)
183205

0 commit comments

Comments
 (0)