I'm creating an embedded system using Buildroot. Currently, my Buildroot configuration ensures the rootfs is remounted as read/write during startup. However I would like to remove this feature and keep my rootfs as read-only.
I have a few questions regarding this:
How do I change a user's password? This would require changing /etc/passwd & /etc/shadow.
How do I change the timezone? This would require changing /etc/localtime.
How do I create ssh keys for sshd? ssh-keygen creates the keys in /etc/ssh/
According to the Filesystem Hierarchy Standard, a Linux system is required to function with a read-only /etc/ directory, but it seems I'm finding a distinct loss of functionality as described above.
Secondly, after specifying that the rootfs is to remain read-only in my Buildroot configuration, it elects to mount /var/ as a tmpfs (in RAM, so it is writable)
But, this is volatile, how can I ensure runtime files (which I need to save) aren't lost on reboot or unexpected power-loss?
I'm using UBIFS, in my embedded system. Am I required to create a read/write UBI volume which I use as persistent storage? Is this the standard in embedded systems?
And finally, should I re-evaluate my idea to use a read-only rootfs at all? Given I am using UBI, and as wear-levelling is implemented across all the UBI volumes (the exist on the same device, of course), will I receive any benefit in making my rootfs read-only?