mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] busybox: add sysctl config file
@ 2012-05-28 12:42 Bart vdr. Meulen
  0 siblings, 0 replies; only message in thread
From: Bart vdr. Meulen @ 2012-05-28 12:42 UTC (permalink / raw)
  To: ptxdist

From: Remy Bohmer <linux@bohmer.net>

Add sysctl.conf to busybox configuration

Add option to install an generic, or project specific sysctl.conf file on the
target filesystem.
Also add the option to read the file during boot-time

Signed-off-by: Remy Bohmer <linux@bohmer.net>
---
 generic/etc/init.d/sysctl |   23 +++++++++++++++++++++++
 rules/busybox-bbinit.in   |    5 +++++
 rules/busybox.in          |    6 ++++++
 rules/busybox.make        |   15 +++++++++++++++
 4 files changed, 49 insertions(+)
 create mode 100644 generic/etc/init.d/sysctl

diff --git a/generic/etc/init.d/sysctl b/generic/etc/init.d/sysctl
new file mode 100644
index 0000000..d23f9d5
--- /dev/null
+++ b/generic/etc/init.d/sysctl
@@ -0,0 +1,23 @@
+#! /bin/sh
+# /etc/init.d/sysctl: Set kernel variables from /etc/sysctl.conf
+#
+
+PATH=/sbin:$PATH
+which sysctl > /dev/null || exit 0
+
+case "$1" in
+	start|restart|force-reload)
+		for file in /etc/sysctl.conf /etc/sysctl.d/*.conf ; do
+			if [ -r "$file" ] ; then
+				sysctl -p "$file" > /dev/null 2>&1
+			fi
+		done
+		;;
+	stop)
+		;;
+	*)
+		echo "Usage: /etc/init.d/sysctl {start|stop|restart|force-reload}" >&2
+		exit 3
+		;;
+esac
+exit 0
diff --git a/rules/busybox-bbinit.in b/rules/busybox-bbinit.in
index 86b69d5..d414a51 100644
--- a/rules/busybox-bbinit.in
+++ b/rules/busybox-bbinit.in
@@ -30,3 +30,8 @@ config BUSYBOX_TELNETD_BBINIT_LINK
 	prompt "telnetd"
 	default "S16telnetd"
 
+config BUSYBOX_BB_SYSCTL_BBINIT_LINK
+	string
+	depends on BUSYBOX_BB_SYSCTL_STARTSCRIPT
+	prompt "sysctl"
+	default "S17sysctl"
diff --git a/rules/busybox.in b/rules/busybox.in
index 2cfdeaf..41b85f0 100644
--- a/rules/busybox.in
+++ b/rules/busybox.in
@@ -68,6 +68,12 @@ config BUSYBOX_HWCLOCK_STARTSCRIPT
 	default y
 	prompt "install /etc/init.d/hwclock"
 
+config BUSYBOX_BB_SYSCTL_STARTSCRIPT
+	bool
+	depends on BUSYBOX_BB_SYSCTL
+	default y
+	prompt "Install /etc/init.d/sysctl"
+
 comment "---"
 
 config BUSYBOX_TELNETD_SYSTEMD_UNIT
diff --git a/rules/busybox.make b/rules/busybox.make
index 9021a02..a3261fb 100644
--- a/rules/busybox.make
+++ b/rules/busybox.make
@@ -170,6 +170,17 @@ ifneq ($(call remove_quotes, $(PTXCONF_BUSYBOX_HWCLOCK_BBINIT_LINK)),)
 		/etc/rc.d/$(PTXCONF_BUSYBOX_HWCLOCK_BBINIT_LINK))
 endif
 endif
+
+ifdef PTXCONF_BUSYBOX_BB_SYSCTL_STARTSCRIPT
+	@$(call install_alternative, busybox, 0, 0, 0755, /etc/init.d/sysctl)
+
+ifneq ($(call remove_quotes,$(PTXCONF_BUSYBOX_BB_SYSCTL_BBINIT_LINK)),)
+	@$(call install_link, busybox, \
+		../init.d/sysctl, \
+		/etc/rc.d/$(PTXCONF_BUSYBOX_BB_SYSCTL_BBINIT_LINK))
+endif
+endif
+
 endif # PTXCONF_INITMETHOD_BBINIT
 
 ifdef PTXCONF_BUSYBOX_TELNETD_SYSTEMD_UNIT
@@ -199,6 +210,10 @@ ifdef PTXCONF_BUSYBOX_CROND
 	@$(call install_copy, busybox, 0, 0, 0755, /var/spool/cron/crontabs/)
 endif
 
+ifdef PTXCONF_BUSYBOX_BB_SYSCTL
+	@$(call install_alternative, busybox, 0, 0, 0755, /etc/sysctl.conf)
+endif
+
 	@$(call install_finish, busybox)
 
 	@$(call touch)
-- 
1.7.9.5


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-05-28 12:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-28 12:42 [ptxdist] [PATCH] busybox: add sysctl config file Bart vdr. Meulen

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