-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: build updates; ubuntu 22.04, remove svn, Makefile feature-flag…
…s, 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
- Loading branch information
1 parent
a93262a
commit b03fdf9
Showing
9 changed files
with
309 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#**/.git | ||
|
||
#edk2/* | ||
#edk2-non-osi/* | ||
#edk2-platforms/* | ||
#ipxe/* | ||
|
||
outs/* | ||
sdcard_rpi*.img | ||
sdcard_rpi*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
Build/ | ||
firmware/ | ||
sdcard/ | ||
sdcard.img | ||
sdcard.zip | ||
outs/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
|
||
|
||
## docker build -f Dockerfile . -t ipxe_pipxe_localbuild --output "./" --target copytohost | ||
|
||
## docker via podman | ||
## docker --cgroup-manager cgroupfs build -f Dockerfile . -t ipxe_pipxe_localbuild --output "./" --target copytohost | ||
|
||
|
||
## todo use volume map for build and output | ||
## (untested) docker build -f Dockerfile . -v $(pwd):/opt/thisrepo -t ipxe_pipxe_localbuild | ||
|
||
|
||
|
||
FROM ubuntu:22.04 as runner | ||
|
||
RUN \ | ||
apt update && \ | ||
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \ | ||
binutils \ | ||
ca-certificates \ | ||
gcc \ | ||
g++ \ | ||
git \ | ||
make \ | ||
python-is-python3 \ | ||
python3 | ||
|
||
RUN \ | ||
apt clean | ||
|
||
|
||
|
||
|
||
## jammy's mtools (ver 4.0.32) has breaking bug; noble's (ver 4.0.43) works | ||
|
||
## mtools hack (for ubuntu 22.04); set default apt release | ||
ENV MTOOLS_UBUNTU_RELEASE_NAME=noble | ||
RUN \ | ||
cat <<EOFF > /etc/apt/apt.conf.d/01-default-release | ||
APT | ||
{ | ||
Default-Release "jammy"; | ||
}; | ||
EOFF | ||
RUN \ | ||
cat <<EOFF >> /etc/apt/sources.list | ||
|
||
## hack for mtools; add different source repo | ||
deb http://security.ubuntu.com/ubuntu ${MTOOLS_UBUNTU_RELEASE_NAME} main | ||
EOFF | ||
|
||
## package pin for mtools to use different source repo | ||
RUN \ | ||
cat <<EOFF >> /etc/apt/preferences.d/01-mtools | ||
Package: mtools | ||
Pin: release n=${MTOOLS_UBUNTU_RELEASE_NAME} | ||
Pin-Priority: 995 | ||
EOFF | ||
|
||
|
||
|
||
|
||
## install packages | ||
RUN apt update | ||
RUN apt install -y -o Acquire::Retries=50 \ | ||
gcc-aarch64-linux-gnu iasl mtools \ | ||
lzma-dev uuid-dev zip | ||
|
||
|
||
|
||
|
||
FROM runner as builder | ||
|
||
|
||
|
||
|
||
## copy in repo | ||
## improve? with mounting $(pwd):/opt/thisrepo | ||
COPY . /opt/thisrepo | ||
|
||
|
||
|
||
|
||
WORKDIR /opt/thisrepo | ||
|
||
|
||
|
||
|
||
## run make: Sources (git) | ||
RUN \ | ||
make submodules | ||
|
||
## run make: Sources (git sparce-checkout) | ||
RUN \ | ||
make firmware | ||
|
||
|
||
|
||
|
||
FROM builder as build | ||
|
||
|
||
|
||
|
||
## run make: Build (EFI) | ||
RUN \ | ||
make efi -e RPI_MAJ_VER=3 | ||
|
||
## run make: Build (iPXE) | ||
RUN \ | ||
make ipxe -j 4 -e RPI_MAJ_VER=3 | ||
|
||
## run make: SD card (rpi3) | ||
RUN \ | ||
make -e RPI_MAJ_VER=3 | ||
|
||
## run make: SD card (rpi4) | ||
RUN \ | ||
make -e RPI_MAJ_VER=4 | ||
|
||
RUN \ | ||
chmod 666 sdcard_rpi*.* | ||
|
||
|
||
FROM scratch as copytohost | ||
|
||
|
||
COPY --link --from=build /opt/thisrepo/sdcard_rpi3.zip /outs/sdcard_rpi3.img | ||
COPY --link --from=build /opt/thisrepo/sdcard_rpi3.zip /outs/sdcard_rpi3.zip | ||
|
||
COPY --link --from=build /opt/thisrepo/sdcard_rpi4.zip /outs/sdcard_rpi4.img | ||
COPY --link --from=build /opt/thisrepo/sdcard_rpi4.zip /outs/sdcard_rpi4.zip |
Oops, something went wrong.