openssh: fix for read-only rootfs
authorChen Qi <Qi.Chen@windriver.com>
Mon, 29 Jul 2013 02:11:07 +0000 (10:11 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 16 Aug 2013 10:14:36 +0000 (11:14 +0100)
commit5a311d1eaacc4c6ac469bde7616d5fc43da1db54
treeee56644758a52edb124f607ee2b41639b27d5678
parent64bcd633f4fcdfbaa8b8ce244499ba1d1e651c9b
openssh: fix for read-only rootfs

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.

In order for Yocto based image to work correctly for read-only rootfs,
we use the following logic for openssh.

If the rootfs is read-only and there are pre-generated keys under /etc/ssh,
we use the pre-generated keys. Note the pre-generated keys are mainly for
debugging or development purpose.
If the rootfs is read-only and there are no pre-generated keys under
/etc/ssh, we use /var/run/ssh as the location for ssh keys. That is, at
system boot-up, the generated ssh keys will put into /var/run/ssh.

[YOCTO #4887]

(From OE-Core rev: 2ed44745024f04aa4e00ddba3009153c6b47c8e9)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/image.bbclass
meta/recipes-connectivity/openssh/openssh-6.2p2/init
meta/recipes-connectivity/openssh/openssh_6.2p2.bb