Skip to content

Commit 09c20b9

Browse files
authored
Merge pull request #1 from henrywang/ubuntu
Add Ubuntu 26.04 support (GRUB, UKI, UKI + Secure Boot)
2 parents a343744 + 249794a commit 09c20b9

15 files changed

Lines changed: 907 additions & 177 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ name: CI
22

33
on:
44
push:
5+
branches: [main]
56
pull_request:
7+
branches: [main]
68

79
env:
810
CARGO_TERM_COLOR: always

.github/workflows/container.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
uses: docker/build-push-action@v6
3232
with:
3333
context: .
34-
file: Containerfile.base
34+
file: Containerfile.fedora
3535
target: grub
3636
push: true
3737
tags: ghcr.io/${{ github.repository_owner }}/composefs-os:fedora-44
@@ -42,7 +42,7 @@ jobs:
4242
uses: docker/build-push-action@v6
4343
with:
4444
context: .
45-
file: Containerfile.base
45+
file: Containerfile.fedora
4646
target: uki
4747
push: true
4848
tags: ghcr.io/${{ github.repository_owner }}/composefs-os:fedora-44-uki
@@ -53,7 +53,7 @@ jobs:
5353
uses: docker/build-push-action@v6
5454
with:
5555
context: .
56-
file: Containerfile.base
56+
file: Containerfile.fedora
5757
target: uki-secureboot
5858
push: true
5959
tags: ghcr.io/${{ github.repository_owner }}/composefs-os:fedora-44-uki-sb

.github/workflows/e2e.yml

Lines changed: 144 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ on:
44
push:
55
branches: [main]
66
pull_request:
7+
branches: [main]
78

89
jobs:
9-
e2e:
10+
e2e-fedora:
1011
runs-on: ubuntu-latest
1112

1213
steps:
@@ -21,22 +22,28 @@ jobs:
2122
2223
- name: Install dependencies
2324
run: |
25+
# noble's buildah 1.33 does not support COPY <<heredoc inline-file
26+
# syntax; plucky has buildah 1.38+ and podman 5.x which do.
27+
# crun is also pulled from plucky because podman 5.x requires a
28+
# newer crun than noble provides.
29+
echo 'deb http://archive.ubuntu.com/ubuntu plucky main universe' \
30+
| sudo tee /etc/apt/sources.list.d/plucky.list
2431
sudo apt-get update -q
2532
sudo apt-get install -y -q \
26-
just qemu-system-x86 ovmf podman skopeo python3-pexpect \
27-
python3-virt-firmware
33+
just qemu-system-x86 ovmf python3-pexpect python3-virt-firmware
34+
sudo apt-get install -y -q -t plucky podman buildah skopeo crun
2835
2936
- name: Set up Docker Buildx
3037
uses: docker/setup-buildx-action@v3
3138

