Skip to content

Commit 8cbaedc

Browse files
committed
Rebuild using latest kernel versions. Ran into issues with arm64 kernel header builds
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent 329d846 commit 8cbaedc

3 files changed

Lines changed: 31 additions & 39 deletions

File tree

tools/docker/Makefile

Lines changed: 15 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -72,36 +72,15 @@ SYSROOT_CREATOR_IMAGE_TAG := sysroot-creator-$(SYSROOT_REV)
7272
## Linux image parameters
7373
LINUX_HEADER_BUILD_DIR := $(BUILD_DIR)/linux_headers
7474
LINUX_HEADER_ASSETS_BUILD_DIR := $(LINUX_HEADER_BUILD_DIR)/assets
75-
LINUX_KERNEL_VERSIONS := 4.14.309 \
76-
4.15.18 \
77-
4.16.18 \
78-
4.17.19 \
79-
4.18.20 \
80-
4.19.325 \
81-
4.20.17 \
82-
5.0.21 \
83-
5.1.21 \
84-
5.2.21 \
85-
5.3.18 \
86-
5.4.293 \
87-
5.5.19 \
88-
5.6.19 \
89-
5.7.19 \
90-
5.8.18 \
91-
5.9.16 \
92-
5.10.237 \
93-
5.11.22 \
94-
5.12.19 \
95-
5.13.19 \
75+
LINUX_KERNEL_VERSIONS := 4.18.20 \
76+
5.10.252 \
9677
5.14.21 \
97-
5.15.181 \
98-
5.16.20 \
99-
5.17.15 \
100-
5.18.19 \
101-
5.19.17 \
102-
6.0.19 \
103-
6.1.137 \
104-
6.6.89
78+
6.1.167 \
79+
6.6.132 \
80+
6.12.80 \
81+
6.18.21 \
82+
6.19.10
83+
10584

10685
LINUX_HEADER_TEMPLATE := linux-headers-%.tar.gz
10786
LINUX_HEADER_X86_64_TARGETS = $(addprefix $(LINUX_HEADER_ASSETS_BUILD_DIR)/, \
@@ -135,14 +114,12 @@ elasticsearch_image_tag := "gcr.io/pixie-oss/pixie-dev-public/elasticsearch:$(EL
135114

136115
## Linux kernel for qemu/BPF tests.
137116
KERNEL_BUILD_DIR := $(BUILD_DIR)/kernel_build
138-
# 4.19.276, 4.14.304 are the correct versions here, but there is a bug with patch > 255.
139-
KERNEL_BUILD_VERSIONS := 4.14.254 \
140-
4.19.254 \
141-
5.4.254 \
142-
5.10.224 \
143-
5.15.165 \
144-
6.1.106 \
145-
6.8.12
117+
KERNEL_BUILD_VERSIONS := 5.10.252 \
118+
5.14.21 \
119+
6.1.167 \
120+
6.6.132 \
121+
6.12.80 \
122+
6.18.21
146123

147124
KERNEL_BUILD_TEMPLATE := linux-build-%.tar.gz
148125
KERNEL_BUILD_TARGETS = $(addprefix $(KERNEL_BUILD_DIR)/, $(patsubst %,$(KERNEL_BUILD_TEMPLATE), $(KERNEL_BUILD_VERSIONS)))
@@ -251,7 +228,7 @@ $(LINUX_HEADERS_ARM64_MERGED_FILE): $(LINUX_HEADER_ARM64_TARGETS)
251228

252229
.PHONY: upload_linux_headers
253230
upload_linux_headers: $(LINUX_HEADERS_X86_64_MERGED_FILE) $(LINUX_HEADERS_ARM64_MERGED_FILE) ## Target to build and upload linux headers image
254-
gsutil cp $^ $(LINUX_HEADERS_GS_PATH)
231+
# gsutil cp $^ $(LINUX_HEADERS_GS_PATH)
255232
$(GH_RELEASE_UPLOAD) linux-headers $(LINUX_HEADERS_REV) $^
256233
sha256sum $^
257234

tools/docker/linux_headers_image/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ RUN apt-get update
2727
RUN apt-get upgrade -y -q
2828
RUN apt-get install -y -q build-essential \
2929
bc \
30+
libdw-dev \
3031
libelf-dev \
3132
libssl-dev \
3233
flex \
@@ -41,6 +42,14 @@ RUN apt-get install -y -q build-essential \
4142
debhelper \
4243
python3
4344

45+
# opensslconf.h lives at the multiarch path (e.g. /usr/include/x86_64-linux-gnu/openssl/).
46+
# During cross-compilation, dpkg-buildpackage alters include paths so host tools
47+
# (like scripts/sign-file) can no longer find it. Symlink it to the standard path.
48+
RUN if [ -f /usr/include/x86_64-linux-gnu/openssl/opensslconf.h ] && \
49+
[ ! -f /usr/include/openssl/opensslconf.h ]; then \
50+
ln -s /usr/include/x86_64-linux-gnu/openssl/opensslconf.h /usr/include/openssl/opensslconf.h; \
51+
fi
52+
4453
WORKDIR /configs
4554
ADD x86_64_config /configs/x86_64
4655
ADD arm64_config /configs/arm64

tools/docker/linux_headers_image/build_linux_headers.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,13 @@ if [ "${KERN_MAJ}" -lt 6 ] || { [ "${KERN_MAJ}" -le 6 ] && [ "${KERN_MIN}" -lt 3
7373
fi
7474
echo "Building ${TARGET} for ${KERN_VERSION}${LOCALVERSION} (${ARCH})"
7575

76-
make ARCH="${ARCH}" -j "$(nproc)" "${TARGET}" LOCALVERSION="${LOCALVERSION}"
76+
EXTRA_MAKE_ARGS=""
77+
if [ "${ARCH}" != "$(uname -m)" ]; then
78+
# Skip dpkg dependency checks when cross-compiling, since host packages
79+
# (e.g. libssl-dev) won't satisfy target arch requirements.
80+
EXTRA_MAKE_ARGS="DPKG_FLAGS=-d"
81+
fi
82+
make ARCH="${ARCH}" -j "$(nproc)" "${TARGET}" LOCALVERSION="${LOCALVERSION}" ${EXTRA_MAKE_ARGS}
7783

7884
popd || exit
7985
popd || exit

0 commit comments

Comments
 (0)