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.txt
toextraargs
: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-seed
file to a writable location, done like Chris - Disable
systemd-rfkill
also 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 -b
I 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
sudo
state totmpfs
as 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/fstab
to store chromium state in RAM:
tmpfs /home/dietpi/.config tmpfs size=100M,noatime,lazytime,nodev,nosuid
- Set / in
/etc/fstab
fromrw
toro
. - Reboot