Re: [isar-cip-core][PATCH v2 4/6] customizations: Relocate /root under /home


Quirin Gylstorff
 

On 4/22/22 09:47, Jan Kiszka wrote:
From: Jan Kiszka <jan.kiszka@...>
This is needed for read-only rootfs setups. We could also update the
account settings, but establishing a link comes with less surprises.
What happens if the /home mount fails? Does the system fall back to / ?

This should be the behavior according to [1].

[1]: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s14.html

Quirin


Signed-off-by: Jan Kiszka <jan.kiszka@...>
---
recipes-core/customizations/files/postinst | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/recipes-core/customizations/files/postinst b/recipes-core/customizations/files/postinst
index 9b553da..6ca309a 100644
--- a/recipes-core/customizations/files/postinst
+++ b/recipes-core/customizations/files/postinst
@@ -17,3 +17,7 @@ echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
HOSTNAME=demo
echo "$HOSTNAME" > /etc/hostname
echo "127.0.0.1 $HOSTNAME" >> /etc/hosts
+
+# needed for read-only rootfs with writable /home
+mv /root /home/
+ln -s /home/root /root

Join {cip-dev@lists.cip-project.org to automatically receive all group messages.