Rewrite makefile to use out/ dir
This commit is contained in:
@@ -1,11 +1,5 @@
|
||||
ARG TAG=dev
|
||||
ARG DOCKER_IMAGE_ROOT=monok8s
|
||||
FROM --platform=$BUILDPLATFORM ${DOCKER_IMAGE_ROOT}/kernel-build:${TAG} AS kernel
|
||||
|
||||
# Selective mods
|
||||
RUN mkdir /out/selected-mods
|
||||
COPY initramfs/selective-mods.sh /
|
||||
RUN /selective-mods.sh /out/rootfs/lib/modules/$(ls /out/rootfs/lib/modules/) /out/selected-mods
|
||||
|
||||
FROM --platform=$BUILDPLATFORM ${DOCKER_IMAGE_ROOT}/build-base:${TAG} AS build
|
||||
|
||||
@@ -35,7 +29,11 @@ COPY initramfs/init init
|
||||
RUN chmod +x init
|
||||
RUN mkdir -p bin sbin etc proc sys dev lib usr/bin usr/sbin
|
||||
|
||||
COPY --from=kernel /out/selected-mods/* ./lib/
|
||||
# Selective mods
|
||||
RUN mkdir -p /out/selected-mods /out/kernel
|
||||
COPY initramfs/selective-mods.sh /
|
||||
COPY out/rootfs /out/rootfs
|
||||
RUN /selective-mods.sh /out/rootfs/lib/modules/$(ls /out/rootfs/lib/modules/) ./lib/
|
||||
|
||||
RUN find . -print0 | cpio --null -ov --format=newc | gzip -9 > ../initramfs.cpio.gz
|
||||
|
||||
|
||||
@@ -10,11 +10,11 @@ ARG DEVICE_TREE_TARGET
|
||||
RUN mkdir /image
|
||||
WORKDIR /image
|
||||
|
||||
COPY --from=kernel /out/kernel/Image.gz ./Image.gz
|
||||
COPY --from=kernel /out/kernel/System.map ./
|
||||
COPY --from=kernel /out/kernel/.config ./
|
||||
COPY --from=fit /out/initramfs.cpio.gz ./
|
||||
COPY --from=kernel /out/${DEVICE_TREE_TARGET}.dtb ./
|
||||
COPY [ "./out/Image.gz" \
|
||||
, "./out/System.map" \
|
||||
, "./out/.config" \
|
||||
, "./out/initramfs.cpio.gz" \
|
||||
, "./out/${DEVICE_TREE_TARGET}.dtb", "./" ]
|
||||
|
||||
COPY ./board.its ./_board.its
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
ARG RELEASE_IMAGE
|
||||
FROM scratch
|
||||
|
||||
COPY --from artifacts $RELEASE_IMAGE /$RELEASE_IMAGE
|
||||
Reference in New Issue
Block a user