Skip to content

libimbiledevice how add this lib cross tool-ng ? #80

@ligteltelecom

Description

@ligteltelecom

Hi. can someany help me? need add this lib libimobiledevice in kernel linux

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

# 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 && \
    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

# kernel and rootfs
#RUN cd build && \
#    git clone https://github.com/jcmvbkbc/buildroot -b xtensa-2023.02-fdpic --depth=1 && \
#    make -C buildroot O=`pwd`/build-xtensa-2023.02-fdpic-esp32s3 esp32s3wifi_defconfig && \
#    buildroot/utils/config --file build-xtensa-2023.02-fdpic-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_PATH `pwd`/crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic && \
#    buildroot/utils/config --file build-xtensa-2023.02-fdpic-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_PREFIX '$(ARCH)-esp32s3-linux-uclibcfdpic' && \
#    buildroot/utils/config --file build-xtensa-2023.02-fdpic-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX '$(ARCH)-esp32s3-linux-uclibcfdpic' && \
#    make -C buildroot O=`pwd`/build-xtensa-2023.02-fdpic-esp32s3

RUN cd build && \ 
	git clone https://github.com/jcmvbkbc/buildroot -b xtensa-2024.02-fdpic && \
	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-xtensa-2023.02-fdpic-esp32s3/images/etc.jffs2 ] || exit 1


# 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 shmem --depth=1 && \
    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-xtensa-2023.02-fdpic-esp32s3/images/xipImage release && \
    cp build-xtensa-2023.02-fdpic-esp32s3/images/rootfs.cramfs release && \
    cp build-xtensa-2023.02-fdpic-esp32s3/images/etc.jffs2 release



# keep docker running so we can debug/rebuild :)
USER root
ENTRYPOINT ["tail", "-f", "/dev/null"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions