From patchwork Tue Jun 28 10:13:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1649421 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.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.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 4LXL6t66yvz9sG2 for ; Tue, 28 Jun 2022 20:14:30 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 8C35D4098D; Tue, 28 Jun 2022 10:14:28 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 8C35D4098D 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 RZKj4RsCN4Sg; Tue, 28 Jun 2022 10:14:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 630B3409AA; Tue, 28 Jun 2022 10:14:26 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 630B3409AA 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 225371BF599 for ; Tue, 28 Jun 2022 10:14:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id F0AE340598 for ; Tue, 28 Jun 2022 10:14:12 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org F0AE340598 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 Npph0GlWTj4u for ; Tue, 28 Jun 2022 10:14:12 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 2DD3240123 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by smtp2.osuosl.org (Postfix) with ESMTPS id 2DD3240123 for ; Tue, 28 Jun 2022 10:14:12 +0000 (UTC) Received: by mail-ej1-x635.google.com with SMTP id u15so24696663ejc.10 for ; Tue, 28 Jun 2022 03:14:12 -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=ID5oIq3f6UBrOZANoK6iN32LQNSNO4BMTFoqao9bj1Cwtw/ehqnVXGttb/12t01bB5 6luP94tVgkrn2N2RCOTSKBD09zben7LH12SNNbfkysYK+uuP4X9732dVetRe+KC0bvO2 ttTwq8MbTMPZXQiKBQ7SU4Mp12Kxz9BLSTvL8whArFkwzjaLaHnyqZXFq8hUfFsaGi52 QgSqLXtQjM65AFHGLZKTwWz9gDFkPWg31JXuAW0O2jckxb1CnwkW8MzFdo2iahs5WTtO 7TSmbC3EdLnJF6xRIjSj0FA2xwtV2t8PNZWIOUC/Q+P/i7MOWz1vnlhET3z5eUb9vVJH ouYw== X-Gm-Message-State: AJIora+HRcIxrt92gi+vq1EyccX1eOZjz7UHDSpe9PLAX4883P2BzCsC 3yFy48HoBPKWar8+kT747lG74kcDkvvJOw== X-Google-Smtp-Source: AGRyM1vUMTOWeyt6Kgv4a700/Q2Z8idR6Wulx8mqwviMcRe9++GHKqWu/6nNC1akYd8qqxtlKQuHDA== X-Received: by 2002:a17:907:6da2:b0:726:3ebd:9c9a with SMTP id sb34-20020a1709076da200b007263ebd9c9amr17318317ejc.628.1656411250336; Tue, 28 Jun 2022 03:14:10 -0700 (PDT) Received: from angeloc.pdxnet.pdxeng.ch (host085115199111.static.fidoka.tech. [85.115.199.111]) by smtp.gmail.com with ESMTPSA id x2-20020a05640225c200b00435651c4a01sm9308401edb.56.2022.06.28.03.14.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 03:14:10 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 28 Jun 2022 12:13:48 +0200 Message-Id: <20220628101352.1786434-2-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220628101352.1786434-1-angelo@amarulasolutions.com> References: <20220628101352.1786434-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=SZxwGxf78dUaUde6Wi1jGw/lzxZIOj3rH8GCtfaDNo7/PEqW/tjAtuUQSHoOeOCPcN VhZFSSlYKp66xZ64App7zIX/py+6MV53Bxcj7yNSgcIOzvRs5tOFbMHv20sm32fVyTU6 2L1z/K4kZmR1MsrIZ95gL6tuYgHP/KvKtGTBI= 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=SZxwGxf7 Subject: [Buildroot] [PATCH v2 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 --- 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 Jun 28 10:13:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1649422 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.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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LXL784SvLz9sG2 for ; Tue, 28 Jun 2022 20:14:44 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 2844182EAD; Tue, 28 Jun 2022 10:14:42 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 2844182EAD 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 9CVg-6hEz7pH; Tue, 28 Jun 2022 10:14:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 39B4782CF1; Tue, 28 Jun 2022 10:14:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 39B4782CF1 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 6C9491BF599 for ; Tue, 28 Jun 2022 10:14:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 4753082C04 for ; Tue, 28 Jun 2022 10:14:15 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 4753082C04 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 iDAd5Vz9XGpx for ; Tue, 28 Jun 2022 10:14:13 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 0506F82B97 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by smtp1.osuosl.org (Postfix) with ESMTPS id 0506F82B97 for ; Tue, 28 Jun 2022 10:14:12 +0000 (UTC) Received: by mail-ej1-x633.google.com with SMTP id d2so12985059ejy.1 for ; Tue, 28 Jun 2022 03:14:12 -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=FKXg9Qo0wAzL7z+7YYsBD7YCwyvRu8DndPUIRYKrJWoQoOT7NUWVk+/mRcRI9mi/NU Z+/hpD6QlwOqBgrQ42GqGJBgi+b2OAIHAo0GtaJexsXIDQqRCx9p1rjplGLQYZzCWe/k V1U7ZNWU/0kSyxSUl+ml4h8mVD/vGlM1HhkIhs+WdsGO8nWqudMym2GR2mG0iJeAnXtu DnnuzoJN4AlxX0kJoJqdV5oQ4LxWz7Q2U64Gi6jxVDtJA6DXOdnIIRwlIXj1Hf76AOwy SLrUco6P9QvyTxyRNyswluS20zZYR5I+PfTRI6lK6PNc9RlmYL4VKuthUSSPxUyKQrW5 N1lg== X-Gm-Message-State: AJIora9curFq6+Pg9PCaBwjbqn54khAHfIdMuP6fg1qyCeOIa2jjB0AU vVJOpzhWSMtOykK3UHTmJYx0WO9krzjTvQ== X-Google-Smtp-Source: AGRyM1vjxlNuQ4aXE1311g+KEm4nkxx1xwAE3znIcfGN3hkNTkuVgVDdhVihBz72b9HwU1ZGRaslPA== X-Received: by 2002:a17:906:51db:b0:722:ea9b:ff9e with SMTP id v27-20020a17090651db00b00722ea9bff9emr17370243ejk.16.1656411251104; Tue, 28 Jun 2022 03:14:11 -0700 (PDT) Received: from angeloc.pdxnet.pdxeng.ch (host085115199111.static.fidoka.tech. [85.115.199.111]) by smtp.gmail.com with ESMTPSA id x2-20020a05640225c200b00435651c4a01sm9308401edb.56.2022.06.28.03.14.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 03:14:10 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 28 Jun 2022 12:13:49 +0200 Message-Id: <20220628101352.1786434-3-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220628101352.1786434-1-angelo@amarulasolutions.com> References: <20220628101352.1786434-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=XJTWsO82kvKLO3R1MeI9JAaIO0Pn4VBLxUSWmhDntC/idOnJfLdGBE45wWJy4mCdSZ NvIH1IcYEyZuEUPYz4rmdPrnGSoqgTm1XXngdTtGsdgH8lRuuMvMjjOPDsB6wp43UjhK 8WbjLlKzbeehgPc9CtpIkvd9hUTWMGJ1/POFg= X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=XJTWsO82 Subject: [Buildroot] [PATCH v2 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 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 Jun 28 10:13:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1649423 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.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.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 4LXL7P1WVPz9sG2 for ; Tue, 28 Jun 2022 20:14:57 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 4FACC409BE; Tue, 28 Jun 2022 10:14:55 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 4FACC409BE 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 4PwIAivij7lD; Tue, 28 Jun 2022 10:14:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 17314409AA; Tue, 28 Jun 2022 10:14:53 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 17314409AA 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 15DBD1BF599 for ; Tue, 28 Jun 2022 10:14:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id E1DB840598 for ; Tue, 28 Jun 2022 10:14:15 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org E1DB840598 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 eHcG47tre-u7 for ; Tue, 28 Jun 2022 10:14:13 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 99084405A9 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by smtp2.osuosl.org (Postfix) with ESMTPS id 99084405A9 for ; Tue, 28 Jun 2022 10:14:13 +0000 (UTC) Received: by mail-ed1-x534.google.com with SMTP id eq6so16817255edb.6 for ; Tue, 28 Jun 2022 03:14:13 -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=1u236+xqtV/CygcWDT7QetsGxExGpC/wL72l5rgnEcdg9EaXxOqWlx2PHmD4DcNuGC hXWFh1NtkolhlhOYc6QlLo6Bi/ZDihJ9bDOfdY7iD7eMKNVebqgHDgqrcRo370ElU7dL S8gEU9r0an6aUeuHvp0I1rG9mhN4GDGKFxzzYVVJji7YhThhTCqr8CiOIopJcCqXju81 HWnhriZ0DuRvhhVnU70m5YhTxgZTQjnSUFV1ZISpV+EHzDoJEv86fwPhUviELyhzVkhI kvKkN7TBos3KrYkwMdkGzTtxjIU7TWfM0e+ItkBv6dtWG7bCIgvoqFLEGIWX8YUtKdW+ iNlQ== X-Gm-Message-State: AJIora+bqk9RxPGThccP58cIDvG1GH7yrBlj/qwuCX4jwgXtK/Yss4mw 5lHVtmXr4enPrABk2CUo1/fUAHVsiGMCqQ== X-Google-Smtp-Source: AGRyM1u3he3nrcIcWz8cKZpx2lGFsUVuHButkB009htempkOHairEO0paouuHQQQPZ05iNaxayzOxQ== X-Received: by 2002:a05:6402:448a:b0:435:3fbe:2593 with SMTP id er10-20020a056402448a00b004353fbe2593mr21999786edb.226.1656411251843; Tue, 28 Jun 2022 03:14:11 -0700 (PDT) Received: from angeloc.pdxnet.pdxeng.ch (host085115199111.static.fidoka.tech. [85.115.199.111]) by smtp.gmail.com with ESMTPSA id x2-20020a05640225c200b00435651c4a01sm9308401edb.56.2022.06.28.03.14.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 03:14:11 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 28 Jun 2022 12:13:50 +0200 Message-Id: <20220628101352.1786434-4-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220628101352.1786434-1-angelo@amarulasolutions.com> References: <20220628101352.1786434-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=XerLwo4YtCcl/3vfUvYoc56nGSRa9h+gYJJyYjtwC1slKA11qYBu/61OSRRNYp1fw3 HJMkR70AxcHmw2W5ySu3ZTyXlQg83xLni1mY6tzG+AJ+gSPr5mQWPvNqoc2PcB/BpWFg EMTg1F9UHjA5lvtbngLfV0Xe6IAcym+IaSvIU= 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=XerLwo4Y Subject: [Buildroot] [PATCH v2 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 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 Jun 28 10:13:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1649424 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.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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LXL7f6BR2z9sG2 for ; Tue, 28 Jun 2022 20:15:10 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 0C9F082F2D; Tue, 28 Jun 2022 10:15:09 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 0C9F082F2D 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 F4y7VnTsriu1; Tue, 28 Jun 2022 10:15:08 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 2E4C782CF1; Tue, 28 Jun 2022 10:15:07 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 2E4C782CF1 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 1B82D1BF9C6 for ; Tue, 28 Jun 2022 10:14:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id E9B6060E82 for ; Tue, 28 Jun 2022 10:14:15 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org E9B6060E82 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 is0Zfs7kL8Qq for ; Tue, 28 Jun 2022 10:14:14 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 79BF460E7E 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 79BF460E7E for ; Tue, 28 Jun 2022 10:14:14 +0000 (UTC) Received: by mail-ej1-x629.google.com with SMTP id cw10so24754528ejb.3 for ; Tue, 28 Jun 2022 03:14:14 -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=lUWeFJ2fz8gjJsQbSJ0KVCvaTjQlMtc94Jse7UtcNOY=; b=Uz+qPixYonRVjxTrcOst92ARJg/3/3Vj4RK3N3Igdrpa1kod2QKcAI1oMMQJO7sJJz bRr0kHOe2TLgEkw7nTfNHDYo4qQgh11IZ7XzkVIEGxt3WzzQvY5Cu7CiP3PuagpsGQZz 3YRU1/FX+0uNiwbMKiYrQdkIXeFmNAxSKshP6Es/TtyX6mylUSfCOuR3IUkMMV2gYYdP 17EWXrQX56xIr4krzypwtNBIjQpJyEaFaCqc6+YkWaexKpPHKjs666fyV8h7iV4U7iW/ CzWMSUT6POBsGDTQYhGfT2WvJIEo+DsomZPho9kNpuHLFBz6xUEPzXZAwy3DcOfL14kG 1SHw== X-Gm-Message-State: AJIora9aYMwvkZwYQb8zODTcmIrnzubRBEp/QTknKs0+dmZzpCbyD7/7 Ou7rK8mOc6/90PeylyufpPscCXhfGnOMug== X-Google-Smtp-Source: AGRyM1vx2FfKcH6YYbs2eue1j87ps70M65vGZ2aomGHjgtlpMnUuXTP63ZEIhqReggz8nKHak4nalw== X-Received: by 2002:a17:906:794a:b0:722:efd0:862f with SMTP id l10-20020a170906794a00b00722efd0862fmr16891024ejo.650.1656411252650; Tue, 28 Jun 2022 03:14:12 -0700 (PDT) Received: from angeloc.pdxnet.pdxeng.ch (host085115199111.static.fidoka.tech. [85.115.199.111]) by smtp.gmail.com with ESMTPSA id x2-20020a05640225c200b00435651c4a01sm9308401edb.56.2022.06.28.03.14.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 03:14:12 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 28 Jun 2022 12:13:51 +0200 Message-Id: <20220628101352.1786434-5-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220628101352.1786434-1-angelo@amarulasolutions.com> References: <20220628101352.1786434-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=lUWeFJ2fz8gjJsQbSJ0KVCvaTjQlMtc94Jse7UtcNOY=; b=WXVqG2s+6K3WUVD7YQiW2rHPxsRlG6Cu/GGil5iRRGGX+0LcUtEm+ZFFg0gry7kps4 MUSXu9HZFAA2OdxV1y7kIOT9mf0ujGrXJ/+sNqKgB5ud4+5+iVgy4WhbVnp7qJtiRSb1 LDEtNsMV3bAm6N1UyNvR8wMWUsAVy6jku6etA= 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=WXVqG2s+ Subject: [Buildroot] [PATCH v2 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 bringup the wifi interface and the related wpa supplicant. Signed-off-by: Angelo Compagnucci --- 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..e3830aa1ad 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"; \ ) >> $(TARGET_DIR)/etc/network/interfaces endef define IFUPDOWN_SCRIPTS_DHCP_OPENRC From patchwork Tue Jun 28 10:13:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1649425 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 4LXL7w1zWGz9sG2 for ; Tue, 28 Jun 2022 20:15:24 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 3C1724109F; Tue, 28 Jun 2022 10:15:22 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 3C1724109F 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 NZctRjFbNyYR; Tue, 28 Jun 2022 10:15:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id EDF8C409AA; Tue, 28 Jun 2022 10:15:19 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org EDF8C409AA 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 2A2F71BF9D1 for ; Tue, 28 Jun 2022 10:14:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 131A982B97 for ; Tue, 28 Jun 2022 10:14:16 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 131A982B97 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 kSlebIQ35hkh for ; Tue, 28 Jun 2022 10:14:15 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 4ACCA82C99 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by smtp1.osuosl.org (Postfix) with ESMTPS id 4ACCA82C99 for ; Tue, 28 Jun 2022 10:14:15 +0000 (UTC) Received: by mail-ed1-x536.google.com with SMTP id e2so16866145edv.3 for ; Tue, 28 Jun 2022 03:14:15 -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=M0/PTrrbdZDPkev04aCKrD4Kp5qtS3yLVWzY97zv1BOcT9szwN7Pcg8rbdVLxwyrTs 7BUiZR/KofXwSAlyPK4D/a2szEHtTZ28M8MUaWZsYz73griCDf+Ci8bIqPosEhKyVukf Ig4pIC7mUGUY4hvq6ZOrcJi9aEOJVB8VCXmzPDDICmTpeRT5IRgqQmxbCn7ePsC4QLGx 1C396G9ZyXkumZ2lEXuO4EEGkzYI/gmOJKG4aCWqD2QWRWMQd1Sfah4nRZKeSMLqDWqN 5Wm+OJYRsZSx0vZpAYnSWulxFIk5Y2LAiJQZ7GoCm/cBBf2EoV2Knk+jJrWAuHIT6eml wNFw== X-Gm-Message-State: AJIora+iiLaBhEf5y4wqyphLU7pMnhr2pq1+JD3pt0tnF/bqa8UaD23N wX91rzgfQ9Zv1GofA4agGQs6KJkc5EtrtQ== X-Google-Smtp-Source: AGRyM1uOYkh2ZCoINFlqrQhySPHGfUQ6b5BBaY2NFhVto7i4aMgNMMFu7RfZQQ4nKjixDp/cxqraRQ== X-Received: by 2002:a05:6402:398:b0:435:6df7:b7e4 with SMTP id o24-20020a056402039800b004356df7b7e4mr22361548edv.306.1656411253515; Tue, 28 Jun 2022 03:14:13 -0700 (PDT) Received: from angeloc.pdxnet.pdxeng.ch (host085115199111.static.fidoka.tech. [85.115.199.111]) by smtp.gmail.com with ESMTPSA id x2-20020a05640225c200b00435651c4a01sm9308401edb.56.2022.06.28.03.14.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 03:14:13 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 28 Jun 2022 12:13:52 +0200 Message-Id: <20220628101352.1786434-6-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220628101352.1786434-1-angelo@amarulasolutions.com> References: <20220628101352.1786434-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=rGx8D7q0b6i24UJ3UffwzujR4ZffCSk27VL4s3iurErRYQVqkKcxd30L8iMoRpBK24 jiSMFiCx3xE/DwwDC/fJgT9IoMHDdoC/ktjS1RIBlOZ29v1HyUdmwRMaaL5snMLbCLvC GcF0m5q2AHA5UUx7MfJeC4FWQzAjPuqv7tmwY= X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=rGx8D7q0 Subject: [Buildroot] [PATCH v2 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 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