summaryrefslogtreecommitdiff
path: root/meta/classes/image.bbclass
diff options
context:
space:
mode:
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>2015-09-30 15:53:17 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-01 07:40:36 +0100
commita4b91f5199dd4d1302484cbd972a484d36f7886f (patch)
tree83cf1acf4b8423d061384c86db96a739cc1c42d9 /meta/classes/image.bbclass
parentd5ea131fe94939daabee1afe8219683de259b7a3 (diff)
downloadopenembedded-core-a4b91f5199dd4d1302484cbd972a484d36f7886f.tar.gz
openembedded-core-a4b91f5199dd4d1302484cbd972a484d36f7886f.tar.bz2
openembedded-core-a4b91f5199dd4d1302484cbd972a484d36f7886f.zip
image.bbclass: tweak the key location for dropbear when rootfs is readonly
In the same way it's done for openssh. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r--meta/classes/image.bbclass11
1 files changed, 11 insertions, 0 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 9fbdce583c..d2f8105f13 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -251,6 +251,17 @@ read_only_rootfs_hook () {
echo "SSHD_OPTS='-f /etc/ssh/sshd_config_readonly'" >> ${IMAGE_ROOTFS}/etc/default/ssh
fi
fi
+
+ # Also tweak the key location for dropbear in the same way.
+ if [ -d ${IMAGE_ROOTFS}/etc/dropbear ]; then
+ if [ -e ${IMAGE_ROOTFS}/etc/dropbear/dropbear_rsa_host_key ]; then
+ echo "DROPBEAR_RSAKEY_DIR=/etc/dropbear" >> ${IMAGE_ROOTFS}/etc/default/dropbear
+ else
+ echo "DROPBEAR_RSAKEY_DIR=/var/lib/dropbear" >> ${IMAGE_ROOTFS}/etc/default/dropbear
+ fi
+ fi
+
+
if ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "true", "false", d)}; then
# Change the value of ROOTFS_READ_ONLY in /etc/default/rcS to yes
if [ -e ${IMAGE_ROOTFS}/etc/default/rcS ]; then