From patchwork Tue Jul 5 07:32:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1652318 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=buildroot.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LcZBs2FFHz9ryY for ; Tue, 5 Jul 2022 17:32:37 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 8AAB560EE8; Tue, 5 Jul 2022 07:32:34 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 8AAB560EE8 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 3Bj56Lj5_TgJ; Tue, 5 Jul 2022 07:32:33 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id B97E8605C9; Tue, 5 Jul 2022 07:32:31 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org B97E8605C9 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 905261BF2B3 for ; Tue, 5 Jul 2022 07:32:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 67C3A4175E for ; Tue, 5 Jul 2022 07:32:17 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 67C3A4175E 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 5JlxQLdHAFrD for ; Tue, 5 Jul 2022 07:32:16 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 7642A41760 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by smtp4.osuosl.org (Postfix) with ESMTPS id 7642A41760 for ; Tue, 5 Jul 2022 07:32:16 +0000 (UTC) Received: by mail-ej1-x629.google.com with SMTP id dn9so14836875ejc.7 for ; Tue, 05 Jul 2022 00:32:16 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=8azgUmT5ugFWM53+ubIFzoE+rS0HXB0IwLwLhhKHXiM=; b=7iy77zRvJFQgng+d94Sna7+mduSgwJSWidcuzIw1NBWfYVNVx+7XhwwsC2I+aQHF04 Ma9Df9lsjX8FS3WCGNfmqtENtTyOe9kDsyExFwO3LxpI8dHrtog39Jl/Z9GVJH0Jx2d2 Nzkcl3Dc0lFEnv2PSkG6QxoUEYV9AZonimL+S3Y+e1BuyZQB5igYM8aS0qgipkm1C+IQ fT206jnui8ILbGxR9ARuBeOEjjsK+tiUnJXvJzMcgZIvDPvPemklV7636DXMxOVjhAyj BR5LgmWXPNA2uVaEzexNFhp2WYFI9IJDQXqmmv/98I9m9Klo7SzzXdOk29nf8lUEkQlA Y2LA== X-Gm-Message-State: AJIora8n+iZ6TRV1dhxmW1VQ/pUFo3Lfo2DyY9AotfjugQ4xHvZS5Ehy Spuiq0FglLGlk1+XnX19aQS/ttVdoWI3WQ== X-Google-Smtp-Source: AGRyM1sDKSPetnDfrZlENNaiVmWJ47YNsGSONQHGY+X7ZHzdla+LGZlN+TFIiscfoONaZ6Xu8w4WvA== X-Received: by 2002:a17:907:3e11:b0:726:372b:6c32 with SMTP id hp17-20020a1709073e1100b00726372b6c32mr33223956ejc.157.1657006334470; Tue, 05 Jul 2022 00:32:14 -0700 (PDT) Received: from angeloc.pdxnet.pdxeng.ch (host085115199111.static.fidoka.tech. [85.115.199.111]) by smtp.gmail.com with ESMTPSA id t27-20020a17090616db00b0071cbc7487e1sm15274562ejd.69.2022.07.05.00.32.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 00:32:14 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 5 Jul 2022 09:32:02 +0200 Message-Id: <20220705073206.1442280-2-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220705073206.1442280-1-angelo@amarulasolutions.com> References: <20220705073206.1442280-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=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8azgUmT5ugFWM53+ubIFzoE+rS0HXB0IwLwLhhKHXiM=; b=NWoqoLQcxWj9A7QRx1RMlDSN1iSdku7pJkToyYUhv0CF1/vbidtvpG++4qMeazMfWf Wpl2++wlnn9InkK3kkpyv6pUJ976TPMblEYqHjQ9An7mSfMxX604HEs0FymdVpbdgr+Q WF/bTAjlqry3P2SO6tIwPXooUmBbmWLmPwgOE= X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=NWoqoLQc Subject: [Buildroot] [PATCH v3 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: br015@umbiko.net, 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 --- system/Config.in | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/system/Config.in b/system/Config.in index 888c24ce81..9a5bdb2932 100644 --- a/system/Config.in +++ b/system/Config.in @@ -418,6 +418,21 @@ 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" + default n + depends on 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 Jul 5 07:32:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1652319 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=buildroot.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) 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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LcZC56ttqz9ryY for ; Tue, 5 Jul 2022 17:32:49 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 1FD9F40354; Tue, 5 Jul 2022 07:32:47 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 1FD9F40354 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 U8PtcEOZpSaj; Tue, 5 Jul 2022 07:32:46 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id CAA8F40302; Tue, 5 Jul 2022 07:32:44 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org CAA8F40302 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 350641BF2B3 for ; Tue, 5 Jul 2022 07:32:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 1D70760E9F for ; Tue, 5 Jul 2022 07:32:18 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 1D70760E9F 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 yW_1jZzxHImg for ; Tue, 5 Jul 2022 07:32:17 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 3BE1F605B1 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by smtp3.osuosl.org (Postfix) with ESMTPS id 3BE1F605B1 for ; Tue, 5 Jul 2022 07:32:17 +0000 (UTC) Received: by mail-ed1-x52a.google.com with SMTP id z19so14109932edb.11 for ; Tue, 05 Jul 2022 00:32:17 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=JoBXZedk2w0JYcCNb4K9vsPqEWa3eTn83IBb95FaRMc=; b=z3+eKYjC/TdatQuXohZ95ff9s1/0cj5iYftL/4RCe/CiXaJyxdeSwEJUUjljvGYwYC ur+exp0jTWf5bYIikw44vMAiPVJknm8LLZCuRntqolfOrvwunqVkGplB7+nOLKmoOfrD p4QXK6aFWD+cyvt+Gs/iQUcZvAAjL1dAdL3Y14iAwGDwWnrkRyaedt2uO2LZUFEx/qOX f4yPL9d+CeeiVFbCOVWBKusJnWUZ2QlH9TNCg1FPrFHPVrgBO5rV9Oz9BJJ+1g2U8voM gpZuNOpjnu11HWVEK2nrnzxW9OT5FMjxqFvEc40DRNwlvqcCCDhIGMuhIuiWfoFjX1P/ EjBQ== X-Gm-Message-State: AJIora9/PsfPtPMh1kJOe4iXlINg7ZLnKWlfG8mbU+EhdIxC/gm8dQec CI3570auYfZVbZQUzodRWBg4wjoFzeLnQg== X-Google-Smtp-Source: AGRyM1saeW4jfd5Fm0VaP8KhyyNj4p+fa2B75hzWXIFg34kpk+8MJEBvmhClcfXmxQlGPf54Rk343Q== X-Received: by 2002:a05:6402:520b:b0:435:c2a4:f822 with SMTP id s11-20020a056402520b00b00435c2a4f822mr45693883edd.198.1657006335321; Tue, 05 Jul 2022 00:32:15 -0700 (PDT) Received: from angeloc.pdxnet.pdxeng.ch (host085115199111.static.fidoka.tech. [85.115.199.111]) by smtp.gmail.com with ESMTPSA id t27-20020a17090616db00b0071cbc7487e1sm15274562ejd.69.2022.07.05.00.32.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 00:32:14 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 5 Jul 2022 09:32:03 +0200 Message-Id: <20220705073206.1442280-3-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220705073206.1442280-1-angelo@amarulasolutions.com> References: <20220705073206.1442280-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=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JoBXZedk2w0JYcCNb4K9vsPqEWa3eTn83IBb95FaRMc=; b=H2pI/LfJM08V86vKXiUiUcvS5kbocZoBpw2Q30bIkEBFRYdHX45jZDozWJSRTp4PrW gPjetbVNVcOWVFqt5Wz5IL3DUT+HcWJm39RIsI2t92Kw4QDXjZ40DfOGoJmV5FFg12JQ qs+DaDRoERJLQ4yN+CwNOdRuCdzKlJFXA81HE= 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=H2pI/LfJ Subject: [Buildroot] [PATCH v3 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: br015@umbiko.net, 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 afcd6502e3..09971654fe 100644 --- a/package/wpa_supplicant/wpa_supplicant.mk +++ b/package/wpa_supplicant/wpa_supplicant.mk @@ -264,6 +264,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 @@ -275,6 +288,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 Jul 5 07:32:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1652320 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=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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LcZCM2cBbz9ryY for ; Tue, 5 Jul 2022 17:33:03 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 77B9B813DD; Tue, 5 Jul 2022 07:33:01 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 77B9B813DD 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 sv5lPLRleK2w; Tue, 5 Jul 2022 07:33:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 5FBB381342; Tue, 5 Jul 2022 07:32:59 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 5FBB381342 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 EC99F1BF2B3 for ; Tue, 5 Jul 2022 07:32:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id C5303605B1 for ; Tue, 5 Jul 2022 07:32:18 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org C5303605B1 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 CtA8mxeMcuRn for ; Tue, 5 Jul 2022 07:32:18 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org E89B1605C9 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by smtp3.osuosl.org (Postfix) with ESMTPS id E89B1605C9 for ; Tue, 5 Jul 2022 07:32:17 +0000 (UTC) Received: by mail-ed1-x52e.google.com with SMTP id v12so1526623edc.10 for ; Tue, 05 Jul 2022 00:32:17 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=nlFAp1mCT74Ux7ULX0KXwfvIKlZwxvD3KwNxZlej07k=; b=dc1sQVwiwUAvjlkLw7BlTY8RPASUivZDJhMMYIV07S5HdHOzuIRpyY8+wtFFeB3FBU SDX4NfLJJ+BenJT8OyZneGo8Y6ZPrZO18XE34DzI/YnhKVMjXcCpXF6DYlcX8amb32Xw 9Oj7LaJxS5zTuvG5LHsyp7DMQm9Ge/ScGutRAJDT2ftIXLbl4Azqwt5hwE5yMPGAtSsU c4qfPBpWNDScrdYYkVGN/bEFcInGK+CEJ3myHke72ArJ10pLL4fkshPRwgLNVj04hrb4 iRQTM+xWFA9SGoDRAOB5KY/7oyBmbFtvky9Mw7oeuulRHPWHrA3H3fLnymbocMzeF4kM JBhg== X-Gm-Message-State: AJIora9MgBhkrzI0BL269kgtLu/nTOC2sVQO1aV6NJngbkQM8J6UDel1 MSHiZvSIK60jDQ3aFzj/4AbGpH1Sx2Z3MA== X-Google-Smtp-Source: AGRyM1tB+cJxFWxSVId2xqOW5kDDF1mpiDeGi9uphVgjoOlW+GJQ3RQctCwx1e8xY63vVZe60178IA== X-Received: by 2002:a05:6402:3216:b0:435:a061:d662 with SMTP id g22-20020a056402321600b00435a061d662mr43898718eda.275.1657006336204; Tue, 05 Jul 2022 00:32:16 -0700 (PDT) Received: from angeloc.pdxnet.pdxeng.ch (host085115199111.static.fidoka.tech. [85.115.199.111]) by smtp.gmail.com with ESMTPSA id t27-20020a17090616db00b0071cbc7487e1sm15274562ejd.69.2022.07.05.00.32.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 00:32:15 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 5 Jul 2022 09:32:04 +0200 Message-Id: <20220705073206.1442280-4-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220705073206.1442280-1-angelo@amarulasolutions.com> References: <20220705073206.1442280-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=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nlFAp1mCT74Ux7ULX0KXwfvIKlZwxvD3KwNxZlej07k=; b=HZmzCgV4g7h/mp4etuR8WB2hN0iRDFIhqVUsuEkVEyH825QMQZSCYM0nrDxoFd104t iihnE31/bSof3/9n5ludd2v5utK45S9Tj8bmANSJHbzxLOCcY0tRpz0Wt+XNFp1dPdES 9habTWyfIdUIL55xw0Cbak3bXcTHiLDL5jxco= 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=HZmzCgV4 Subject: [Buildroot] [PATCH v3 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: br015@umbiko.net, 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 09971654fe..157d45ee7f 100644 --- a/package/wpa_supplicant/wpa_supplicant.mk +++ b/package/wpa_supplicant/wpa_supplicant.mk @@ -275,6 +275,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 @@ -302,6 +311,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 9a5bdb2932..084340b1a4 100644 --- a/system/Config.in +++ b/system/Config.in @@ -422,6 +422,7 @@ config BR2_SYSTEM_CONNECT_WIFI bool "Connect to a default wifi access point" default n depends on 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 Jul 5 07:32:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1652321 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=buildroot.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LcZCc62Nbz9ryY for ; Tue, 5 Jul 2022 17:33:16 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 87BFB40327; Tue, 5 Jul 2022 07:33:14 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 87BFB40327 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 ZHz7UOgnx1Lj; Tue, 5 Jul 2022 07:33:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 977DB404C9; Tue, 5 Jul 2022 07:33:12 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 977DB404C9 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 0916C1BF9B5 for ; Tue, 5 Jul 2022 07:32:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D19944176C for ; Tue, 5 Jul 2022 07:32:19 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org D19944176C 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 Dn841bHFPn37 for ; Tue, 5 Jul 2022 07:32:19 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org D8EBD41763 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by smtp4.osuosl.org (Postfix) with ESMTPS id D8EBD41763 for ; Tue, 5 Jul 2022 07:32:18 +0000 (UTC) Received: by mail-ed1-x52f.google.com with SMTP id z19so14110045edb.11 for ; Tue, 05 Jul 2022 00:32:18 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=DfWCxSgYwqIh9O3bxJaS3BSLgdhGOqg5CgJ7XyOxv/8=; b=PWvuGo6SLyxuJrcn60cO6dkACDM7U09ushR6+yZ87nbQ6AK7SRgoIkraWRALAgsaeb aB/VmhrJPIbGf6B5NUova38NE4afzH5ztN8E7SdXi7QvAA9KnG/SoutQZF3FQseUuH9G bhIvszYF5LA0RRXfCDaTIirrLxoTg2VNpjqA1YvAw4AIGqMSLIaDz1HgTBfNvBANzqzu 5INN1UnYkIx0PuZo3EIPvpL5QFkcspRjR+2Tttl+ELSWhfsurwHC56wcyH49mwynFcg7 0qKwC9PrNEcGXC1GOQ8iwlRpzaM6XAksEMuPDIuzMva1ePfXrbY698LAL7ZsLUOvIYQp VPyQ== X-Gm-Message-State: AJIora/zK95spF65JPjh/9cc0heXqgMHYarW0sxlUkdKu+zpRTxPocT8 cVlL1/L2fdgaVDwP7R3MXlp6OLanebleuw== X-Google-Smtp-Source: AGRyM1sns+WBkdIwOg8VVAUZ0KaHxix63xfS5LZ4bsIQOPxkU/0cIzpJfeSmGnQCL7fROr5fHrJ92Q== X-Received: by 2002:aa7:de88:0:b0:435:9a54:168a with SMTP id j8-20020aa7de88000000b004359a54168amr43349403edv.73.1657006337048; Tue, 05 Jul 2022 00:32:17 -0700 (PDT) Received: from angeloc.pdxnet.pdxeng.ch (host085115199111.static.fidoka.tech. [85.115.199.111]) by smtp.gmail.com with ESMTPSA id t27-20020a17090616db00b0071cbc7487e1sm15274562ejd.69.2022.07.05.00.32.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 00:32:16 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 5 Jul 2022 09:32:05 +0200 Message-Id: <20220705073206.1442280-5-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220705073206.1442280-1-angelo@amarulasolutions.com> References: <20220705073206.1442280-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=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DfWCxSgYwqIh9O3bxJaS3BSLgdhGOqg5CgJ7XyOxv/8=; b=jpEkUN5d782Uiql3/qnnm0k7gQbKr1NTt+CFZGUzoqF2hYUFkoXY5JiMnGx7wJJP0P nP/mAFhSgpesSnXKAohV2aOQFXx3NdY8nxlCMo5UEvqXZyeZHl5yRIbTEel4jmRgzI38 EqvTPjyJtKjoQ0B+M/gvGqhCCF6Y8L9q0+uLU= X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=jpEkUN5d Subject: [Buildroot] [PATCH v3 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: br015@umbiko.net, Angelo Compagnucci Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Add a proper wpa-conf line to the interfaces files to let the system bringup 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 Jul 5 07:32:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1652322 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=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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LcZCs50Bkz9ryY for ; Tue, 5 Jul 2022 17:33:29 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 9D93C40A19; Tue, 5 Jul 2022 07:33:27 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 9D93C40A19 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 D_RUF-7FSyJv; Tue, 5 Jul 2022 07:33:26 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 9B89340A09; Tue, 5 Jul 2022 07:33:25 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 9B89340A09 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 968541BF2B3 for ; Tue, 5 Jul 2022 07:32:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 7EB32605B1 for ; Tue, 5 Jul 2022 07:32:20 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 7EB32605B1 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 qvUlyAhWkL9u for ; Tue, 5 Jul 2022 07:32:19 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org A6B07605C9 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by smtp3.osuosl.org (Postfix) with ESMTPS id A6B07605C9 for ; Tue, 5 Jul 2022 07:32:19 +0000 (UTC) Received: by mail-ed1-x533.google.com with SMTP id g1so6517011edb.12 for ; Tue, 05 Jul 2022 00:32:19 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Qvi6hB5jpDDJ8wVe4EmHtFbcs/mkSh/0stDdeDDPLNM=; b=0AtNzj6UaplyyfK6tpX63LeiRogDlLpgNPpI8CE8C3IsJ7ZxpfhMgIDzF6Gk2gPm/p gShvRjctIJd+QWiBywoigJ/quQF+fcqaSS/7XueeWiqVUPEb64mWaNsfvzz82/c+rYjX sN9AiGr2guIqCVfgk70dnO52YK7tTxQNmqZYfmVLU1x15OjcnoGBLDnJzVL0W+RtNwGK EIcR8hkSEQZA8ZjckDX/mZ595pptQJt0zvi8dkfcAzsQi4LC8fUJT5lDLqZHXGioJNjK n9nQJMVzLxMT49AGlbxguXGr28TMbO/RFKIu7ZheznhgQEpWy9yL5P0RTO3NGTxaV5dv F26g== X-Gm-Message-State: AJIora/ImtofFZhcGpwy7A1sV/D2WaFE0x5rh67krMaO43y46kCQinYr WQYbrwsgE8x0JWR2dL75jyNrEQcN24WtdQ== X-Google-Smtp-Source: AGRyM1tPsSgFTiS3v/BGU315bAU63CsdCaypoy7f1mNypM++KjFA8BFr3G+OMuPiVvm7LUfdr/oWPw== X-Received: by 2002:a05:6402:5188:b0:437:618c:c124 with SMTP id q8-20020a056402518800b00437618cc124mr44187847edd.233.1657006337886; Tue, 05 Jul 2022 00:32:17 -0700 (PDT) Received: from angeloc.pdxnet.pdxeng.ch (host085115199111.static.fidoka.tech. [85.115.199.111]) by smtp.gmail.com with ESMTPSA id t27-20020a17090616db00b0071cbc7487e1sm15274562ejd.69.2022.07.05.00.32.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 00:32:17 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 5 Jul 2022 09:32:06 +0200 Message-Id: <20220705073206.1442280-6-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220705073206.1442280-1-angelo@amarulasolutions.com> References: <20220705073206.1442280-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=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Qvi6hB5jpDDJ8wVe4EmHtFbcs/mkSh/0stDdeDDPLNM=; b=Z6tNuRw5n1gJh4eBIl1LudDZ6NAn9UOx4PQpiPqxa0SQUf4JsrKil27HnX8bPeT1V2 i2hk4Kx+oCaYMSqc7DhIomkZW5h4GIqJK0SbzfIHIcOV6lr7+ol/RukCQsMkdiBnCFe7 nK8y3HENVWMB8XvIe/WbqG6a+8jVq/246Uhwc= 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=Z6tNuRw5 Subject: [Buildroot] [PATCH v3 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: br015@umbiko.net, 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 file. 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 --- Changes 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) 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..3937945596 --- /dev/null +++ b/package/initscripts/init.d/S11modules @@ -0,0 +1,59 @@ +#!/bin/sh + +MODULES="*.conf" +MODULES_DIR="/etc/modules-load.d" + +[ -z "$(ls -A ${MODULES_DIR}/${MODULES} 2> /dev/null)" ] && exit 0 + +load_unload() { + for module_file in $(ls -1 ${MODULES_DIR}); do + while read module args; do + + case "$module" in + ""|"#"*) continue ;; + esac + + if [ "$1" = "load" ]; then + modprobe -q ${module} ${args} >/dev/null && \ + printf ' %s success,' "$module" || + printf ' %s failed,' "$module" + else + rmmod ${module} >/dev/null + fi + + done < ${MODULES_DIR}/${module_file} + done +} + +start() { + printf 'Starting modules:' + + load_unload load + + echo ' OK' +} + +stop() { + printf 'Stopping modules:' + + load_unload unload + + echo 'OK' +} + +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