Temp commit, nothing works yet

This commit is contained in:
2026-04-08 01:12:49 +08:00
parent bc4b124246
commit 0c5f490dfc
9 changed files with 125 additions and 19 deletions

View File

@@ -0,0 +1,51 @@
ARG TAG=dev
ARG DOCKER_IMAGE_ROOT=monok8s
FROM alpine:3.22 AS build
RUN apk add --no-cache \
bash \
build-base \
linux-headers \
meson \
ninja \
pkgconf \
python3 \
py3-elftools \
coreutils \
file \
git \
bsd-compat-headers
RUN mkdir /src
WORKDIR /src
ARG DPDK_TAR
ARG DPDK_VERSION
COPY ${DPDK_TAR} /tmp/
RUN set -eux; \
mkdir -p /src/dpdk; \
tar -xf "/tmp/$(basename "${DPDK_TAR}")" -C /src/dpdk --strip-components=1
RUN set -eux; \
meson setup /src/dpdk/build /src/dpdk \
--buildtype=release \
-Dplatform=dpaa \
-Dtests=false \
-Ddisable_drivers=crypto/*,compress/*,baseband/*,dma/*,event/*,regex/*,ml/*,gpu/*,raw/*,net/pcap,net/tap,net/vhost,net/virtio,net/ixgbe,net/i40e,net/txgbe,net/ring,net/af_packet; \
meson configure /src/dpdk/build | tee /tmp/meson-config.txt; \
grep -Ei 'dpaa|platform|disable_drivers' /tmp/meson-config.txt || true; \
ninja -C /src/dpdk/build; \
DESTDIR=/out ninja -C /src/dpdk/build install
RUN set -eux; \
mkdir -p /artifact/bin; \
test -x /src/dpdk/build/app/dpdk-testpmd; \
cp /src/dpdk/build/app/dpdk-testpmd /artifact/bin/
FROM scratch AS export
COPY --from=build /out/ /
COPY --from=build /artifact/ /

View File

@@ -1,3 +1,5 @@
include ../build.env
# Should be the same as upstream version in production
VERSION ?= dev
UBOOT_VERSION=v2026.01
@@ -12,12 +14,14 @@ BIN_DIR := bin
OUT_DIR := out
UBOOT_TAR := $(PACKAGES_DIR)/uboot-$(UBOOT_VERSION).tar.gz
DPDK_TAR := $(PACKAGES_DIR)/dpdk/$(DPDK_VERSION).tar.gz
BUILDINFO_FILE := pkg/buildinfo/buildinfo_gen.go
CRD_PATHS := ./pkg/apis/...
$(PACKAGES_DIR):
mkdir -p $@
mkdir -p $@ \
$@/dpdk
# Never cache this
.buildinfo:
@@ -33,6 +37,9 @@ $(PACKAGES_DIR):
')' \
> $(BUILDINFO_FILE)
$(DPDK_TAR): | $(PACKAGES_DIR)
curl -L -o $@ "https://github.com/nxp-qoriq/dpdk/archive/refs/tags/$(DPDK_VERSION).tar.gz"
$(UBOOT_TAR): | $(PACKAGES_DIR)
git clone --depth 1 --branch v2026.01 --filter=blob:none https://github.com/u-boot/u-boot.git $(OUT_DIR)/u-boot-$(UBOOT_VERSION)
tar -C "$(OUT_DIR)/u-boot-$(UBOOT_VERSION)" -zcf "$@" .
@@ -46,6 +53,15 @@ uboot-tools: $(UBOOT_TAR)
--build-arg UBOOT_TAR=$(UBOOT_TAR) \
--output type=local,dest=./$(OUT_DIR) .
dpdk: $(UBOOT_TAR)
@mkdir -p $(OUT_DIR)/dpdk
docker buildx build --platform linux/arm64 \
-f docker/dpdk.Dockerfile \
--build-arg DOCKER_IMAGE_ROOT=$(DOCKER_IMAGE_ROOT) \
--build-arg TAG=$(TAG) \
--build-arg DPDK_TAR=$(DPDK_TAR) \
--output type=local,dest=./$(OUT_DIR)/dpdk .
build: .buildinfo
mkdir -p $(BIN_DIR) $(OUT_DIR)/crds
controller-gen crd paths=$(CRD_PATHS) output:crd:dir=$(OUT_DIR)/crds
@@ -73,4 +89,4 @@ clean:
all: build build-agent build-local
.PHONY: clean all run .buildinfo build build-local build-agent uboot-tools
.PHONY: clean all run .buildinfo build build-local build-agent uboot-tools dpdk