From patchwork Fri Nov 22 18:10:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jeroen.de.wachter@telenet.be X-Patchwork-Id: 293572 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 8024E2C00E0 for ; Sat, 23 Nov 2013 05:10:33 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8C55E82577; Fri, 22 Nov 2013 18:10:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KMaVnJVKJhVT; Fri, 22 Nov 2013 18:10:25 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 1527C82459; Fri, 22 Nov 2013 18:10:25 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id DE1DD1C2D86 for ; Fri, 22 Nov 2013 18:10:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D750282459 for ; Fri, 22 Nov 2013 18:10:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D2mLHfb7CEor for ; Fri, 22 Nov 2013 18:10:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gerard.telenet-ops.be (gerard.telenet-ops.be [195.130.132.48]) by whitealder.osuosl.org (Postfix) with ESMTP id DF84882397 for ; Fri, 22 Nov 2013 18:10:21 +0000 (UTC) Received: from zcshobo47.telenet-ops.be ([213.224.145.81]) by gerard.telenet-ops.be with bizsmtp id siAK1m0141lbizZ0HiAKKP; Fri, 22 Nov 2013 19:10:19 +0100 Date: Fri, 22 Nov 2013 19:10:19 +0100 (CET) From: jeroen.de.wachter@telenet.be To: buildroot@busybox.net Message-ID: <1485435858.899015.1385143819916.JavaMail.root@telenet.be> MIME-Version: 1.0 X-Originating-IP: [::ffff:195.207.101.112] Thread-Topic: Add support to set the default port for dropbear to listen on Thread-Index: Gs2Mms9D6Le9S3mtr51AAhFxmZkoBw== Subject: [Buildroot] [PATCH 1/1] Add support to set the default port for dropbear to listen on X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net A menu entry has been added to set the port. This menu entry is processed like entries that were already present and will rewrite one line of the options.h file that is used by dropbear during compilation. Signed-off-by: Jeroen De Wachter --- package/dropbear/Config.in | 11 +++++++++++ package/dropbear/dropbear.mk | 6 ++++++ 2 files changed, 17 insertions(+), 0 deletions(-) -- 1.7.1 diff --git a/package/dropbear/Config.in b/package/dropbear/Config.in index 68c3b71..f266567 100644 --- a/package/dropbear/Config.in +++ b/package/dropbear/Config.in @@ -36,4 +36,15 @@ config BR2_PACKAGE_DROPBEAR_LASTLOG Enable logging of dropbear access to lastlog. Notice that Buildroot does not generate lastlog by default. +config BR2_PACKAGE_DROPBEAR_DEFPORT + int "Default port" + default "22" + depends on BR2_PACKAGE_DROPBEAR + help + Default port for dropbear to listen on. Can be overruled + by command line option. The default init script calls the + binary without parameters so if you want to use the + default script, this is a good way of setting a + non-standard port. + endif diff --git a/package/dropbear/dropbear.mk b/package/dropbear/dropbear.mk index 7fa9273..84c34be 100644 --- a/package/dropbear/dropbear.mk +++ b/package/dropbear/dropbear.mk @@ -39,6 +39,10 @@ define DROPBEAR_BUILD_FEATURED $(SED) 's:.*\(#define DROPBEAR_SHA2_512_HMAC\).*:\1:' $(@D)/options.h endef +define DROPBEAR_SET_DEFPORT + $(SED) 's:.*\(#define DROPBEAR_DEFPORT\).*:\1 "$(BR2_PACKAGE_DROPBEAR_DEFPORT)":' $(@D)/options.h +endef + define DROPBEAR_DISABLE_STANDALONE $(SED) 's:\(#define NON_INETD_MODE\):/*\1 */:' $(@D)/options.h endef @@ -72,6 +76,8 @@ ifneq ($(BR2_PACKAGE_DROPBEAR_LASTLOG),y) DROPBEAR_CONF_OPT += --disable-lastlog endif +DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_SET_DEFPORT + define DROPBEAR_INSTALL_TARGET_CMDS $(INSTALL) -m 755 $(@D)/dropbearmulti $(TARGET_DIR)/usr/sbin/dropbear for f in $(DROPBEAR_TARGET_BINS); do \