Creating your own image based on latest stable turns out to be relatively straightforward, though there are a few pitfalls. The steps are roughly the following:
- Create a Debian boostrap install
- Add dependencies of your program and things like X, Network Manager etc
- Install your program
- Configure the system to automatically login root on boot
- Configure root to start X upon login (but only on virtual terminal 1)
- Create an .xinitrc to start your application upon X startup
Using it is simple: insert a fresh USB stick in the machine and see what device name it is assigned to. Let's assume it is /dev/sdd. Then run the installer:
sudo ./createimage.py /dev/sdd
Once the process is complete and you can boot any computer with the USB stick to see this:
This may not look like much but the text in the top left corner is in fact a PyGTK program. The entire thing fits in a 226 MB squashfs image and takes only a few minutes to create from scratch. Expanding the program to have the functionality you want is then straightforward. The Debian base image takes care of all the difficult things like hardware autodetection, network configuration and so on.
Problems and points of improvement
The biggest problem is that when booted like this the mouse cursor is invisible. I don't know why. All I could find were other people asking about the same issue but no answers. If someone knows how to fix this, patches are welcome.
The setup causes the root user to autologin on all virtual terminals, not just #1.
If you need to run stuff like PulseAudio or any other thing that requires a full session, you'll probably need to install a full DE session and use its kiosk mode.
This setup runs as root. This may be good. It may be bad. It depends on your use case.
For more complex apps you'd probably want to create a DEB package and use it to install dependencies rather than hardcoding the list in the script as is done currently.
No comments:
Post a Comment