diff --git a/pkg/action/build-iso.go b/pkg/action/build-iso.go index b52fdd5..d3c10ae 100644 --- a/pkg/action/build-iso.go +++ b/pkg/action/build-iso.go @@ -184,6 +184,11 @@ func (b BuildISOAction) createEFI(rootdir string, isoDir string) error { b.cfg.Logger.Errorf("Failed writing grub.cfg: %v", err) return err } + err = b.cfg.Fs.WriteFile(filepath.Join(temp, constants.EfiBootPath, constants.GrubCfg), []byte(constants.GrubEfiCfg), constants.FilePerm) + if err != nil { + b.cfg.Logger.Errorf("Failed writing grub.cfg: %v", err) + return err + } // Ubuntu efi searches for the grub.cfg file under /EFI/ubuntu/grub.cfg while we store it under /boot/grub2/grub.cfg // workaround this by copying it there as well // read the kairos-release from the rootfs to know if we are creating a ubuntu based iso @@ -205,11 +210,21 @@ func (b BuildISOAction) createEFI(rootdir string, isoDir string) error { b.cfg.Logger.Errorf("Failed writing grub.cfg: %v", err) return err } + err = utils.MkdirAll(b.cfg.Fs, filepath.Join(temp, "EFI/ubuntu/"), constants.DirPerm) + if err != nil { + b.cfg.Logger.Errorf("Failed writing grub.cfg: %v", err) + return err + } err = b.cfg.Fs.WriteFile(filepath.Join(isoDir, "EFI/ubuntu/", constants.GrubCfg), []byte(constants.GrubEfiCfg), constants.FilePerm) if err != nil { b.cfg.Logger.Errorf("Failed writing grub.cfg: %v", err) return err } + err = b.cfg.Fs.WriteFile(filepath.Join(temp, "EFI/ubuntu/", constants.GrubCfg), []byte(constants.GrubEfiCfg), constants.FilePerm) + if err != nil { + b.cfg.Logger.Errorf("Failed writing grub.cfg: %v", err) + return err + } } // Calculate EFI image size based on artifacts