Skip to content

Commit

Permalink
Merge pull request kata-containers#5023 from jongwu/save_uefi
Browse files Browse the repository at this point in the history
fw/arm64: speed up installation of UEFI image
  • Loading branch information
GabyCT authored Aug 7, 2023
2 parents 0f2c2d8 + 94aef1a commit de2c828
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .ci/aarch64/install_rom_aarch64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ TOOLCHAIN_PREFIX="${TOOLCHAIN_ARCHIVE_PREFIX}/bin/aarch64-none-elf-"
TOOLCHAIN_SOURCE_URL="https://developer.arm.com/-/media/Files/downloads/gnu-a/${TOOLCHAIN_VERSION}/binrel/${TOOLCHAIN_ARCHIVE}"

export EDK2_WORKSPACE=$(mktemp -d)
BACKUP_EFI_DIR=$HOME/backup

#tag or commit id of source code
EDK2_REPO_TAG_ID="edk2-stable202202"
Expand All @@ -36,6 +37,7 @@ INSTALL_PATH="${DESTDIR:-}${PREFIX}/share/kata-containers"
EFI_NAME="QEMU_EFI.fd"
EFI_DEFAULT_DIR="${EDK2_WORKSPACE}/qemu-efi-aarch64"
EFI_DEFAULT_PATH="${EFI_DEFAULT_DIR}/${EFI_NAME}"
BACKUP_EFI="${BACKUP_EFI_DIR}/${EFI_NAME}"

FLASH0_NAME="kata-flash0.img"
FLASH1_NAME="kata-flash1.img"
Expand Down Expand Up @@ -143,6 +145,11 @@ main()
exit 0
fi

if [ -f "${BACKUP_EFI}" ]; then
[ ! -d "${EFI_DEFAULT_DIR}" ] && mkdir -p "${EFI_DEFAULT_DIR}"
cp "${BACKUP_EFI}" "${EFI_DEFAULT_PATH}"
fi

#There maybe something wrong with the qemu efi download from linaro
#Just build it from source code until the issue is fixed
if [ ! -e "${EFI_DEFAULT_PATH}" ]; then
Expand All @@ -156,6 +163,10 @@ main()
prepare_uefi_flash
install_uefi_flash "${EDK2_WORKSPACE}/${FLASH0_NAME}" "${EDK2_WORKSPACE}/${FLASH1_NAME}"

# Save EFI file to backup dir
[ ! -d "${BACKUP_EFI_DIR}" ] && mkdir -p "${BACKUP_EFI_DIR}"
[ ! -f "${BACKUP_EFI}" ] && cp "${QEMU_EFI_BUILD_PATH}" "${BACKUP_EFI_DIR}"

echo "Info: install uefi rom image successfully"
clean_up

Expand Down

0 comments on commit de2c828

Please sign in to comment.