From patchwork Tue Jan 4 07:11:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Smirnov X-Patchwork-Id: 1575005 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=iYKZaTHH; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=LqL1A8sj; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JSkTq5PLcz9sXM for ; Tue, 4 Jan 2022 18:17:50 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=9fKUWv/91yRb1vhEifPE0oBJjJI2HHdLQnP1NM4WLTg=; b=iYKZaTHHCbLJpP 0bE42tuj96VLQKeAYcUDKUGa+g6nFEereqa3gLG/njLIZzQim4jnzo5lSUSv+Fvby4WWxochhNC08 y98s0dySUxjssE0qSVrPrUBYZlpMR+NW+mpHuIl+SqhDn61hnXjRdw6RaYUM+XyI6DvZTVbljXeev NogU5gXbHmfttFKKsaOU0BMvFm+VLQZS1yf4Hrb+1AwpUvHwMyRtMY9T3JCbmYgZtz9iLkBTJxAqu P9hqz48dRVVTSQmWK3ZR5+uwFLpOHZ2WEc55UvF3G6rXao0JgHjhqtMIcNINpsNDzEYqqbjC2RRxc RWNGBLBwGuO0bJKzMzVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4dzo-00AUpW-5I; Tue, 04 Jan 2022 07:12:36 +0000 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4dzi-00AUp5-FG for openwrt-devel@lists.openwrt.org; Tue, 04 Jan 2022 07:12:31 +0000 Received: by mail-lj1-x230.google.com with SMTP id k27so59128181ljc.4 for ; Mon, 03 Jan 2022 23:12:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WLkfocOSFupqniXrKvyrJcgJUozJepl8nOT4vVZlwTw=; b=LqL1A8sjXQ8aIx6EGA09cU/elzpyR46Yu/BW7i5hvwWTJFXPlqHhPSNf5tpsy1HeUF FyVlbVS8IBYoTyH+QfznCJPh4+1J2yBsxAosr4qXrMK680/FeiyZ4Yg2kR2eiwsAwMwT 6NeJl2TZpVHtdy+R+HloAxS470osjgpjT84M08E8JOtCnOOjbSr5NfaAJ9vnVjKH3E3N WwN/3Z9uPbroBb6Bsb3tPr3pMeC5N3sPkcjh8R1wGdKFx8M9+RQRUNzs7sd+/C5DThg2 wlnuHPWnBmt0K+vRKaU6MayMyQyrAYUV0EdeTxEjz5emh6jacd5iB1NEB5Z3CQLPAdj1 oPNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WLkfocOSFupqniXrKvyrJcgJUozJepl8nOT4vVZlwTw=; b=D2g5HNBcvNoODj5DoOn7VsJzW7CbmsBXBlm7DDAwXbHYHmKKKT/rhJyLIia0sr9CMw UehZAh/7nt/dbrVDYK03r1Xs5rGMYYFBZIFvXzNkWylgHtjLq6XFa38abBmhIj5/C8l3 V5UoCGtfH30dr8CArr2vkPvWE/Sw9fencqVvBNGa697RgyrRVFYIoqRpA4so9kMj3rcb a2Ze+7yILHiYiJdxJoGHGXl/Kh+Ng7NcdY04FVtRY2uIMY74LC39AszZpFozPq8EMPLM /nMafdh8uy+bPO+AqaI9rcUr1trewikNH6DGmPacghdwbofsn/QEEMetMOpbVvQHyxex BMqg== X-Gm-Message-State: AOAM530GqXJnH67ctkY6cjHusmD8djNsr8GSN6ToQYbj8n0h77fFsxKh WDe+/eSldH5YGXrf03+yff5qMdWI1x8= X-Google-Smtp-Source: ABdhPJxVpyYUopwV/gIsa7Sr58CnL0jtPYib2GXR0Qgz8ygoEoSJ+K990cdYDSpRS+ZhBZuUAZ5TvQ== X-Received: by 2002:a05:651c:1606:: with SMTP id f6mr39105356ljq.450.1641280348146; Mon, 03 Jan 2022 23:12:28 -0800 (PST) Received: from scuderia-pc.lan ([2a02:2168:93b5:6f00:9846:17c3:2b7d:bfb9]) by smtp.gmail.com with ESMTPSA id c37sm3720250lfv.0.2022.01.03.23.12.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jan 2022 23:12:27 -0800 (PST) From: Alexey Smirnov To: openwrt-devel@lists.openwrt.org Cc: Alexey Smirnov Subject: [PATCH] base-files: add support for heartbeat led trigger Date: Tue, 4 Jan 2022 10:11:51 +0300 Message-Id: <20220104071151.3031137-1-s.alexey@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220103_231230_547023_D3702304 X-CRM114-Status: UNSURE ( 7.65 ) X-CRM114-Notice: Please train this message. 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 patch adds support for creation heartbeat led trigger with, for example, this command: ucidef_set_led_heartbeat "..." "..." "..." from /etc/board.d/01_leds. 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:230 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.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [s.alexey[at]gmail.com] -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: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This patch adds support for creation heartbeat led trigger with, for example, this command: ucidef_set_led_heartbeat "..." "..." "..." from /etc/board.d/01_leds. Signed-off-by: Alexey Smirnov --- package/base-files/files/lib/functions/uci-defaults.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh index 02882f43ca..f96e645e73 100644 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -418,6 +418,15 @@ ucidef_set_led_default() { json_select .. } +ucidef_set_led_heartbeat() { + _ucidef_set_led_common "$1" "$2" "$3" + + json_add_string trigger heartbeat + json_select .. + + json_select .. +} + ucidef_set_led_gpio() { local gpio="$4" local inverted="$5"