Skip to content

Commit f8bbdb1

Browse files
LeviTrammellclaude
andcommitted
Add Pi test variant using bootupd PR #935
Creates a test variant to evaluate bootupd PR #935's extend-payload-to-esp command as an alternative to the bootupctl shim approach. Key changes: - New pi-pr935 variant using Fedora 43 (Rawhide) - Builds bootupd from say-paul/bootupd firmware-copy branch - Uses bootupctl backend extend-payload-to-esp to stage firmware - No bootupctl shim required - Added task definitions for building container and disk images This will help test and provide feedback on coreos/bootupd#935 and #766 to move the ARM firmware support ecosystem forward. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 6bc7157 commit f8bbdb1

File tree

5 files changed

+188
-0
lines changed

5 files changed

+188
-0
lines changed

.taskfiles/containers/Taskfile.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,13 @@ tasks:
4747
vars:
4848
FILE: ./variants/odroid-go-ultra/Containerfile.simple
4949
TAG: odroid-go-ultra
50+
51+
pi-pr935:
52+
desc: Build Raspberry Pi image using bootupd PR #935 (test variant, Fedora 43)
53+
deps: []
54+
cmd:
55+
task: build
56+
vars:
57+
FILE: ./variants/pi-pr935/Containerfile
58+
TAG: pi-pr935
59+
FEDORA_MAJOR_VERSION: 43

.taskfiles/images/Taskfile.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,14 @@ tasks:
5252
desc: Build complete Odroid Go Ultra image with embedded bootloader
5353
cmd: ./variants/odroid-go-ultra/scripts/create-full-image.sh {{.BASE_REPO}}/odroid-go-ultra
5454

55+
pi-pr935:
56+
desc: Build Raspberry Pi disk image using bootupd PR #935 (test variant, Fedora 43)
57+
cmd:
58+
task: bootc-image-builder
59+
vars:
60+
ARCH: aarch64
61+
IMAGE: pi-pr935
62+
ROOTFS: ext4
63+
OUTDIR: dist/pi-pr935
64+
CONFIG: variants/pi-pr935/config.toml
65+

