From beeb9a5b91c69187e8419c66e2cae7d557956819 Mon Sep 17 00:00:00 2001 From: Peter McGoron Date: Tue, 20 Jun 2023 13:09:27 -0400 Subject: [PATCH] rename hardware docker file --- build/Dockerfile.hardware | 42 +++++++++++++++++++++++++++++++++++++++ build/Makefile | 7 +++---- 2 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 build/Dockerfile.hardware diff --git a/build/Dockerfile.hardware b/build/Dockerfile.hardware new file mode 100644 index 0000000..e89d901 --- /dev/null +++ b/build/Dockerfile.hardware @@ -0,0 +1,42 @@ +# Copyright 2023 (C) Peter McGoron +# +# This file is a part of Upsilon, a free and open source software project. +# For license terms, refer to the files in `doc/copying` in the Upsilon +# source distribution. + +FROM debian:bookworm + +ENV FPGA_FAM=xc7 +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 \ + && adduser --quiet --disabled-password user + +USER user:user +WORKDIR /home/user + +# F4PGA +COPY --chown=user:user install_f4pga_defs.sh /home/user +RUN chmod +x install_f4pga_defs.sh \ + && ./install_f4pga_defs.sh \ + && echo 'source ~/conda/xc7/conda/etc/profile.d/conda.sh' >> /home/user/.bashrc \ + && echo 'conda activate xc7' >> /home/user/.bashrc \ + && rm install_f4pga_defs.sh + +COPY --chown=user:user f4pga.tar.gz /home/user +RUN tar -xvf f4pga.tar.gz \ + && rm f4pga.tar.gz \ + && cd f4pga/f4pga \ + && bash -c 'source ~/conda/xc7/conda/etc/profile.d/conda.sh; conda activate xc7; pip install . ninja meson' + +#LITEX +COPY --chown=user:user litex/litex_setup.py /home/user +RUN mkdir /home/user/litex \ + && chmod +x litex_setup.py \ + && cd litex/ \ + && bash -c 'source ~/conda/xc7/conda/etc/profile.d/conda.sh; conda activate xc7; ../litex_setup.py --init --install --user --tag=2023.04' \ + && rm ../litex_setup.py + diff --git a/build/Makefile b/build/Makefile index 41a2121..9f3adc9 100644 --- a/build/Makefile +++ b/build/Makefile @@ -5,8 +5,7 @@ # source distribution. .PHONY: images f4pga buildroot litex clone help attach hardware-image \ - buildroot-image litex-f4pga-image \ - upsilon-hardware.tar.gz upsilon-opensbi.tar.gz upsilon-buildroot.tar.gz + buildroot-image upsilon-hardware.tar.gz upsilon-opensbi.tar.gz upsilon-buildroot.tar.gz ###### Images @@ -19,9 +18,9 @@ images: hardware-image buildroot-image opensbi-image ### Hardware container hardware-image: - docker build -f Dockerfile.litex_f4pga -t "upsilon-litex-f4pga-env" . + docker build -f Dockerfile.hardware -t "upsilon-hardware-env" . hardware-container: - docker run -d --name upsilon-hardware upsilon-litex-f4pga-env /bin/sh -c 'while true; do sleep 2; done' + docker run -d --name upsilon-hardware upsilon-hardware-env /bin/sh -c 'while true; do sleep 2; done' hardware-copy: upsilon-hardware.tar.gz # XXX: this always fails if there are very high UIDs, but the # file is copied successfully.