Skip to content
This repository was archived by the owner on Jun 28, 2024. It is now read-only.

Commit 94aef1a

Browse files
committed
fw/arm64: speed up installation of UEFI image
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: #5022 Signed-off-by: Jianyong Wu <[email protected]>
1 parent 8f55257 commit 94aef1a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.ci/aarch64/install_rom_aarch64.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ TOOLCHAIN_PREFIX="${TOOLCHAIN_ARCHIVE_PREFIX}/bin/aarch64-none-elf-"
2323
TOOLCHAIN_SOURCE_URL="https://developer.arm.com/-/media/Files/downloads/gnu-a/${TOOLCHAIN_VERSION}/binrel/${TOOLCHAIN_ARCHIVE}"
2424

2525
export EDK2_WORKSPACE=$(mktemp -d)
26+
BACKUP_EFI_DIR=$HOME/backup
2627

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

4042
FLASH0_NAME="kata-flash0.img"
4143
FLASH1_NAME="kata-flash1.img"
@@ -130,6 +132,11 @@ main()
130132
exit 0
131133
fi
132134

135+
if [ -f "${BACKUP_EFI}" ]; then
136+
[ ! -d "${EFI_DEFAULT_DIR}" ] && mkdir -p "${EFI_DEFAULT_DIR}"
137+
cp "${BACKUP_EFI}" "${EFI_DEFAULT_PATH}"
138+
fi
139+
133140
#There maybe something wrong with the qemu efi download from linaro
134141
#Just build it from source code until the issue is fixed
135142
if [ ! -e "${EFI_DEFAULT_PATH}" ]; then
@@ -143,6 +150,10 @@ main()
143150
prepare_uefi_flash
144151
install_uefi_flash "${EDK2_WORKSPACE}/${FLASH0_NAME}" "${EDK2_WORKSPACE}/${FLASH1_NAME}"
145152

153+
# Save EFI file to backup dir
154+
[ ! -d "${BACKUP_EFI_DIR}" ] && mkdir -p "${BACKUP_EFI_DIR}"
155+
[ ! -f "${BACKUP_EFI}" ] && cp "${QEMU_EFI_BUILD_PATH}" "${BACKUP_EFI_DIR}"
156+
146157
echo "Info: install uefi rom image successfully"
147158
clean_up
148159
}

0 commit comments

Comments
 (0)