32-
# Build the base image from source (covers PRs that change Containerfile.base
39+
# Build the base image from source (covers PRs that change Containerfile.fedora
3340
# or the Rust code compiled inside it). Layer cache keeps this fast after
3441
# the first run.
3542
- name: Build base image
3643
uses: docker/build-push-action@v6
3744
with:
3845
context: .
39-
file: Containerfile.base
46+
file: Containerfile.fedora
4047
target: grub
4148
push: false
4249
load: true
@@ -71,7 +78,7 @@ jobs:
7178
uses: docker/build-push-action@v6
7279
with:
7380
context: .
74-
file: Containerfile.base
81+
file: Containerfile.fedora
7582
target: uki
7683
push: false
7784
load: true
@@ -100,7 +107,7 @@ jobs:
100107
uses: docker/build-push-action@v6
101108
with:
102109
context: .
103-
file: Containerfile.base
110+
file: Containerfile.fedora
104111
target: uki-secureboot
105112
push: false
106113
load: true
@@ -134,3 +141,133 @@ jobs:
134141
disk-uki.raw
135142
disk-uki-sb.raw
136143
retention-days: 1
144+
145+
e2e-ubuntu:
146+
runs-on: ubuntu-latest
147+
148+
steps:
149+
- uses: actions/checkout@v4
150+
151+
- name: Enable KVM
152+
run: |
153+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
154+
| sudo tee /etc/udev/rules.d/99-kvm4all.rules
155+
sudo udevadm control --reload-rules
156+
sudo udevadm trigger --name-match=kvm
157+
158+
- name: Install dependencies
159+
run: |
160+
# noble's buildah 1.33 does not support COPY <<heredoc inline-file
161+
# syntax; plucky has buildah 1.38+ and podman 5.x which do.
162+
# crun is also pulled from plucky because podman 5.x requires a
163+
# newer crun than noble provides.
164+
echo 'deb http://archive.ubuntu.com/ubuntu plucky main universe' \
165+
| sudo tee /etc/apt/sources.list.d/plucky.list
166+
sudo apt-get update -q
167+
sudo apt-get install -y -q \
168+
just qemu-system-x86 ovmf python3-pexpect python3-virt-firmware
169+
sudo apt-get install -y -q -t plucky podman buildah skopeo crun
170+
171+
- name: Set up Docker Buildx
172+
uses: docker/setup-buildx-action@v3
173+
174+
- name: Build Ubuntu base image (GRUB)
175+
uses: docker/build-push-action@v6
176+
with:
177+
context: .
178+
file: Containerfile.ubuntu
179+
target: grub
180+
push: false
181+
load: true
182+
tags: composefs-os:ubuntu-26.04
183+
cache-from: type=gha,scope=ubuntu
184+
cache-to: type=gha,mode=max,scope=ubuntu
185+
186+
- name: Load Ubuntu base image into podman
187+
run: |
188+
sudo skopeo copy \
189+
docker-daemon:composefs-os:ubuntu-26.04 \
190+
containers-storage:localhost/composefs-os:ubuntu-26.04
191+
192+
- name: Build Ubuntu test image
193+
run: sudo just build-example-ubuntu localhost/composefs-os:ubuntu-26.04
194+
195+
- name: Install to disk image (Ubuntu GRUB)
196+
run: just install-disk composefs-os-ubuntu-test:latest disk-ubuntu.raw 5G
197+
198+
- name: Run e2e tests (Ubuntu GRUB)
199+
run: just e2e disk-ubuntu.raw
200+
201+
- name: Install to disk image (Ubuntu GRUB + Secure Boot)
202+
run: just install-disk-secureboot composefs-os-ubuntu-test:latest disk-ubuntu-sb.raw 5G
203+
204+
- name: Run e2e tests (Ubuntu GRUB + Secure Boot)
205+
run: just e2e-secureboot disk-ubuntu-sb.raw
206+
207+
- name: Build Ubuntu UKI base image
208+
uses: docker/build-push-action@v6
209+
with:
210+
context: .
211+
file: Containerfile.ubuntu
212+
target: uki
213+
push: false
214+
load: true
215+
tags: composefs-os:ubuntu-26.04-uki
216+
cache-from: type=gha,scope=ubuntu
217+
cache-to: type=gha,mode=max,scope=ubuntu
218+
219+
- name: Load Ubuntu UKI base image into podman
220+
run: |
221+
sudo skopeo copy \
222+
docker-daemon:composefs-os:ubuntu-26.04-uki \
223+
containers-storage:localhost/composefs-os:ubuntu-26.04-uki
224+
225+
- name: Build Ubuntu UKI test image
226+
run: sudo just build-example-ubuntu-uki localhost/composefs-os:ubuntu-26.04-uki
227+
228+
- name: Install to disk image (Ubuntu UKI)
229+
run: just install-disk-uki composefs-os-ubuntu-uki-test:latest disk-ubuntu-uki.raw 5G
230+
231+
- name: Run e2e tests (Ubuntu UKI)
232+
run: |
233+
OVMF_VARS=$(find /usr/share -name 'OVMF_VARS.fd' ! -name '*.secboot*' ! -name '*.ms.*' | head -1)
234+
just e2e-uki disk-ubuntu-uki.raw "$OVMF_VARS"
235+
236+
- name: Build Ubuntu UKI+SB base image
237+
uses: docker/build-push-action@v6
238+
with:
239+
context: .
240+
file: Containerfile.ubuntu
241+
target: uki-secureboot
242+
push: false
243+
load: true
244+
tags: composefs-os:ubuntu-26.04-uki-sb
245+
cache-from: type=gha,scope=ubuntu
246+
cache-to: type=gha,mode=max,scope=ubuntu
247+
248+
- name: Load Ubuntu UKI+SB base image into podman
249+
run: |
250+
sudo skopeo copy \
251+
docker-daemon:composefs-os:ubuntu-26.04-uki-sb \
252+
containers-storage:localhost/composefs-os:ubuntu-26.04-uki-sb
253+
254+
- name: Build Ubuntu UKI+SB test image
255+
run: sudo just build-example-ubuntu-uki-secureboot localhost/composefs-os:ubuntu-26.04-uki-sb
256+
257+
- name: Install to disk image (Ubuntu UKI+SB)
258+
run: just install-disk-uki-secureboot composefs-os-ubuntu-uki-sb-test:latest disk-ubuntu-uki-sb.raw 5G
259+
260+
- name: Run e2e tests (Ubuntu UKI+SB)
261+
run: just e2e-uki-secureboot disk-ubuntu-uki-sb.raw
262+
263+
- name: Upload Ubuntu disk images on failure
264+
if: failure()
265+
uses: actions/upload-artifact@v4
266+
with:
267+
name: disk-ubuntu-raw
268+
path: |
269+
disk-ubuntu.raw
270+
disk-ubuntu-sb.raw
271+
disk-ubuntu-uki.raw
272+
disk-ubuntu-uki-sb.raw
273+
retention-days: 1

