Rewrite makefile to use out/ dir

This commit is contained in:
2026-03-23 01:19:24 +08:00
parent e324969a94
commit 5d421b6743
7 changed files with 140 additions and 55 deletions

View File

@@ -1,6 +1,6 @@
ARG TAG=dev
ARG DOCKER_IMAGE_ROOT=monok8s
FROM --platform=$BUILDPLATFORM ${DOCKER_IMAGE_ROOT}/build-base:${TAG}
FROM --platform=$BUILDPLATFORM ${DOCKER_IMAGE_ROOT}/build-base:${TAG} AS build
ARG NXP_VERSION
ARG ARCH
@@ -46,3 +46,14 @@ RUN depmod -b /out/rootfs $(ls /out/rootfs/lib/modules/)
RUN find /out/kernel -name "${DEVICE_TREE_TARGET}.dtb" -exec cp {} /out/ \;
RUN test -f "/out/${DEVICE_TREE_TARGET}.dtb"
FROM scratch
ARG DEVICE_TREE_TARGET
COPY --from=build \
/out/kernel/System.map \
/out/kernel/.config \
/out/kernel/Image.gz \
/out/${DEVICE_TREE_TARGET}.dtb \
./
COPY --from=build /out/rootfs/ ./rootfs