FC: ELF format kernel image unsupported with firecracker on AArch64

The bootloader in firecracker on ARM platform only supports kernel
in Portable Executable(PE) format.
So we need `build-kernel.sh` to provide correct kernel image format
when parameter `hypervisor_target`, `-t`, defined with firecracker.

Fixes: #886

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
This commit is contained in:
Penny Zheng 2019-12-17 18:00:55 +08:00
parent d1cd6c3e2e
commit 2ef9bbc16a
2 changed files with 11 additions and 2 deletions

View File

@ -260,6 +260,7 @@ get_default_kernel_config() {
if [ -d "${archfragdir}" ]; then
config="$(get_kernel_frag_path ${archfragdir} ${kernel_path})"
else
[ "${hypervisor}" == "firecracker" ] && hypervisor="kvm"
config="${default_kernel_config_dir}/${kernel_arch}_kata_${hypervisor}_${major_kernel}.x"
fi
@ -354,6 +355,7 @@ build_kernel() {
make -j $(nproc) ARCH="${arch_target}"
[ "$arch_target" != "powerpc" ] && ([ -e "arch/${arch_target}/boot/bzImage" ] || [ -e "arch/${arch_target}/boot/Image.gz" ])
[ -e "vmlinux" ]
[ "${hypervisor_target}" == "firecracker" ] && [ "${arch_target}" == "arm64" ] && [ -e "arch/${arch_target}/boot/Image" ]
popd >>/dev/null
}
@ -382,8 +384,15 @@ install_kata() {
install --mode 0644 -D "${bzImage}" "${install_path}/${vmlinuz}"
fi
install --mode 0644 -D "vmlinux" "${install_path}/${vmlinux}"
if [ "${hypervisor_target}" == "firecracker" ] && [ "${arch_target}" == "arm64" ]; then
vmlinux="${vmlinux}-${hypervisor_target}"
install --mode 0644 -D "arch/${arch_target}/boot/Image" "${install_path}/${vmlinux}"
else
install --mode 0644 -D "vmlinux" "${install_path}/${vmlinux}"
fi
install --mode 0644 -D ./.config "${install_path}/config-${kernel_version}"
if [[ ${experimental_kernel} == "true" ]]; then
sufix="-virtiofs.container"
else

View File

@ -1 +1 @@
60
61