From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wg0-f42.google.com ([74.125.82.42]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1SYzIG-00089h-BG for ptxdist@pengutronix.de; Mon, 28 May 2012 14:43:33 +0200 Received: by wgbds11 with SMTP id ds11so1408493wgb.1 for ; Mon, 28 May 2012 05:43:22 -0700 (PDT) From: "Bart vdr. Meulen" Date: Mon, 28 May 2012 14:42:27 +0200 Message-Id: <1338208981-8681-1-git-send-email-bartvdrmeulen@gmail.com> Subject: [ptxdist] [PATCH] busybox: add sysctl config file Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de From: Remy Bohmer 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 --- 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