Skip to content

Commit b03fdf9

Browse files
chore: build updates; ubuntu 22.04, remove svn, Makefile feature-flags, re-add Dockerfile
git submodule updates to reflect latest from https://github.com/netbootxyz/pipxe svn on github has been deprecated, see: https://github.blog/2023-01-20-sunsetting-subversion-support/ re-create Dockerfile for easier local testing (use ubuntu:22.04 to mimic github's runner) use latest supported github ubuntu version (currently 22.04); include hack to use latest mtools version (currently 4.0.43) - ubuntu 22.04's mtools (version 4.0.32) contains crash-bug include c compile flag fixes in Makefile (since git modules are not yet updated) ( TODO: verify if needed after git submodule updates ) Makefile has a few environment switches: - RPI_MAJ_VER: [ 3 | default: 4 ] # inspired by netbootxyz, influences IPXE_TGT and output img/zip names - BOOTLOADER_FILENAME: example.ipxe # inspired by netbootxyz, ipxe file to embed - TRUST_FILES: example1.crt,example2.crt # inspired by netbootxyz, adds cert data
1 parent a93262a commit b03fdf9

File tree

9 files changed

+309
-36
lines changed

9 files changed

+309
-36
lines changed

.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#**/.git
2+
3+
#edk2/*
4+
#edk2-non-osi/*
5+
#edk2-platforms/*
6+
#ipxe/*
7+
8+
outs/*
9+
sdcard_rpi*.img
10+
sdcard_rpi*.zip

.github/workflows/build.yml

Lines changed: 88 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,80 @@ jobs:
66

77
build:
88
name: Build
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-22.04
1010
steps:
1111

1212
- name: Check out code
1313
uses: actions/checkout@v2
1414

15+
- name: "mtools hack (for ubuntu 22.04): set apt default-release to DISTRIB_CODENAME from lsb-release"
16+
run: |
17+
echo "Distrib Codename: $(sed -r -n 's/DISTRIB_CODENAME=(.*)/\1/p' /etc/lsb-release)"
18+
FILE=$(printf 'APT\n{\n Default-Release "%s";\n}\n' "$(sed -r -n 's/DISTRIB_CODENAME=(.*)/\1/p' /etc/lsb-release)" )
19+
echo "$FILE" | sudo dd of=/etc/apt/apt.conf.d/01-default-release
20+
21+
- name: "mtools hack (for ubuntu 22.04): add apt source for noble"
22+
run: |
23+
FILE=$(printf '%s\ndeb http://security.ubuntu.com/ubuntu noble main\n' "$(cat /etc/apt/sources.list)" )
24+
echo "$FILE" | sudo dd of=/etc/apt/sources.list
25+
26+
- name: "mtools hack (for ubuntu 22.04): mtools package-pin to noble"
27+
run: |
28+
FILE=$(printf 'Package: mtools\nPin: release n=noble\nPin-Priority: 995\n')
29+
echo "$FILE" | sudo dd of=/etc/apt/preferences.d/01-mtools
30+
31+
32+
#- name: python hack (for ubuntu 22.04): ensure python exists in PATH as symlink to python3
33+
# run: sudo ln -sf $(which python3) $(which python3 | sed 's/3//g')
34+
35+
1536
- name: Install packages
1637
run: |
1738
sudo apt update
1839
sudo apt install -y -o Acquire::Retries=50 \
19-
gcc-aarch64-linux-gnu iasl mtools subversion \
20-
lzma-dev uuid-dev
40+
gcc-aarch64-linux-gnu iasl mtools \
41+
lzma-dev uuid-dev zip
2142
2243
- name: Sources (git)
2344
run: |
2445
make submodules
2546
26-
- name: Sources (subversion)
47+
- name: Sources (git sparce-checkout)
2748
run: |
2849
make firmware
2950
30-
- name: Build (EFI)
51+
52+
- name: Build (EFI) (rpi3)
53+
run: |
54+
make efi -e RPI_MAJ_VER=3
55+
56+
- name: Build (iPXE) (rpi3)
3157
run: |
32-
make efi
58+
make ipxe -j 4 -e RPI_MAJ_VER=3
3359
34-
- name: Build (iPXE)
60+
- name: SD card (rpi3)
3561
run: |
36-
make ipxe -j 4
62+
make -e RPI_MAJ_VER=3
3763
38-
- name: SD card
64+
65+
66+
- name: Build (EFI) (rpi4)
67+
run: |
68+
make efi -e RPI_MAJ_VER=4
69+
70+
- name: Build (iPXE) (rpi4)
71+
run: |
72+
make ipxe -j 4 -e RPI_MAJ_VER=4
73+
74+
- name: SD card (rpi4)
3975
run: |
40-
make
76+
make -e RPI_MAJ_VER=4
77+
78+
79+
80+
81+
82+
4183
4284
- name: Create release
4385
id: create_release
@@ -49,24 +91,54 @@ jobs:
4991
tag_name: ${{ github.ref }}
5092
release_name: ${{ github.ref }}
5193

52-
- name: Upload (sdcard.img)
94+
95+
96+
97+
- name: Upload (sdcard_rpi3.img)
98+
if: startsWith(github.event.ref, 'refs/tags/v')
99+
uses: actions/upload-release-asset@v1
100+
env:
101+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102+
with:
103+
upload_url: ${{ steps.create_release.outputs.upload_url }}
104+
asset_name: sdcard_rpi3.img
105+
asset_path: sdcard_rpi3.img
106+
asset_content_type: application/octet-stream
107+
108+
109+
- name: Upload (sdcard_rpi3.zip)
53110
if: startsWith(github.event.ref, 'refs/tags/v')
54111
uses: actions/upload-release-asset@v1
55112
env:
56113
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57114
with:
58115
upload_url: ${{ steps.create_release.outputs.upload_url }}
59-
asset_name: sdcard.img
60-
asset_path: sdcard.img
116+
asset_name: sdcard_rpi3.zip
117+
asset_path: sdcard_rpi3.zip
118+
asset_content_type: application/zip
119+
120+
121+
122+
123+
- name: Upload (sdcard_rpi4.img)
124+
if: startsWith(github.event.ref, 'refs/tags/v')
125+
uses: actions/upload-release-asset@v1
126+
env:
127+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128+
with:
129+
upload_url: ${{ steps.create_release.outputs.upload_url }}
130+
asset_name: sdcard_rpi4.img
131+
asset_path: sdcard_rpi4.img
61132
asset_content_type: application/octet-stream
62133

63-
- name: Upload (sdcard.zip)
134+
135+
- name: Upload (sdcard_rpi4.zip)
64136
if: startsWith(github.event.ref, 'refs/tags/v')
65137
uses: actions/upload-release-asset@v1
66138
env:
67139
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68140
with:
69141
upload_url: ${{ steps.create_release.outputs.upload_url }}
70-
asset_name: sdcard.zip
71-
asset_path: sdcard.zip
142+
asset_name: sdcard_rpi4.zip
143+
asset_path: sdcard_rpi4.zip
72144
asset_content_type: application/zip

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
Build/
22
firmware/
33
sdcard/
4-
sdcard.img
5-
sdcard.zip
4+
outs/*

Dockerfile

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
2+
3+
## docker build -f Dockerfile . -t ipxe_pipxe_localbuild --output "./" --target copytohost
4+
5+
## docker via podman
6+
## docker --cgroup-manager cgroupfs build -f Dockerfile . -t ipxe_pipxe_localbuild --output "./" --target copytohost
7+
8+
9+
## todo use volume map for build and output
10+
## (untested) docker build -f Dockerfile . -v $(pwd):/opt/thisrepo -t ipxe_pipxe_localbuild
11+
12+
13+
14+
FROM ubuntu:22.04 as runner
15+
16+
RUN \
17+
apt update && \
18+
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
19+
binutils \
20+
ca-certificates \
21+
gcc \
22+
g++ \
23+
git \
24+
make \
25+
python-is-python3 \
26+
python3
27+
28+
RUN \
29+
apt clean
30+
31+
32+
33+
34+
## jammy's mtools (ver 4.0.32) has breaking bug; noble's (ver 4.0.43) works
35+
36+
## mtools hack (for ubuntu 22.04); set default apt release
37+
ENV MTOOLS_UBUNTU_RELEASE_NAME=noble
38+
RUN \
39+
cat <<EOFF > /etc/apt/apt.conf.d/01-default-release
40+
APT
41+
{
42+
Default-Release "jammy";
43+
};
44+
EOFF
45+
RUN \
46+
cat <<EOFF >> /etc/apt/sources.list
47+
48+
## hack for mtools; add different source repo
49+
deb http://security.ubuntu.com/ubuntu ${MTOOLS_UBUNTU_RELEASE_NAME} main
50+
EOFF
51+
52+
## package pin for mtools to use different source repo
53+
RUN \
54+
cat <<EOFF >> /etc/apt/preferences.d/01-mtools
55+
Package: mtools
56+
Pin: release n=${MTOOLS_UBUNTU_RELEASE_NAME}
57+
Pin-Priority: 995
58+
EOFF
59+
60+
61+
62+
63+
## install packages
64+
RUN apt update
65+
RUN apt install -y -o Acquire::Retries=50 \
66+
gcc-aarch64-linux-gnu iasl mtools \
67+
lzma-dev uuid-dev zip
68+
69+
70+
71+
72+
FROM runner as builder
73+
74+
75+
76+
77+
## copy in repo
78+
## improve? with mounting $(pwd):/opt/thisrepo
79+
COPY . /opt/thisrepo
80+
81+
82+
83+
84+
WORKDIR /opt/thisrepo
85+
86+
87+
88+
89+
## run make: Sources (git)
90+
RUN \
91+
make submodules
92+
93+
## run make: Sources (git sparce-checkout)
94+
RUN \
95+
make firmware
96+
97+
98+
99+
100+
FROM builder as build
101+
102+
103+
104+
105+
## run make: Build (EFI)
106+
RUN \
107+
make efi -e RPI_MAJ_VER=3
108+
109+
## run make: Build (iPXE)
110+
RUN \
111+
make ipxe -j 4 -e RPI_MAJ_VER=3
112+
113+
## run make: SD card (rpi3)
114+
RUN \
115+
make -e RPI_MAJ_VER=3
116+
117+
## run make: SD card (rpi4)
118+
RUN \
119+
make -e RPI_MAJ_VER=4
120+
121+
RUN \
122+
chmod 666 sdcard_rpi*.*
123+
124+
125+
FROM scratch as copytohost
126+
127+
128+
COPY --link --from=build /opt/thisrepo/sdcard_rpi3.zip /outs/sdcard_rpi3.img
129+
COPY --link --from=build /opt/thisrepo/sdcard_rpi3.zip /outs/sdcard_rpi3.zip
130+
131+
COPY --link --from=build /opt/thisrepo/sdcard_rpi4.zip /outs/sdcard_rpi4.img
132+
COPY --link --from=build /opt/thisrepo/sdcard_rpi4.zip /outs/sdcard_rpi4.zip

0 commit comments

Comments
 (0)