CONTRIBUTING.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,22 @@ just fmt # reformat source
1818
## Building container images
1919

2020
```sh
21-
# Base images (slow — runs dnf + dracut inside the container)
21+
# Fedora base images (slow — runs dnf + dracut inside the container)
2222
just build-base # GRUB/shim boot
2323
just build-base-uki # systemd-boot + UKI
2424

25-
# Example images layered on top (fast)
25+
# Fedora example images layered on top (fast)
2626
just build-example # GRUB example → composefs-os-test:latest
2727
just build-example-uki # UKI example → composefs-os-uki-test:latest
28+
29+
# Ubuntu base images (slow — runs apt + dracut inside the container)
30+
just build-base-ubuntu # GRUB
31+
just build-base-ubuntu-uki # systemd-boot + UKI
32+
just build-base-ubuntu-uki-secureboot # UKI + Secure Boot
33+
34+
# Ubuntu example images layered on top (fast)
35+
just build-example-ubuntu # GRUB example → composefs-os-ubuntu-test:latest
36+
just build-example-ubuntu-uki # UKI example → composefs-os-ubuntu-uki-test:latest
2837
```
2938

3039
Custom images follow the same pattern — no `FROM scratch` or layout step needed:
@@ -42,12 +51,12 @@ CMD ["/sbin/init"]
4251
Pass `-v /dev:/dev` for physical disk installs; not needed for the loopback images below.
4352

4453
```sh
45-
# Create disk images (requires sudo)
54+
# Create disk images (requires sudo) — Fedora
4655
just install-disk # GRUB → disk.raw
4756
just install-disk-secureboot # Secure Boot → disk-sb.raw
4857
just install-disk-uki # UKI → disk-uki.raw
4958

50-
# Run e2e tests against those images
59+
# Run e2e tests against those images — Fedora
5160
just e2e # GRUB tests
5261
just e2e-secureboot # Secure Boot tests
5362
just e2e-uki # UKI tests
@@ -56,9 +65,15 @@ just e2e-uki # UKI tests
5665
Or use the all-in-one recipes that build, install, and test in one shot:
5766

5867
```sh
68+
# Fedora
5969
just ci-grub # GRUB end-to-end
6070
just ci-secureboot # Secure Boot end-to-end
6171
just ci-uki # UKI end-to-end
72+
73+
# Ubuntu
74+
just ci-ubuntu-grub # GRUB end-to-end
75+
just ci-ubuntu-uki # UKI end-to-end
76+
just ci-ubuntu-uki-secureboot # UKI + Secure Boot end-to-end
6277
```
6378

6479
## Pull Requests
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# --target uki systemd-boot + UKI (BLS Type 2, cmdline embedded at build time)
66
#
77
# Build:
8-
# podman build -t composefs-os:fedora-44 -f Containerfile.base . # GRUB
9-
# podman build -t composefs-os:fedora-44-uki --target uki -f Containerfile.base .
8+
# podman build -t composefs-os:fedora-44 -f Containerfile.fedora . # GRUB
9+
# podman build -t composefs-os:fedora-44-uki --target uki -f Containerfile.fedora .
1010

1111
# ---------------------------------------------------------------------------
1212
# Stage 0a: Build cbootc

0 commit comments

Comments
 (0)