cmm offload is now working

This commit is contained in:
2026-05-14 07:29:45 +08:00
parent 1dab92663d
commit 839576a15f
6 changed files with 270 additions and 0 deletions

View File

@@ -167,6 +167,19 @@ RUN cd /src/ASK && \
test ! -s /tmp/ask-module-patches.list || xargs -a /tmp/ask-module-patches.list git apply --check && \
test ! -s /tmp/ask-module-patches.list || xargs -a /tmp/ask-module-patches.list git apply
# Verify ct enum
COPY scripts/check-ctenum/kernel_ctenum.c /src/check-ctenum/kernel_ctenum.c
RUN cd /src/linux \
&& make ARCH="${ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" \
headers_install INSTALL_HDR_PATH=/tmp/kernel-headers \
&& cc -I/tmp/kernel-headers/include \
/src/check-ctenum/kernel_ctenum.c \
-o /tmp/kernel_ctenum \
&& /tmp/kernel_ctenum | sort > /src/kernel_ctenum.txt
COPY scripts/check-ctenum/libnfct_ctenum.c /src/check-ctenum/libnfct_ctenum.c
# Build patched libnfnetlink + libnetfilter_conntrack into the musl sysroot.
# These are needed by cmm through pkg-config.
RUN mkdir -p "${ASK_DIR}/sources" && \
@@ -194,6 +207,15 @@ RUN mkdir -p "${ASK_DIR}/sources" && \
| sort > /tmp/libnfct-patches.list && \
test ! -s /tmp/libnfct-patches.list || xargs -a /tmp/libnfct-patches.list git apply --check && \
test ! -s /tmp/libnfct-patches.list || xargs -a /tmp/libnfct-patches.list git apply && \
####### Ensure parities for KERNEL <-> libnfct's enum #######
cd /src/libnetfilter_conntrack \
&& cc -I. -I"${SYSROOT}/include" /src/check-ctenum/libnfct_ctenum.c -o /tmp/libnfct_ctenum \
&& /tmp/libnfct_ctenum | sort > /tmp/libnfct_ctenum.txt \
&& echo "libnfct conntrack enum values:" \
&& cat /tmp/libnfct_ctenum.txt \
&& echo "Comparing kernel/libnfct conntrack enum ABI:" \
&& diff -u /src/kernel_ctenum.txt /tmp/libnfct_ctenum.txt && \
####### End #######
PKG_CONFIG_PATH="${SYSROOT}/lib/pkgconfig" \
CC=aarch64-linux-musl-gcc AR=aarch64-linux-musl-ar RANLIB=aarch64-linux-musl-ranlib \
./configure --host="${HOST}" --prefix="${SYSROOT}" \