Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package: dropbear: make PATH configurable
@ 2018-03-08 21:44 Markus Mayer
  2018-03-08 21:48 ` Yann E. MORIN
  2018-03-09  9:04 ` Nicolas Cavallari
  0 siblings, 2 replies; 8+ messages in thread
From: Markus Mayer @ 2018-03-08 21:44 UTC (permalink / raw)
  To: buildroot

Make the default PATH dropbear is using configurable.

If not specified, it will continue to default to dropbear's
DEFAULT_PATH.

Signed-off-by: Markus Mayer <mmayer@broadcom.com>
---

Please let me know what you think. Thanks.

 package/dropbear/Config.in   | 6 ++++++
 package/dropbear/dropbear.mk | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/package/dropbear/Config.in b/package/dropbear/Config.in
index 6700778161ba..d38ecf50834a 100644
--- a/package/dropbear/Config.in
+++ b/package/dropbear/Config.in
@@ -55,4 +55,10 @@ 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_PATH
+	string "dropbear default path"
+	help
+	  Use the path specified here as dropbear's default path.
+	  If not specified, dropbear will use "/usr/bin:/bin".
+
 endif
diff --git a/package/dropbear/dropbear.mk b/package/dropbear/dropbear.mk
index 01a1a07b7696..ddbedf3bce93 100644
--- a/package/dropbear/dropbear.mk
+++ b/package/dropbear/dropbear.mk
@@ -51,6 +51,14 @@ define DROPBEAR_DISABLE_STANDALONE
 	$(SED) 's:\(#define NON_INETD_MODE\):/*\1 */:' $(@D)/options.h
 endef
 
+ifneq ($(BR2_PACKAGE_DROPBEAR_PATH),"")
+define DROPBEAR_CUSTOM_PATH
+	$(SED) 's|^\(#define DEFAULT_PATH\).*|\1 $(BR2_PACKAGE_DROPBEAR_PATH)|' $(@D)/options.h
+endef
+
+DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_CUSTOM_PATH
+endif
+
 define DROPBEAR_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/dropbear/dropbear.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/dropbear.service
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [Buildroot] [PATCH v2] package: dropbear: make PATH configurable
@ 2018-03-09 22:41 Markus Mayer
  2018-07-01  1:57 ` [Buildroot] [PATCH] " Carlos Santos
  0 siblings, 1 reply; 8+ messages in thread
From: Markus Mayer @ 2018-03-09 22:41 UTC (permalink / raw)
  To: buildroot

Make the default PATH dropbear is using configurable.

If not specified, it will continue to default to dropbear's
DEFAULT_PATH.

Signed-off-by: Markus Mayer <mmayer@broadcom.com>
---

Changes since v1:
- Made regex safer
  + allow multiple spaces after #define
  + make sure there are spaces or tabs after DEFAULT_PATH

 package/dropbear/Config.in   | 6 ++++++
 package/dropbear/dropbear.mk | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/package/dropbear/Config.in b/package/dropbear/Config.in
index 6700778161ba..0cc68d737d2c 100644
--- a/package/dropbear/Config.in
+++ b/package/dropbear/Config.in
@@ -55,4 +55,10 @@ 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_PATH
+	string "dropbear default path"
+	help
+	  Use the path specified here as dropbear's default path.
+	  If not specified, dropbear will use "/usr/bin:/bin".
+
 endif
diff --git a/package/dropbear/dropbear.mk b/package/dropbear/dropbear.mk
index 01a1a07b7696..9da340670a70 100644
--- a/package/dropbear/dropbear.mk
+++ b/package/dropbear/dropbear.mk
@@ -51,6 +51,14 @@ define DROPBEAR_DISABLE_STANDALONE
 	$(SED) 's:\(#define NON_INETD_MODE\):/*\1 */:' $(@D)/options.h
 endef
 
+ifneq ($(BR2_PACKAGE_DROPBEAR_PATH),"")
+define DROPBEAR_CUSTOM_PATH
+	$(SED) 's|^\(#define \+DEFAULT_PATH\)[	 ]\+.*|\1 $(BR2_PACKAGE_DROPBEAR_PATH)|' $(@D)/options.h
+endef
+
+DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_CUSTOM_PATH
+endif
+
 define DROPBEAR_INSTALL_INIT_SYSTEMD
 	$(INSTALL) -D -m 644 package/dropbear/dropbear.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/dropbear.service
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-07-01  1:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-08 21:44 [Buildroot] [PATCH] package: dropbear: make PATH configurable Markus Mayer
2018-03-08 21:48 ` Yann E. MORIN
2018-03-08 22:29   ` Markus Mayer
2018-03-09  0:34     ` Christopher McCrory
2018-03-09 17:10       ` Christopher McCrory
2018-03-09 21:29         ` Markus Mayer
2018-03-09  9:04 ` Nicolas Cavallari
  -- strict thread matches above, loose matches on Subject: below --
2018-03-09 22:41 [Buildroot] [PATCH v2] " Markus Mayer
2018-07-01  1:57 ` [Buildroot] [PATCH] " Carlos Santos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox