1FROM ubuntu:22.04 2 3COPY scripts/cross-apt-packages.sh /scripts/ 4RUN sh /scripts/cross-apt-packages.sh 5 6COPY scripts/crosstool-ng.sh /scripts/ 7RUN sh /scripts/crosstool-ng.sh 8 9COPY scripts/rustbuild-setup.sh /scripts/ 10RUN sh /scripts/rustbuild-setup.sh 11WORKDIR /tmp 12 13COPY scripts/crosstool-ng-build.sh /scripts/ 14COPY host-x86_64/dist-mips-linux/patches/ /tmp/patches/ 15COPY host-x86_64/dist-mips-linux/mips-linux-gnu.defconfig /tmp/crosstool.defconfig 16RUN /scripts/crosstool-ng-build.sh 17 18COPY scripts/sccache.sh /scripts/ 19RUN sh /scripts/sccache.sh 20 21ENV PATH=$PATH:/x-tools/mips-unknown-linux-gnu/bin 22 23ENV \ 24 CC_mips_unknown_linux_gnu=mips-unknown-linux-gnu-gcc \ 25 AR_mips_unknown_linux_gnu=mips-unknown-linux-gnu-ar \ 26 CXX_mips_unknown_linux_gnu=mips-unknown-linux-gnu-g++ 27 28ENV HOSTS=mips-unknown-linux-gnu 29 30ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs 31ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS 32