From eeadc3f225aa41b395be0af8624134285cdba264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Roth?= Date: Wed, 15 May 2024 18:04:37 +0200 Subject: [PATCH] installer: fix arm grub installation --- .../scripts/init-premount/installer | 18 +++++++++++++++--- molior-deploy | 2 +- molior-deploy.sh.inc | 9 ++++++++- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/initrd-installer/scripts/init-premount/installer b/initrd-installer/scripts/init-premount/installer index 24b0465..94453aa 100755 --- a/initrd-installer/scripts/init-premount/installer +++ b/initrd-installer/scripts/init-premount/installer @@ -61,7 +61,7 @@ logo() echo "$textprefix | | | | | | (_) | | | (_) | | " echo "$textprefix |_| |_| |_|\\___/|_|_|\\___/|_| " echo - echo "$textprefix --- Installer --- $MOLIOR_TOOLS_VERSION" + echo "$textprefix--- Installer for $PROJECT $REVISION ---" echo -e "\033[1;m" } @@ -417,6 +417,7 @@ if [ "$INSTALLER_ASK_CONFIRM" != "no" ]; then fi fi +sleep 2 logo sleep 1 starttime=$(date +"%s") @@ -578,9 +579,20 @@ else chroot $target grub-install --recheck --force fi else # no EFI support in current boot mode - chroot $target grub-install --recheck --force --target x86_64-efi + if [ "$ARCH" = "amd64" ]; then + GRUBEFITYPE=x86_64-efi + GRUBFILE=grubx64.efi + EFIFILE=bootx64.efi + elif [ "$ARCH" = "arm64" ]; then + GRUBEFITYPE=arm64-efi + GRUBFILE=grubaa64.efi + EFIFILE=bootaa64.efi + else + log_error "Unsupported EFI Architecture: $ARCH" + fi + chroot $target grub-install --recheck --force --target $GRUBEFITYPE mkdir -p $target/boot/efi/EFI/BOOT - mv $target/boot/efi/efi/debian/grubx64.efi $target/boot/efi/EFI/BOOT/bootx64.efi + mv $target/boot/efi/efi/debian/$GRUBFILE $target/boot/efi/EFI/BOOT/$EFIFILE fi else if [ -n "$RAID_NAME" ] || [ -n "$fs_on_raid" ] && [ "$fs_on_raid" -eq 1 ]; then diff --git a/molior-deploy b/molior-deploy index 6256df7..9f0b672 100755 --- a/molior-deploy +++ b/molior-deploy @@ -1507,7 +1507,7 @@ workflow_base() fi if [ -n "$REQUIRED_HOST_COMMANDS" ]; then - log "checking host environmen" + log "checking host environment" ok=1 for cmd in $REQUIRED_HOST_COMMANDS do diff --git a/molior-deploy.sh.inc b/molior-deploy.sh.inc index 8300ae7..c589f35 100644 --- a/molior-deploy.sh.inc +++ b/molior-deploy.sh.inc @@ -1193,7 +1193,14 @@ install_grub_bootloader() fi log "grub-install ($t)" if [ "$TARGET_BOOTTYPE" = "efi" ]; then - chroot $target grub-install --removable --recheck --force --no-floppy --target x86_64-efi >&2 + if [ "$ARCH" = "amd64" ]; then + GRUBEFITYPE=x86_64-efi + elif [ "$ARCH" = "arm64" ]; then + GRUBEFITYPE=arm64-efi + else + log_error "Unsupported EFI Architecture: $ARCH" + fi + chroot $target grub-install --removable --recheck --force --no-floppy --target $GRUBEFITYPE >&2 exit_on_error "installing grub failed" else chroot $target grub-install --modules part_msdos --recheck --force --no-floppy $disk >&2