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].



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
echo "$HOSTNAME" > /etc/hostname
echo " $HOSTNAME" >> /etc/hosts
+# needed for read-only rootfs with writable /home
+mv /root /home/
+ln -s /home/root /root

Join { to automatically receive all group messages.