i'm new by here, and first of all, thank you for the great piece of software !
I came to DietPi while starting a home project using a small cluster of 4 XU4 boards (Odroid MC1) which i want to fully automate (installation and then containerization using Docker or similar software). DietPi was the best choice for that purpose, to my mind.
Anyway, there are 2 improvements that i'd like to do :
1) the root fs (userdata) needs to be deported to a USB device during installation.
2) the boot fs must be set readonly on the µSD once the installation is done.
=> I don't want to write ANY single bit of data to the µSD card after the final automated installation process. The USB device will be used for this purpose.
I spent a few hours looking at the DietPi scripts, and i believe this can be done "easily".
I did it manually just to be sure, using the GUI (dietpi-drive_manager) and CLI (nano /etc/fstab, option ro on /boot)
Reboot and here we go... it works \o/
So here is the workflow i'm thinking about :
- Flash the SD card with a fresh DietPi image,
- Replace some scripts with customized ones (TODO),
- put the SD card and a USB storage in the XU4,
- power on,
The following will be automated :
- the boot process starts and detects a fresh install, with a custom option "Use external USB storage and secure µSD card",
- /boot and /rootfs are mounted from the µSD, and a /dev/sda is detected,
- the custom script launches dietpi-drive_manager with no user input to :
- format the USB storage with EXT4, and maybe fix its UID,
- rsync the root to USB storage,
- modify the mount point of /
- the boot process starts and detects a not-so-fresh install, with a custom option "Use external USB storage and secure µSD card",
- ...do the usual update and other automations...
- before last reboot, the custom script sets the boot fs to read-only.
Do you foresee any problem ?
Thanks in advance for your feedback !