kernel: add hook to allow modifying kernel headers before packaging

This commit is contained in:
Gunjan Gupta
2024-02-20 15:30:54 +05:30
parent 14ce06c5da
commit 2bce64e24d
2 changed files with 8 additions and 1 deletions

View File

@@ -143,7 +143,7 @@ function artifact_kernel_prepare_version() {
declare var_config_hash_short="${vars_config_hash:0:${short_hash_size}}"
# Hash the extension hooks
declare -a extension_hooks_to_hash=("pre_package_kernel_image" "kernel_copy_extra_sources")
declare -a extension_hooks_to_hash=("pre_package_kernel_image" "kernel_copy_extra_sources" "pre_package_kernel_headers")
declare -a extension_hooks_hashed=("$(dump_extension_method_sources_functions "${extension_hooks_to_hash[@]}")")
declare hash_hooks="undetermined"
hash_hooks="$(echo "${extension_hooks_hashed[@]}" | sha256sum | cut -d' ' -f1)"

View File

@@ -457,6 +457,13 @@ function kernel_package_callback_linux_headers() {
)
fi
call_extension_method "pre_package_kernel_headers" <<- 'PRE_PACKAGE_KERNEL_HEADERS'
*fix kernel headers before packaging*
Some (legacy/vendor) kernels need preprocessing of the produced kernel headers before packaging.
Use this hook to do that, by modifying the file in place, in `${headers_target_dir}` directory.
The kernel sources can be found in `${kernel_work_dir}`.
PRE_PACKAGE_KERNEL_HEADERS
# Generate a control file
# TODO: libssl-dev is only required if we're signing modules, which is a kernel .config option.
cat <<- CONTROL_FILE > "${package_DEBIAN_dir}/control"