[OE-core] [PATCH V2 10/10] openssh: make /etc/ssh directory writable in read-only rootfs
Qi.Chen at windriver.com
Qi.Chen at windriver.com
Mon Jul 29 02:33:10 UTC 2013
From: Chen Qi <Qi.Chen at windriver.com>
If the rootfs is read-only and the ssh keys are not available at system
start-up, the init script will generate ssh keys into /etc/ssh, thus
causing a 'read-only file system' error.
Make this directory writable in case of a read-only rootfs.
Note that if the ssh keys are pregenerated, they will not be lost,
as there's a copying process before bind mounting.
[YOCTO #4887]
Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
---
meta/recipes-connectivity/openssh/openssh_6.2p2.bb | 3 +++
1 file changed, 3 insertions(+)
diff --git a/meta/recipes-connectivity/openssh/openssh_6.2p2.bb b/meta/recipes-connectivity/openssh/openssh_6.2p2.bb
index ab2eefb..a1b5e51 100644
--- a/meta/recipes-connectivity/openssh/openssh_6.2p2.bb
+++ b/meta/recipes-connectivity/openssh/openssh_6.2p2.bb
@@ -86,6 +86,9 @@ do_install_append () {
install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/sshd
rm -f ${D}${bindir}/slogin ${D}${datadir}/Ssh.bin
rmdir ${D}${localstatedir}/run/sshd ${D}${localstatedir}/run ${D}${localstatedir}
+ # Create config files for read-only rootfs
+ install -d ${D}${sysconfdir}/default/readonly
+ echo "/etc/ssh /var/volatile/etc/ssh" > ${D}${sysconfdir}/default/readonly/openssh
}
ALLOW_EMPTY_${PN} = "1"
--
1.7.9.5
More information about the Openembedded-core
mailing list