Skip to content

Commit

Permalink
FC: ELF format kernel image unsupported with firecracker on AArch64
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pennyzct committed Dec 18, 2019
1 parent d1cd6c3 commit 2ef9bbc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion kernel/build-kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion kernel/kata_config_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
60
61

0 comments on commit 2ef9bbc

Please sign in to comment.