kernel: measured rootfs as argument to build-kernel.sh

By convention the caller of tools/packaging/kernel/build-kernel.sh changes
the script behavior by passing arguments, whereas, for measured rootfs
it has used an environment variable (MEASURED_ROOTFS). This refactor
the script so that the caller now must pass the "-m" argument to enable
the build of the kernel with measured rootfs support.

Fixes #6674
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
This commit is contained in:
Wainer dos Santos Moschetta
2023-07-04 09:37:41 -03:00
parent 891f488ee3
commit 3f16d29593
4 changed files with 14 additions and 8 deletions

View File

@@ -300,7 +300,7 @@ install_cached_kernel_tarball_component() {
install_kernel_helper() {
local kernel_version_yaml_path="${1}"
local kernel_name="${2}"
local extra_cmd=${3}
local extra_cmd="${3:-}"
export kernel_version="$(get_from_kata_deps ${kernel_version_yaml_path})"
export kernel_kata_config_version="$(cat ${repo_root_dir}/tools/packaging/kernel/kata_config_version)"
@@ -317,6 +317,9 @@ install_kernel_helper() {
if [ "${MEASURED_ROOTFS}" == "yes" ]; then
info "build initramfs for cc kernel"
"${initramfs_builder}"
# Turn on the flag to build the kernel with support to
# measured rootfs.
extra_cmd+=" -m"
fi
info "build ${kernel_name}"