My second need for a tiny kiosk system is to have it read only to prevent filesystem crash on power loss.
Here is a short tutorial what I have done so far to get there, maybe it is helpful for others. Of course give hints, if you think some things can perform better.
As source of inspiration I took https://www.dzombak.com/blog/2024/03/Running-a-Raspberry-Pi-with-a-read-only-root-filesystem.html
- Add kernel parameters for kernel in
/boot/dietpiEnv.txttoextraargs:fsck.mode=skip noswap ro - Instead of doing the ntp stuff described by Chris I simply disabled the time sync service entirely via dietpi-config: Set Time sync mode to Custom.
- To work arround network issues I disabled DHCP on my interface and set it to static IP
- Move the
random-seedfile to a writable location, done like Chris - Disable
systemd-rfkillalso done like Chris - Regarding the log and logrotate i am not sure what to do. As dietpi is configured the logging goes into RAM anyway. But if I call
journalctl -bI see following errors
Okt 26 19:44:22 DietPi systemd[1]: dietpi-ramlog.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Okt 26 19:44:22 DietPi systemd[1]: dietpi-ramlog.service: Failed with result 'exit-code'.
Okt 26 19:44:22 DietPi systemd[1]: Failed to start dietpi-ramlog.service - DietPi-RAMlog.
- Move
sudostate totmpfsas described by Chris - for x-org: Set XAUTHORITY environment variable to
/tmp/.Xauthority - call startx with following additional parameter:
-- -nolisten tcp -logfile /dev/null - Add an additional entry in
/etc/fstabto store chromium state in RAM:
tmpfs /home/dietpi/.config tmpfs size=100M,noatime,lazytime,nodev,nosuid
- Set / in
/etc/fstabfromrwtoro. - Reboot