variants/pi-pr935/Containerfile

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Test variant for Raspberry Pi using bootupd PR #935
2+
# Tests the extend-payload-to-esp approach instead of bootupctl shim
3+
ARG FEDORA_MAJOR_VERSION=43
4+
5+
# Stage 1: Build bootupd from PR #935
6+
FROM quay.io/fedora/fedora-bootc:${FEDORA_MAJOR_VERSION} AS bootupd-builder
7+
8+
RUN dnf install -y \
9+
make \
10+
cargo \
11+
rust \
12+
glib2-devel \
13+
openssl-devel \
14+
ostree-devel \
15+
git \
16+
&& dnf clean all
17+
18+
# Clone PR #935 branch
19+
RUN git clone -b firmware-copy https://github.com/say-paul/bootupd.git /build/bootupd
20+
21+
WORKDIR /build/bootupd
22+
23+
# Build bootupd (set CARGO_HOME to avoid cache conflicts)
24+
ENV CARGO_HOME=/build/.cargo
25+
RUN make && make install-all DESTDIR=/out
26+
27+
# Stage 2: Main Pi image with PR #935 bootupd
28+
FROM quay.io/fedora/fedora-bootc:${FEDORA_MAJOR_VERSION}
29+
30+
# Copy PR #935 bootupd over the default one
31+
COPY --from=bootupd-builder /out/ /
32+
33+
# Set up passwordless sudo
34+
COPY ./variants/pi/files/wheel-passwordless-sudo /etc/sudoers.d/wheel-passwordless-sudo
35+
36+
# Run common installation script
37+
COPY ./scripts/install-common.sh /tmp
38+
RUN /tmp/install-common.sh
39+
40+
# Install firmware and u-boot packages
41+
RUN dnf install -y bcm2711-firmware uboot-images-armv8 && \
42+
dnf clean all
43+
44+
# Use PR #935's extend-payload-to-esp command to stage firmware
45+
# First, extend the bcm2711-firmware files from /boot/efi
46+
RUN bootupctl backend extend-payload-to-esp /boot/efi
47+
48+
# Second, extend the u-boot binary from /usr/share/uboot/rpi_arm64
49+
# Note: We need to copy u-boot.bin to expected name first
50+
RUN cp -P /usr/share/uboot/rpi_arm64/u-boot.bin /usr/share/uboot/rpi_arm64/rpi-u-boot.bin || true
51+
RUN bootupctl backend extend-payload-to-esp /usr/share/uboot/rpi_arm64
52+
53+
# Verify the staging worked
54+
RUN echo "=== Checking staged firmware ===" && \
55+
ls -la /usr/lib/efi/firmware/ || echo "No /usr/lib/efi/firmware directory" && \
56+
find /usr/lib/efi -type f 2>/dev/null || echo "No files in /usr/lib/efi"
57+
58+
# Enable SSH
59+
RUN systemctl enable sshd
60+
61+
# USB gadget networking setup
62+
COPY ./variants/pi/files/etc/systemd/system/usb-gadget.service /etc/systemd/system/usb-gadget.service
63+
COPY ./variants/pi/files/etc/systemd/system/dnsmasq-usb0.service /etc/systemd/system/dnsmasq-usb0.service
64+
COPY ./variants/pi/files/etc/modules-load.d/gadget.conf /etc/modules-load.d/gadget.conf
65+
COPY ./variants/pi/files/etc/usb-gadgets/net-ecm /etc/usb-gadgets/net-ecm
66+
COPY ./variants/pi/files/usr/local/bin/usb-gadget.sh /usr/local/bin/usb-gadget.sh
67+
COPY ./variants/pi/files/etc/dnsmasq.d/usb-gadget /etc/dnsmasq.d/usb-gadget
68+
COPY ./variants/pi/scripts/setup-usb-gadget.sh /tmp
69+
RUN /tmp/setup-usb-gadget.sh
70+
71+
# First boot partition resize
72+
COPY ./variants/pi/files/usr/lib/dracut/modules.d/99growfs/growfs.sh /usr/lib/dracut/modules.d/99growfs/growfs.sh
73+
COPY ./variants/pi/files/usr/lib/dracut/modules.d/99growfs/module-setup.sh /usr/lib/dracut/modules.d/99growfs/module-setup.sh
74+
COPY ./variants/pi/scripts/install-first-boot-resize.sh /tmp
75+
RUN /tmp/install-first-boot-resize.sh
76+
77+
# NOTE: No bootupctl shim needed! PR #935 should handle firmware installation automatically
78+
# during 'bootupd backend install' and 'bootupd update'
79+
80+
RUN bootc container lint

