Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: build updates; ubuntu 22.04, remove svn, Makefile feature-flags, re-add Dockerfile #2

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .dockerignore
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
144 changes: 144 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
name: Build

on: push

jobs:

build:
name: Build
runs-on: ubuntu-22.04
steps:

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

- name: "mtools hack (for ubuntu 22.04): set apt default-release to DISTRIB_CODENAME from lsb-release"
run: |
echo "Distrib Codename: $(sed -r -n 's/DISTRIB_CODENAME=(.*)/\1/p' /etc/lsb-release)"
FILE=$(printf 'APT\n{\n Default-Release "%s";\n}\n' "$(sed -r -n 's/DISTRIB_CODENAME=(.*)/\1/p' /etc/lsb-release)" )
echo "$FILE" | sudo dd of=/etc/apt/apt.conf.d/01-default-release

- name: "mtools hack (for ubuntu 22.04): add apt source for noble"
run: |
FILE=$(printf '%s\ndeb http://security.ubuntu.com/ubuntu noble main\n' "$(cat /etc/apt/sources.list)" )
echo "$FILE" | sudo dd of=/etc/apt/sources.list

- name: "mtools hack (for ubuntu 22.04): mtools package-pin to noble"
run: |
FILE=$(printf 'Package: mtools\nPin: release n=noble\nPin-Priority: 995\n')
echo "$FILE" | sudo dd of=/etc/apt/preferences.d/01-mtools


#- name: python hack (for ubuntu 22.04): ensure python exists in PATH as symlink to python3
# run: sudo ln -sf $(which python3) $(which python3 | sed 's/3//g')


- name: Install packages
run: |
sudo apt update
sudo apt install -y -o Acquire::Retries=50 \
gcc-aarch64-linux-gnu iasl mtools \
lzma-dev uuid-dev zip

- name: Sources (git)
run: |
make submodules

- name: Sources (git sparce-checkout)
run: |
make firmware


- name: Build (EFI) (rpi3)
run: |
make efi -e RPI_MAJ_VER=3

- name: Build (iPXE) (rpi3)
run: |
make ipxe -j 4 -e RPI_MAJ_VER=3

- name: SD card (rpi3)
run: |
make -e RPI_MAJ_VER=3



- name: Build (EFI) (rpi4)
run: |
make efi -e RPI_MAJ_VER=4

- name: Build (iPXE) (rpi4)
run: |
make ipxe -j 4 -e RPI_MAJ_VER=4

- name: SD card (rpi4)
run: |
make -e RPI_MAJ_VER=4







- name: Create release
id: create_release
if: startsWith(github.event.ref, 'refs/tags/v')
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}




- name: Upload (sdcard_rpi3.img)
if: startsWith(github.event.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: sdcard_rpi3.img
asset_path: sdcard_rpi3.img
asset_content_type: application/octet-stream


- name: Upload (sdcard_rpi3.zip)
if: startsWith(github.event.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: sdcard_rpi3.zip
asset_path: sdcard_rpi3.zip
asset_content_type: application/zip




- name: Upload (sdcard_rpi4.img)
if: startsWith(github.event.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: sdcard_rpi4.img
asset_path: sdcard_rpi4.img
asset_content_type: application/octet-stream


- name: Upload (sdcard_rpi4.zip)
if: startsWith(github.event.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: sdcard_rpi4.zip
asset_path: sdcard_rpi4.zip
asset_content_type: application/zip
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Build/
firmware/
sdcard/
sdcard.img
sdcard.zip
outs/*
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
url = https://github.com/tianocore/edk2-non-osi.git
[submodule "ipxe"]
path = ipxe
url = https://git.ipxe.org/ipxe.git
url = https://github.com/ipxe/ipxe.git
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

155 changes: 132 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,132 @@
FROM fedora

RUN dnf update -y \
&& dnf install -y \
binutils \
gcc \
gcc-aarch64-linux-gnu \
git-core \
iasl \
libuuid-devel \
make \
mtools \
perl \
python \
subversion \
xz-devel \
&& dnf clean all

RUN mkdir -p /opt/build

COPY . /opt/build

CMD make -C /opt/build


## 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
Loading