From patchwork Sun May 12 19:55:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiDFgXlzemN6ZWs=?= X-Patchwork-Id: 1098586 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bofc.pl Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 452F7z65MHz9sNk for ; Mon, 13 May 2019 05:56:31 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 69C8A23DA9; Sun, 12 May 2019 19:56:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UpAFlxdP78Ya; Sun, 12 May 2019 19:56:24 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 84BDE23BE7; Sun, 12 May 2019 19:56:14 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 44A5C1BF859 for ; Sun, 12 May 2019 19:56:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id F0F0485361 for ; Sun, 12 May 2019 19:56:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uipKc1WCN8Xw for ; Sun, 12 May 2019 19:56:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from cache12.mydevil.net (cache12.mydevil.net [128.204.216.223]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 1C46485249 for ; Sun, 12 May 2019 19:56:11 +0000 (UTC) From: =?utf-8?b?TWljaGHFgiDFgXlzemN6ZWs=?= To: buildroot@buildroot.org Date: Sun, 12 May 2019 21:55:46 +0200 Message-Id: <20190512195550.24457-9-michal.lyszczek@bofc.pl> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20190512195550.24457-1-michal.lyszczek@bofc.pl> References: <20190512195550.24457-1-michal.lyszczek@bofc.pl> MIME-Version: 1.0 X-AV-Check: Passed X-System-Sender: michal.lyszczek@bofc.pl Subject: [Buildroot] [PATCH v2 09/13] package/openrc: add patch to support busybox version of sysctl X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?TWljaGHFgiDFgXlzemN6ZWs=?= Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Busybox version of sysctl does not support --system argument, and files need to be loaded one by one. This patch adds code to sysctl service in openrc to recognize busybox sysctl and execute proper function based on that. Signed-off-by: Michał Łyszczek --- Changes v1 -> v2 None --- ...tl.in-add-support-for-busybox-sysctl.patch | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 package/openrc/0001-init.d-sysctl.in-add-support-for-busybox-sysctl.patch diff --git a/package/openrc/0001-init.d-sysctl.in-add-support-for-busybox-sysctl.patch b/package/openrc/0001-init.d-sysctl.in-add-support-for-busybox-sysctl.patch new file mode 100644 index 0000000000..da8cf042c6 --- /dev/null +++ b/package/openrc/0001-init.d-sysctl.in-add-support-for-busybox-sysctl.patch @@ -0,0 +1,66 @@ +From ec1a0c8fa2e7a7c6cf70f68bdabc07cbb1a567cf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20=C5=81yszczek?= +Date: Sun, 5 May 2019 23:43:40 +0200 +Subject: [PATCH] init.d/sysctl.in: add support for busybox sysctl +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Busybox version of sysctl does not support --system argument, +and files need to be loaded one by one. This patch adds code +to recognize busybox sysctl and execute proper function based +on that. + +Signed-off-by: Michał Łyszczek +--- + init.d/sysctl.in | 27 ++++++++++++++++++++++++++- + 1 file changed, 26 insertions(+), 1 deletion(-) + +diff --git a/init.d/sysctl.in b/init.d/sysctl.in +index e49f4db2..a705b3d4 100644 +--- a/init.d/sysctl.in ++++ b/init.d/sysctl.in +@@ -37,6 +37,23 @@ BSD_sysctl() + return $retval + } + ++Busybox_sysctl() ++{ ++ local quiet ++ yesno $rc_verbose || quiet=-q ++ ++ eindent ++ for conf in /etc/sysctl.conf /etc/sysctl.d/*.conf; do ++ if [ -r "$conf" ]; then ++ vebegin "applying $conf" ++ sysctl $quiet -p "$conf" || retval=1 ++ veend $retval ++ fi ++ done ++ eoutdent ++ return $retval ++} ++ + Linux_sysctl() + { + local quiet +@@ -52,7 +69,15 @@ start() + ebegin "Configuring kernel parameters" + case "$RC_UNAME" in + *BSD|GNU) BSD_sysctl; rc=$? ;; +- Linux) Linux_sysctl; rc=$? ;; ++ Linux) ++ sysctl -h > /dev/null 2>&1 ++ if [ $? -ne 0 ]; then ++ # busybox version of sysctl does not recognize -h option ++ Busybox_sysctl ++ else ++ Linux_sysctl ++ fi ++ rc=$? ;; + esac + eend $rc "Unable to configure some kernel parameters" + } +-- +2.18.1 +