mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-09 22:16:58 +02:00
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:
parent
acea447ccd
commit
16feac5ef6
@ -361,7 +361,11 @@ finish_image() {
|
|||||||
# This script must mount the ESP partition differently, so run it after unmount
|
# This script must mount the ESP partition differently, so run it after unmount
|
||||||
if [[ "${install_grub}" -eq 1 ]]; then
|
if [[ "${install_grub}" -eq 1 ]]; then
|
||||||
local target
|
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
|
if [[ "${PROD_IMAGE}" -eq 1 && ${FLAGS_enable_verity} -eq ${FLAGS_TRUE} ]]; then
|
||||||
${BUILD_LIBRARY_DIR}/grub_install.sh \
|
${BUILD_LIBRARY_DIR}/grub_install.sh \
|
||||||
--target="${target}" --disk_image="${disk_img}" --verity
|
--target="${target}" --disk_image="${disk_img}" --verity
|
||||||
|
@ -53,7 +53,11 @@ if [ -z "$linux_console" ]; then
|
|||||||
terminal_input console serial_com0
|
terminal_input console serial_com0
|
||||||
terminal_output console serial_com0
|
terminal_output console serial_com0
|
||||||
elif [ "$grub_platform" = efi ]; then
|
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
|
elif [ "$grub_platform" = xen ]; then
|
||||||
set linux_console="console=hvc0"
|
set linux_console="console=hvc0"
|
||||||
fi
|
fi
|
||||||
@ -66,6 +70,11 @@ else
|
|||||||
set suf=""
|
set suf=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Use standard linux command for arm64
|
||||||
|
if [ "$grub_cpu" = arm64 ]; then
|
||||||
|
set suf=""
|
||||||
|
fi
|
||||||
|
|
||||||
menuentry "CoreOS default" --id=coreos {
|
menuentry "CoreOS default" --id=coreos {
|
||||||
gptprio.next -d usr -u usr_uuid
|
gptprio.next -d usr -u usr_uuid
|
||||||
if [ "$usr_uuid" = "7130c94a-213a-4e5a-8e26-6cce9662f132" ]; then
|
if [ "$usr_uuid" = "7130c94a-213a-4e5a-8e26-6cce9662f132" ]; then
|
||||||
|
@ -49,6 +49,10 @@ case "${FLAGS_target}" in
|
|||||||
x86_64-xen)
|
x86_64-xen)
|
||||||
CORE_NAME="core.elf"
|
CORE_NAME="core.elf"
|
||||||
;;
|
;;
|
||||||
|
arm64-efi)
|
||||||
|
CORE_MODULES+=( serial efi_gop )
|
||||||
|
CORE_NAME="core-arm64.efi"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
die_notrace "Unknown GRUB target ${FLAGS_target}"
|
die_notrace "Unknown GRUB target ${FLAGS_target}"
|
||||||
;;
|
;;
|
||||||
@ -192,6 +196,13 @@ case "${FLAGS_target}" in
|
|||||||
sudo cp "${BUILD_LIBRARY_DIR}/menu.lst" \
|
sudo cp "${BUILD_LIBRARY_DIR}/menu.lst" \
|
||||||
"${ESP_DIR}/boot/grub/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
|
esac
|
||||||
|
|
||||||
cleanup
|
cleanup
|
||||||
|
Loading…
Reference in New Issue
Block a user