Skip to content

Commit

Permalink
tar-artifacts: include selftests/bpf dependencies
Browse files Browse the repository at this point in the history
Include KBUILD_OUTPUT files necessary for building selftests/bpf in a
clean Linux source tree without rebuilding the kernel. That is:
* "include" directories
* Module.symvers
* tools/objtool

These together take just a couple of Mb, so they are added
uncodintionally.

Signed-off-by: Ihor Solodrai <[email protected]>
  • Loading branch information
theihor committed Feb 5, 2025
1 parent 8a4bc90 commit 0f59300
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions tar-artifacts/tar-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,25 @@ source "${GITHUB_ACTION_PATH}/../helpers.sh"
"${arch}"-linux-gnu-strip --strip-debug "${KBUILD_OUTPUT}"/vmlinux

image_name=$(make -C ${REPO_ROOT} ARCH="$(platform_to_kernel_arch "${arch}")" -s image_name)
kbuild_output_file_list=(
".config"
"${image_name}"
"include/"
"vmlinux"
)
kbuild_output_file_list=(".config" "${image_name}" "vmlinux")

function push_to_kout_list() {
local item="$1"
if [[ -e "${KBUILD_OUTPUT}/${item}" ]]; then
kbuild_output_file_list+=("${item}")
else
echo "tar-artifacts.sh warning: couldn't find ${KBUILD_OUTPUT}/${item}"
fi
}

cd "${KBUILD_OUTPUT}"
push_to_kout_list "Module.symvers"
push_to_kout_list "scripts/"
push_to_kout_list "tools/objtool/"
for dir in $(find . -type d -name "include"); do
push_to_kout_list "${dir}/"
done
cd -

tar -rf "${tarball}" -C "${KBUILD_OUTPUT}" \
--transform "s,^,kbuild-output/," \
Expand Down

0 comments on commit 0f59300

Please sign in to comment.