Skip to content

Instantly share code, notes, and snippets.

@tttapa
Created April 17, 2019 22:43
Show Gist options
  • Save tttapa/d8fae51bd1234c6afc5230043ec16edf to your computer and use it in GitHub Desktop.
Save tttapa/d8fae51bd1234c6afc5230043ec16edf to your computer and use it in GitHub Desktop.
Docker build crosstools-NG
# https://solarianprogrammer.com/2018/05/06/building-gcc-cross-compiler-raspberry-pi/
# Ubuntu 18.04 at the time of writing (2019-04-02)
FROM ubuntu:latest
# Install some tools and compilers + clean up
RUN apt-get update && \
apt-get install -y git wget \
gcc g++ cmake make autoconf automake gperf diffutils bzip2 xz-utils \
flex gawk help2man libncurses-dev patch bison python-dev gnupg2 texinfo unzip libtool-bin && \
apt-get clean autoclean && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
# Add a user called `develop`
RUN useradd -ms /bin/bash develop
RUN echo "develop ALL=(ALL:ALL) ALL" >> /etc/sudoers
USER develop
WORKDIR /home/develop
ENV VERSION=1.24.0
# RUN wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-$VERSION.tar.bz2
# RUN gpg --keyserver http://pgp.surfnet.nl --recv-keys 35B871D1 11D618A4
# RUN wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-$VERSION.tar.bz2.sig
# RUN gpg --verify crosstool-ng-$VERSION.tar.bz2.sig
# RUN tar -xjf crosstool-ng-$VERSION.tar.bz2
# WORKDIR /home/develop/crosstool-ng-${VERSION}
RUN git clone https://github.com/crosstool-ng/crosstool-ng.git
WORKDIR /home/develop/crosstool-ng
RUN git checkout crosstool-ng-${VERSION}
RUN ./bootstrap
RUN ./configure --prefix=/home/develop/.local
RUN make -j$(nproc)
RUN make install
ENV PATH=/home/develop/.local/bin:$PATH
RUN ct-ng --version
WORKDIR /home/develop
RUN wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.4.tar.xz
RUN mkdir /home/develop/ZYBO
WORKDIR /home/develop/ZYBO
COPY --chown=develop:develop config .config
RUN ls -al
RUN ct-ng build
ENV PATH=/home/develop/x-tools/arm-cortexa9_neon-linux-gnueabihf:$PATH
# ARG WORKSPACE_ROOT
# VOLUME ${WORKSPACE_ROOT}
# WORKDIR ${WORKSPACE_ROOT}/build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment