spiri-project/Dockerfile

37 lines
1.6 KiB
Docker

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/
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 LINUX_FOR_TEGRA /jetson/Linux_for_Tegra
ENV KERNEL_LOCATION_FROM_BUILD_DIR ../../spiri-project/source/Jetpack/kernel/kernel-4.9/
ENV KERNEL_LOCATION $KERNEL_LOCATION_FROM_BUILD_DIR
COPY ./ /jetson/Linux_for_Tegra/spiri-project
WORKDIR /jetson/Linux_for_Tegra/spiri-project/CTI-L4T/
RUN ./install.sh
RUN mkdir -p /jetson/Linux_for_Tegra/builds/build_tx2/build
WORKDIR /jetson/Linux_for_Tegra/builds/build_tx2/
RUN make -C $KERNEL_LOCATION ARCH=arm64 O=$PWD/build/ tegra_defconfig
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/lib/modules/
FROM --platform=linux/arm64 scratch
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 /build/boot/
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