From 30b8dd2abe54be4a75802009fae8e3aaae00fe10 Mon Sep 17 00:00:00 2001 From: Duesentrieb71 Date: Thu, 21 Mar 2024 17:47:01 +0100 Subject: [PATCH] compiling fsbl with docker works now! See README --- Dockerfile | 52 ---------------------------------- README.md | 20 ++++++++++--- docker/compile_fsbl/Dockerfile | 15 ++++++++++ 3 files changed, 31 insertions(+), 56 deletions(-) delete mode 100644 Dockerfile create mode 100644 docker/compile_fsbl/Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index a569273..0000000 --- a/Dockerfile +++ /dev/null @@ -1,52 +0,0 @@ -FROM debian:bookworm-slim - -# Install required packages -RUN apt-get update && apt-get install -y \ - build-essential \ - cmake \ - gcc \ - g++ \ - git \ - curl \ - wget \ - make \ - openocd \ - gdb-multiarch \ - gcc-arm-none-eabi \ - fish \ - && rm -rf /var/lib/apt/lists/* - - -# Install Rust toolchain -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly -ENV PATH="/root/.cargo/bin:${PATH}" -RUN rustup target add armv7-unknown-linux-gnueabihf -RUN rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu -RUN rustup override set nightly - -# # Clone FSBL code from the Xilinx repository -# RUN git clone https://github.com/Xilinx/embeddedsw.git -# # Build the FSBL -# RUN cd embeddedsw/lib/sw_apps/zynq_fsbl/src/ && make BOARD=zed CFLAGS=-DFSBL_DEBUG_INFO - - -# RUN cd mission_rust -# RUN cargo update -# RUN cargo build -Z build-std - -# Set a working directory -# WORKDIR /workspace/mission_rust -# Assuming the Rust project is copied into the container -WORKDIR /workspace/ -COPY . . - -# Build commands can be added here if needed -# For example, to build the FSBL project: -# RUN cd embeddedsw/lib/sw_apps/zynq_fsbl/src/ && make BOARD=zed CFLAGS=-DFSBL_DEBUG_INFO - -# RUN mkdir build_cli -# RUN cd build_cli -# RUN cmake -DCMAKE_TOOLCHAIN_FILE=../bsp_z7/cmake/arm-none-eabi.toolchain .. - -# Set the entrypoint to a shell -ENTRYPOINT ["/usr/bin/fish"] diff --git a/README.md b/README.md index d2c9129..35146b2 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,22 @@ # FSBL +## Build with Docker -FSBL code is at https://github.com/Xilinx/embeddedsw/ - -there: ```sh -cd lib/sw_apps/zynq_fsbl/src/ && make BOARD=zed CFLAGS=-DFSBL_DEBUG_INFO +cd docker/compile_fsbl/ +git clone https://github.com/Xilinx/embeddedsw/ +docker build -t compile_fsbl . +``` +docker build might fail because of firewall settings or the IRS wireguard VPN. + + +To build the FSBL, run the following command in the `docker/compile-fsbl` directory: +```sh +docker run -v ./embeddedsw:/project compile_fsbl /bin/bash -c "cd lib/sw_apps/zynq_fsbl/src && make BOARD=zed SHELL=/bin/bash" +``` + +If you want, copy the FSBL.elf to the docker/compile_fsbl directory for easier access: +```sh +cp embeddedsw/lib/sw_apps/zynq_fsbl/src/fsbl.elf . ``` # Building diff --git a/docker/compile_fsbl/Dockerfile b/docker/compile_fsbl/Dockerfile new file mode 100644 index 0000000..b61ce0d --- /dev/null +++ b/docker/compile_fsbl/Dockerfile @@ -0,0 +1,15 @@ +FROM debian:12.5 + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN apt-get update && apt-get install -y \ + make \ + cmake \ + gcc-arm-none-eabi \ + && rm -rf /var/lib/apt/lists/* + # Remove the package lists to reduce the image size + + +WORKDIR /project/ +