[Buildroot] [PATCH] package: dropbear: add support for displaying /etc/motd

Thomas Petazzoni thomas.petazzoni at bootlin.com
Thu May 23 12:28:57 UTC 2019


Hello Alexandru,

On Thu, 23 May 2019 15:11:15 +0300
Alexandru Ardelean <ardeleanalex at gmail.com> wrote:

> When dropbear changed the way how to configure things, by providing a
> `localoptions.h` file, it also defaulted (somehow) to disable the display
> of /etc/motd by default.
> 
> This can be configured by adding a `#define DO_MOTD 1` in the
> `localoptions.h`, which requires it's own `BR2_PACKAGE_DROPBEAR_MOTD`
> Kconfig option.
> 
> By default, support for displaying `/etc/motd` on login is disabled.
> 
> Signed-off-by: Alexandru Ardelean <ardeleanalex at gmail.com>

Thanks for your patch.

> +config BR2_PACKAGE_DROPBEAR_MOTD
> +	bool "display motd on login"
> +	help
> +	  Add support for displaying the contents of /etc/motd
> +	  when a user logs into a SSH session.

In fact, I am a bit worried by all those additional dropbear options to
tweak "minor" details of the dropbear configuration.

Perhaps we should bite the bullet and add an option like this:

config BR2_PACKAGE_DROPBEAR_CONFIG_FILE
	string "path to dropbear config file"
	help
	  Path to a file whose contents will be appended to Dropbear
	  localoptions.h. It can be used to tweak the Dropbear
	  configuration.

And then, in the .mk:

DROPBEAR_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_DROPBEAR_CONFIG_FILE))
ifneq ($(DROPBEAR_CONFIG_FILE),)
define DROPBEAR_APPEND_CONFIG_FILE
	cat $(DROPBEAR_CONFIG_FILE) >> $(@D)/localoptions.h
endef
DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_APPEND_CONFIG_FILE
endif

This way, we have something that is much more flexible, as it allows
you to define whatever Dropbear option you like.

Note: this is just a suggestion; I don't know what other
maintainers/developers will think about it.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


More information about the buildroot mailing list