[openwrt/openwrt] netifd: check if /sbin/wifi exists before calling it

LEDE Commits lede-commits at lists.infradead.org
Sat Nov 30 10:23:32 PST 2024


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/207bfee855320dc938f39e179b1d2e3b008140cb

commit 207bfee855320dc938f39e179b1d2e3b008140cb
Author: Andris PE <neandris at gmail.com>
AuthorDate: Tue Mar 26 21:53:06 2024 +0200

    netifd: check if /sbin/wifi exists before calling it
    
    Avoid harmless error from network script by checking presence of
    now-optional wifi support script, most notably confusing users of x86
    snapshots.
    
    Fixes: #14964
    Signed-off-by: Andris PE <neandris at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/14986
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/network/config/netifd/Makefile                 | 2 +-
 package/network/config/netifd/files/etc/init.d/network | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
index 82a04adecd..95f1f6f7d1 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=netifd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
diff --git a/package/network/config/netifd/files/etc/init.d/network b/package/network/config/netifd/files/etc/init.d/network
index dc208c4ce0..86340b77e5 100755
--- a/package/network/config/netifd/files/etc/init.d/network
+++ b/package/network/config/netifd/files/etc/init.d/network
@@ -30,12 +30,12 @@ reload_service() {
 
 	init_switch
 	ubus call network reload || rv=1
-	/sbin/wifi reload_legacy
+	[ -x /sbin/wifi ] && /sbin/wifi reload_legacy
 	return $rv
 }
 
 stop_service() {
-	/sbin/wifi down
+	[ -x /sbin/wifi ] && /sbin/wifi down
 	ifdown -a
 	sleep 1
 }




More information about the lede-commits mailing list