Add arm64 grub installation support

Add the necessary variables in grub.cfg and populate the EFI
partition with arm64 efi executable and modules.

Signed-off-by: Andrej Rosano <andrej@inversepath.com>
This commit is contained in:
Andrej Rosano 2015-09-14 12:24:41 +02:00
parent acea447ccd
commit 16feac5ef6
3 changed files with 26 additions and 2 deletions

View File

@ -361,7 +361,11 @@ finish_image() {
# This script must mount the ESP partition differently, so run it after unmount
if [[ "${install_grub}" -eq 1 ]]; then
local target
for target in i386-pc x86_64-efi x86_64-xen; do
local target_list="i386-pc x86_64-efi x86_64-xen"
if [[ ${BOARD} == "arm64-usr" ]]; then
target_list="arm64-efi"
fi
for target in ${target_list}; do
if [[ "${PROD_IMAGE}" -eq 1 && ${FLAGS_enable_verity} -eq ${FLAGS_TRUE} ]]; then
${BUILD_LIBRARY_DIR}/grub_install.sh \
--target="${target}" --disk_image="${disk_img}" --verity

View File

@ -53,7 +53,11 @@ if [ -z "$linux_console" ]; then
terminal_input console serial_com0
terminal_output console serial_com0
elif [ "$grub_platform" = efi ]; then
set linux_console="console=ttyS0,115200n8 console=tty0"
if [ "$grub_cpu" = arm64 ]; then
set linux_console="console=ttyAMA0,115200n8"
else
set linux_console="console=ttyS0,115200n8 console=tty0"
fi
elif [ "$grub_platform" = xen ]; then
set linux_console="console=hvc0"
fi
@ -66,6 +70,11 @@ else
set suf=""
fi
# Use standard linux command for arm64
if [ "$grub_cpu" = arm64 ]; then
set suf=""
fi
menuentry "CoreOS default" --id=coreos {
gptprio.next -d usr -u usr_uuid
if [ "$usr_uuid" = "7130c94a-213a-4e5a-8e26-6cce9662f132" ]; then

View File

@ -49,6 +49,10 @@ case "${FLAGS_target}" in
x86_64-xen)
CORE_NAME="core.elf"
;;
arm64-efi)
CORE_MODULES+=( serial efi_gop )
CORE_NAME="core-arm64.efi"
;;
*)
die_notrace "Unknown GRUB target ${FLAGS_target}"
;;
@ -192,6 +196,13 @@ case "${FLAGS_target}" in
sudo cp "${BUILD_LIBRARY_DIR}/menu.lst" \
"${ESP_DIR}/boot/grub/menu.lst"
;;
arm64-efi)
info "Installing default arm64 UEFI bootloader."
sudo mkdir -p "${ESP_DIR}/EFI/boot"
#FIXME(andrejro): shim not ported to aarch64
sudo cp "${ESP_DIR}/${GRUB_DIR}/${CORE_NAME}" \
"${ESP_DIR}/EFI/boot/bootaa64.efi"
;;
esac
cleanup