variants/pi-pr935/README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Raspberry Pi PR #935 Test Variant
2+
3+
This is a **test variant** for Raspberry Pi that uses bootupd PR #935's `extend-payload-to-esp` command instead of the bootupctl shim approach used in the main `pi` variant.
4+
5+
## Purpose
6+
7+
Test whether [bootupd PR #935](https://github.com/coreos/bootupd/pull/935) provides a cleaner solution for installing firmware files to the ESP partition without needing a custom bootupctl shim.
8+
9+
## What's Different
10+
11+
### Main Pi Variant
12+
- Stages firmware to `/usr/lib/bootc-raspi-firmwares/`
13+
- Uses a bootupctl shim that intercepts `bootupd backend install`
14+
- Shim copies firmware files to ESP during installation
15+
16+
### PR #935 Test Variant
17+
- Uses `bootupctl backend extend-payload-to-esp` command
18+
- Should stage firmware to `/usr/lib/efi/firmware/{name}/{version}/`
19+
- bootupd should automatically install firmware during `bootupd backend install`
20+
- No shim needed!
21+
22+
## Building
23+
24+
```bash
25+
# Build the container
26+
task containers:pi-pr935
27+
28+
# Build the disk image
29+
task images:pi-pr935
30+
31+
# Output will be in dist/pi-pr935/
32+
```
33+
34+
## Testing Checklist
35+
36+
- [ ] Container builds successfully
37+
- [ ] Firmware files are staged to `/usr/lib/efi/firmware/`
38+
- [ ] Disk image builds successfully
39+
- [ ] Firmware files appear in `/boot/efi/` on the disk image
40+
- [ ] Image boots on Raspberry Pi
41+
- [ ] USB gadget networking works
42+
- [ ] System is functional
43+
44+
## What to Report
45+
46+
If testing is successful, report to [PR #935](https://github.com/coreos/bootupd/pull/935) or [Issue #766](https://github.com/coreos/bootupd/issues/766):
47+
48+
1. **Success/Failure**: Did the image build and boot?
49+
2. **Firmware Installation**: Were all firmware files correctly installed to ESP?
50+
3. **Simplification**: Is this approach simpler than the shim?
51+
4. **Updates**: Does `bootupctl update` handle firmware updates correctly?
52+
53+
## Comparison Commands
54+
55+
```bash
56+
# Check firmware staging in container
57+
podman run --rm ghcr.io/levitrammell/pi-pr935 ls -R /usr/lib/efi/firmware/
58+
59+
# Compare with main pi variant
60+
podman run --rm ghcr.io/levitrammell/pi ls -R /usr/lib/bootc-raspi-firmwares/
61+
62+
# Check what's in ESP on built image
63+
sudo mount dist/pi-pr935/image/disk.raw2 /mnt
64+
ls -la /mnt/boot/efi/
65+
sudo umount /mnt
66+
```
67+
68+
## Expected Outcome
69+
70+
If PR #935 works correctly:
71+
- Firmware files should be in `/usr/lib/efi/firmware/` in the container
72+
- Firmware files should be copied to `/boot/efi/` during image build
73+
- The Pi should boot without needing a bootupctl shim
74+
- This proves PR #935 provides a better solution for ARM firmware
75+
76+
## Notes
77+
78+
- Uses Fedora 43 (Rawhide) as suggested in the bootupd discussions
79+
- Requires ARM64 build environment or emulation
80+
- May need adjustments if PR #935 API changes

variants/pi-pr935/config.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[[customizations.user]]
2+
name = "levi"
3+
key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDuOzvkmG+6bfrQ0YC04MnU3LUHiDYb5P4oyyx4TMbH1UJzvLYLstufefvVXkmOumgQ1mrIKDc0yq6rOt8Z5V2wGIHXLyqhAosu0HeZ6ZoO00pdzTVbJ67DtEoj6Fq/7pXKxdvuMVuUYJqYCqz20nt3DPYAVIg0ba5EFg1U5JKIFoUo6IOqDQSAjAPSnwmnQpqnt03u5zJWxj6ULAF0PkJsAN9/wlw1KCtdtI6uxTSo49dTamesr4XVQIWLMt6+TrI3ltt9AQ4NtbU/f3wuJa0+NgSkt06Vg0t++VALYuEZDFOCQMZNT6XSt0nK/WV71/KyGWOYXsRGsLYyhqgrP1XNvElFIqS0E6a3vNAEa0kpuVzXbqV96rlrB7Rv5HAcao+4yIPmon6pJ0QBl1gJotpjgRr3jfj1NBcQU8M0ry9b8sA0r2I98WDJfpim50lT2sLqk+E5czvtQlKNT/z0pKgNNkQFPOmLuh3ObJBWM4M8pwUSBhkffcOpNg8FNE3+ST+tzoSOi9rzdmcZFw/7Ul/eHjT5CpfVhNrX+aWFIue/VXDTp11Ha/y4NWjxjBuzmJ879fVTiRBqj/LhZzQ1B7RUGqqAV/RlE3DOv9YGVsgDszuHVONnW7YOGGGqC+FCkTeNtHo6x0IQx3KIy7vU4VsIAr0CUctALxe7K0Rh6UvkGw== [email protected]"
4+
groups = ["wheel"]
5+
6+
[customizations.kernel]
7+
append = "modules-load=dwc2,g_ether"

0 commit comments

Comments
 (0)