kernel: Normalize target-arch for setup-kernel function

As we had dicussed in issue#140:
https://github.com/kata-containers/documentation/issues/140
We have normalized output for x86_64, arm64 and ppc64. And
James had implemented a kata-arch.sh in tests/.ci :
https://github.com/kata-containers/tests/blob/master/.ci/kata-arch.sh
But in build-kernel.sh the setup-kernel function had used the
"uname -m" output as target-arch directly, this will cause the
following scripts can't find kernel config files.

Fixed #111

Signed-off-by: Wei Chen <wei.chen@arm.com>
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
This commit is contained in:
Wei Chen
2018-07-31 05:14:17 +00:00
parent f0e1d9dc4d
commit 195b5744ea

View File

@@ -188,6 +188,7 @@ setup_kernel() {
[ -n "${hypervisor_target}" ] || hypervisor_target="kvm" [ -n "${hypervisor_target}" ] || hypervisor_target="kvm"
[ -n "${arch_target}" ] || arch_target="$(uname -m)" [ -n "${arch_target}" ] || arch_target="$(uname -m)"
arch_target=$(arch_to_kernel "${arch_target}")
[ -n "${kernel_config_path}" ] || kernel_config_path=$(get_default_kernel_config "${kernel_version}" "${hypervisor_target}" "${arch_target}") [ -n "${kernel_config_path}" ] || kernel_config_path=$(get_default_kernel_config "${kernel_version}" "${hypervisor_target}" "${arch_target}")
cp "${kernel_config_path}" ./.config cp "${kernel_config_path}" ./.config