|
| 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 | +---- |
0 commit comments