From f648c931057a040bdb8acdf4c45bf2df8b113b18 Mon Sep 17 00:00:00 2001 From: Chiao Yang Date: Fri, 22 Dec 2023 13:05:13 +0800 Subject: [PATCH] mainboards: Add docker build support Add docker build support to unify the build environment for mainboards. Current supported mainboards: Signed-off-by: Chiao Yang Signed-off-by: KuiRong <605470060@gms.tku.edu.tw> --- mainboards/Dockerfile | 52 +++++++++++++++++++++++++++++++++++++++++++ mainboards/Makefile | 49 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 mainboards/Dockerfile diff --git a/mainboards/Dockerfile b/mainboards/Dockerfile new file mode 100644 index 0000000..84365c1 --- /dev/null +++ b/mainboards/Dockerfile @@ -0,0 +1,52 @@ +FROM ubuntu:latest + + +LABEL description="Build environment for Linuxboot mainboards" + +# Working directory for mounting git repo in +RUN mkdir /linuxboot-mainboards +WORKDIR /linuxboot-mainboards + +# Install dependencies +RUN apt-get update +RUN apt-get install -y \ + gcc-aarch64-linux-gnu \ + gcc-arm-linux-gnueabi \ + gcc-arm-linux-gnueabihf \ + gcc-riscv64-linux-gnu \ + libelf-dev \ + u-boot-tools \ + acpica-tools \ + bc \ + bison \ + build-essential \ + cpio \ + flex \ + kmod \ + libncurses5-dev \ + libssl-dev \ + nasm \ + qemu-system \ + uuid-dev \ + wget \ + git \ + ssh + +# install golang +RUN wget https://go.dev/dl/go1.21.5.linux-amd64.tar.gz +RUN rm -rf /usr/local/go && \ + tar -C /usr/local -xzf go1.21.5.linux-amd64.tar.gz +ENV GOPATH="/root/go" +ENV GOROOT="/usr/local/go" +ENV PATH="$PATH:/root/go/bin:/usr/local/go/bin" +RUN go env -w GO111MODULE=off + + +# Fake sshkey +RUN mkdir ~/.ssh && touch ~/.ssh/cpu_rsa.pub +# RUN touch tyan7106/key.pub +# RUN touch tyan7106/ssh_host_rsa_key + + + +ENTRYPOINT ["/bin/bash", "-l", "-c"] \ No newline at end of file diff --git a/mainboards/Makefile b/mainboards/Makefile index c8fee15..669c41d 100644 --- a/mainboards/Makefile +++ b/mainboards/Makefile @@ -1,3 +1,5 @@ +CONTAINER_NAME := linuxboot-mainboards + all: echo pick one of debian-packages or repos @@ -11,3 +13,50 @@ getmecleaner: go get -u github.com/u-root/cpu/... git clone https://github.com/corna/me_cleaner @echo Now add $(PWD)/me_cleaner to PATH + + +docker-build: Dockerfile + docker build -t $(CONTAINER_NAME) -f $< . + +docker-run-aeeon-up: docker-build + docker run --rm -v "$(shell pwd)/aeeon/up":/$(CONTAINER_NAME) $(CONTAINER_NAME) 'make fetch flashkernel' + + +docker-run-aeeon-upxtreme: docker-build + docker run --rm -v "$(shell pwd)/aeeon/upxtreme":/$(CONTAINER_NAME) $(CONTAINER_NAME) 'make fetch flashkernel' + +docker-run-bytedance-g220a: docker-build + docker run --rm -v "$(shell pwd)/bytedance/g220a":/$(CONTAINER_NAME) $(CONTAINER_NAME) 'make fetch flashkernel' + +docker-run-digitallogger-atomicpi: docker-build + docker run --rm -v "$(shell pwd)/digitalloggers/atomicpi":/$(CONTAINER_NAME) $(CONTAINER_NAME) 'make fetch flashkernel' + +docker-run-amd-rome: docker-build + docker run --rm -v "$(shell pwd)/amd/rome":/$(CONTAINER_NAME) $(CONTAINER_NAME) 'make fetch flashkernel' + +docker-run-ampere-jade: docker-build + docker run --rm -v "$(shell pwd)/ampere/jade":/$(CONTAINER_NAME) $(CONTAINER_NAME) 'make fetch flashkernel' + +docker-run-cubie-board: docker-build + docker run --rm -v "$(shell pwd)/cubie/board":/$(CONTAINER_NAME) $(CONTAINER_NAME) 'make fetch flashkernel' + +docker-run-intel-hw: docker-build + docker run --rm -v "$(shell pwd)/intel/hw":/$(CONTAINER_NAME) $(CONTAINER_NAME) 'make fetch flashkernel' + +docker-run-intel-s2600: docker-build + docker run --rm -v "$(shell pwd)/intel/s2600":/$(CONTAINER_NAME) $(CONTAINER_NAME) 'make fetch flashkernel' + +docker-run-lenovo-sr630: docker-build + docker run --rm -v "$(shell pwd)/lenovo/sr630":/$(CONTAINER_NAME) $(CONTAINER_NAME) 'make fetch flashkernel' + +docker-run-marvel-macchiatobin: docker-build + docker run --rm -v "$(shell pwd)/marvel/macchiatobin":/$(CONTAINER_NAME) $(CONTAINER_NAME) 'make fetch flashkernel' + +docker-run-opentitanpilot-dresden: docker-build + docker run --rm -v "$(shell pwd)/opentitanpilot/dresden":/$(CONTAINER_NAME) $(CONTAINER_NAME) 'make fetch flashkernel' + +docker-run-pcengines-apu2: docker-build + docker run --rm -v "$(shell pwd)/pcengines/apu2":/$(CONTAINER_NAME) $(CONTAINER_NAME) 'make fetch flashkernel' + +docker-run-qemu-x86-64: docker-build + docker run --rm -v "$(shell pwd)/qemu/x86_64":/$(CONTAINER_NAME) $(CONTAINER_NAME) 'make fetch flashkernel' \ No newline at end of file