Patchwork dropbear: hack around different sftp-server path definitions

login
register
mail settings
Submitter Enrico Scholz
Date April 26, 2013, 4:38 p.m.
Message ID <1366994325-3427-1-git-send-email-enrico.scholz@sigma-chemnitz.de>
Download mbox | patch
Permalink /patch/48957/
State New
Headers show

Comments

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
${libexecdir}.

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 <enrico.scholz@sigma-chemnitz.de>
---
 meta/recipes-core/dropbear/dropbear.inc | 8 ++++++++
 1 file changed, 8 insertions(+)

Patch

diff --git a/meta/recipes-core/dropbear/dropbear.inc b/meta/recipes-core/dropbear/dropbear.inc
index 945e3d7..2a44a0c 100644
--- a/meta/recipes-core/dropbear/dropbear.inc
+++ b/meta/recipes-core/dropbear/dropbear.inc
@@ -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}"