From patchwork Thu Oct 12 08:42:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1847313 X-Patchwork-Delegate: linus.walleij@linaro.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=D01qbXqI; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=DinZ+gqr; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S5jqp4h9Kz23jm for ; Thu, 12 Oct 2023 19:44:38 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:In-Reply-To:References:Message-Id: MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ggZ0zFItbUyMlcaAc1DLkd9mPEH+Lom9hJO4M+uhBU0=; b=D01qbXqI7aS1g4 Crhs1bMErDAzJMyeWqMl1XcO0uMnpjPj5pADoLvw4ppWS19EPQXiYBoRo3zbnp1x1EmS09hTfRbpK dx97R3YUG6bTVZd6J71bnNq1cM9tOXWgYl8/uhXkC78JVIG0uGympkAr03Dgm2hvObp1a2lJD/xlk EWIQOsVk8xVTqHR9qqA1Lap5cKIKRAHPpZ4Jq3opqReMQAdkfU321T9yXz3OwFmjoD1M611+4+yhJ gkA4p4FcDYw94vwxaP0t3g9D7UPamWM9VYGyLfoNiXXUKKK4VJSIMVc2HIvV5wTrrH/Gd3CdfJKQs 0Wezhsy9q76ejUSVrUCQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qqrHR-000EFt-0p; Thu, 12 Oct 2023 08:42:53 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qqrH5-000E0M-2k for openwrt-devel@lists.openwrt.org; Thu, 12 Oct 2023 08:42:33 +0000 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-50573e85ee0so955399e87.3 for ; Thu, 12 Oct 2023 01:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697100149; x=1697704949; darn=lists.openwrt.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8qhjcstDdWHYTDL3NCyeuM7cRjkIGvStx1Zqm/R6Db0=; b=DinZ+gqrNraGU9Tkvv+CUaEVAdC7iRWyqOIcNxiB8mL66CNO/NrkuMuF146le+XgXP bJMTpI9Ouz6gSD034QDXLfAqdzlO013FU0pahGTml0njjNg2ZuRNiP0Ebk2oYJVC87KG Yqkmn72DmLcstB8N/hAZs87Ri79nVYiZwzSTwsqHCYwGrFCwR4xySjQKie0tRZITD6bq lvYk13uk0JLDt4+fSTY45KDxncyYEauQiT8Z/e5zqg60hldRU1HiFadDcX2WS8Ft2j/j V9Q6CIThmsK3Ko0ECRp4h3bhyrfMpsSaUXZNGA9bL5wtRw/F4kRFY1SnLkYVyLU1hoFA Alrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697100149; x=1697704949; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8qhjcstDdWHYTDL3NCyeuM7cRjkIGvStx1Zqm/R6Db0=; b=fkQChE1kWVOfXV8DjTTjE2obGsMlWLzfXbaBECDUhTdgqkosup+8UNIHRa4nSTEslR wwAYYTZXWkHfldc7lQEOtJoyif36KjViA0DEnE/eaYbbY+ILrCfwbmGPTPohl3KT7Iz4 w0l5rmBBHAk7QJS3j+HG38lis1y3rNEDh7PxMoDnZRUDSF5DP7NYHOfTTDlg/ij26m2Y VMsbOA7V1XCF0LvM6/nJE96kpbHjsv0J7JPCgIyvFGwK9f8UG8gzIbAPMp2m0aoqfAbb Q9EiuACvwVLdd6KxHr9EX3owCBtZcuChk/tDBOMqpnABExp76BA5ziH44SZ+0jGkIdvl 1jFw== X-Gm-Message-State: AOJu0YzYc10m3KMHZGXs0KMQzlkbH5t2gtnox53EVilLLsUjzJawLSM5 vU3WVn7rPg/82fD93AFLYln2ZJBJ5q1GaHlkiKI= X-Google-Smtp-Source: AGHT+IFmdB87PdacF58CTT79Fh3/nuCUZR0wdwSOa73nQmECMqtmtzJpmV4Dl6Gkq49HU5EPHwUDdQ== X-Received: by 2002:ac2:446b:0:b0:4fe:3724:fdae with SMTP id y11-20020ac2446b000000b004fe3724fdaemr17215060lfl.66.1697100149112; Thu, 12 Oct 2023 01:42:29 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id o9-20020a05651238a900b00501c8959f6asm2705043lft.98.2023.10.12.01.42.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 01:42:28 -0700 (PDT) From: Linus Walleij Date: Thu, 12 Oct 2023 10:42:25 +0200 Subject: [PATCH v3 10/10] ixp4xx: Add hdparm script MIME-Version: 1.0 Message-Id: <20231012-ixp4xx-v3-10-e09c74712c0b@linaro.org> References: <20231012-ixp4xx-v3-0-e09c74712c0b@linaro.org> In-Reply-To: <20231012-ixp4xx-v3-0-e09c74712c0b@linaro.org> To: Imre Kaloz , Krzysztof Halasa , Howard Harte , openwrt-devel@lists.openwrt.org X-Mailer: b4 0.12.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231012_014232_072095_4157AC34 X-CRM114-Status: GOOD ( 10.27 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This script will make sure to spin down harddrives on IXP4xx NAS devices such as the NSLU2 and siblings after 1 minute of inactivity. Signed-off-by: Linus Walleij --- target/linux/ixp4xx/base-files/etc/board.d/03_hdparm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:132 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hauke Mehrtens , Linus Walleij , Raylynn Knight Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This script will make sure to spin down harddrives on IXP4xx NAS devices such as the NSLU2 and siblings after 1 minute of inactivity. Signed-off-by: Linus Walleij --- target/linux/ixp4xx/base-files/etc/board.d/03_hdparm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/target/linux/ixp4xx/base-files/etc/board.d/03_hdparm b/target/linux/ixp4xx/base-files/etc/board.d/03_hdparm new file mode 100644 index 000000000000..27f2b760420e --- /dev/null +++ b/target/linux/ixp4xx/base-files/etc/board.d/03_hdparm @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Spin down drives after one minute if inactive + +if [ ! -n "$(command -v hdparm)" ]; then + exit 0 +fi + +DISKS=$(find /dev/sd[a-z] 2>/dev/null) +for DISK in $DISKS +do + if [ -b $DISK ] ; then + hdparm -S 12 $DISK > /dev/null + fi +done