![Page 1: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/1.jpg)
Raspberry Pi Image Customization with GitHub Actions
![Page 2: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/2.jpg)
Gina Häußge aka @fooselPassionate code monkey 🐒 Geek 👩💻 Gamer 🎮 Hobby baker 👩🍳
Creator & maintainer of OctoPrint 🐙 GitHub Star 🌟
![Page 3: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/3.jpg)
Introduction & MotivationRaspberry Pi? Images? Customization? Why?
![Page 4: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/4.jpg)
Raspberry Pi?• Small Single Board Computer
• Released in 2012
• Starts at 35 bucks
• Boots from an SD card
flashed with an OS image
![Page 5: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/5.jpg)
Flashed OS image?• Most often: “Raspberry Pi
OS”, Debian derivative
• One .iso file
• Two partitions: /boot
(FAT32) & / (ext4)
• Flashed via a flash tool like
the Raspberry Pi Imager
![Page 6: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/6.jpg)
OS choice: rpi-imager.json
![Page 7: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/7.jpg)
Why customize an image?• To preinstall or update
software
• To preconfigure things
• Case in Point: OctoPi
• OctoPrint + … + preconfig
• Keep OctoPrint updated!
![Page 8: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/8.jpg)
Why not do it interactively?• Many things happen on first boot
• Key generation
• File system extension
• More, depending on software
• Consequence: Boot & copy = 👎
• Also: Automating builds = ❤
![Page 9: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/9.jpg)
Enter: CustoPiZer👉OctoPrint/CustoPiZer
![Page 10: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/10.jpg)
CustoPiZer• Customization tool for images
• Mounts partitions
• Runs scripts inside chroot
• Available as Docker image!
• Available as GitHub Action!
• based on work by Guy Sheffer
![Page 11: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/11.jpg)
Usage as GitHub Action
![Page 12: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/12.jpg)
Tying everything together👉OctoPrint/OctoPi-UpToDate
![Page 13: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/13.jpg)
scripts/01-update-octoprint
![Page 14: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/14.jpg)
![Page 15: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/15.jpg)
rpi-imager.json snippet
![Page 16: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/16.jpg)
![Page 17: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/17.jpg)
And rpi-imager.json?
![Page 18: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/18.jpg)
Summary• Image customization as a ~5min GitHub Action run
• Automatic release generation
• Automatic rpi-imager.json snippet generation
• Merging of snippets for stable & pre releases and serving via
GitHub pages
• … and all fully automated! 🤖
![Page 19: Raspberry Pi Image Customization with GitHub Actions](https://reader030.vdocument.in/reader030/viewer/2022012714/61ac942c58988a7e5a472b56/html5/thumbnails/19.jpg)
Slides: octoprint.org/slides/universe2021.pdf