Skip to content

Instantly share code, notes, and snippets.

@rena2019
Last active June 15, 2023 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rena2019/53d62b4e33da360846a983310002c658 to your computer and use it in GitHub Desktop.
Save rena2019/53d62b4e33da360846a983310002c658 to your computer and use it in GitHub Desktop.
Dockerfile for Linux @ ESP32-S3
# Booting linux on ESP32s3
# http://wiki.osll.ru/doku.php/etc:users:jcmvbkbc:linux-xtensa:esp32s3
#################
# docker build -t esp32linux -f Dockerfile .
# docker run -it --name esp32linux esp32linux
FROM ubuntu:22.04
# ubuntu:20.04 does not work because autoconf 2.xx ist required
RUN apt-get update && apt-get install git build-essential autoconf flex texinfo unzip help2man file gawk wget bison libncurses-dev -y
WORKDIR /myapp
#ubuntu 22.04: libtool 2.4.6-15build2
RUN wget http://ftp.gnu.org/gnu/libtool/libtool-2.4.7.tar.gz
RUN tar -xvf libtool-2.4.7.tar.gz
WORKDIR /myapp/libtool-2.4.7
RUN ./configure --disable-static
RUN make
RUN make install
RUN ./libtool --version
WORKDIR /myapp
RUN git clone https://github.com/jcmvbkbc/xtensa-dynconfig -b original
RUN git clone https://github.com/jcmvbkbc/config-esp32s3 esp32s3
RUN make -C xtensa-dynconfig ORIG=1 CONF_DIR=`pwd` esp32s3.so
RUN export XTENSA_GNU_CONFIG=`pwd`/xtensa-dynconfig/esp32s3.so # make sure this environment variable is set for all commands involving building or using the toolchain
# https://crosstool-ng.github.io/
RUN git clone https://github.com/jcmvbkbc/crosstool-NG.git -b xtensa-fdpic
#pushd crosstool-NG
WORKDIR /myapp/crosstool-NG
RUN ./bootstrap && ./configure --enable-local && make
RUN ./ct-ng xtensa-esp32s3-linux-uclibcfdpic
# [ERROR] You must NOT be root to run crosstool-NG
# CT_ALLOW_BUILD_AS_ROOT=y CT_ALLOW_BUILD_AS_ROOT_SURE=y
RUN CT_PREFIX=`pwd`/builds CT_ALLOW_BUILD_AS_ROOT=y CT_ALLOW_BUILD_AS_ROOT_SURE=y nice ./ct-ng build
#popd
WORKDIR /myapp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment