Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Angelo Compagnucci <angelo@amarulasolutions.com>
To: buildroot@buildroot.org
Cc: br015@umbiko.net, Angelo Compagnucci <angelo@amarulasolutions.com>
Subject: [Buildroot] [PATCH v3 3/5] package/wpa_supplicant: configure wifi on systemd when enabled
Date: Tue,  5 Jul 2022 09:32:04 +0200	[thread overview]
Message-ID: <20220705073206.1442280-4-angelo@amarulasolutions.com> (raw)
In-Reply-To: <20220705073206.1442280-1-angelo@amarulasolutions.com>

Configure a default basic wifi setup able to automatically connect
to the selected access point.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
 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"
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2022-07-05  7:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-05  7:32 [Buildroot] [PATCH v3 0/5] Configure default wifi through kconfig Angelo Compagnucci
2022-07-05  7:32 ` [Buildroot] [PATCH v3 1/5] system: adding options for configuring wifi Angelo Compagnucci
2022-09-18  9:57   ` Peter Korsgaard
2022-10-03 15:42     ` Angelo Compagnucci
2022-10-04  9:05       ` Andreas Ziegler
2022-10-04  9:14         ` Angelo Compagnucci
2022-07-05  7:32 ` [Buildroot] [PATCH v3 2/5] package/wpa_supplicant: configure wifi on systemv when enabled Angelo Compagnucci
2022-07-05  7:32 ` Angelo Compagnucci [this message]
2022-09-18 10:00   ` [Buildroot] [PATCH v3 3/5] package/wpa_supplicant: configure wifi on systemd " Peter Korsgaard
2022-10-03 15:44     ` Angelo Compagnucci
2022-07-05  7:32 ` [Buildroot] [PATCH v3 4/5] package/ifupdown-scripts: add wifi configuration " Angelo Compagnucci
2022-09-18 10:03   ` Peter Korsgaard
2022-10-03 15:50     ` Angelo Compagnucci
2022-07-05  7:32 ` [Buildroot] [PATCH v3 5/5] package/initscripts: add service to load kernel modules at boot Angelo Compagnucci
2022-09-18 10:10   ` Peter Korsgaard
2022-10-03 15:53     ` Angelo Compagnucci

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220705073206.1442280-4-angelo@amarulasolutions.com \
    --to=angelo@amarulasolutions.com \
    --cc=br015@umbiko.net \
    --cc=buildroot@buildroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox