Patchwork dropbear: hack around different sftp-server path definitions

mail settings
Submitter Enrico Scholz
Date April 26, 2013, 4:38 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/48957/
State New
Headers show


Enrico Scholz - April 26, 2013, 4:38 p.m.
oe defines libexecdir to be different for each package which breaks
the expectations of dropbear which searches 'sftp-server' within

Patch tries to guess the correct location of the sftp-server helper
program by testing for oe's idea of libexecdir.  People on irc told
they are using the traditional '/usr/libexec' in their distribution so
that this case is handled as well.

Patch is not perfect, but solves the problem for now.

Signed-off-by: Enrico Scholz <>
 meta/recipes-core/dropbear/ | 8 ++++++++
 1 file changed, 8 insertions(+)


diff --git a/meta/recipes-core/dropbear/ b/meta/recipes-core/dropbear/
index 945e3d7..2a44a0c 100644
--- a/meta/recipes-core/dropbear/
+++ b/meta/recipes-core/dropbear/
@@ -32,6 +32,14 @@  inherit autotools update-rc.d
 INITSCRIPT_NAME = "dropbear"
 INITSCRIPT_PARAMS = "defaults 10"
+# workaround different libexecdir definition in oe; it does not fix
+# the multilib issues but mades sftp work again when dropbear and
+# openssh-sftp-server are for the same architecture.
+_sftp_server_path = "${@\
+    ['${libexecdir}/sftp-server','${libdir}/openssh/sftp-server']\
+    [d.getVar('libexecdir', True).endswith(d.expand('/${BPN}'))]}"
+CFLAGS += "-DSFTPSERVER_PATH=\\"${_sftp_server_path}\\""
 CFLAGS_prepend = " -I. "
 LD = "${CC}"