Configure default wifi through kconfig
v4 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 | 15 +++++ 4 files changed, 100 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 v4 1/5 system: adding options for configuring wifi
These options can be used by packages to configure a wifi card to connect at boot.
---
v4:
* Adding depends on BR2_SYSTEM_DHCP != "" (Andreas Ziegler)
system/Config.in | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
system/Config.in +14 -0
@@ -418,6 +418,20 @@ comment "automatic network configuration via DHCP needs ifupdown or busybox or n depends on !(BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN || \ BR2_PACKAGE_SYSTEMD_NETWORKD || BR2_PACKAGE_NETIFRC) +config BR2_SYSTEM_CONNECT_WIFI + bool "Connect to a default wifi access point" + depends on BR2_SYSTEM_DHCP != "" && BR2_PACKAGE_WPA_SUPPLICANT + +config BR2_SYSTEM_CONNECT_WIFI_SSID + string "Access point SSID" + default "" + depends on BR2_SYSTEM_CONNECT_WIFI + +config BR2_SYSTEM_CONNECT_WIFI_PASSWORD + string "Access point password" + default "" + depends on BR2_SYSTEM_CONNECT_WIFI + endif # BR2_ROOTFS_SKELETON_DEFAULT config BR2_SYSTEM_DEFAULT_PATH
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v4 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
@@ -266,6 +266,19 @@ define WPA_SUPPLICANT_INSTALL_IFUP_SCRIPTS endef endif +ifeq ($(BR2_SYSTEM_CONNECT_WIFI),y) +define WPA_SUPPLICANT_ENABLE_WIFI + $(SED) '/network={/,/}/d' $(TARGET_DIR)/etc/wpa_supplicant.conf; \ + ( echo "network={"; \ + echo " scan_ssid=1"; \ + echo " key_mgmt=WPA-PSK"; \ + echo " ssid=\"$(BR2_SYSTEM_CONNECT_WIFI_SSID)\""; \ + echo " psk=\"$(BR2_SYSTEM_CONNECT_WIFI_PASSWORD)\""; \ + echo "}"; \ + ) >> $(TARGET_DIR)/etc/wpa_supplicant.conf +endef +endif + define WPA_SUPPLICANT_INSTALL_TARGET_CMDS $(INSTALL) -m 0755 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/wpa_supplicant \ $(TARGET_DIR)/usr/sbin/wpa_supplicant
@@ -277,6 +290,7 @@ define WPA_SUPPLICANT_INSTALL_TARGET_CMDS $(WPA_SUPPLICANT_INSTALL_WPA_CLIENT_SO) $(WPA_SUPPLICANT_INSTALL_IFUP_SCRIPTS) $(WPA_SUPPLICANT_ENABLE_CTRL_IFACE) + $(WPA_SUPPLICANT_ENABLE_WIFI) endef define WPA_SUPPLICANT_INSTALL_INIT_SYSTEMD
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v4 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
@@ -277,6 +277,15 @@ define WPA_SUPPLICANT_ENABLE_WIFI echo "}"; \ ) >> $(TARGET_DIR)/etc/wpa_supplicant.conf endef +define WPA_SUPPLICANT_WIFI_INSTALL_INIT_SYSTEMD + $(INSTALL) -m 0755 -d $(TARGET_DIR)/etc/wpa_supplicant/ + ln -sf ../wpa_supplicant.conf \ + $(TARGET_DIR)/etc/wpa_supplicant/wpa_supplicant-$(BR2_SYSTEM_DHCP).conf +endef +define WPA_SUPPLICANT_WIFI_INSTALL_INIT_SYSTEMD_PRESET + $(HOST_DIR)/bin/systemctl --root=$(TARGET_DIR) preset wpa_supplicant\@$(BR2_SYSTEM_DHCP).service +endef +SYSTEMD_ROOTFS_PRE_CMD_HOOKS += WPA_SUPPLICANT_WIFI_INSTALL_INIT_SYSTEMD_PRESET endif define WPA_SUPPLICANT_INSTALL_TARGET_CMDS
@@ -304,6 +313,7 @@ define WPA_SUPPLICANT_INSTALL_INIT_SYSTEMD $(TARGET_DIR)/usr/lib/systemd/system/[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
@@ -421,6 +421,7 @@ comment "automatic network configuration via DHCP needs ifupdown or busybox or n config BR2_SYSTEM_CONNECT_WIFI bool "Connect to a default wifi access point" depends on BR2_SYSTEM_DHCP != "" && BR2_PACKAGE_WPA_SUPPLICANT + select BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE if BR2_PACKAGE_SYSTEMD config BR2_SYSTEM_CONNECT_WIFI_SSID string "Access point SSID"
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v4 3/5] package/wpa_supplicant: configure wifi on systemd when enabled
Quoted 2 lines · Angelo Compagnucci
Configure a default basic wifi setup able to automatically connect to the selected access point.
I think this feature is indeed useful. IIUC, currently wpa_supplicant actually
isn't started, even though we do install a service file.
Quoted 12 lines
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 283
Quoted 7 lines
package/wpa_supplicant/wpa_supplicant.mk +4
-0@@ -277,6 +277,15 @@ define WPA_SUPPLICANT_ENABLE_WIFI echo "}"; \ ) >> $(TARGET_DIR)/etc/wpa_supplicant.conf endef +define WPA_SUPPLICANT_WIFI_INSTALL_INIT_SYSTEMD + $(INSTALL) -m 0755 -d $(TARGET_DIR)/etc/wpa_supplicant/ + ln -sf ../wpa_supplicant.conf \ + $(TARGET_DIR)/etc/wpa_supplicant/wpa_supplicant-$(BR2_SYSTEM_DHCP).conf
If the interface-specific service is used rather than the global one, I think
the idea is to be able to use separate conf files for them. So I think it makes more sense to copy than symlink.
That said, I'm not sure if it's really useful to use the per-interface
service. The global one should work as well, no? I think the only thing we're missing is to enable it for the wifi interface.
Also, I don't think it's a good idea to reuse BR2_SYSTEM_DHCP for this. There
are quite a few boards that have both ethernet and wifi and ideally we want both to come up. So I think it's worth adding a BR2_SYSTEM_WLAN to specify the wifi interface - and perhaps automatically select wpa_supplicant if that option is set (although we could just as well use iwd instead of supplicant, of course).
package/wpa_supplicant/wpa_supplicant.mk define WPA_SUPPLICANT_ENABLE_WIFI · line 286
Quoted 3 lines
package/wpa_supplicant/wpa_supplicant.mk +3
-0+endef +define WPA_SUPPLICANT_WIFI_INSTALL_INIT_SYSTEMD_PRESET + $(HOST_DIR)/bin/systemctl --root=$(TARGET_DIR) preset wpa_supplicant\@$(BR2_SYSTEM_DHCP).service
I'm not sure what this is supposed to do. Doesn't it just undo the disable we
do in 50-wpa_supplicant.preset? Wouldn't it be better to just remove that preset somehow?
Quoted 18 lines
package/wpa_supplicant/wpa_supplicant.mk +3
-0+endef +SYSTEMD_ROOTFS_PRE_CMD_HOOKS += WPA_SUPPLICANT_WIFI_INSTALL_INIT_SYSTEMD_PRESET endif define WPA_SUPPLICANT_INSTALL_TARGET_CMDS@@ -304,6 +313,7 @@ define WPA_SUPPLICANT_INSTALL_INIT_SYSTEMD $(TARGET_DIR)/usr/lib/systemd/system/[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 +0
-0
system/Config.in comment "automatic network configuration via DHCP needs ifupdown or busybox or n · line 424
Quoted 4 lines
system/Config.in +1
-0@@ -421,6 +421,7 @@ comment "automatic network configuration via DHCP needs ifupdown or busybox or n config BR2_SYSTEM_CONNECT_WIFI bool "Connect to a default wifi access point" depends on BR2_SYSTEM_DHCP != "" && BR2_PACKAGE_WPA_SUPPLICANT + select BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE if BR2_PACKAGE_SYSTEMD
This needs some explanation. I don't see the service files requiring this
anywhere.
On the other hand, the global service file does start wpa_supplicant with the
-u option so it would need dbus.
Regards,
Arnout
system/Config.in comment "automatic network configuration via DHCP needs ifupdown or busybox or n · line 427
Quoted 3 lines
system/Config.in +0
-0config BR2_SYSTEM_CONNECT_WIFI_SSID string "Access point SSID"
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v4 3/5] package/wpa_supplicant: configure wifi on systemd when enabled
Hi Arnout,
Quoted 9 lines · Arnout Vandecappelle
Quoted 2 lines · Angelo Compagnucci
Configure a default basic wifi setup able to automatically connect to the selected access point.
I think this feature is indeed useful. IIUC, currently
wpa_supplicantactually
isn't started, even though we do install a service file.
I do not think I'm going to respin another version of this patch due to the fact the other patches in the series were rejected.
This patch is indeed not useful without the others: what's the point of having systemd configured for wpa_supplicant if in any case the user must configure an overlay to add a working wpa_supplicant.conf file? The series was meant to offer an easy way to configure the wifi in the same way we do for the ethernet.
Moreover, if we configure wpa_supplicant here, it's not going to work without clearly explain somewhere that the user must implement its own wpa_supplicant.conf file.
Imho it's way more confusing than offering a completely DIY solution as we do now. In the first case we need to explain somewhere what to do, in the latter the user will figure it out.
Quoted 79 lines
Quoted 13 lines
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
-0package/wpa_supplicant/wpa_supplicant.mk define WPA_SUPPLICANT_ENABLE_WIFI · line 283
Quoted 7 lines
package/wpa_supplicant/wpa_supplicant.mk +4
-0@@ -277,6 +277,15 @@ define WPA_SUPPLICANT_ENABLE_WIFI echo "}"; \ ) >> $(TARGET_DIR)/etc/wpa_supplicant.conf endef +define WPA_SUPPLICANT_WIFI_INSTALL_INIT_SYSTEMD + $(INSTALL) -m 0755 -d $(TARGET_DIR)/etc/wpa_supplicant/ + ln -sf ../wpa_supplicant.conf \ + $(TARGET_DIR)/etc/wpa_supplicant/wpa_supplicant-$(BR2_SYSTEM_DHCP).confIf the interface-specific service is used rather than the global one, I think
the idea is to be able to use separate conf files for them. So I think it makes more sense to copy than symlink.That said, I'm not sure if it's really useful to use the per-interface
service. The global one should work as well, no? I think the only thing we're missing is to enable it for the wifi interface.Also, I don't think it's a good idea to reuse
BR2_SYSTEM_DHCPfor this. There
are quite a few boards that have both ethernet and wifi and ideally we want both to come up. So I think it's worth adding aBR2_SYSTEM_WLANto specify the wifi interface - and perhaps automatically selectwpa_supplicantif that option is set (although we could just as well use iwd instead of supplicant, of course).package/wpa_supplicant/wpa_supplicant.mk define WPA_SUPPLICANT_ENABLE_WIFI · line 286
Quoted 3 lines
package/wpa_supplicant/wpa_supplicant.mk +3
-0+endef +define WPA_SUPPLICANT_WIFI_INSTALL_INIT_SYSTEMD_PRESET + $(HOST_DIR)/bin/systemctl --root=$(TARGET_DIR) preset wpa_supplicant\@$(BR2_SYSTEM_DHCP).serviceI'm not sure what this is supposed to do. Doesn't it just undo the disable we
do in 50-wpa_supplicant.preset? Wouldn't it be better to just remove that preset somehow?Quoted 18 lines
package/wpa_supplicant/wpa_supplicant.mk +3
-0+endef +SYSTEMD_ROOTFS_PRE_CMD_HOOKS += WPA_SUPPLICANT_WIFI_INSTALL_INIT_SYSTEMD_PRESET endif define WPA_SUPPLICANT_INSTALL_TARGET_CMDS@@ -304,6 +313,7 @@ define WPA_SUPPLICANT_INSTALL_INIT_SYSTEMD $(TARGET_DIR)/usr/lib/systemd/system/[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 +0
-0system/Config.in comment "automatic network configuration via DHCP needs ifupdown or busybox or n · line 424
Quoted 4 lines
system/Config.in +1
-0@@ -421,6 +421,7 @@ comment "automatic network configuration via DHCP needs ifupdown or busybox or n config BR2_SYSTEM_CONNECT_WIFI bool "Connect to a default wifi access point" depends on BR2_SYSTEM_DHCP != "" && BR2_PACKAGE_WPA_SUPPLICANT + select BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE if BR2_PACKAGE_SYSTEMDThis needs some explanation. I don't see the service files requiring this
anywhere.On the other hand, the global service file does start
wpa_supplicantwith the
-u option so it would need dbus.Regards,
ArnoutQuoted 3 lines
system/Config.in +0
-0config BR2_SYSTEM_CONNECT_WIFI_SSID string "Access point SSID"
Signature · 20 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 v4 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 bring up 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 v4 4/5] package/ifupdown-scripts: add wifi configuration when enabled
Quoted 18 lines · Angelo Compagnucci
Add a proper wpa-conf line to the interfaces files to let the system bring up the wifi interface and the related wpa supplicant.
Signed-off-by Angelo Compagnucci <[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 32
Quoted 5 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; \
You can write this as
$(if $(BR2_SYSTEM_CONNECT_WIFI),echo " wpa-conf /etc/wpa_supplicant.conf")
(but as I said, I think it's better to have a separate BR2_SYSTEM_WLAN section.)
Regards,
Arnout
package/ifupdown-scripts/ifupdown-scripts.mk define IFUPDOWN_SCRIPTS_DHCP · line 35
Quoted 3 lines
package/ifupdown-scripts/ifupdown-scripts.mk +0
-0) >> $(TARGET_DIR)/etc/network/interfaces endef define IFUPDOWN_SCRIPTS_DHCP_OPENRC
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v4 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-load.d/*.conf files. The modules files matches the one used by systemd, which in turn has a builtin mechanism to load a module at boot, therefore making systemv init on par with systemd features.
---
v2:
* Moved script to initscripts (Arnout)
* Moved script to S11modules, after S10[mu]dev (Andreas)
* Use /etc/modules-load.d/ to share the same setup with systemd (me) v4:
* Select only .conf file (Peter)
* Better ouput: printing module name only when loaded successfully, print a FAIL when at least one module fails (Peter)
package/initscripts/init.d/S11modules | 59 +++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 package/initscripts/init.d/S11modules
package/initscripts/init.d/S11modules new file +59 -0
@@ -0,0 +1,59 @@ +#!/bin/sh + +MODULES_DIR="/etc/modules-load.d/" + +[ -z "$(ls -A ${MODULES_DIR} 2> /dev/null)" ] && exit 0 + +load_unload() { + for module_file in $(ls -1 ${MODULES_DIR}/*.conf); do + while read module args; do + + case "$module" in + ""|"#"*) continue ;; + esac + + if [ "$1" = "load" ]; then + modprobe -q ${module} ${args} >/dev/null && \ + printf '%s ' "$module" || RET='FAIL' + else + rmmod ${module} >/dev/null + fi + + done < ${module_file} + done + + RET='OK' +} + +start() { + printf 'Starting modules: ' + + load_unload load + + echo $RET +} + +stop() { + printf 'Stopping modules: ' + + load_unload unload + + echo $RET +} + +restart() { + stop + sleep 1 + start +} + +case "$1" in + start|stop|restart) + "$1";; + reload) + # Restart, since there is no true "reload" feature. + restart;; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 +esac
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v4 5/5] package/initscripts: add service to load kernel modules at boot
Quoted 28 lines · Angelo Compagnucci
In cases where no hotplug is available (by choice or by the lack of a proper hotplug method for a device), this service can be used to load kernel module drivers by reading the
/etc/modules-load.d/*.conffiles. 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]>---
v2:
* Moved script to initscripts (Arnout)
* Moved script to S11modules, after S10[mu]dev (Andreas)
* Use/etc/modules-load.d/to share the same setup with systemd (me) v4:
* Select only .conf file (Peter)
* Better ouput: printing module name only when loaded successfully, print a FAIL when at least one module fails (Peter)package/initscripts/init.d/S11modules | 59 +++++++++++++++++++++++++++ 1 file changed, 59 insertions(+)create mode 100644 package/initscripts/init.d/S11modules
package/initscripts/init.d/S11modules new file +0
-0
package/initscripts/init.d/S11modules line 3
Quoted 3 lines
package/initscripts/init.d/S11modules new file +3
-0@@ -0,0 +1,59 @@ +#!/bin/sh + +MODULES_DIR="/etc/modules-load.d/"
The script was failing check-package because there's no DAEMON variable. Of
course, it's not appropriate to have a DAEMON variable in this init script because there's no daemon to start...
On option would be to set a dummy DAEMON variable, but that would be rather
pointless. So instead, I used the check-package exception comment to avoid it. However, that feature didn't exist yet for global checks (done in the after() function). So I added that feature to check-package.
Because the change became a bit too big to apply directly, I resent. Of
course, stupid me forgot to add versioning information :-(
package/initscripts/init.d/S11modules line 8
Quoted 5 lines
package/initscripts/init.d/S11modules new file +5
-0+ +[ -z "$(ls -A ${MODULES_DIR} 2> /dev/null)" ] && exit 0 + +load_unload() { + for module_file in $(ls -1 ${MODULES_DIR}/*.conf); do
This (and a few other lines) triggered a shellcheck warning. I fixed those.
Could you test with the patch I sent?
Regards,
Arnout
Quoted 41 lines
package/initscripts/init.d/S11modules new file +41
-0+ while read module args; do + + case "$module" in + ""|"#"*) continue ;; + esac + + if [ "$1" = "load" ]; then + modprobe -q ${module} ${args} >/dev/null && \ + printf '%s ' "$module" || RET='FAIL' + else + rmmod ${module} >/dev/null + fi + + done < ${module_file} + done + + RET='OK' +} + +start() { + printf 'Starting modules: ' + + load_unload load + + echo $RET +} + +stop() { + printf 'Stopping modules: ' + + load_unload unload + + echo $RET +} + +restart() { + stop + sleep 1 + start +} +
package/initscripts/init.d/S11modules line 59
Quoted 10 lines
package/initscripts/init.d/S11modules new file +10
-0+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
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 5 lines · Angelo Compagnucci
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.
As you say, it's something that can easily be added in an overlay. In
addition, it's something that is only useful in a very specific, very small use case: when you're demonstrating a board of which you use only in a single place and aren't planning to move anywhere else, and when you don't want ot spend time preparing a proper overlay for it.
So, I'm going to mark this series as rejected.
That said, there are some useful bits in it, which I'll comment on individually.
Regards,
Arnout
Quoted 8 lines
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
Quoted 7 lines
package/ifupdown-scripts/ifupdown-scripts.mk | 2 + package/initscripts/init.d/S11modules | 59 ++++++++++++++++++++ package/wpa_supplicant/wpa_supplicant.mk | 24 ++++++++ system/Config.in | 15 +++++ 4 files changed, 100 insertions(+)create mode 100644 package/initscripts/init.d/S11modules
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 9 lines · Arnout Vandecappelle
Quoted 5 lines · Angelo Compagnucci
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.
Quoted 5 lines
As you say, it's something that can easily be added in an overlay. In addition, it's something that is only useful in a very specific, very small use case: when you're demonstrating a board of which you use only in a single place and aren't planning to move anywhere else, and when you don't want ot spend time preparing a proper overlay for it.
So, I'm going to mark this series as rejected.
That said, there are some useful bits in it, which I'll comment on individually.
In a discussion thread on v3, you wrote that currently this is your documentation:
# wpa_passphrase ACCESSPOINTNAME >> /etc/wpa_supplicant.conf (type password and enter) # wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -B # udhcpc -i wlan0
Basically, removing the need for the latter two steps is worthwhile, but the first step is only reasonable to do on the device itself.
Regards,
Arnout
Quoted 19 lines
Regards,
ArnoutQuoted 15 lines
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 | 15 +++++4 files changed, 100 insertions(+)create mode 100644 package/initscripts/init.d/S11modules
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot