From patchwork Sat Oct 7 20:36:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 1844790 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (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 4S2xss5WZNz1yqD for ; Sun, 8 Oct 2023 07:36:46 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 7FABF417DC; Sat, 7 Oct 2023 20:36:43 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 7FABF417DC X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 74F8PfoZWHiK; Sat, 7 Oct 2023 20:36:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 50E67417E8; Sat, 7 Oct 2023 20:36:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 50E67417E8 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 15B6C1BF3BD for ; Sat, 7 Oct 2023 20:36:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id E2BFE8397F for ; Sat, 7 Oct 2023 20:36:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org E2BFE8397F X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WmxiZlwaZ5NW for ; Sat, 7 Oct 2023 20:36:38 +0000 (UTC) Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by smtp1.osuosl.org (Postfix) with ESMTPS id CA61A83906 for ; Sat, 7 Oct 2023 20:36:37 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org CA61A83906 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4064867903cso32388055e9.2 for ; Sat, 07 Oct 2023 13:36:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696710995; x=1697315795; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7+JSkAnDqfe8IvYMpi5SRDP1c5mq1HK5vsKGv3z9IJg=; b=hqBKupmK6v6wQux3qM6ZNNbKla809rcpI+3I9OC9oNRficCY5pMYXChqcUublTnFy/ T/nGtIZr9NCf9S/guIqB2zL7KVdIUus0vzwA9K/x1wfNEyS90EAr6FX0YQQiwJnjcdfG zBVJyBmQajUR6QPEPccMfGTMM55BIqlCf+OxVK6WTEBn32o6zXp72W/lNsN4JsZgFff8 ZZUi75gmb9WmQrEQ8rogCDPPVPDvbVmtu2UK7Cff7l5YWwA6yfd9cBMZNaMeaU8BZhAZ 0hrJZblL2pa4mXq5CeFchyboSrcUHoric0Dm4214/9RqoTZrAgKfWdAjffHfFIy0spAJ nZQQ== X-Gm-Message-State: AOJu0YzaECjbt7QWOMg4COt833K2JxFilMLiC0V+MSWm6N7rv/YzuwGg ZcicwdPIOG3HYVub3DqJCLjVN05Jk1KboXMI6LQ= X-Google-Smtp-Source: AGHT+IF9jct60MZPs6Hh0Q36nphcCQydkkWEaOSh2/JaD59ZbgnIL3k2rlImwlCe8tUlWfHP/U8fQQ== X-Received: by 2002:adf:ce90:0:b0:321:cec8:e64d with SMTP id r16-20020adfce90000000b00321cec8e64dmr10300937wrn.62.1696710995471; Sat, 07 Oct 2023 13:36:35 -0700 (PDT) Received: from arnoutx1.telenet.be (ptr-9fplejq23yjvo6iq027.18120a2.ip6.access.telenet.be. [2a02:1811:3a7e:7b00:d490:c3e3:649d:eccf]) by smtp.gmail.com with ESMTPSA id y20-20020aa7d514000000b00537708be5c6sm4271519edq.73.2023.10.07.13.36.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 13:36:34 -0700 (PDT) To: buildroot@buildroot.org Date: Sat, 7 Oct 2023 22:36:32 +0200 Message-ID: <20231007203633.2415431-1-arnout@mind.be> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; t=1696710995; x=1697315795; darn=buildroot.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7+JSkAnDqfe8IvYMpi5SRDP1c5mq1HK5vsKGv3z9IJg=; b=E2aXg4fbN2DYD2EfXVoVkx33n/tuO6oucimJJLsoyeLO+UmjEi/JtNl559UobY135v IvfvJpzfu5LzzLp86BbqOv9tdxh3S6GaH/TS3pN903m0vYTh1IaXeDfqQQI37/MS5Znl 4NgrHVgSvP4ldWoKDxYUvWQBjuUiXp3xD3hEeSqjl3F4bJLUkYmMLBZGz3v+5J8pxzC4 DMTWOfXHJ3yI4d7Rs3PI5plBgwSmDnLERTQ/d4n+AgoIla4npMN3KkoepAUSEsG6EvaY DeLa9SvLKpO52K3xRiSAT0YHp/lbSaPhvQOVN6lYsMXuxEL7yZ+3tSyYEYL66C2vS5va 4XPQ== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=mind.be header.i=@mind.be header.a=rsa-sha256 header.s=google header.b=E2aXg4fb Subject: [Buildroot] [PATCH 1/2] utils/check-package: allow exception for global checks X-BeenThere: buildroot@buildroot.org 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: , X-Patchwork-Original-From: Arnout Vandecappelle via buildroot From: Arnout Vandecappelle Reply-To: Arnout Vandecappelle Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" check-package has a mechanism for a specific file to make an exception to a specific checker, by preceding the offending line with "check-package ... ". However, this is not possible for the global checks that are done in the checker's after() function. Allow exceptions for the global checks by writing the same "check-package ... " comment on the last line of the file. Signed-off-by: Arnout Vandecappelle --- utils/check-package | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/check-package b/utils/check-package index 105902303e..38119f7136 100755 --- a/utils/check-package +++ b/utils/check-package @@ -247,6 +247,8 @@ def check_file_using_lib(fname): lastline = text for name, cf in objects: + if cf.disable.search(lastline): + continue warn, fail = print_warnings(cf.after(), name in xfail) if fail > 0: failed.add(name) From patchwork Sat Oct 7 20:36:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 1844791 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (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 4S2xt32Zfxz1yqD for ; Sun, 8 Oct 2023 07:36:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C5B26418C1; Sat, 7 Oct 2023 20:36:56 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org C5B26418C1 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZGX4N-Va4xkr; Sat, 7 Oct 2023 20:36:55 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 7F301418B2; Sat, 7 Oct 2023 20:36:54 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 7F301418B2 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 993691BF3BD for ; Sat, 7 Oct 2023 20:36:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 715CF60F83 for ; Sat, 7 Oct 2023 20:36:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 715CF60F83 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NUJGbfrov21Z for ; Sat, 7 Oct 2023 20:36:38 +0000 (UTC) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by smtp3.osuosl.org (Postfix) with ESMTPS id 8CF7D60E15 for ; Sat, 7 Oct 2023 20:36:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 8CF7D60E15 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-51e28cac164so9449406a12.1 for ; Sat, 07 Oct 2023 13:36:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696710996; x=1697315796; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6NIuow5LXDwk+vb64f/jq5Ri9w2Q0N4+IHOvZp1r+aA=; b=rpCatgwwZ5JKt9RrB+GsZiS7nBxc63vtRqaI4x7OZWmL7kMTC7nYLc1/ELgiS0ckt3 dcIt2kEsfOMl9cdeIM8UgwnDYZTlRpDsJZyMg6aYTDwnzoDp5LehZzU/eoMk18fU9jU6 sNGNjWXGcKeL4QQP9SF6oUIEvHqbP2yrEIXQlUM1WBsUfY9XtGzI1MZGWul3qPI7jKz2 40+hNl5RJwKsZKmwtNRufHYplX8rc31/DEinihev8pZ1yZ11ZOgLM30jVcw2DrWxirtk XvbI9+BUCc5BlIQ6x0Lh4LSXPYBCwkoX8PeBfxpashk2DlUt7TLDJ9/pMz1QiIwsqvgy 8MxA== X-Gm-Message-State: AOJu0YzIWlK++MvcmmT7gV0eTNw6X/VhUSD3gDtMhuAdC3PrUunVtFYn 45X5tU+GcdC4C8FqzPKwQ9wlYFCchwfNPrQ3LAA= X-Google-Smtp-Source: AGHT+IEOCjnDDSYTkoD4D4R/xwqXsJW4d1ndVUuGJsAcY23yG7xWRXVk72jwmaKB2xIJTmrz+Z+brA== X-Received: by 2002:aa7:c318:0:b0:533:dcb1:5ab4 with SMTP id l24-20020aa7c318000000b00533dcb15ab4mr8167922edq.18.1696710996420; Sat, 07 Oct 2023 13:36:36 -0700 (PDT) Received: from arnoutx1.telenet.be (ptr-9fplejq23yjvo6iq027.18120a2.ip6.access.telenet.be. [2a02:1811:3a7e:7b00:d490:c3e3:649d:eccf]) by smtp.gmail.com with ESMTPSA id y20-20020aa7d514000000b00537708be5c6sm4271519edq.73.2023.10.07.13.36.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 13:36:35 -0700 (PDT) To: buildroot@buildroot.org Date: Sat, 7 Oct 2023 22:36:33 +0200 Message-ID: <20231007203633.2415431-2-arnout@mind.be> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231007203633.2415431-1-arnout@mind.be> References: <20231007203633.2415431-1-arnout@mind.be> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; t=1696710996; x=1697315796; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6NIuow5LXDwk+vb64f/jq5Ri9w2Q0N4+IHOvZp1r+aA=; b=HcOPku8q3boE4gELfurOvkOACtVeq31SV5wT42jrJofn7sDpoAH31g7Rbu+FprczhA Uc0V74WP/meOXAsXxECWIPS843Dwx3kv/DbUlS82ZmpuK7FIUqcNMUuCZvPKhlTBO8ZG 7BUHabbm0dQCRK45e2t+heOiPbO3SFWQHbu7exZQhA6RiaITvn4ih/slktfXnOMAyjVV 5J/gfWVHGMCpMnlEwx3YputILXejD0PmtqlbV1yWWGp35vPYgHutuYhTs1i84OpiCWoO cYVeVS8oo4QfWiv1h1hxc05z/JDMk9JAMBqsIa0fyWugKJQ+KeP6S35keH3ParJbJTHJ jdvQ== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=mind.be header.i=@mind.be header.a=rsa-sha256 header.s=google header.b=HcOPku8q Subject: [Buildroot] [PATCH 2/2] package/initscripts: add service to load kernel modules at boot X-BeenThere: buildroot@buildroot.org 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: , X-Patchwork-Original-From: Arnout Vandecappelle via buildroot From: Arnout Vandecappelle Reply-To: Arnout Vandecappelle Cc: Angelo Compagnucci Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" From: Angelo Compagnucci In cases where no hotplug is available (by choice or by the lack of a proper hotplug method for a device), this service can be used to load kernel module drivers by reading the /etc/modules-load.d/*.conf files. The modules files matches the one used by systemd, which in turn has a builtin mechanism to load a module at boot, therefore making systemv init on par with systemd features. Signed-off-by: Angelo Compagnucci [Arnout: - add exception for missing DAEMON variable; - fix shellcheck warnings ] Signed-off-by: Arnout Vandecappelle --- package/initscripts/init.d/S11modules | 62 +++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 package/initscripts/init.d/S11modules diff --git a/package/initscripts/init.d/S11modules b/package/initscripts/init.d/S11modules new file mode 100644 index 0000000000..ab9b93dae3 --- /dev/null +++ b/package/initscripts/init.d/S11modules @@ -0,0 +1,62 @@ +#!/bin/sh + +MODULES_DIR="/etc/modules-load.d/" + +[ -z "$(ls -A ${MODULES_DIR} 2> /dev/null)" ] && exit 0 + +load_unload() { + for module_file in "${MODULES_DIR}"/*.conf; do + while read -r module args; do + + case "$module" in + ""|"#"*) continue ;; + esac + + if [ "$1" = "load" ]; then + # shellcheck disable=SC2086 # We need word splitting for args + modprobe -q "${module}" ${args} >/dev/null && \ + printf '%s ' "$module" || RET='FAIL' + else + rmmod "${module}" >/dev/null + fi + + done < "${module_file}" + done + + RET='OK' +} + +start() { + printf 'Starting modules: ' + + load_unload load + + echo $RET +} + +stop() { + printf 'Stopping modules: ' + + load_unload unload + + echo $RET +} + +restart() { + stop + sleep 1 + start +} + +case "$1" in + start|stop|restart) + "$1";; + reload) + # Restart, since there is no true "reload" feature. + restart;; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 +esac + +# check-package Ignore missing DAEMON Variables