[OpenWrt-Devel] [PATCH] [package] busybox: Add option to install example udhcpc script

Michal Hrusecky michal.hrusecky at nic.cz
Fri May 13 04:17:44 EDT 2016


When building very minimal system, people might be interested in using udhcpc.
To be able to use it, it needs script to actually set addresses. There is an
example script provided in examples directory which might be good enough for
some purposes. This patch makes it possible to select it in menuconfig and
enable it's installation.

Signed-off-by: Michal Hrusecky <michal.hrusecky at nic.cz>
---
 package/utils/busybox/Makefile                          | 5 +++++
 package/utils/busybox/config/networking/udhcp/Config.in | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile
index 24c064c..1f60257 100644
--- a/package/utils/busybox/Makefile
+++ b/package/utils/busybox/Makefile
@@ -115,6 +115,11 @@ define Package/busybox/install
 	$(INSTALL_BIN) ./files/cron $(1)/etc/init.d/cron
 	$(INSTALL_BIN) ./files/sysntpd $(1)/etc/init.d/sysntpd
 	$(INSTALL_BIN) ./files/ntpd-hotplug $(1)/usr/sbin/ntpd-hotplug
+	$(INSTALL_DIR) $(1)/etc/init.d
+ ifeq ($(CONFIG_BUSYBOX_CONFIG_UDHCP_INSTALL_SIMPLE_SCRIPT),y)
+	$(INSTALL_DIR) $(1)$(shell dirname $(CONFIG_BUSYBOX_CONFIG_UDHCPC_DEFAULT_SCRIPT))
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/examples/udhcp/simple.script $(1)$(CONFIG_BUSYBOX_CONFIG_UDHCPC_DEFAULT_SCRIPT)
+ endif
 	-rm -rf $(1)/lib64
 endef
 
diff --git a/package/utils/busybox/config/networking/udhcp/Config.in b/package/utils/busybox/config/networking/udhcp/Config.in
index 4f48400..371adc4 100644
--- a/package/utils/busybox/config/networking/udhcp/Config.in
+++ b/package/utils/busybox/config/networking/udhcp/Config.in
@@ -147,6 +147,13 @@ config BUSYBOX_CONFIG_UDHCPC_DEFAULT_SCRIPT
 	  examples/udhcp for a working example. Normally it is safe
 	  to leave this untouched.
 
+config BUSYBOX_CONFIG_UDHCP_INSTALL_SIMPLE_SCRIPT
+	bool "Install simple config script"
+	default n
+	depends on BUSYBOX_CONFIG_UDHCPC
+	help
+	  Installs example configuration script so udhcpc can be used out of the box.
+
 config BUSYBOX_CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS
 	int "DHCP options slack buffer size"
 	default BUSYBOX_DEFAULT_UDHCPC_SLACK_FOR_BUGGY_SERVERS
-- 
2.8.2
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list