mainboards: Add docker build support

Add docker build support to unify the build environment for
mainboards.

Current supported mainboards:

Signed-off-by: Chiao Yang <chiao.cs.yang@gmail.com>
Signed-off-by: KuiRong <605470060@gms.tku.edu.tw>
This commit is contained in:
Chiao Yang 2023-12-22 13:05:13 +08:00 committed by ron minnich
parent a297524f04
commit f648c93105
2 changed files with 101 additions and 0 deletions

52
mainboards/Dockerfile Normal file
View File

@ -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"]

View File

@ -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'