diff --git a/rasbian-image/docker-compose.everest-core.yml b/rasbian-image/docker-compose.everest-core.yml new file mode 100644 index 00000000..58996092 --- /dev/null +++ b/rasbian-image/docker-compose.everest-core.yml @@ -0,0 +1,15 @@ +version: "3" + +services: + everest-core: + container_name: everest-core + build: + dockerfile: "everest-core.dockerfile" + # deploy: + # resources: + # limits: + # cpus: "4" + # memory: "1024M" + + stdin_open: true + tty: true diff --git a/rasbian-image/docker-compose.qemu-raspbian.yml b/rasbian-image/docker-compose.qemu-raspbian.yml new file mode 100644 index 00000000..3cb14d32 --- /dev/null +++ b/rasbian-image/docker-compose.qemu-raspbian.yml @@ -0,0 +1,21 @@ +version: "3" +services: + qemu: + container_name: qemu-raspbian + image: qemux/qemu-arm + volumes: + - /path/to/1688039802-2023-06-29-belaybox.img:/storage/boot.iso + environment: + # BOOT: "https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/aarch64/alpine-virt-3.19.1-aarch64.iso" + KVM: "N" + # RAM_SIZE: "2G" + # CPU_CORES: "4" + # DISK_SIZE: "64G" + # devices: + # - /dev/kvm + cap_add: + - NET_ADMIN + ports: + - 8006:8006 + stop_grace_period: 2m + restart: on-failure diff --git a/rasbian-image/docker-compose.raspbian-dockerpi.yml b/rasbian-image/docker-compose.raspbian-dockerpi.yml new file mode 100644 index 00000000..0d6878ae --- /dev/null +++ b/rasbian-image/docker-compose.raspbian-dockerpi.yml @@ -0,0 +1,15 @@ +version: "3" + +services: + raspbian-everest: + container_name: raspbian-everest + image: lukechilds/dockerpi:vm + volumes: + - /path/to/1688039802-2023-06-29-belaybox.img:/sdcard/filesystem.img + # deploy: + # resources: + # limits: + # cpus: "4" + # memory: "1024M" + stdin_open: true + tty: true diff --git a/rasbian-image/docker-compose.raspbian-stretch-everest.yml b/rasbian-image/docker-compose.raspbian-stretch-everest.yml new file mode 100644 index 00000000..12b0fd8b --- /dev/null +++ b/rasbian-image/docker-compose.raspbian-stretch-everest.yml @@ -0,0 +1,15 @@ +version: "3" + +services: + raspbian-everest: + container_name: raspbian-everest + build: + dockerfile: "raspbian-everest.dockerfile" + # deploy: + # resources: + # limits: + # cpus: "4" + # memory: "1024M" + + stdin_open: true + tty: true diff --git a/rasbian-image/everest-core.dockerfile b/rasbian-image/everest-core.dockerfile new file mode 100644 index 00000000..f345f4b4 --- /dev/null +++ b/rasbian-image/everest-core.dockerfile @@ -0,0 +1,63 @@ +FROM ubuntu:latest + +RUN apt update && apt-get install sudo curl -y + +# setup clang format +RUN apt install clang-format-12 -y +RUN update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-12 100 + +# setup nodejs v21 +RUN curl -fsSL https://deb.nodesource.com/setup_21.x | sudo -E bash - && sudo apt-get install -y nodejs + +# install dependencies +RUN sudo apt install -y python3-pip git rsync wget cmake doxygen graphviz build-essential clang-tidy cppcheck openjdk-17-jdk \ + libboost-all-dev libssl-dev libsqlite3-dev rfkill libpcap-dev libevent-dev pkg-config libcap-dev zip +# note, removed the following packages from this command: npm docker docker-compose nodejs curl + +# install python dependencies +RUN python3 -m pip install --upgrade pip setuptools wheel jstyleson jsonschema + +# download EDM source files +RUN git clone https://github.com/EVerest/everest-dev-environment.git + +# install EDM +RUN cd everest-dev-environment/dependency_manager && python3 -m pip install . + +# add /home/USER/.local/bin and CPM_SOURCE_CACHE to $PATH +ENV PATH=$PATH:/home/$(whoami)/.local/bin +ENV CPM_SOURCE_CACHE=$HOME/.cache/CPM + +# setup EVerest workspace: +RUN cd everest-dev-environment/dependency_manager && edm init --workspace ~/checkout/everest-workspace + +# install ev-cli +RUN cd ~/checkout/everest-workspace/everest-utils/ev-dev-tools && python3 -m pip install . + +# install the required packages for ISO15118 communication +RUN cd ~/checkout/everest-workspace/Josev && python3 -m pip install -r requirements.txt + +# build EVerest +RUN mkdir -p ~/checkout/everest-workspace/everest-core/build \ + && cd ~/checkout/everest-workspace/everest-core/build \ + && cmake .. \ + && make install + +# download and untar the bullseye-toolchain +RUN wget http://build.pionix.de:8888/release/toolchains/bullseye-toolchain.tgz && tar xfz bullseye-toolchain.tgz +RUN rm bullseye-toolchain.tgz + +# cross-compile by changing the given paths accordingly and build EVerest +RUN cd ~/checkout/everest-workspace/everest-core \ + && cmake \ + -DCMAKE_TOOLCHAIN_FILE=/bullseye-toolchain/toolchain.cmake \ + -DCMAKE_INSTALL_PREFIX=/mnt/user_data/opt/everest \ + -S . -B build-cross \ + && make -C build-cross \ + && make DESTDIR=./dist -C build-cross install +# && make -j$(nproc) -C build-cross \ +# && make -j$(nproc) DESTDIR=./dist -C build-cross install + +RUN cd ~/checkout/everest-workspace/everest-core/build-cross/dist/mnt/user_data/opt/ && \ + zip -r /everest.zip everest + +ENTRYPOINT ["/bin/bash"] \ No newline at end of file diff --git a/rasbian-image/raspbian-everest.dockerfile b/rasbian-image/raspbian-everest.dockerfile new file mode 100644 index 00000000..013d818c --- /dev/null +++ b/rasbian-image/raspbian-everest.dockerfile @@ -0,0 +1,18 @@ +FROM raspbian/stretch:latest + +# copy everest binaries +COPY everest.zip /everest.zip + +# add legacy sources +RUN rm /etc/apt/sources.list +COPY sources.list /etc/apt/sources.list + +# install dependencies +RUN apt-get update && apt-get install zip -y + +# unzip everest binaries into the recommended directory +RUN mkdir -p /mnt/user_data/opt/ +RUN unzip everest.zip -d /mnt/user_data/opt/ +RUN rm everest.zip + +ENTRYPOINT ["/bin/sh"] \ No newline at end of file diff --git a/rasbian-image/sources.list b/rasbian-image/sources.list new file mode 100644 index 00000000..0ba80246 --- /dev/null +++ b/rasbian-image/sources.list @@ -0,0 +1 @@ +deb http://legacy.raspbian.org/raspbian/ stretch main contrib non-free rpi firmware \ No newline at end of file