Getting Chromium running in kiosk mode on a readonly filesystem

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

  1. Add kernel parameters for kernel in /boot/dietpiEnv.txt to extraargs: fsck.mode=skip noswap ro
  2. 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.
  3. To work arround network issues I disabled DHCP on my interface and set it to static IP
  4. Move the random-seed file to a writable location, done like Chris
  5. Disable systemd-rfkill also done like Chris
  6. 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.
  1. Move sudo state to tmpfs as described by Chris
  2. for x-org: Set XAUTHORITY environment variable to /tmp/.Xauthority
  3. call startx with following additional parameter: -- -nolisten tcp -logfile /dev/null
  4. Add an additional entry in /etc/fstab to store chromium state in RAM:
tmpfs /home/dietpi/.config tmpfs size=100M,noatime,lazytime,nodev,nosuid
  1. Set / in /etc/fstab from rw to ro.
  2. Reboot