image: {{.Values.image}}

{{ if .Values.arch }}
  {{ if eq .Values.arch "arm64" }}
prelude:
- zypper in -y grub2-arm64-efi grub2
  {{ else }}
prelude:
- zypper in -y grub2-i386-pc grub2-x86_64-efi grub2
  {{ end }}
{{end}}

steps:
- mkdir -p /grub-artifacts/grub2
- mkdir -p /grub-artifacts/EFI/BOOT
- cp -rf /usr/share/grub2/* /grub-artifacts/grub2
{{ if .Values.arch }}
  {{ if eq .Values.arch "arm64" }}
- cp /usr/share/grub2/arm64-efi/grub.efi /grub-artifacts/EFI/BOOT/grub.efi
- cp /usr/share/grub2/arm64-efi/grub.efi /grub-artifacts/EFI/BOOT/BOOTAA64.EFI
  {{ else }}
- cp /usr/share/grub2/x86_64-efi/grub.efi /grub-artifacts/EFI/BOOT/grub.efi
- cp /usr/share/grub2/x86_64-efi/grub.efi /grub-artifacts/EFI/BOOT/BOOTX64.EFI
  {{ end }}
{{end}}

package_dir: /grub-artifacts
