Configure default wifi through kconfig
v3 cover Configure default wifi through kconfig
This series was born while adding support for a board and feeling the necessity to have the networking options available in .config. I understand that something like that could be done by adding an overlay, but it requires a lot of boilerplate only to be able to connect to a wifi network.
Angelo Compagnucci (5):
system: adding options for configuring wifi package/wpa_supplicant: configure wifi on systemv when enabled package/wpa_supplicant: configure wifi on systemd when enabled package/ifupdown-scripts: add wifi configuration when enabled package/initscripts: add service to load kernel modules at boot
package/ifupdown-scripts/ifupdown-scripts.mk | 2 + package/initscripts/init.d/S11modules | 59 ++++++++++++++++++++ package/wpa_supplicant/wpa_supplicant.mk | 24 ++++++++ system/Config.in | 16 ++++++ 4 files changed, 101 insertions(+) create mode 100644 package/initscripts/init.d/S11modules
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 1/5 system: adding options for configuring wifi
These options can be used by packages to configure a wifi card to connect at boot.
--- system/Config.in | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
system/Config.in +15 -0
@@ -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
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v3 1/5] system: adding options for configuring wifi
Quoted 15 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Angelo" == Angelo Compagnucci <[email protected]> writes:
These options can be used by packages to configure a wifi card to connect at boot.
Signed-off-by Angelo Compagnucci <[email protected]>--- system/Config.in | 15 +++++++++++++++ 1 file changed, 15 insertions(+)system/Config.in +0
-0
system/Config.in comment "automatic network configuration via DHCP needs ifupdown or busybox or n · line 423
Quoted 6 lines
system/Config.in +3
-0@@ -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
'n' is default, so drop that. This doesn't really do anything unless the user also configures BR2_SYSTEM_DHCP="wlan0", right?
I must say I am not really convinced. This is only useful for quite specific setups (E.G. a lot more specific than BR2_SYSTEM_DHCP which we use in a number of defconfigs) and hard codes a number of things (like WPA-PSK that may or may not make sense in the future).
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v3 1/5] system: adding options for configuring wifi
Quoted 16 lines · Peter Korsgaard
system/Config.in comment "automatic network configuration via DHCP
Quoted 15 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Angelo" == Angelo Compagnucci <[email protected]> writes:
These options can be used by packages to configure a wifi card to connect at boot.
Signed-off-by Angelo Compagnucci <[email protected]>--- system/Config.in | 15 +++++++++++++++ 1 file changed, 15 insertions(+)system/Config.in +0
-0@@ -418,6 +418,21 @@ comment "automatic network configuration via DHCPneeds ifupdown or busybox or n
Quoted 8 lines
system/Config.in comment "automatic network configuration via DHCP needs ifupdown or busybox or n · line 423
Quoted 6 lines
system/Config.in +3
-0depends 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'n' is default, so drop that.
Right.
Quoted 3 lines
This doesn't really do anything unless the user also configures BR2_SYSTEM_DHCP="wlan0", right?
Right.
Quoted 6 lines
I must say I am not really convinced. This is only useful for quite specific setups (E.G. a lot more specific than
BR2_SYSTEM_DHCPwhich we use in a number of defconfigs) and hard codes a number of things (like WPA-PSK that may or may not make sense in the future).
This is what we have now on several readme.txt on how to connect to a wifi
WiFi
====
# wpa_passphrase ACCESSPOINTNAME >> /etc/wpa_supplicant.conf (type password and enter) # wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -B # udhcpc -i wlan0
I don't think this is nice.
I'd like to see something like that:
WiFi
====
# Enable BR2_SYSTEM_CONNECT_WIFI configure option
# Set the Wifi SSID with the option BR2_SYSTEM_CONNECT_WIFI_SSID # Set the password with the option BR2_SYSTEM_CONNECT_WIFI_PASSWORD
Nicer and easier. I know that the wpa-psk could change in the feature, but then we can change to whatever default mechanism will be in place at that moment.
Quoted 4 lines
--
Bye, Peter Korsgaard
Signature · 15 lines
Angelo Compagnucci Software Engineer [email protected] __________________________________ Amarula Solutions SRL Via le Canevare 30, 31100 Treviso, Veneto, IT T. +39 (0)42 243 5310 [email protected] www.amarulasolutions.com [`as] https://www.amarulasolutions.com|
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v3 1/5] system: adding options for configuring wifi
Hi Angelo, Peter, *,
Quoted 23 lines · Angelo Compagnucci
Quoted 20 lines · Peter Korsgaard
system/Config.in comment "automatic network configuration via
Quoted 15 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Angelo" == Angelo Compagnucci <[email protected]> writes:
These options can be used by packages to configure a wifi card to connect at boot.
Signed-off-by Angelo Compagnucci <[email protected]>--- system/Config.in | 15 +++++++++++++++ 1 file changed, 15 insertions(+)system/Config.in +0
-0@@ -418,6 +418,21 @@ comment "automatic network configuration viaDHCP
needs ifupdown or busybox or nQuoted 2 lines
system/Config.in +0
-0depends on !(BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN || \ BR2_PACKAGE_SYSTEMD_NETWORKD || BR2_PACKAGE_NETIFRC)
Quoted 3 lines
Quoted 3 lines
system/Config.in comment "automatic network configuration via DHCP needs ifupdown or busybox or n · line 423
Quoted 3 lines
system/Config.in +3
-0+config BR2_SYSTEM_CONNECT_WIFI + bool "Connect to a default wifi access point" + default n
Depending on BR2_SYSTEM_DHCP would remove some unwanted side effects:
+config BR2_SYSTEM_CONNECT_WIFI
+ bool "Connect to a default wifi access point"
+ depends on BR2_SYSTEM_DHCP != "" && BR2_PACKAGE_WPA_SUPPLICANT
Kind regards,
Andreas
Quoted 63 lines
Quoted 2 lines
'n' is default, so drop that.
Right.
Quoted 3 lines
This doesn't really do anything unless the user also configures BR2_SYSTEM_DHCP="wlan0", right?
Right.
Quoted 6 lines
I must say I am not really convinced. This is only useful for quite specific setups (E.G. a lot more specific than
BR2_SYSTEM_DHCPwhich we use in a number of defconfigs) and hard codes a number of things (like WPA-PSK that may or may not make sense in the future).This is what we have now on several readme.txt on how to connect to a wifi
WiFi
====# wpa_passphrase ACCESSPOINTNAME >> /etc/wpa_supplicant.conf (type password and enter) # wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -B # udhcpc -i wlan0I don't think this is nice.
I'd like to see something like that:
WiFi
====# Enable
BR2_SYSTEM_CONNECT_WIFIconfigure option
# Set the Wifi SSID with the optionBR2_SYSTEM_CONNECT_WIFI_SSID# Set the password with the optionBR2_SYSTEM_CONNECT_WIFI_PASSWORDNicer and easier. I know that the wpa-psk could change in the feature, but then we can change to whatever default mechanism will be in place at that moment.
Quoted 4 lines
--
Bye, Peter Korsgaard--
Angelo Compagnucci
Software Engineer
[email protected]
__________________________________
Amarula Solutions SRL
Quoted 7 lines
Via le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 (0)42 243 5310
[email protected]www.amarulasolutions.com
[`as] https://www.amarulasolutions.com|
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v3 1/5] system: adding options for configuring wifi
Quoted 34 lines · Andreas Ziegler
Hi Angelo, Peter, *,
Quoted 4 lines · Angelo Compagnucci
Quoted 1 line · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Angelo" == Angelo Compagnucci <[email protected]>
Quoted 19 lines · writes:
Quoted 19 lines
system/Config.in comment "automatic network configuration via
Quoted 14 lines
These options can be used by packages to configure a wifi card to connect at boot.
Signed-off-by Angelo Compagnucci <[email protected]>--- system/Config.in | 15 +++++++++++++++ 1 file changed, 15 insertions(+)system/Config.in +0
-0@@ -418,6 +418,21 @@ comment "automatic network configuration viaDHCP
needs ifupdown or busybox or nQuoted 2 lines
system/Config.in +0
-0depends on !(BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN || \ BR2_PACKAGE_SYSTEMD_NETWORKD || BR2_PACKAGE_NETIFRC)Quoted 3 lines
Quoted 3 lines
system/Config.in comment "automatic network configuration via DHCP needs ifupdown or busybox or n · line 423
Quoted 3 lines
system/Config.in +3
-0+config BR2_SYSTEM_CONNECT_WIFI + bool "Connect to a default wifi access point" + default nDepending on
BR2_SYSTEM_DHCPwould remove some unwanted side effects:
system/Config.in comment "automatic network configuration via DHCP needs ifupdown or busybox or n
Quoted 3 lines
system/Config.in +3
-0+config BR2_SYSTEM_CONNECT_WIFI + bool "Connect to a default wifi access point" + depends on BR2_SYSTEM_DHCP != "" && BR2_PACKAGE_WPA_SUPPLICANT
Nice indeed!
Quoted 79 lines
Kind regards,
AndreasQuoted 74 lines
Quoted 2 lines
'n' is default, so drop that.
Right.
Quoted 3 lines
This doesn't really do anything unless the user also configures BR2_SYSTEM_DHCP="wlan0", right?
Right.
Quoted 7 lines
I must say I am not really convinced. This is only useful for quite specific setups (E.G. a lot more specific than
BR2_SYSTEM_DHCPwhich we
use in a number of defconfigs) and hard codes a number of things (like WPA-PSK that may or may not make sense in the future).This is what we have now on several readme.txt on how to connect to a wifi
WiFi
====# wpa_passphrase ACCESSPOINTNAME >> /etc/wpa_supplicant.conf (type password and enter) # wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -B # udhcpc -i wlan0I don't think this is nice.
I'd like to see something like that:
WiFi
====# Enable
BR2_SYSTEM_CONNECT_WIFIconfigure option
# Set the Wifi SSID with the optionBR2_SYSTEM_CONNECT_WIFI_SSID# Set the password with the optionBR2_SYSTEM_CONNECT_WIFI_PASSWORDNicer and easier. I know that the wpa-psk could change in the feature, but
then we can change to whatever default mechanism will be in place at that
moment.Quoted 4 lines
--
Bye, Peter Korsgaard--
Angelo Compagnucci
Software Engineer
[email protected]
__________________________________
Amarula Solutions SRLVia le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 (0)42 243 5310
[email protected]www.amarulasolutions.com
[`as] https://www.amarulasolutions.com|
Signature · 15 lines
Angelo Compagnucci Software Engineer [email protected] __________________________________ Amarula Solutions SRL Via le Canevare 30, 31100 Treviso, Veneto, IT T. +39 (0)42 243 5310 [email protected] www.amarulasolutions.com [`as] https://www.amarulasolutions.com|
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 2/5 package/wpa_supplicant: configure wifi on systemv when enabled
In reply to Angelo CompagnucciConfigure a default basic wifi setup able to automatically connect to the selected access point.
--- package/wpa_supplicant/wpa_supplicant.mk | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
package/wpa_supplicant/wpa_supplicant.mk +14 -0
@@ -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
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 3/5 package/wpa_supplicant: configure wifi on systemd when enabled
In reply to Angelo CompagnucciConfigure a default basic wifi setup able to automatically connect to the selected access point.
--- package/wpa_supplicant/wpa_supplicant.mk | 10 ++++++++++ system/Config.in | 1 + 2 files changed, 11 insertions(+)
package/wpa_supplicant/wpa_supplicant.mk +10 -0
@@ -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/[email protected] $(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))
system/Config.in +1 -0
@@ -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"
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v3 3/5] package/wpa_supplicant: configure wifi on systemd when enabled
Quoted 16 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Angelo" == Angelo Compagnucci <[email protected]> writes:
Configure a default basic wifi setup able to automatically connect to the selected access point.
Signed-off-by Angelo Compagnucci <[email protected]>--- package/wpa_supplicant/wpa_supplicant.mk | 10 ++++++++++ system/Config.in | 1 + 2 files changed, 11 insertions(+)package/wpa_supplicant/wpa_supplicant.mk +0
-0
package/wpa_supplicant/wpa_supplicant.mk define WPA_SUPPLICANT_ENABLE_WIFI · line 281
Quoted 7 lines
package/wpa_supplicant/wpa_supplicant.mk +4
-0@@ -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
How do you know BR2_SYSTEM_DHCP is set to something sensible here?
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v3 3/5] package/wpa_supplicant: configure wifi on systemd when enabled
Quoted 26 lines · Peter Korsgaard
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Angelo" == Angelo Compagnucci <[email protected]> writes:
Configure a default basic wifi setup able to automatically connect to the selected access point.
Review
Quoted 7 lines
Signed-off-by Angelo Compagnucci <[email protected]>--- package/wpa_supplicant/wpa_supplicant.mk | 10 ++++++++++ system/Config.in | 1 + 2 files changed, 11 insertions(+)(quoted diff) +0
-0
b/package/wpa_supplicant/wpa_supplicant.mkpackage/wpa_supplicant/wpa_supplicant.mk define WPA_SUPPLICANT_ENABLE_WIFI · line 281
Quoted 11 lines
index
09971654fe..157d45ee7f100644package/wpa_supplicant/wpa_supplicant.mk +4
-0@@ -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
Quoted 2 lines
How do you know
BR2_SYSTEM_DHCPis set to something sensible here?
Not enforced, but if a user put a nonexistent interface, that file simply won't work. It is up to the user knowing which interface he wants to enable dhcp onto.
Quoted 4 lines
--
Bye, Peter Korsgaard
Signature · 15 lines
Angelo Compagnucci Software Engineer [email protected] __________________________________ Amarula Solutions SRL Via le Canevare 30, 31100 Treviso, Veneto, IT T. +39 (0)42 243 5310 [email protected] www.amarulasolutions.com [`as] https://www.amarulasolutions.com|
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 4/5 package/ifupdown-scripts: add wifi configuration when enabled
In reply to Angelo CompagnucciAdd a proper wpa-conf line to the interfaces files to let the system bringup the wifi interface and the related wpa supplicant.
---
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(+)
package/ifupdown-scripts/ifupdown-scripts.mk +2 -0
@@ -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
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v3 4/5] package/ifupdown-scripts: add wifi configuration when enabled
Quoted 20 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Angelo" == Angelo Compagnucci <[email protected]> writes:
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 <[email protected]>---
Changes:
v3:
* add "|| true" lo let the command exit without error whenBR2_SYSTEM_CONNECT_WIFIis empty (me)package/ifupdown-scripts/ifupdown-scripts.mk | 2 ++ 1 file changed, 2 insertions(+)package/ifupdown-scripts/ifupdown-scripts.mk +0
-0
package/ifupdown-scripts/ifupdown-scripts.mk define IFUPDOWN_SCRIPTS_DHCP · line 33
Quoted 6 lines
package/ifupdown-scripts/ifupdown-scripts.mk +2
-0@@ -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
Maybe we should do this unconditionally if we overwrite /etc/network/interfaces and wpa_supplicant is enabled?
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v3 4/5] package/ifupdown-scripts: add wifi configuration when enabled
Quoted 27 lines · Peter Korsgaard
Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Angelo" == Angelo Compagnucci <[email protected]> writes:
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 <[email protected]>---
Changes:
v3:
* add "|| true" lo let the command exit without error whenBR2_SYSTEM_CONNECT_WIFIis empty (me)Review
Quoted 4 lines
package/ifupdown-scripts/ifupdown-scripts.mk | 2 ++ 1 file changed, 2 insertions(+)(quoted diff) +0
-0
b/package/ifupdown-scripts/ifupdown-scripts.mkpackage/ifupdown-scripts/ifupdown-scripts.mk define IFUPDOWN_SCRIPTS_DHCP · line 32
Quoted 9 lines
index
5ef032142c..ebaf234143100644package/ifupdown-scripts/ifupdown-scripts.mk +2
-0@@ -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; \
Quoted 5 lines
package/ifupdown-scripts/ifupdown-scripts.mk define IFUPDOWN_SCRIPTS_DHCP · line 33
Quoted 1 line
package/ifupdown-scripts/ifupdown-scripts.mk +0
-0) >> $(TARGET_DIR)/etc/network/interfacesMaybe we should do this unconditionally if we overwrite
/etc/network/interfacesandwpa_supplicantis enabled?
Not entirely sure to understand this comment. We need to enable the "wpa-conf" line only when a user enables BR2_SYSTEM_CONNECT_WIFI.
If a user overwrites /etc/network/interfaces in a overlay, he must ensure it is compiling also wpa_supplicant.
Are suggesting to add code somewhere to check if a user enabled "wpa-conf" line in his own overlay and then enable wpa_supplicant package for him?
Quoted 3 lines
--
Bye, Peter Korsgaard
Signature · 15 lines
Angelo Compagnucci Software Engineer [email protected] __________________________________ Amarula Solutions SRL Via le Canevare 30, 31100 Treviso, Veneto, IT T. +39 (0)42 243 5310 [email protected] www.amarulasolutions.com [`as] https://www.amarulasolutions.com|
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 5/5 package/initscripts: add service to load kernel modules at boot
In reply to Angelo CompagnucciIn 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.
---
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
package/initscripts/init.d/S11modules new file +59 -0
@@ -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
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v3 5/5] package/initscripts: add service to load kernel modules at boot
Quoted 28 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Angelo" == Angelo Compagnucci <[email protected]> writes:
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/modulesfile.
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 <[email protected]>---
Changesv2:
* 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/S11modulespackage/initscripts/init.d/S11modules new file +0
-0
package/initscripts/init.d/S11modules line 6
Quoted 6 lines
package/initscripts/init.d/S11modules new file +6
-0@@ -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
The commit message talks about /etc/modules, but you are reading from /etc/modules-load.d/*.conf?
How about supporting both /etc/modules and this directory instead?
package/initscripts/init.d/S11modules line 9
Quoted 3 lines
package/initscripts/init.d/S11modules new file +3
-0+ +load_unload() { + for module_file in $(ls -1 ${MODULES_DIR}); do
And here you take all files in /etc/modules-load.d, even if they don't have a .conf extension?
package/initscripts/init.d/S11modules line 19
Quoted 6 lines
package/initscripts/init.d/S11modules new file +6
-0+ esac + + if [ "$1" = "load" ]; then + modprobe -q ${module} ${args} >/dev/null && \ + printf ' %s success,' "$module" || + printf ' %s failed,' "$module"
success/failed are quite long strings, how about only printing the module name on success and a big scary FAIL like we do elsewhere on failures?
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v3 5/5] package/initscripts: add service to load kernel modules at boot
Quoted 24 lines · Peter Korsgaard
Quoted 18 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Angelo" == Angelo Compagnucci <[email protected]> writes:
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/modulesfile.
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 <[email protected]>---
Changesv2:
* 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)Review
Quoted 5 lines
package/initscripts/init.d/S11modules | 59 +++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 package/initscripts/init.d/S11modules(quoted diff) +0
-0b/package/initscripts/init.d/S11modules
Quoted 15 lines
package/initscripts/init.d/S11modules line 6
Quoted 11 lines
new file mode 100644
index 0000000000..3937945596package/initscripts/init.d/S11modules new file +6
-0@@ -0,0 +1,59 @@ +#!/bin/sh + +MODULES="*.conf" +MODULES_DIR="/etc/modules-load.d" + +[ -z "$(ls -A ${MODULES_DIR}/${MODULES} 2> /dev/null)" ] && exit 0The commit message talks about
/etc/modules, but you are reading from/etc/modules-load.d/*.conf?
Yes, right, commit message must be fixed.
Quoted 2 lines
How about supporting both
/etc/modulesand this directory instead?
It is doable, but if we are on par with systemd I cannot see why adding /etc/modules. The same goal can be obtained easily dropping a file in /etc/modules-load.d/ .
Quoted 9 lines
package/initscripts/init.d/S11modules line 9
Quoted 5 lines
package/initscripts/init.d/S11modules new file +3
-0+ +load_unload() { + for module_file in $(ls -1 ${MODULES_DIR}); doAnd here you take all files in
/etc/modules-load.d, even if they don't have a .conf extension?
Nice catch.
Quoted 5 lines
package/initscripts/init.d/S11modules
Quoted 5 lines
package/initscripts/init.d/S11modules new file +4
-0+ esac + + if [ "$1" = "load" ]; then + modprobe -q ${module} ${args} >/dev/null
Quoted 8 lines
&& \
package/initscripts/init.d/S11modules line 19
Quoted 2 lines
package/initscripts/init.d/S11modules new file +2
-0+ printf ' %s success,' "$module" || + printf ' %s failed,' "$module"success/failed are quite long strings, how about only printing the module name on success and a big scary FAIL like we do elsewhere on failures?
Nice suggestion.
Quoted 4 lines
--
Bye, Peter Korsgaard
Signature · 15 lines
Angelo Compagnucci Software Engineer [email protected] __________________________________ Amarula Solutions SRL Via le Canevare 30, 31100 Treviso, Veneto, IT T. +39 (0)42 243 5310 [email protected] www.amarulasolutions.com [`as] https://www.amarulasolutions.com|
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot