Page 1 of 1

simple RO headless pi zero system

Posted: Tue Sep 04, 2018 8:43 am
by Seb.26
Hi world,
I have build a small camera system based on a PI zero + Camera v2.

I want to make it a true read-only system the simplest way, no more update needed, no file writing ...

I'm using the last Strech version and all tutorials are about 'overlay'.

Can't I just use simple way like :
> disable swap
> mount some files in ram disk (logs & cie)
> make SD card read-only

Is there a tutorial about RO system for Raspian Strech version ?

Thanks.

Re: simple RO headless pi zero system

Posted: Tue Sep 04, 2018 1:05 pm
by thagrol
I've had success with this: https://learn.adafruit.com/read-only-raspberry-pi/

Does what you're asking for.

Re: simple RO headless pi zero system

Posted: Tue Sep 04, 2018 1:51 pm
by Seb.26
I will try this, thanks for your help.

Re: simple RO headless pi zero system

Posted: Thu Sep 06, 2018 9:01 am
by Joel_Mckay
Indeed, I put together a gpu mate desktop Raspbian Stretch pi3 kernel version with Overlay, AUFS, and the vc4 core bug fix.
https://sourceforge.net/projects/microm ... -pi/files/
(there is still that flash & gpu enabled VLC plug-in bug that requires restarting midori once)

> disable swap
not a good idea for users given the ram drive fills quickly, but I simply moved the swap file into a user partition
(The OS / and /boot is read-only)

> mount some files in ram disk (logs & cie)
already done, keep in mind you'll need to modify several processes (mostly systemd related)

> make SD card read-only
While the program is compiled in this OS, it doesn't really allow easy updates

You could easily modify the scripts for your setup with:
1. remount the os in RW mode
2. cp -R /home/pi /root/pi
3. apt-get remove purge dphys-swapfile
4. unmount /home
5. mv /root/pi /home/pi
6. comment out /home mount in /etc/fstab*
7. edit RO/RW mount shell scripts in /opt to support card (un)locking (the sdcard program is in /usr/local/ )
8. reboot in RO

Be aware you will have about 40MB of changes in /home before the system runs out of ram.
However, I'm sure you can rebuild the ramdisk file for your needs, and start purging files you don't need to make the OS smaller.
;-)

Best of luck,
~J~

Re: simple RO headless pi zero system

Posted: Mon Sep 10, 2018 10:34 am
by HawaiianPi
You might want to take a look at Tinycore Linux for the Pi. http://tinycorelinux.net/ports.html

It runs entirely from RAM, so no writes to the SD card.

Re: simple RO headless pi zero system

Posted: Tue Sep 18, 2018 9:48 am
by rln
HawaiianPi wrote:
Mon Sep 10, 2018 10:34 am
It runs entirely from RAM, so no writes to the SD card.
Another ramdisk distro alternative is my Nard.
http://www.nard.se/