summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMichael Glembotzki <m.glembo@gmail.com>2024-04-22 18:39:38 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-04-23 13:40:18 +0100
commit943c6acf855fd9de592f0b77828242c2c6e0869f (patch)
tree5bdc89ce18921738404e2c7d75f1417aef250e44 /meta
parent1f17a8d13684db6cc603a5184f5d61ab8c715d89 (diff)
downloadopenembedded-core-master.tar.gz
rootfs-postcommands.bbclass: Only set DROPBEAR_RSAKEY_DIR onceHEADmaster
If DROPBEAR_RSAKEY_DIR has already been set before, e.g. by overwriting the file dropbear.default, the line will still be appended a second time. DROPBEAR_RSAKEY_DIR="/path/to/dropbear" DROPBEAR_EXTRA_ARGS="-B" DROPBEAR_RSAKEY_DIR=/var/lib/dropbear Signed-off-by: Michael Glembotzki <Michael.Glembotzki@iris-sensing.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes-recipe/rootfs-postcommands.bbclass4
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/classes-recipe/rootfs-postcommands.bbclass b/meta/classes-recipe/rootfs-postcommands.bbclass
index e81b69a239..920da94ba2 100644
--- a/meta/classes-recipe/rootfs-postcommands.bbclass
+++ b/meta/classes-recipe/rootfs-postcommands.bbclass
@@ -206,7 +206,9 @@ read_only_rootfs_hook () {
# 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=/var/lib/dropbear" >> ${IMAGE_ROOTFS}/etc/default/dropbear
+ if ! grep -q "^DROPBEAR_RSAKEY_DIR=" ${IMAGE_ROOTFS}/etc/default/dropbear ; then
+ echo "DROPBEAR_RSAKEY_DIR=/var/lib/dropbear" >> ${IMAGE_ROOTFS}/etc/default/dropbear
+ fi
fi
fi
fi