From patchwork Tue Oct 4 11:04:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1685844 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::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MhZbm0Qnqz1ypH for ; Tue, 4 Oct 2022 22:04:51 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id A583C82FD5; Tue, 4 Oct 2022 11:04:49 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org A583C82FD5 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 nFiFNgNhIQpP; Tue, 4 Oct 2022 11:04:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id D010F82F76; Tue, 4 Oct 2022 11:04:47 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org D010F82F76 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 BAD471BF863 for ; Tue, 4 Oct 2022 11:04:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 966CA82F84 for ; Tue, 4 Oct 2022 11:04:34 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 966CA82F84 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 YMqQSh62Flgy for ; Tue, 4 Oct 2022 11:04:33 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 3A04182F77 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by smtp1.osuosl.org (Postfix) with ESMTPS id 3A04182F77 for ; Tue, 4 Oct 2022 11:04:33 +0000 (UTC) Received: by mail-ed1-x52f.google.com with SMTP id m3so18305344eda.12 for ; Tue, 04 Oct 2022 04:04:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=FSGmpFymiY6zwSpyok4ysixOiJ9DPk5IrMaKY/ZivEU=; b=EL+a8AzAzumnNYE/QYzY5t0PViBIUh4J8ziDDrgq1Bk3zu+3mQampSOqv5ViDD+GL+ hqrBKfvJSWZSAqMy7eoLIVXsNmHFuWlIEAt6lhB2fguJmvbQS7hGfoK87c3bHsiartw6 FxgmgAJw3TDIUVSEsm2/KGFGqTHBzXEwLRmpXWcinhSKDQtM7QfnWrDCa1PRyWoWDtTN su6MWo1Eqodq/MPmMUpvg5ZdSazOqyaueoMnWYhM8U4lo5tDQPETiabsbW9DpLEmudjJ kiELF0EJ0DxuSLiRwaiYoAyxyh6G4BhxosPKJbL5fo29zvmI53KMwH3aRtGQs4JXI4ZG m8+A== X-Gm-Message-State: ACrzQf3GaV2vEBkfHpFminTZz+MaBvHnxqJ9rn6DRDtws7p/JRFmjRRc q+iYrITZmlux2J03De7TkOl3suIRPDFPEw== X-Google-Smtp-Source: AMsMyM5pSEgfbgeanKasu3pPfKgDHZkFjM8M81s5X6HBcfEHGiio4HSVb21rO6ztG+B7LIxAohQlnw== X-Received: by 2002:aa7:d614:0:b0:458:f796:f86a with SMTP id c20-20020aa7d614000000b00458f796f86amr9127138edr.294.1664881471138; Tue, 04 Oct 2022 04:04:31 -0700 (PDT) Received: from angeloc.amarulasolutions.com (host085115199111.static.fidoka.tech. [85.115.199.111]) by smtp.gmail.com with ESMTPSA id p24-20020aa7cc98000000b00456d2721d93sm1427714edt.64.2022.10.04.04.04.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 04:04:30 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 4 Oct 2022 13:04:17 +0200 Message-Id: <20221004110421.137795-2-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221004110421.137795-1-angelo@amarulasolutions.com> References: <20221004110421.137795-1-angelo@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=FSGmpFymiY6zwSpyok4ysixOiJ9DPk5IrMaKY/ZivEU=; b=Q/XBakoYmLbmq9EeEHf0ChEPg7HjhlwKBjsRL5spBkV16eCez3pFwdItV+P3OS9GUh RBZf5Zlr90msYBI6D63v2gyNFRJUmnqSJcLyR863giJMkeWmh4cBwJsjMT8Mjo0RKxE/ Z9qpcjWmKS4XAuBCaxQ2a4MRKYj0Fw6i/Jyyc= X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=Q/XBakoY Subject: [Buildroot] [PATCH v4 1/5] system: adding options for configuring wifi 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: , Cc: Angelo Compagnucci Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" These options can be used by packages to configure a wifi card to connect at boot. Signed-off-by: Angelo Compagnucci --- v4: * Adding depends on BR2_SYSTEM_DHCP != "" (Andreas Ziegler) system/Config.in | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/system/Config.in b/system/Config.in index 888c24ce81..647072b965 100644 --- a/system/Config.in +++ b/system/Config.in @@ -418,6 +418,20 @@ comment "automatic network configuration via DHCP needs ifupdown or busybox or n depends on !(BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN || \ BR2_PACKAGE_SYSTEMD_NETWORKD || BR2_PACKAGE_NETIFRC) +config BR2_SYSTEM_CONNECT_WIFI + bool "Connect to a default wifi access point" + depends on BR2_SYSTEM_DHCP != "" && BR2_PACKAGE_WPA_SUPPLICANT + +config BR2_SYSTEM_CONNECT_WIFI_SSID + string "Access point SSID" + default "" + depends on BR2_SYSTEM_CONNECT_WIFI + +config BR2_SYSTEM_CONNECT_WIFI_PASSWORD + string "Access point password" + default "" + depends on BR2_SYSTEM_CONNECT_WIFI + endif # BR2_ROOTFS_SKELETON_DEFAULT config BR2_SYSTEM_DEFAULT_PATH From patchwork Tue Oct 4 11:04:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1685845 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=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MhZbz6dcGz1yqj for ; Tue, 4 Oct 2022 22:05:03 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id E91F040B33; Tue, 4 Oct 2022 11:05:01 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org E91F040B33 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2EImLT34cu8x; Tue, 4 Oct 2022 11:05:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 3389B40B83; Tue, 4 Oct 2022 11:05:00 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 3389B40B83 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 6448C1BF863 for ; Tue, 4 Oct 2022 11:04:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 3FBE460B43 for ; Tue, 4 Oct 2022 11:04:36 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 3FBE460B43 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 gY36kyjc2zUg for ; Tue, 4 Oct 2022 11:04:35 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org B975360B2A Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by smtp3.osuosl.org (Postfix) with ESMTPS id B975360B2A for ; Tue, 4 Oct 2022 11:04:34 +0000 (UTC) Received: by mail-ej1-x62e.google.com with SMTP id f1so10562657ejw.7 for ; Tue, 04 Oct 2022 04:04:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=Qkr+SoRYmoQplcz5P1J9gPzunzTmYhmu3lRVmIKafJs=; b=dhfVQRBe2bVC/BK+rBA8D2Rks2Sv+u9UgzEtYE99nZA4UGVIWwWSSMSwrOKOrfwizO zeMo5UgnucTmHz0mHR6PcPanArseuvfMlIpYIfoeugvG45GDCsHkjbYDAGLWhyAyrKjL zrudMBkHywDX/saEPDgm2Twfd0CEWdmtWy7VZkiiyE1//2pGo0wOAhGsap1xYvTc6L1T +LtMshZ3kfMamDJef962bE3vhLYNDt9lRTBVgKNnxyuHxRjk4VYfITGlyXzT0hh3VUTR R0XKsm3LSKMJjE3O6C6Qdd4rfMpy+bNdUBaz64jSUFMsGO84KCYyQwiolABkou0gg+1t o1Jg== X-Gm-Message-State: ACrzQf0Lppn9lr1R7gd7S4J8nVHCtYsG0fAey+y6/NgB1OU0Zg8Wlxuo XAVWLAlxNbmViFN7wXllSg7mYpeOmrd8Lg== X-Google-Smtp-Source: AMsMyM5tkX8uQprAt7TOQ4hm2DlcmkIAg4aXvsrlfTArGK8AE+/eMloEjYei9JvJjkaSzEZfs5pdEg== X-Received: by 2002:a17:907:6d8c:b0:781:e30f:3218 with SMTP id sb12-20020a1709076d8c00b00781e30f3218mr18934690ejc.430.1664881472599; Tue, 04 Oct 2022 04:04:32 -0700 (PDT) Received: from angeloc.amarulasolutions.com (host085115199111.static.fidoka.tech. [85.115.199.111]) by smtp.gmail.com with ESMTPSA id p24-20020aa7cc98000000b00456d2721d93sm1427714edt.64.2022.10.04.04.04.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 04:04:31 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 4 Oct 2022 13:04:18 +0200 Message-Id: <20221004110421.137795-3-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221004110421.137795-1-angelo@amarulasolutions.com> References: <20221004110421.137795-1-angelo@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=Qkr+SoRYmoQplcz5P1J9gPzunzTmYhmu3lRVmIKafJs=; b=ZXuJ6u+WnfHnnTREFifIYGoJjNAizX5n/Aqd3eWKZ+hf5U4Pc1pfnZd4fNzX/wM/9m JIu99c/8aQdexHKKDRWwA/IBqqn5w3o/rwl2uLuLPCpGPlnrjZbIN/m15GlEvGOUWkwa GVaZonQoQc5+vrENl5SSCqsZ/2H3S2sFu+330= X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=ZXuJ6u+W Subject: [Buildroot] [PATCH v4 2/5] package/wpa_supplicant: configure wifi on systemv when enabled 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: , Cc: Angelo Compagnucci Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Configure a default basic wifi setup able to automatically connect to the selected access point. Signed-off-by: Angelo Compagnucci --- package/wpa_supplicant/wpa_supplicant.mk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/package/wpa_supplicant/wpa_supplicant.mk b/package/wpa_supplicant/wpa_supplicant.mk index e5e3938be1..60ae290e26 100644 --- a/package/wpa_supplicant/wpa_supplicant.mk +++ b/package/wpa_supplicant/wpa_supplicant.mk @@ -266,6 +266,19 @@ define WPA_SUPPLICANT_INSTALL_IFUP_SCRIPTS endef endif +ifeq ($(BR2_SYSTEM_CONNECT_WIFI),y) +define WPA_SUPPLICANT_ENABLE_WIFI + $(SED) '/network={/,/}/d' $(TARGET_DIR)/etc/wpa_supplicant.conf; \ + ( echo "network={"; \ + echo " scan_ssid=1"; \ + echo " key_mgmt=WPA-PSK"; \ + echo " ssid=\"$(BR2_SYSTEM_CONNECT_WIFI_SSID)\""; \ + echo " psk=\"$(BR2_SYSTEM_CONNECT_WIFI_PASSWORD)\""; \ + echo "}"; \ + ) >> $(TARGET_DIR)/etc/wpa_supplicant.conf +endef +endif + define WPA_SUPPLICANT_INSTALL_TARGET_CMDS $(INSTALL) -m 0755 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/wpa_supplicant \ $(TARGET_DIR)/usr/sbin/wpa_supplicant @@ -277,6 +290,7 @@ define WPA_SUPPLICANT_INSTALL_TARGET_CMDS $(WPA_SUPPLICANT_INSTALL_WPA_CLIENT_SO) $(WPA_SUPPLICANT_INSTALL_IFUP_SCRIPTS) $(WPA_SUPPLICANT_ENABLE_CTRL_IFACE) + $(WPA_SUPPLICANT_ENABLE_WIFI) endef define WPA_SUPPLICANT_INSTALL_INIT_SYSTEMD From patchwork Tue Oct 4 11:04:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1685846 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=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MhZcD37Ctz1yqn for ; Tue, 4 Oct 2022 22:05:16 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 6BE8883096; Tue, 4 Oct 2022 11:05:14 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 6BE8883096 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 2bqeYuRA_lxf; Tue, 4 Oct 2022 11:05:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 9312F82F76; Tue, 4 Oct 2022 11:05:12 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 9312F82F76 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 547C31BF863 for ; Tue, 4 Oct 2022 11:04:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 2D43D40B3B for ; Tue, 4 Oct 2022 11:04:37 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 2D43D40B3B X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AGHl58jyI13d for ; Tue, 4 Oct 2022 11:04:36 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 4BD99400CE Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by smtp2.osuosl.org (Postfix) with ESMTPS id 4BD99400CE for ; Tue, 4 Oct 2022 11:04:36 +0000 (UTC) Received: by mail-ej1-x632.google.com with SMTP id a2so7952042ejx.10 for ; Tue, 04 Oct 2022 04:04:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=LC7LouO0LMHHg0KxUIw00YtG//Y0YQiQMsJVBNOBDl8=; b=y2mVB5TLlsbDUEIhZZ8O13ovtvYKklV23hsi8yRhatafX/KzRjc41XJnHLYrjczk69 7fhUWz6lfNbGi5wVwF0v735qHaKOqgE0PEP7jA7LUyl/5qoizBExcQQZeVG77nZk0Ccu 7fmhw8Jgzh2KJ0YjClClCFQtCbt7gN3+YxeCgya6IF5iwV0eFWKZkHTfuKS3zB8szr0Y /4k0VaWChHG9M7pCFZi5S1WZ3CkDIgUav3Cps7pCKfTnC2EKifFs6R9icmUPR0rBrGUD aW7T8MtPd0DDBm4la7JcFrfpGk1nwHJaja+9VJYyKRBeOZ+UKQViIvs1c3b7pyGDNCTV wQgQ== X-Gm-Message-State: ACrzQf0ei8Kj/DLx/jzJa22j0hkBRB5PAGjE/tz5nEh8Fl26xIkCu4H+ 410Wo5KgVHJWol8yE6zOpgQqQvkhhWjkkQ== X-Google-Smtp-Source: AMsMyM5h1laqBDOFmVoESwK3lc46HyXFMTId+PaaaQfsQJQOa7yw5ns1j+EmcZGb0hx+uOaOi5vWNw== X-Received: by 2002:a17:907:96ab:b0:782:2f88:cf29 with SMTP id hd43-20020a17090796ab00b007822f88cf29mr19007247ejc.72.1664881474137; Tue, 04 Oct 2022 04:04:34 -0700 (PDT) Received: from angeloc.amarulasolutions.com (host085115199111.static.fidoka.tech. [85.115.199.111]) by smtp.gmail.com with ESMTPSA id p24-20020aa7cc98000000b00456d2721d93sm1427714edt.64.2022.10.04.04.04.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 04:04:33 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 4 Oct 2022 13:04:19 +0200 Message-Id: <20221004110421.137795-4-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221004110421.137795-1-angelo@amarulasolutions.com> References: <20221004110421.137795-1-angelo@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=LC7LouO0LMHHg0KxUIw00YtG//Y0YQiQMsJVBNOBDl8=; b=h0CGUD5IpBR8rTWQ1G41ktqoDpz2/a/q23ol+QDyPntA86QonCvgJXPeO9+9ZV2Tkm agKiUWmFZRFAXpnSXqVXTBcYYE38kBnfvIavbGGf0VmIWahBI0Sv9GBE47KSnvRvfb3D 9Yh+8/gamzAB9OJ7TM0jX9blzgfLHSjmnF/I8= X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=h0CGUD5I Subject: [Buildroot] [PATCH v4 3/5] package/wpa_supplicant: configure wifi on systemd when enabled 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: , Cc: Angelo Compagnucci Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Configure a default basic wifi setup able to automatically connect to the selected access point. Signed-off-by: Angelo Compagnucci --- package/wpa_supplicant/wpa_supplicant.mk | 10 ++++++++++ system/Config.in | 1 + 2 files changed, 11 insertions(+) diff --git a/package/wpa_supplicant/wpa_supplicant.mk b/package/wpa_supplicant/wpa_supplicant.mk index 60ae290e26..8611fc6577 100644 --- a/package/wpa_supplicant/wpa_supplicant.mk +++ b/package/wpa_supplicant/wpa_supplicant.mk @@ -277,6 +277,15 @@ define WPA_SUPPLICANT_ENABLE_WIFI echo "}"; \ ) >> $(TARGET_DIR)/etc/wpa_supplicant.conf endef +define WPA_SUPPLICANT_WIFI_INSTALL_INIT_SYSTEMD + $(INSTALL) -m 0755 -d $(TARGET_DIR)/etc/wpa_supplicant/ + ln -sf ../wpa_supplicant.conf \ + $(TARGET_DIR)/etc/wpa_supplicant/wpa_supplicant-$(BR2_SYSTEM_DHCP).conf +endef +define WPA_SUPPLICANT_WIFI_INSTALL_INIT_SYSTEMD_PRESET + $(HOST_DIR)/bin/systemctl --root=$(TARGET_DIR) preset wpa_supplicant\@$(BR2_SYSTEM_DHCP).service +endef +SYSTEMD_ROOTFS_PRE_CMD_HOOKS += WPA_SUPPLICANT_WIFI_INSTALL_INIT_SYSTEMD_PRESET endif define WPA_SUPPLICANT_INSTALL_TARGET_CMDS @@ -304,6 +313,7 @@ define WPA_SUPPLICANT_INSTALL_INIT_SYSTEMD $(TARGET_DIR)/usr/lib/systemd/system/wpa_supplicant-wired@.service $(INSTALL) -D -m 644 $(WPA_SUPPLICANT_PKGDIR)/50-wpa_supplicant.preset \ $(TARGET_DIR)/usr/lib/systemd/system-preset/50-wpa_supplicant.preset + $(WPA_SUPPLICANT_WIFI_INSTALL_INIT_SYSTEMD) endef $(eval $(generic-package)) diff --git a/system/Config.in b/system/Config.in index 647072b965..761a5a95c2 100644 --- a/system/Config.in +++ b/system/Config.in @@ -421,6 +421,7 @@ comment "automatic network configuration via DHCP needs ifupdown or busybox or n config BR2_SYSTEM_CONNECT_WIFI bool "Connect to a default wifi access point" depends on BR2_SYSTEM_DHCP != "" && BR2_PACKAGE_WPA_SUPPLICANT + select BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE if BR2_PACKAGE_SYSTEMD config BR2_SYSTEM_CONNECT_WIFI_SSID string "Access point SSID" From patchwork Tue Oct 4 11:04:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1685847 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::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MhZcS46Cdz1yqn for ; Tue, 4 Oct 2022 22:05:28 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id CD41B8316A; Tue, 4 Oct 2022 11:05:26 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org CD41B8316A 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 YClIQPVg3qcO; Tue, 4 Oct 2022 11:05:26 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 10AD7830C0; Tue, 4 Oct 2022 11:05:25 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 10AD7830C0 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 788A01BF863 for ; Tue, 4 Oct 2022 11:04:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 6193260B43 for ; Tue, 4 Oct 2022 11:04:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 6193260B43 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 GRi3r1xvmHi9 for ; Tue, 4 Oct 2022 11:04:37 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org A0EFC60B2A Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by smtp3.osuosl.org (Postfix) with ESMTPS id A0EFC60B2A for ; Tue, 4 Oct 2022 11:04:37 +0000 (UTC) Received: by mail-ej1-x62c.google.com with SMTP id lt21so2777326ejb.0 for ; Tue, 04 Oct 2022 04:04:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=nL5Il5SYFr6EutzGZX5WkmSEHN9rORiMQQEIe49FfcM=; b=qypUHFYUTNN8WkI/zxwiKKMSxJmnV62PXNHQRDD6bDOIS88bhDYqDkFBEqDfBk5ha4 a3n+qy41O2HeFovc5HxC+wzLPlo1/vc+ZYS6tjS09Z3Z2ZV7Ox3B76qx8YTxfHoMs0iA ze070AbFGxgeGUCrZ0Auz7mjRXA5HcZlqdrCRnR2YjNh3pUPZQDnhX2Kw5qvWa51cU7x mQI8H5DFqUJhFlgHulRgsI+dnEGLxDW3Zxvo8mccoNyjaoukUFQu0Io12++Wthwpd7WM os+fpTJ6/u2uDyk4p0NYZIKdu1PsmqODuXCuoicHuXoZgYl36lZn2sQqGUasffg2z1MB lYYQ== X-Gm-Message-State: ACrzQf0Yog/qZLQW8gCW4Wjrnsq/O+osIhtcLYNhe5ZZVdDWMexdbM16 2K2Lqmh7FDnMsE79EtEFx8hm+dDQLfufKA== X-Google-Smtp-Source: AMsMyM6MzOZ6q0qzTWGaWGcdzEf7ryue5dJnpfTrfB4VWBxOsZHdGKChE2+2gSaEHpvS16QRLxDJow== X-Received: by 2002:a17:907:a05c:b0:772:eb61:904b with SMTP id gz28-20020a170907a05c00b00772eb61904bmr18906012ejc.237.1664881475530; Tue, 04 Oct 2022 04:04:35 -0700 (PDT) Received: from angeloc.amarulasolutions.com (host085115199111.static.fidoka.tech. [85.115.199.111]) by smtp.gmail.com with ESMTPSA id p24-20020aa7cc98000000b00456d2721d93sm1427714edt.64.2022.10.04.04.04.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 04:04:34 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 4 Oct 2022 13:04:20 +0200 Message-Id: <20221004110421.137795-5-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221004110421.137795-1-angelo@amarulasolutions.com> References: <20221004110421.137795-1-angelo@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=nL5Il5SYFr6EutzGZX5WkmSEHN9rORiMQQEIe49FfcM=; b=kLEiZzSaqLb8B6nPlnPBDYsIdQ5HlKozVcGrmDxKy5Tk9o98tu8EfTiPOdKU6FQqFn cY1hqZjNxYiQHIIuvvS5D65d10DvSGDpb9Dk+CLWZ3I8sSfC2ywZ24qMng0QrJtImW0K tqlVI4h9a14lxijhlebcb++Egkzc7EO/7GXio= X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=kLEiZzSa Subject: [Buildroot] [PATCH v4 4/5] package/ifupdown-scripts: add wifi configuration when enabled 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: , Cc: Angelo Compagnucci Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Add a proper wpa-conf line to the interfaces files to let the system bring up the wifi interface and the related wpa supplicant. Signed-off-by: Angelo Compagnucci --- Changes: v3: * add "|| true" lo let the command exit without error when BR2_SYSTEM_CONNECT_WIFI is empty (me) package/ifupdown-scripts/ifupdown-scripts.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/ifupdown-scripts/ifupdown-scripts.mk b/package/ifupdown-scripts/ifupdown-scripts.mk index 5ef032142c..ebaf234143 100644 --- a/package/ifupdown-scripts/ifupdown-scripts.mk +++ b/package/ifupdown-scripts/ifupdown-scripts.mk @@ -28,6 +28,8 @@ define IFUPDOWN_SCRIPTS_DHCP echo " pre-up /etc/network/nfs_check"; \ echo " wait-delay 15"; \ echo " hostname \$$(hostname)"; \ + test -n "$(BR2_SYSTEM_CONNECT_WIFI)" && \ + echo " wpa-conf /etc/wpa_supplicant.conf" || true; \ ) >> $(TARGET_DIR)/etc/network/interfaces endef define IFUPDOWN_SCRIPTS_DHCP_OPENRC From patchwork Tue Oct 4 11:04:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1685848 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::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MhZcj1W18z1yqn for ; Tue, 4 Oct 2022 22:05:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 6CB0F832C7; Tue, 4 Oct 2022 11:05:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 6CB0F832C7 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 tK32z3c-hb0w; Tue, 4 Oct 2022 11:05:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 785658329A; Tue, 4 Oct 2022 11:05:37 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 785658329A 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 0A8631BF863 for ; Tue, 4 Oct 2022 11:04:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id DABAB60B46 for ; Tue, 4 Oct 2022 11:04:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org DABAB60B46 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 mOUK2ajGuG9I for ; Tue, 4 Oct 2022 11:04:39 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org F3B5860B2A Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by smtp3.osuosl.org (Postfix) with ESMTPS id F3B5860B2A for ; Tue, 4 Oct 2022 11:04:38 +0000 (UTC) Received: by mail-ej1-x629.google.com with SMTP id au23so7295682ejc.1 for ; Tue, 04 Oct 2022 04:04:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=+yQkyNh99w3m87kHimxHu2uuMBMHMhSzzJ7m3IlPdpU=; b=x6ov3cs4iloMfFkQgQBDZEPho6NnQ/yLL4xdBTLyBlNk1185v8yAe8kdheGKbblEKA lH8rLrXNcdWJMfriAJ5mksnMt2oDIzy4I30wCUZ8GDym0Mf+InFuNDUnuagNj7IcZ/lc 9x78idRGdyP42N7j5nOCDtgx8cyVJquKtJ21BXuNoWE8TlfRNjq3DddFTEqmFJHjJRaY wOC0bEw+xiTk680RfEE1mvsSxsC7vFqFA+9EEpnw0fwmplIeRa2+ZOU+INX2WRUUjs0W zRigSc+pt4K+bI6WMSaQgff122F4xQ60d+PVc9iQwTBdTaWGCH3vXp7gFj7S+H+Leptd coPA== X-Gm-Message-State: ACrzQf0R2XPCuEnAhgJe956IKxC5nttQK2sBVdu7p8grzkL9cJd99480 LaIzGKxZqcMr7rDNMemDnlHkaZM1hL5zig== X-Google-Smtp-Source: AMsMyM6G/tVplJazfHe7XL8ea+8OltP9oPAVyFXNUSQyWcozE3PtBpO5/6F2pCnY2g2Ia1ez6+PjHQ== X-Received: by 2002:a17:907:74a:b0:77e:9455:b4e3 with SMTP id xc10-20020a170907074a00b0077e9455b4e3mr19061425ejb.471.1664881476912; Tue, 04 Oct 2022 04:04:36 -0700 (PDT) Received: from angeloc.amarulasolutions.com (host085115199111.static.fidoka.tech. [85.115.199.111]) by smtp.gmail.com with ESMTPSA id p24-20020aa7cc98000000b00456d2721d93sm1427714edt.64.2022.10.04.04.04.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 04:04:36 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 4 Oct 2022 13:04:21 +0200 Message-Id: <20221004110421.137795-6-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221004110421.137795-1-angelo@amarulasolutions.com> References: <20221004110421.137795-1-angelo@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=+yQkyNh99w3m87kHimxHu2uuMBMHMhSzzJ7m3IlPdpU=; b=Ew4BbC04LXc4oDbMoKPsw8eZvyrtNpK7Ww6XGKEBqdhUjkwQ5BOgzZo/VzX8DetDdH YDLZRwf7X1dMYf+zKsUDG3DkuhB9Yp5riMb9CyZVOOtO5B33y9GxAVxFqZa6JgpKBAl4 NmmkN0I+c+JQbD/NFULeKGPtkBD8tK9pDLR1M= X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=Ew4BbC04 Subject: [Buildroot] [PATCH v4 5/5] 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: , Cc: Angelo Compagnucci Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" 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 --- v2: * Moved script to initscripts (Arnout) * Moved script to S11modules, after S10[mu]dev (Andreas) * Use /etc/modules-load.d/ to share the same setup with systemd (me) v4: * Select only .conf file (Peter) * Better ouput: printing module name only when loaded successfully, print a FAIL when at least one module fails (Peter) package/initscripts/init.d/S11modules | 59 +++++++++++++++++++++++++++ 1 file changed, 59 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..dcc2e79135 --- /dev/null +++ b/package/initscripts/init.d/S11modules @@ -0,0 +1,59 @@ +#!/bin/sh + +MODULES_DIR="/etc/modules-load.d/" + +[ -z "$(ls -A ${MODULES_DIR} 2> /dev/null)" ] && exit 0 + +load_unload() { + for module_file in $(ls -1 ${MODULES_DIR}/*.conf); do + while read module args; do + + case "$module" in + ""|"#"*) continue ;; + esac + + if [ "$1" = "load" ]; then + 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