mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: "Bart vdr. Meulen" <bartvdrmeulen@gmail.com>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH] busybox: add sysctl config file
Date: Mon, 28 May 2012 14:42:27 +0200	[thread overview]
Message-ID: <1338208981-8681-1-git-send-email-bartvdrmeulen@gmail.com> (raw)

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

                 reply	other threads:[~2012-05-28 12:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1338208981-8681-1-git-send-email-bartvdrmeulen@gmail.com \
    --to=bartvdrmeulen@gmail.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox