From ed188288be72b7a3283c8922f7f74506dbf36d63 Mon Sep 17 00:00:00 2001 From: Peter McGoron Date: Fri, 2 Jun 2023 16:02:45 -0400 Subject: [PATCH] compiling opensbi --- Makefile | 13 ++++++++----- scripts/Dockerfile.litex_f4pga | 3 +-- scripts/Dockerfile.opensbi | 13 ++++++++----- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 581d0e1..9b378a6 100644 --- a/Makefile +++ b/Makefile @@ -41,12 +41,15 @@ hardware-container-clean: opensbi-container: docker run -d --name upsilon-opensbi-container upsilon-opensbi-env /bin/sh -c 'while true; do sleep 2; done' opensbi-container-copy: upsilon-opensbi.tar.gz - -docker cp upsilon-opensbi.tar.gz upsilon-opensbi-container:/home/user/upsilon-opensbi.tgz -opensbi-container-shell: - docker exec -ti upsilon-opensbi-container /bin/bash -l + -docker cp upsilon-opensbi.tar.gz upsilon-opensbi-container:/home/user/upsilon-opensbi.tar.gz +opensbi-container-execute: + docker exec -ti upsilon-opensbi-container /bin/bash -c ' \ + tar -xvf upsilon-opensbi.tar.gz; \ + cd opensbi && make CROSS_COMPILE=riscv64-linux-gnu- PLATFORM=litex/vexriscv; \ + ' opensbi-container-clean: - -docker container stop upsilon-hardware-container - -docker container rm upsilon-hardware-container + -docker container stop upsilon-opensbi-container + -docker container rm upsilon-opensbi-container ###### External projects diff --git a/scripts/Dockerfile.litex_f4pga b/scripts/Dockerfile.litex_f4pga index 71b49a5..0a58481 100644 --- a/scripts/Dockerfile.litex_f4pga +++ b/scripts/Dockerfile.litex_f4pga @@ -6,9 +6,8 @@ ENV F4PGA_INSTALL_DIR=/home/user/conda RUN apt-get update \ && apt-get -y upgrade \ && apt-get install -y git wget python3 xz-utils bash verilator \ - m4 device-tree-compiler make gcc-riscv64-unknown-elf vi \ + m4 device-tree-compiler make gcc-riscv64-unknown-elf \ && adduser --quiet --disabled-password user -EXPOSE 22 USER user:user WORKDIR /home/user diff --git a/scripts/Dockerfile.opensbi b/scripts/Dockerfile.opensbi index 1efb9f1..04e0fdd 100644 --- a/scripts/Dockerfile.opensbi +++ b/scripts/Dockerfile.opensbi @@ -2,15 +2,18 @@ FROM debian:bookworm RUN apt-get update \ && apt-get -y upgrade \ - && apt-get install -y make device-tree-compiler python3 gcc-riscv64-linux-gnu \ + && apt-get install -y make device-tree-compiler python3 \ + adduser gcc-riscv64-linux-gnu \ && adduser --quiet --disabled-password user +#RUN apt-get update \ +# && apt-get -y upgrade \ +# && apt-get install -y git wget python3 xz-utils bash verilator \ +# m4 device-tree-compiler make gcc-riscv64-unknown-elf \ +# && adduser --quiet --disabled-password user USER user:user WORKDIR /home/user COPY --chown=user:user opensbi.tar.gz /home/user -COPY --chown=user:user opensbi-platform.tar.gz /home/user RUN tar -xvf opensbi.tar.gz \ - && cd opensbi/platforms \ - && tar -xvf ~/opensbi-platform.tar.gz \ - && rm ~/opensbi.tar.gz ~/opensbi-platform.tar.gz + && rm ~/opensbi.tar.gz