Skip to contentSkip to conversation

Add support to set the default port for dropbear to listen on

PATCH In review jeroen.de.wachter at telenet.be 7 participants 7 messages Nov 22, 2013 – Dec 3, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add support to set the default port for dropbear to listen on

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.

---
 package/dropbear/Config.in   |   11 +++++++++++
 package/dropbear/dropbear.mk |    6 ++++++
 2 files changed, 17 insertions(+), 0 deletions(-)
package/dropbear/Config.in +11 -0
index 68c3b71..f266567 100644
@@ -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
package/dropbear/dropbear.mk +6 -0
index 7fa9273..84c34be 100644
@@ -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

#1 lore raw

PATCH 1/1 Add support to set the default port for dropbear to listen on

Hi Jeroen,

Quoted 16 lines · On Fri, Nov 22, 2013 at 7:10 PM, <[email protected]> wrote:

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.

---
 package/dropbear/Config.in   |   11 +++++++++++
 package/dropbear/dropbear.mk |    6 ++++++
 2 files changed, 17 insertions(+), 0 deletions(-)
package/dropbear/Config.in +0 -0
index 68c3b71..f266567 100644

package/dropbear/Config.in config BR2_PACKAGE_DROPBEAR_LASTLOG · line 42

Quoted 7 lines
package/dropbear/Config.in +4 -0
@@ -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

This 'depends on' is no longer needed. There is already a 'if BR2_PACKAGE_DROPBEAR' around this block.

Best regards
Thomas

#2 lore raw

PATCH 1/1 Add support to set the default port for dropbear to listen on

In reply to jeroen.de.wachter at telenet.be
Quoted 6 lines · jeroen.de.wachter at telenet.be

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.

Hi Jeroen,

Thank you for your patch. However, I don't think we will accept it in
buildroot. We could make thousands of configuration options that deal with all possible fine-grained tweaking. And especially in this particular case, the option is quite invasive (requires 5 additional lines in the .mk file) and it is possible to achieve the same result by adding a command-line option to dropbear, by including a custom S50dropbear to your fs-overlay.

But of course, our friendly maintainer may be of a different opinion.

The patch itself looks good BTW, except that indentation should be with
a tab (tab + 2 spaces for the Config.in help text).

Regards,
Arnout

[snip]

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#3 lore raw

PATCH 1/1 Add support to set the default port for dropbear to listen on

Jeroen, All,

On 2013-11-22 21:17 +0100, Arnout Vandecappelle spake thusly:

Quoted 8 lines · jeroen.de.wachter at telenet.be
Quoted 6 lines

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.

Quoted 8 lines

Hi Jeroen,

Thank you for your patch. However, I don't think we will accept it in
buildroot. We could make thousands of configuration options that deal with all possible fine-grained tweaking. And especially in this particular case, the option is quite invasive (requires 5 additional lines in the .mk file) and it is possible to achieve the same result by adding a command-line option to dropbear, by including a custom S50dropbear to your fs-overlay.

Agreed. We've already declined to apply such changes in the past, on the ground that this kind of run-time configuration should be delegated to either one of:
- a post-build script (BR2_ROOTFS_POST_BUILD_SCRIPT)
- a rootfs-overlay (BR2_ROOTFS_OVERLAY)

The basic idea is that Buildroot should install default, sane config files in /etc, and startup scripts, that provide the standard behaviour of the package (when that makes sense), and that further project-specific customisation is out-of-scope for Buildroot (but Buildroot offers the rootfs-overlay and post-{build,image} scripts for that).

Also, I do not like the way this change tweaks the code between the extract and patch steps. If that was to be accepted at all, then this should be done with a real patch file, not a sed expression.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 1/1 Add support to set the default port for dropbear to listen on

In reply to jeroen.de.wachter at telenet.be
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"jeroen" == jeroen de wachter <[email protected]> writes:

Hi Jeroen,

Quoted 4 lines

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.

Thanks for the patch, but I'm afraid I agree with Arnout and Yann. The difference between this option and the others is that there's a runtime command line option to set the port (-p), whereas that isn't the case for the others.

Please have a look at changing this with a post build script instead. If we want to do something to make it a bit easier, then we could change the init script to source /etc/default/dropbear if available and let if define E.G. ARGS that we could add to the start-stop-command invocation -E.G. how we do in S81named for the bind package.

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

[Buildroot] Moschip MCS8142 SoC

In reply to jeroen.de.wachter at telenet.be

Has anyone happened to work with this Moschip SoC? I found Linux BSP patches for the MCS8140 (OpenWRT 3.3 Kernel plus some initial attempts at mainlining around 3.7), however that MCS8140 SoC was a true ARMv5 compared to the MCS8142 seems to be based on a Faraday fa526 ARMv4. Plus I'm not to sure if the bus and peripheral architecture are simliar (need to do a little more research yet).

Any help is appreciated (reference docs that outline the register definition, etc.) . We're trying to get a 3.x kernel running on this target to replace a older 2.6.24 blob that we can't get source for.....

Thanks!

Matthew L Weber / Sr Software Engineer / Platform SW mlweber1 at rockwellcollins.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20131202/4ae22c2d/attachment-0001.html>

#6 lore raw

[Buildroot] Moschip MCS8142 SoC

Hi Matthew,

Quoted 10 lines · Matthew Weber

Has anyone happened to work with this Moschip SoC? I found Linux BSP patches for the MCS8140 (OpenWRT 3.3 Kernel plus some initial attempts at mainlining around 3.7), however that MCS8140 SoC was a true ARMv5 compared to the MCS8142 seems to be based on a Faraday fa526 ARMv4. Plus I'm not to sure if the bus and peripheral architecture are simliar (need to do a little more research yet).

Any help is appreciated (reference docs that outline the register definition, etc.) . We're trying to get a 3.x kernel running on this target to replace a older 2.6.24 blob that we can't get source for.....

You have better chances of getting useful answers at the linux-arm-kernel mailing list (linux-arm-kernel at lists.infradead.org).

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -