-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
Hi How can i load custom library using crosstto-NG ?
i tried some things more no success yet
FROM ubuntu:22.04
RUN apt-get update
RUN apt-get -y install \
gperf \
bison \
flex \
texinfo \
help2man \
gawk \
unzip \
ncurses-dev \
rsync \
zlib1g \
zlib1g-dev \
xz-utils \
cmake \
git \
wget \
bzip2 \
g++ \
python3 \
python3-dev \
python3-pip \
cpio bc \
virtualenv \
libusb-1.0 && \
ln -s /usr/bin/python3 /usr/bin/python
WORKDIR /app
# install autoconf 2.71
RUN wget https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.xz && \
tar -xf autoconf-2.71.tar.xz && \
cd autoconf-2.71 && \
./configure --prefix=`pwd`/root && \
make && \
make install
ENV PATH="$PATH:/app/autoconf-2.71/root/bin"
# dynconfig
RUN git clone https://github.com/jcmvbkbc/xtensa-dynconfig -b original --depth=1 && \
git clone https://github.com/jcmvbkbc/config-esp32s3 esp32s3 --depth=1 && \
make -C xtensa-dynconfig ORIG=1 CONF_DIR=`pwd` esp32s3.so
ENV XTENSA_GNU_CONFIG="/app/xtensa-dynconfig/esp32s3.so"
# ct-ng cannot run as root, we'll just do everything else as a user
RUN useradd -d /app/build -u 3232 esp32 && mkdir build && chown esp32:esp32 build
USER esp32
RUN TARGET=xtensa-esp32s3-linux-uclibcfdpic \
OPENSSL_TARGET=linux-generic64 \
_NUM_CPU=$(expr $(cat /proc/cpuinfo | grep processor | wc -l) - 2) \
_PWD=$(pwd) \
_CT_DIR=${_PWD}/build/crosstool-NG \
_LIB_DIR=${_PWD}/libs \
_OUT_DIR=${_CT_DIR}/builds
# toolchain
RUN cd build && \
git clone https://github.com/jcmvbkbc/crosstool-NG.git -b xtensa-fdpic --depth=1 && \
cd crosstool-NG && \
./bootstrap && \
./configure --enable-local --prefix=${DSTDIR} --host=xtensa-esp32s3-linux-uclibcfdpic && \
make && \
./ct-ng xtensa-esp32s3-linux-uclibcfdpic && \
CT_PREFIX=`pwd`/builds ./ct-ng build || echo "Completed" # the complete ct-ng build fails but we still get what we wanted!
#RUN [ -e build/crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic/bin/xtensa-esp32s3-linux-uclibcfdpic-gcc ] || exit 1
USER root
RUN DSTDIR="${_OUT_DIR}/$TARGET" \
mkdir -p ${DSTDIR}/usr/local/share ${DSTDIR}/usr/local/include \
export cross=${TARGET}- \
export CC="${cross}gcc" \
export PATH=$PATH:${_CT_DIR}/builds/${TARGET}/bin/
RUN cd build && \
apt-get -y install \
build-essential \
pkg-config \
checkinstall \
autoconf \
automake \
libtool-bin \
libusbmuxd-dev \
libssl-dev \
libcurl4-openssl-dev \
usbmuxd
RUN cd build && \
git clone https://github.com/libimobiledevice/libplist.git && \
cd libplist && \
./autogen.sh \
--host=xtensa-esp32s3-linux-uclibcfdpic \
--target=xtensa-esp32s3-linux-uclibcfdpic \
--enable-debug && \
make -j${_NUM_CPU} && \
make install
RUN cd build && \
git clone https://github.com/libimobiledevice/libimobiledevice-glue.git && \
cd libimobiledevice-glue && \
./autogen.sh --prefix=${DSTDIR} \
--host=xtensa-esp32s3-linux-uclibcfdpic \
--target=xtensa-esp32s3-linux-uclibcfdpic \
--enable-debug && \
make clean && \
make -j${_NUM_CPU} && \
make install
RUN cd build && \
git clone https://github.com/libimobiledevice/libtatsu.git && \
cd libtatsu && \
./autogen.sh --prefix=${DSTDIR} \
--host=xtensa-esp32s3-linux-uclibcfdpic \
--target=xtensa-esp32s3-linux-uclibcfdpic \
--enable-debug && \
make clean && \
make -j${_NUM_CPU} && \
make install
RUN cd build && \
git clone https://github.com/libimobiledevice/libimobiledevice.git && \
cd libimobiledevice && \
./autogen.sh --prefix=${DSTDIR} \
--host=xtensa-esp32s3-linux-uclibcfdpic \
--target=xtensa-esp32s3-linux-uclibcfdpic \
--enable-debug && \
make clean && \
make -j${_NUM_CPU} && \
make install
# kernel and rootfs
RUN cd build && \
git clone https://github.com/jcmvbkbc/buildroot -b xtensa-2024.02-fdpic --depth=1 && \
make -C buildroot O=`pwd`/build-buildroot-esp32s3 esp32s3_defconfig && \
buildroot/utils/config --file build-buildroot-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_PATH `pwd`/crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic && \
buildroot/utils/config --file build-buildroot-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_PREFIX '$(ARCH)-esp32s3-linux-uclibcfdpic' && \
buildroot/utils/config --file build-buildroot-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX '$(ARCH)-esp32s3-linux-uclibcfdpic' && \
make -C buildroot O=`pwd`/build-buildroot-esp32s3
RUN [ -f build/build-buildroot-esp32s3/images/xipImage -a -f build/build-buildroot-esp32s3/images/rootfs.cramfs -a -f build/build-buildroot-esp32s3/images/etc.jffs2 ] || exit 1
#adafruit
#
# bootloader
#
ENV IDF_PATH="/app/build/esp-hosted/esp_hosted_ng/esp/esp_driver/esp-idf"
RUN cd build && \
git clone https://github.com/jcmvbkbc/esp-hosted -b ipc && \
cd esp-hosted/esp_hosted_ng/esp/esp_driver && \
cmake . && \
cd esp-idf && \
. ./export.sh && \
cd ../network_adapter && \
idf.py set-target esp32s3 && \
cp sdkconfig.defaults.esp32s3 sdkconfig && \
idf.py build
# move files over
RUN cd build && mkdir release && \
cp esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/bootloader/bootloader.bin release && \
cp esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/partition_table/partition-table.bin release && \
cp esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/network_adapter.bin release && \
cp build-buildroot-esp32s3/images/xipImage release && \
cp build-buildroot-esp32s3/images/rootfs.cramfs release && \
cp build-buildroot-esp32s3/images/etc.jffs2 release
# keep docker running so we can debug/rebuild :)
USER root
ENTRYPOINT ["tail", "-f", "/dev/null"]
#CMD ["sh"]
#
# flash
#
# activate idf.py with . ./export.sh
# copy bootloader.bin partition-table.bin network_adapter.bin xipImage rootfs.cramfs and etc.jffs2 to your host machine
# flash bootloader, partition table and network adapter
# run container from image:
# sudo docker run --device=/dev/ttyACM0 -it esp32s3-linux
# Download Tools for ESP32S3 Flashing
# /app/build/esp-hosted/esp_hosted_ng/esp/esp_driver/esp-idf/install.sh
# esptool.py --chip esp32s3 -p /dev/ttyACM0 -b 921600 --before=default_reset --after=hard_reset write_flash 0x0 bootloader.bin 0x10000 network_adapter.bin 0x8000 partition-table.bin
# flash the system partitions
# parttool.py -p /dev/ttyACM0 -b 921600 write_partition --partition-name linux --input xipImage
# parttool.py -p /dev/ttyACM0 -b 921600 write_partition --partition-name rootfs --input rootfs.cramfs
# parttool.py -p /dev/ttyACM0 -b 921600 write_partition --partition-name etc --input etc.jffs2
I got this error now
76.32 >>> skeleton-init-sysv Installing to target
76.32 rsync -a --ignore-times --exclude .svn --exclude .git --exclude .hg --exclude .bzr --exclude CVS --chmod=u=rwX,go=rX --exclude .empty --exclude '*~' package/skeleton-init-sysv//skeleton/ /app/build/build-buildroot-esp32s3/target/
76.43 >>> skeleton Extracting
76.44 >>> skeleton Patching
76.46 >>> skeleton Configuring
76.48 >>> skeleton Building
76.50 >>> skeleton Installing to target
76.55 >>> toolchain-external-custom Extracting
76.57 >>> toolchain-external-custom Patching
76.59 >>> toolchain-external-custom Configuring
76.60 Cannot execute cross-compiler '/app/build/crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic/bin/xtensa-esp32s3-linux-uclibcfdpic-gcc'
76.60 make: *** [package/pkg-generic.mk:273: /app/build/build-buildroot-esp32s3/build/toolchain-external-custom/.stamp_configured] Error 1
76.60 make: Leaving directory '/app/build/buildroot'
Metadata
Metadata
Assignees
Labels
No labels