66 kernel_version :
77 description : ' Kernel version to build'
88 required : false
9- default : ' 6.18.6 '
9+ default : ' 6.18.32 '
1010 push :
1111 branches :
1212 - main
@@ -16,23 +16,32 @@ permissions:
1616 contents : read
1717
1818env :
19- KERNEL_VERSION : ${{ inputs.kernel_version || '6.18.6 ' }}
19+ KERNEL_VERSION : ${{ inputs.kernel_version || '6.18.32 ' }}
2020
2121jobs :
2222 build-kernel :
23- name : Build Kernel (${{ matrix.arch }})
23+ name : Build Kernel (${{ matrix.arch }} / ${{ matrix.flavor }} )
2424 runs-on :
2525 group : Default Larger Runners
2626 strategy :
2727 fail-fast : false
2828 matrix :
29+ arch : [x86_64, arm64]
30+ # base = pre-eBPF kernel; ebpf = eBPF tracing stack + BTF (for Tetragon).
31+ flavor : [base, ebpf]
2932 include :
3033 - arch : x86_64
3134 build_arch : x86_64
3235 cross_compile_pkgs : " "
3336 - arch : arm64
3437 build_arch : aarch64
3538 cross_compile_pkgs : gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
39+ - flavor : base
40+ build_type_arg : " "
41+ tarball_suffix : " "
42+ - flavor : ebpf
43+ build_type_arg : " -b ebpf"
44+ tarball_suffix : " -ebpf"
3645
3746 steps :
3847 - name : Checkout
4756 build-essential \
4857 cpio \
4958 curl \
59+ dwarves \
5060 flex \
5161 git \
5262 libelf-dev \
@@ -71,22 +81,45 @@ jobs:
7181
7282 - name : Setup kernel source
7383 working-directory : packaging/kernel
74- run : ./build-kernel.sh -a ${{ matrix.build_arch }} -v ${{ env.KERNEL_VERSION }} -f -s setup
84+ run : ./build-kernel.sh -a ${{ matrix.build_arch }} -v ${{ env.KERNEL_VERSION }} ${{ matrix.build_type_arg }} -f -s setup
7585
7686 - name : Build kernel
7787 working-directory : packaging/kernel
78- run : ./build-kernel.sh -a ${{ matrix.build_arch }} -v ${{ env.KERNEL_VERSION }} build
88+ run : ./build-kernel.sh -a ${{ matrix.build_arch }} -v ${{ env.KERNEL_VERSION }} ${{ matrix.build_type_arg }} build
89+
90+ - name : Verify BTF symbols are present
91+ if : matrix.flavor == 'ebpf'
92+ working-directory : packaging/kernel
93+ run : |
94+ # setup runs with -s (skip config checks), so a dropped BTF option
95+ # would not fail the build — it would silently ship a BTF-less kernel
96+ # that crashes Tetragon and other CO-RE agents at startup. Guard both
97+ # the config and the generated .BTF section in vmlinux.
98+ kernel_dir=$(find . -maxdepth 1 -type d -name 'kata-linux-*' | head -n1)
99+ [ -n "${kernel_dir}" ] || { echo "ERROR: kernel build dir not found" >&2; exit 1; }
100+ echo "Checking BTF in ${kernel_dir}"
101+ if ! grep -q '^CONFIG_DEBUG_INFO_BTF=y' "${kernel_dir}/.config"; then
102+ echo "ERROR: CONFIG_DEBUG_INFO_BTF was dropped from .config" >&2
103+ echo "--- DEBUG_KERNEL / DEBUG_INFO / PAHOLE / BTF state ---" >&2
104+ grep -E 'DEBUG_KERNEL|DEBUG_INFO|PAHOLE|BTF' "${kernel_dir}/.config" >&2 || true
105+ exit 1
106+ fi
107+ if ! readelf -S "${kernel_dir}/vmlinux" | grep -q '\.BTF'; then
108+ echo "ERROR: vmlinux has no .BTF section; BTF symbols were not generated" >&2
109+ exit 1
110+ fi
111+ echo "OK: BTF symbols present in vmlinux"
79112
80113 - name : Install kernel artifacts
81114 working-directory : packaging/kernel
82115 run : |
83116 mkdir -p ${{ github.workspace }}/artifacts
84- DESTDIR=${{ github.workspace }}/artifacts ./build-kernel.sh -a ${{ matrix.build_arch }} -v ${{ env.KERNEL_VERSION }} install
117+ DESTDIR=${{ github.workspace }}/artifacts ./build-kernel.sh -a ${{ matrix.build_arch }} -v ${{ env.KERNEL_VERSION }} ${{ matrix.build_type_arg }} install
85118
86119 - name : Create tarball
87120 id : tarball
88121 run : |
89- TARBALL_NAME="${{ steps.version.outputs.version_string }}-${{ matrix.arch }}.tar.gz"
122+ TARBALL_NAME="${{ steps.version.outputs.version_string }}-${{ matrix.arch }}${{ matrix.tarball_suffix }} .tar.gz"
90123 echo "tarball_name=${TARBALL_NAME}" >> $GITHUB_OUTPUT
91124 cd ${{ github.workspace }}/artifacts/usr/share/kata-containers
92125 echo "Creating tarball with:"
@@ -111,7 +144,7 @@ jobs:
111144 - name : Upload artifacts to GitHub
112145 uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
113146 with :
114- name : kernel-${{ matrix.arch }}-${{ steps.version.outputs.version_string }}
147+ name : kernel-${{ matrix.arch }}-${{ matrix.flavor }}-${{ steps.version.outputs.version_string }}
115148 path : ${{ github.workspace }}/${{ steps.tarball.outputs.tarball_name }}
116149 retention-days : 7
117150
@@ -129,7 +162,7 @@ jobs:
129162 run : |
130163 DATE=$(date +%Y%m%d)
131164 SHORT_SHA=$(git rev-parse --short=7 HEAD)
132- KERNEL_VERSION="${{ inputs.kernel_version || '6.18.6 ' }}"
165+ KERNEL_VERSION="${{ inputs.kernel_version || '6.18.32 ' }}"
133166 VERSION_STRING="linux-${KERNEL_VERSION}-runloop-${DATE}-${SHORT_SHA}"
134167 echo "version_string=${VERSION_STRING}" >> $GITHUB_OUTPUT
135168
0 commit comments