From 17b1b63d760c9944daf31f8a6f749cedfec8b76c Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Wed, 24 Apr 2024 09:57:07 +0200 Subject: [PATCH] config sys-fs/zfs-kmod: fix Kernel version issue of zfs-kmod In case of sysext of zfs-kmod, pkg_setup() calls linux-info_get_any_version() of eclass/linux-info.eclass with MERGE_TYPE=binary and LINUX_INFO_BINARY_RESET=0. That results in KV_FULL and KV_OUT_DIR being unset, which is not what we want. So set LINUX_INFO_BINARY_RESET=1 to avoid such side effect. Without setting them, build_sysext complains like below, i.e. it tries to find System.map of a wrong Kernel version 6.6.21, when it should find a newer version like 6.6.23. That results in subsequent zfs CI tests failing due to missing files like System.map and module deps. ``` System.map for kernel 6.6.21-flatcar was not found, may be due to the built kernel sources no longer being available and lacking the fallback: ``` Suggested-by: Jeremi Piotrowski --- .../coreos-overlay/coreos/config/env/sys-fs/zfs-kmod | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sdk_container/src/third_party/coreos-overlay/coreos/config/env/sys-fs/zfs-kmod b/sdk_container/src/third_party/coreos-overlay/coreos/config/env/sys-fs/zfs-kmod index 55536d82a8..d9059b9386 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos/config/env/sys-fs/zfs-kmod +++ b/sdk_container/src/third_party/coreos-overlay/coreos/config/env/sys-fs/zfs-kmod @@ -1,2 +1,9 @@ : ${MODULES_ROOT:=$(echo ${SYSROOT}/lib/modules/*)} KERNEL_DIR="${MODULES_ROOT}/build" + +# Necessary to prevent KV_FULL & KV_OUT_DIR from being unset +# when building Kernel modules for sysext. See also eclass/linux-info.eclass. +cros_pre_pkg_setup_kernel_version() { + LINUX_INFO_BINARY_RESET=1 + get_version +}