From: jeroen.de.wachter at telenet.be <jeroen.de.wachter@telenet.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] Add support to set the default port for dropbear to listen on
Date: Fri, 22 Nov 2013 19:10:19 +0100 (CET) [thread overview]
Message-ID: <1485435858.899015.1385143819916.JavaMail.root@telenet.be> (raw)
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 <jeroen.de_wachter@alcatel-lucent.com>
---
package/dropbear/Config.in | 11 +++++++++++
package/dropbear/dropbear.mk | 6 ++++++
2 files changed, 17 insertions(+), 0 deletions(-)
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 \
--
1.7.1
next reply other threads:[~2013-11-22 18:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-22 18:10 jeroen.de.wachter at telenet.be [this message]
2013-11-22 19:52 ` [Buildroot] [PATCH 1/1] Add support to set the default port for dropbear to listen on Thomas De Schampheleire
2013-11-22 20:17 ` Arnout Vandecappelle
2013-11-22 20:58 ` Yann E. MORIN
2013-11-22 22:14 ` Peter Korsgaard
2013-12-03 4:04 ` [Buildroot] Moschip MCS8142 SoC Matthew Weber
2013-12-03 4:52 ` Baruch Siach
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1485435858.899015.1385143819916.JavaMail.root@telenet.be \
--to=jeroen.de.wachter@telenet.be \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox