Skip to content

Commit

Permalink
installer: fix arm grub installation
Browse files Browse the repository at this point in the history
  • Loading branch information
neolynx committed May 15, 2024
1 parent 7dcb3a9 commit eeadc3f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
18 changes: 15 additions & 3 deletions initrd-installer/scripts/init-premount/installer
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down Expand Up @@ -417,6 +417,7 @@ if [ "$INSTALLER_ASK_CONFIRM" != "no" ]; then
fi
fi

sleep 2
logo
sleep 1
starttime=$(date +"%s")
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion molior-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion molior-deploy.sh.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eeadc3f

Please sign in to comment.