diff mbox

[2/7,v3] package/dropbear: Add separate configuration option for dropbear server

Message ID 1402982507.184682.35787456543.2.gpush@pablo
State Rejected
Headers show

Commit Message

Jeremy Kerr June 17, 2014, 5:21 a.m. UTC
Currently, the dropbear package installs both client and server
components. This means that when we only want the client binaries, we
also get the server, which is run from init.

Even though it's a multi-call binary (the client and server
exist in the same executable), we can define which parts are
compiled-in. We'd also like to selectively install the links and init
scripts.

This change introduces a separate configuration for the dropbear server.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

---
 package/dropbear/Config.in   |    6 ++++++
 package/dropbear/dropbear.mk |   11 +++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

Comments

Gustavo Zacarias July 17, 2014, 7:44 p.m. UTC | #1
On 06/17/2014 02:21 AM, Jeremy Kerr wrote:

> Currently, the dropbear package installs both client and server
> components. This means that when we only want the client binaries, we
> also get the server, which is run from init.
> 
> Even though it's a multi-call binary (the client and server
> exist in the same executable), we can define which parts are
> compiled-in. We'd also like to selectively install the links and init
> scripts.
> 
> This change introduces a separate configuration for the dropbear server.

Hi.
This can be disabled in a post build script by removing the initscript
directly.
If it were a build option that saves space in the target i'd say yay,
but it's not.
And it's a slippery rope since the same could be said/done to countless
other packages that have client-server functionality like openssh,
netsnmp, openvpn and so on.
Others might disagree with me of course.
Regards.
Thomas Petazzoni July 23, 2014, 9:50 p.m. UTC | #2
Dear Gustavo Zacarias,

On Thu, 17 Jul 2014 16:44:37 -0300, Gustavo Zacarias wrote:

> This can be disabled in a post build script by removing the initscript
> directly.
> If it were a build option that saves space in the target i'd say yay,
> but it's not.
> And it's a slippery rope since the same could be said/done to countless
> other packages that have client-server functionality like openssh,
> netsnmp, openvpn and so on.
> Others might disagree with me of course.

Agreed. Therefore, I've marked the patch as rejected in patchwork.

Thanks,

Thomas
diff mbox

Patch

diff --git a/package/dropbear/Config.in b/package/dropbear/Config.in
index 68c3b71..9ff5f47 100644
--- a/package/dropbear/Config.in
+++ b/package/dropbear/Config.in
@@ -8,6 +8,12 @@  config BR2_PACKAGE_DROPBEAR
 
 if BR2_PACKAGE_DROPBEAR
 
+config BR2_PACKAGE_DROPBEAR_SERVER
+	bool "dropbear ssh server"
+	default y
+	help
+	  Enable the dropbear ssh server, run from init
+
 config BR2_PACKAGE_DROPBEAR_DISABLE_REVERSEDNS
 	bool "disable reverse DNS lookups"
 	help
diff --git a/package/dropbear/dropbear.mk b/package/dropbear/dropbear.mk
index 3a39169..4fa26da 100644
--- a/package/dropbear/dropbear.mk
+++ b/package/dropbear/dropbear.mk
@@ -8,8 +8,9 @@  DROPBEAR_VERSION = 2014.63
 DROPBEAR_SITE = http://matt.ucc.asn.au/dropbear/releases
 DROPBEAR_SOURCE = dropbear-$(DROPBEAR_VERSION).tar.bz2
 DROPBEAR_TARGET_BINS = dbclient dropbearkey dropbearconvert scp ssh
+DROPBEAR_MAKE_PROGRAMS = $(filter-out ssh, $(DROPBEAR_TARGET_BINS))
 DROPBEAR_MAKE =	$(MAKE) MULTI=1 SCPPROGRESS=1 \
-		PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
+		PROGRAMS="$(DROPBEAR_MAKE_PROGRAMS)"
 
 DROPBEAR_LICENSE = MIT, BSD-2c-like, BSD-2c
 DROPBEAR_LICENSE_FILES = LICENSE
@@ -18,6 +19,10 @@  ifeq ($(BR2_PREFER_STATIC_LIB),y)
 DROPBEAR_MAKE += STATIC=1
 endif
 
+ifeq ($(BR2_PACKAGE_DROPBEAR_SERVER),y)
+DROPBEAR_TARGET_BINS += dropbear
+endif
+
 define DROPBEAR_FIX_XAUTH
 	$(SED) 's,^#define XAUTH_COMMAND.*/xauth,#define XAUTH_COMMAND "/usr/bin/xauth,g' $(@D)/options.h
 endef
@@ -43,6 +48,7 @@  define DROPBEAR_DISABLE_STANDALONE
 	$(SED) 's:\(#define NON_INETD_MODE\):/*\1 */:' $(@D)/options.h
 endef
 
+ifeq ($(BR2_PACKAGE_DROPBEAR_SERVER),y)
 define DROPBEAR_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/dropbear/dropbear.service \
 		$(TARGET_DIR)/etc/systemd/system/dropbear.service
@@ -59,6 +65,7 @@  endef
 else
 DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_DISABLE_STANDALONE
 endif
+endif
 
 ifeq ($(BR2_PACKAGE_DROPBEAR_DISABLE_REVERSEDNS),)
 DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_ENABLE_REVERSE_DNS
@@ -82,7 +89,7 @@  endif
 
 define DROPBEAR_INSTALL_TARGET_CMDS
 	$(INSTALL) -m 755 $(@D)/dropbearmulti $(TARGET_DIR)/usr/sbin/dropbear
-	for f in $(DROPBEAR_TARGET_BINS); do \
+	for f in $(filter-out dropbear,$(DROPBEAR_TARGET_BINS)); do \
 		ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/$$f ; \
 	done
 	mkdir -p $(TARGET_DIR)/etc/dropbear