Build faster, include modules

This commit is contained in:
Alex Davies 2024-02-02 16:03:30 -04:00
parent 603c6ab8e4
commit 0227ec7804
1 changed files with 13 additions and 5 deletions

View File

@ -1,5 +1,8 @@
from --platform=linux/amd64 git.spirirobotics.com/spiri/tx2-flashing-tool:main as kernel-build from --platform=linux/amd64 git.spirirobotics.com/spiri/tx2-flashing-tool:main as kernel-build
RUN apt-get update
RUN apt-get install -y ripgrep
ADD ./source/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz /opt/gcc-linaro-7.3.1/ ADD ./source/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz /opt/gcc-linaro-7.3.1/
ENV CROSS_COMPILE /opt/gcc-linaro-7.3.1/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- ENV CROSS_COMPILE /opt/gcc-linaro-7.3.1/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
@ -16,13 +19,18 @@ RUN mkdir -p /jetson/Linux_for_Tegra/builds/build_tx2/build
WORKDIR /jetson/Linux_for_Tegra/builds/build_tx2/ WORKDIR /jetson/Linux_for_Tegra/builds/build_tx2/
RUN make -C $KERNEL_LOCATION ARCH=arm64 O=$PWD/build/ tegra_defconfig RUN make -C $KERNEL_LOCATION ARCH=arm64 O=$PWD/build/ tegra_defconfig
RUN make -C $KERNEL_LOCATION ARCH=arm64 O=$PWD/build/ CROSS_COMPILE=${CROSS_COMPILE} -j8 --output-sync=target zImage dtbs modules RUN nice make -C $KERNEL_LOCATION ARCH=arm64 O=$PWD/build/ CROSS_COMPILE=${CROSS_COMPILE} -j$(nproc --ignore 2) --output-sync=target zImage dtbs modules
#Fail if we're missing either of these kenel module
RUN rg mt9m021 build/arch/arm64/boot/Image
RUN rg eg25-g build/arch/arm64/boot/Image
RUN mkdir -p /build/boot/ RUN mkdir -p /build/boot/
RUN mkdir -p /build/lib/modules/ RUN mkdir -p /build/lib/modules/
from --platform=linux/arm64 scratch FROM --platform=linux/arm64 scratch
COPY --from=kernel-build /jetson/Linux_for_Tegra/builds/build_tx2/build/arch/arm64/boot/Image /boot/spiriImage COPY --from=kernel-build /jetson/Linux_for_Tegra/builds/build_tx2/build/arch/arm64/boot/Image /build/boot/spiriImage
COPY --from=kernel-build /jetson/Linux_for_Tegra/builds/build_tx2/build/arch/arm64/boot/dts/tegra186-tx2-spiri-revF+.dtb /boot/ COPY --from=kernel-build /jetson/Linux_for_Tegra/builds/build_tx2/build/arch/arm64/boot/dts/tegra186-tx2-spiri-revF+.dtb /build/boot/
COPY ./extlinux.conf /boot/extlinux/extlinux.conf COPY --from=kernel-build /jetson/Linux_for_Tegra/builds/build_tx2/build/build/drivers/ /build/lib/modules
COPY ./extlinux.conf /build/boot/extlinux/extlinux.conf