Skip to content

Commit

Permalink
fw/arm64: speed up installation of UEFI image
Browse files Browse the repository at this point in the history
Building UEFI image from source take at least 5 min. We can build it
once and save it as backup then copy the UEFI image there to cancel the
build in the following UEFI image installation.

Fixes: kata-containers#5022
Signed-off-by: Jianyong Wu <[email protected]>
  • Loading branch information
jongwu committed Aug 12, 2022
1 parent 8f55257 commit 94aef1a
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 @@ -130,6 +132,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 @@ -143,6 +150,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 94aef1a

Please sign in to comment.