This build system creates a minimal Linux image designed to run a Godot 4 application in kiosk mode on a Raspberry Pi CM4. The system boots directly into your Godot application using the Cage Wayland compositor and Vulkan 1.2.
I have found Godot to be a solid UI for Embedded Linux applications. This is due to the fact its compiled for the native system (over something like ReactJS/electron) and has a minimal foot print for how powerful it is. The GDExtension feature of Godot is also extremely helpful, as you can call native C++ code and libraries like GPIO pins.
You can use this with any other Linux board that supports Vulkan 1.2. Just change the defconfig. Whatever defconfig you use, make sure to copy over the stuff that was added for this intended kiosk functionality as specified by comments in the configs.
- Godot 4.x application compiled for ARM64 and Vulkan 1.2
- Raspberry Pi 4
- Git
- Basic bash environment
-
Clone the repository
git clone https://github.com/corykacal/Embedded-RaspberryPi-Godot-UI-Kiosk-Image godot-kiosk cd godot-kiosk
-
Initialize and update Buildroot submodule
git submodule init git submodule update
-
Copy your Godot binary
# Copy your Godot binary cp path/to/your/godot-binary image/overlay/bin/godot_app
-
Build the system
chmod +x build.sh ./build.sh
# Show help and usage information
./build.sh --help
# Perform full build
./build.sh
# Clean RPi firmware and Linux builds
./build.sh clean
# Perform complete clean (equivalent to make clean)
./build.sh cleanall
.
├── buildroot/ # Buildroot submodule.
├── image/
│ ├── configs/ # Contains the defconfig and linux firmware config file.
│ ├── fragments/ # Linux Kernel Fragment config files.
│ └── overlay/ # System overlay. These files are copied (overlayed) to the Buildroot build directory that the image comes from.
│ ├── bin/ # Place your Godot binary here.
│ └── etc/ # System configuration, inittab, program daemon.
│ └── init.d/ # The program daemon that runs on start.
├── build.sh # Main build script.
└── README.md # This file.
-
To use your own Godot application:
- Ensure your Godot 4.x application is compiled for ARM64 and Vulkan 1.2
- Copy your ARM64 Godot binary to
image/overlay/bin/
- Either name it
godot_app
or update theGODOT_BINARY
variable inbuild.sh
-
The init script (
S99godot
) is automatically generated and will:- Wait for DRM to be ready
- Set up the runtime directory
- Launch your application using Cage
After a successful build, you'll find the output image binary in:
buildroot/output/images/Image
This will include the bootable SD card image for your Raspberry Pi CM4.
-
If the build fails with missing binary:
- Ensure your Godot binary is in
image/overlay/bin/
- Verify the binary name matches
GODOT_BINARY
inbuild.sh
- Ensure your Godot binary is in
-
If your Godot application fails to start:
- Verify your application is compiled for ARM64
- Ensure Vulkan 1.2 compatibility
- Check the system logs and dmesg for graphics driver issues