diff mbox series

[v3,4/5] package/ifupdown-scripts: add wifi configuration when enabled

Message ID 20220705073206.1442280-5-angelo@amarulasolutions.com
State Superseded
Headers show
Series Configure default wifi through kconfig | expand

Commit Message

Angelo Compagnucci July 5, 2022, 7:32 a.m. UTC
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 <angelo@amarulasolutions.com>
---
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(+)

Comments

Peter Korsgaard Sept. 18, 2022, 10:03 a.m. UTC | #1
>>>>> "Angelo" == Angelo Compagnucci <angelo@amarulasolutions.com> 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 <angelo@amarulasolutions.com>
 > ---
 > Changes:
 > v3:
 > * add "|| true" lo let the command exit without error when
 >   BR2_SYSTEM_CONNECT_WIFI is empty (me)

 >  package/ifupdown-scripts/ifupdown-scripts.mk | 2 ++
 >  1 file changed, 2 insertions(+)

 > diff --git a/package/ifupdown-scripts/ifupdown-scripts.mk b/package/ifupdown-scripts/ifupdown-scripts.mk
 > index 5ef032142c..ebaf234143 100644
 > --- a/package/ifupdown-scripts/ifupdown-scripts.mk
 > +++ b/package/ifupdown-scripts/ifupdown-scripts.mk
 > @@ -28,6 +28,8 @@ define IFUPDOWN_SCRIPTS_DHCP
 >  		echo "  pre-up /etc/network/nfs_check"; \
 >  		echo "  wait-delay 15"; \
 >  		echo "  hostname \$$(hostname)"; \
 > +		test -n "$(BR2_SYSTEM_CONNECT_WIFI)" && \
 > +			echo "  wpa-conf /etc/wpa_supplicant.conf" || true; \
 >  	) >> $(TARGET_DIR)/etc/network/interfaces

Maybe we should do this unconditionally if we overwrite
/etc/network/interfaces and wpa_supplicant is enabled?
Angelo Compagnucci Oct. 3, 2022, 3:50 p.m. UTC | #2
On Sun, Sep 18, 2022 at 12:03 PM Peter Korsgaard <peter@korsgaard.com>
wrote:

> >>>>> "Angelo" == Angelo Compagnucci <angelo@amarulasolutions.com> 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 <angelo@amarulasolutions.com>
>  > ---
>  > Changes:
>  > v3:
>  > * add "|| true" lo let the command exit without error when
>  >   BR2_SYSTEM_CONNECT_WIFI is empty (me)
>
>  >  package/ifupdown-scripts/ifupdown-scripts.mk | 2 ++
>  >  1 file changed, 2 insertions(+)
>
>  > diff --git a/package/ifupdown-scripts/ifupdown-scripts.mk
> b/package/ifupdown-scripts/ifupdown-scripts.mk
>  > index 5ef032142c..ebaf234143 100644
>  > --- a/package/ifupdown-scripts/ifupdown-scripts.mk
>  > +++ b/package/ifupdown-scripts/ifupdown-scripts.mk
>  > @@ -28,6 +28,8 @@ define IFUPDOWN_SCRIPTS_DHCP
>  >              echo "  pre-up /etc/network/nfs_check"; \
>  >              echo "  wait-delay 15"; \
>  >              echo "  hostname \$$(hostname)"; \
>  > +            test -n "$(BR2_SYSTEM_CONNECT_WIFI)" && \
>  > +                    echo "  wpa-conf /etc/wpa_supplicant.conf" ||
> true; \
>  >      ) >> $(TARGET_DIR)/etc/network/interfaces
>
> Maybe we should do this unconditionally if we overwrite
> /etc/network/interfaces and wpa_supplicant is 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?


> --
> Bye, Peter Korsgaard
>
diff mbox series

Patch

diff --git a/package/ifupdown-scripts/ifupdown-scripts.mk b/package/ifupdown-scripts/ifupdown-scripts.mk
index 5ef032142c..ebaf234143 100644
--- a/package/ifupdown-scripts/ifupdown-scripts.mk
+++ b/package/ifupdown-scripts/ifupdown-scripts.mk
@@ -28,6 +28,8 @@  define IFUPDOWN_SCRIPTS_DHCP
 		echo "  pre-up /etc/network/nfs_check"; \
 		echo "  wait-delay 15"; \
 		echo "  hostname \$$(hostname)"; \
+		test -n "$(BR2_SYSTEM_CONNECT_WIFI)" && \
+			echo "  wpa-conf /etc/wpa_supplicant.conf" || true; \
 	) >> $(TARGET_DIR)/etc/network/interfaces
 endef
 define IFUPDOWN_SCRIPTS_DHCP_OPENRC