Skip to contentSkip to conversation

Password updates to compressed root image in flash

DISCUSSION David Bilsby 2 participants 2 messages Feb 1, 2016

lore
Share & tools
lore
#0 lore raw

We have a project which will use a Xilinx Zynq running embedded Linux built by Yocto (probably kernel 4.0). The system will boot from QSPI, this will contain the FSBL, u-boot, compressed kernel and compressed rootfs. The rootfs will be expanded into an initramfs which will then be used as the running systems rootfs (rw).

How given this arrangement do you make passwd updates persistent across reboots as currently the update will only affect the RAM copy of /etc/passwd and not get written back to the password file stored in the compressed rootfs image in flash? Similarly how can things like the public key which DropBear generates at boot time be stored permanently so it does not get regenerated every time?

This seems like such an obvious question, however I have not found an answer when searching. I thought it may be possible to split the rootfs into effectively a read-only part (read-write but non-persistent) and a read-write part (persistent) and the splice the two together, but I'm not sure how best to do this. Flash space is very tight on this system so keeping the rootfs in flash uncompressed is not an option.

Any suggestions as to how this is best handled very much appreciated.

Thanks

#1 lore raw
Quoted 7 lines · David Bilsby

We have a project which will use a Xilinx Zynq running embedded Linux built by Yocto (probably kernel 4.0). The system will boot from QSPI, this will contain the FSBL, u-boot, compressed kernel and compressed rootfs. The rootfs will be expanded into an initramfs which will then be used as the running systems rootfs (rw).

How given this arrangement do you make passwd updates persistent across reboots as currently the update will only affect the RAM copy of /etc/passwd and not get written back to the password file stored in the compressed rootfs image in flash? Similarly how can things like the public key which DropBear generates at boot time be stored permanently so it does not get regenerated every time?

you can use symlink farm to point to pregenerated keys
second approach is to use overlays from persistent storage
start looking at readonly-rootfs work that has gone into OE in recent years.

Quoted 12 lines

This seems like such an obvious question, however I have not found an answer when searching. I thought it may be possible to split the rootfs into effectively a read-only part (read-write but non-persistent) and a read-write part (persistent) and the splice the two together, but I'm not sure how best to do this. Flash space is very tight on this system so keeping the rootfs in flash uncompressed is not an option.

Any suggestions as to how this is best handled very much appreciated.

Thanks

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto