From patchwork Sun Mar 29 23:49:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 1263576 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=DUFz3byh; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48rC4Q6mgRz9sQt for ; Mon, 30 Mar 2020 10:49:42 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 959D0874E9; Sun, 29 Mar 2020 23:49:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PYvrBGZSqoq6; Sun, 29 Mar 2020 23:49:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 700938756D; Sun, 29 Mar 2020 23:49:39 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 7B5D11BF475 for ; Sun, 29 Mar 2020 23:49:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7473A2052C for ; Sun, 29 Mar 2020 23:49:37 +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 3fi6FzDO4eVf for ; Sun, 29 Mar 2020 23:49:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) by silver.osuosl.org (Postfix) with ESMTPS id 5C4382043A for ; Sun, 29 Mar 2020 23:49:35 +0000 (UTC) Received: by mail-qt1-f181.google.com with SMTP id c9so13706435qtw.7 for ; Sun, 29 Mar 2020 16:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7hNWG4w7zbfrjSleW90b0XK818wcAyyLHCUZ3Eowr+Y=; b=DUFz3byhnIlemq4mtmeHLp7EgyM9d1n9jIDUjywWBMXXI6dxWsYopNnZW3sbHQYOsl dmHDw58rKAHjK4n5+7JT8JcujqVIQhkKgVy51Qg3QTOBOkHh39BM5prgoysbJk8byg20 ag1McA7ACiiMYgXQL4z/uOtWoj/kW5eyhGwAUAMCve7Fmt2CZVnF2T7fj37IBHnG8Vhm jjOMC9zSAV6ClCRcpARC4frNTYZpQoiDM/4brwtsA7ul7gjdXC5vPNaBlyVYCOdrdhuR 5Iv5tSqW/0qCldQNfXcMUmEQz9A712WDHRR5W+HbzBBGyWq74NE3K4e0DtwDbd9rzsMN Bg+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7hNWG4w7zbfrjSleW90b0XK818wcAyyLHCUZ3Eowr+Y=; b=cRDSumHgCNe+qPOJ9K1vMvQVPCpvOmDMA3o48S9eFXgPlH8KeibXCBLWWnvjV0bYsp Edc0gPTz3aW4zg1hl9iQ6UdZ5PKCAWvqvp+O7ZSIMpqpDaZY1GNF4VIQ8M2ccdLlaBHG OW3kNf7vZcIsrpqHgD2j+r9cIIkA6hnDb7umhWzbUUFUbPbpG6v76AMns5T2IHxXpvcf wIi+2oweI/28q+G/wnBzIvQSKpZc2MI4sHJ9oDTKl5P0BK2YMOnSlUX1Tew1K8PIIRaJ uhN9H/lAK73Qjakx7QwKe+YZ6glH3M24IOtB6LyimkNimd4CTWHU1sgJSLaaJe7f75el fpsA== X-Gm-Message-State: ANhLgQ3F/5c+Pmhq+1jBvqrETVKn8mHA5cWg/mu6+kUi5eEtUdvl9m+V RjcqsIP05yrUlmLe/CKR+UNiPQ3w X-Google-Smtp-Source: ADFU+vtEOhLAEJjVU4GSl64qvAQjOkLye81Czc6SUAANy58f8sU5YntS4dECkIiY3fYt/0PYLjormg== X-Received: by 2002:ac8:342b:: with SMTP id u40mr9069452qtb.83.1585525774095; Sun, 29 Mar 2020 16:49:34 -0700 (PDT) Received: from casantos.remote.csb.com (201.22.223.113.dynamic.adsl.gvt.net.br. [201.22.223.113]) by smtp.gmail.com with ESMTPSA id l7sm8843689qkb.47.2020.03.29.16.49.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Mar 2020 16:49:33 -0700 (PDT) From: unixmania@gmail.com To: buildroot@buildroot.org Date: Sun, 29 Mar 2020 20:49:22 -0300 Message-Id: <20200329234924.14505-2-unixmania@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200329234924.14505-1-unixmania@gmail.com> References: <20200329234924.14505-1-unixmania@gmail.com> Subject: [Buildroot] [PATCH 1/3] pakage/busybox: use same S02sysctl script as procps-ng 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: Carlos Santos , Adam Duskett MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Carlos Santos The scripts were already the same, except for some comments, so make the busybox S02sysctl a symlink to the procps-ng one, which works with both versions of the "sysctl" utility. Signed-off-by: Carlos Santos --- package/busybox/S02sysctl | 67 +-------------------------------------- 1 file changed, 1 insertion(+), 66 deletions(-) mode change 100644 => 120000 package/busybox/S02sysctl diff --git a/package/busybox/S02sysctl b/package/busybox/S02sysctl deleted file mode 100644 index 6bb2fa165e..0000000000 --- a/package/busybox/S02sysctl +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -PROGRAM="sysctl" - -SYSCTL_ARGS="" - -# shellcheck source=/dev/null -[ -r "/etc/default/$PROGRAM" ] && . "/etc/default/$PROGRAM" - -# Files are read from directories in the SYSCTL_SOURCES list, in the given -# order. A file may be used more than once, since there can be multiple -# symlinks to it. No attempt is made to prevent this. -SYSCTL_SOURCES="/etc/sysctl.d/ /usr/local/lib/sysctl.d/ /usr/lib/sysctl.d/ /lib/sysctl.d/ /etc/sysctl.conf" - -# Use some scripting to mimic the --system option of the sysctl provided by -# procps-ng but still reporting errors. Users not interested on error report -# can put "-e" in SYSCTL_ARGS. -# -# The file redirections do the following: -# -# - stdout is redirected to syslog with facility.level "kern.info" -# - stderr is redirected to syslog with facility.level "kern.err" -# - file dscriptor 4 is used to pass the result to the "start" function. -# -# Testing the sysctl exit code is fruitless, as at the moment, since it ends -# with status zero even if errors happen. Hopefully this will be fixed in a -# future version of Busybox. -# -run_program() { - # shellcheck disable=SC2086 # we need the word splitting - find $SYSCTL_SOURCES -maxdepth 1 -name '*.conf' -print0 2> /dev/null | \ - xargs -0 -r -n 1 readlink -f | { - prog_status="OK" - while :; do - read -r file - if [ -z "$file" ]; then - echo "$prog_status" >&4 - break - fi - echo "* Applying $file ..." - /sbin/sysctl -p "$file" $SYSCTL_ARGS || prog_status="FAIL" - done 2>&1 >&3 | /usr/bin/logger -t sysctl -p kern.err - } 3>&1 | /usr/bin/logger -t sysctl -p kern.info -} - -start() { - printf '%s %s: ' "$1" "$PROGRAM" - status=$(run_program 4>&1) - echo "$status" - if [ "$status" = "OK" ]; then - return 0 - fi - return 1 -} - -case "$1" in - start) - start "Running";; - restart|reload) - start "Rerunning";; - stop) - :;; - *) - echo "Usage: $0 {start|stop|restart|reload}" - exit 1 -esac diff --git a/package/busybox/S02sysctl b/package/busybox/S02sysctl new file mode 120000 index 0000000000..796855c332 --- /dev/null +++ b/package/busybox/S02sysctl @@ -0,0 +1 @@ +../procps-ng/S02sysctl \ No newline at end of file