Skip to content

Commit f464f4d

Browse files
authored
Merge pull request #102 from twaldecker/main
Add a bootc example for Raspberry Pi
2 parents 09d17dc + c37349e commit f464f4d

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

user-docs/modules/ROOT/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
** xref:fedora-iot-bootc.adoc[Fedora IoT Bootc]
3232
*** xref:fedora-iot-bootc-pmachine-example.adoc[Bootc Podman Machine Example]
3333
*** xref:fedora-iot-bootc-quay-example.adoc[Bootc Quay Example]
34+
*** xref:fedora-iot-bootc-raspberry-pi-example.adoc[Bootc Raspberry Pi Example]
3435
* xref:contributing.adoc[Contributing & Reporting Bugs]
3536
* xref:reference-platforms.adoc[Reference Platforms]
3637
* xref:prd.adoc[Product Requirement Document]
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
= Fedora IoT Bootc Example with Raspberry Pi
2+
3+
== Installing Fedora IoT on a SD Card
4+
5+
To install Fedora IoT on a SD Card use the arm-image-installer. See xref:physical-device-setup.adoc[Physical Device Setup] for details.
6+
7+
For the Raspberry Pi 3 the command to create the SD Card is the following:
8+
9+
----
10+
sudo arm-image-installer --image=Fedora-IoT-raw-42-20250724.1.aarch64.raw.xz --media=/dev/sda --target=rpi3 --resizefs --addkey=id_rsa.pub
11+
----
12+
13+
This command expects, that your ssh key and the Fedora IoT image is present in the local directory.
14+
15+
After completion you can put the SD Card in the Raspberry Pi, boot and connect via SSH.
16+
17+
== Build a custom Fedora Bootc image and push it to GitLab
18+
19+
To build your own image on your host you can create a Containerfile. This example just copies a file to /etc.
20+
21+
----
22+
FROM quay.io/fedora/fedora-bootc:latest
23+
24+
COPY files/secret /etc
25+
----
26+
27+
To build and push the image with podman run the following on the host:
28+
29+
----
30+
podman build --platform linux/arm64 -t gitlab.internal.net:5005/software/bootc/test-image:latest .
31+
podman login gitlab.internal.net:5005
32+
podman push gitlab.internal.net:5005/software/bootc/test-image:latest
33+
----
34+
35+
== Switch the Raspberry Pi to your custom image
36+
37+
On the Raspberry Pi you can now switch to your custom image.
38+
To access GitLab you need a Project Access Token with Role Developer and Permission `read_registry`.
39+
40+
To create a authentication file encode the GitLab token using an arbitrary user name to base64:
41+
42+
----
43+
echo -n "no_user:glpat-thisisthegitlabprojectaccesstoken" | base64
44+
----
45+
46+
use the base64 string to create a image pull secret on the Raspberry Pi:
47+
48+
----
49+
cat << EOF > /etc/ostree/auth.json
50+
{
51+
"auths": {
52+
"gitlab.internal.net:5005": {
53+
"auth": "bm9fdXNlcjpnbHBhdC10aGlzaXN0aGVnaXRsYWJwcm9qZWN0YWNjZXNzdG9rZW4="
54+
}
55+
}
56+
}
57+
EOF
58+
----
59+
60+
To switch the bootc image you can now run on the Raspberry Pi:
61+
62+
----
63+
bootc switch gitlab.internal.net:5005/software/bootc/test-image:latest
64+
----
65+
66+
After rebooting:
67+
68+
----
69+
reboot
70+
----
71+
72+
The file should be present in the filesystem:
73+
74+
----
75+
cat /etc/secret
76+
----

user-docs/modules/ROOT/pages/fedora-iot-bootc.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ As part of Fedora's initiative towards bootable containers, you can now create F
44
OCI/Docker containers as transport but contain all components needed to boot a Fedora IoT system. This allows you to ship updates to
55
your Fedora IoT system using container images.
66

7+
Bootc is part of the standard Fedora IoT distribution. After xref:physical-device-setup.adoc[setting up a Physical Device]
8+
you can use the Bootc tools to update the system.
9+
710
Essentially, Fedora IoT bootc images retain all the functionality you're used to in Fedora IoT, while leveraging the flexibility
811
and ease of maintenance provided by bootc.
912

0 commit comments

Comments
 (0)