[OpenWrt-Devel] [PATCH] mac80211: remove error from detectscript

Stam, Michel [FINT] M.Stam at fugro.nl
Mon Oct 6 04:55:39 EDT 2014


Hello John,

The error that I see is that the directory does not exist. This happens
when the unit does not have a ieee80211 card available, or  if the
kernel does not have wifi suppor. In both cases, /sys/class/ieee80211
does not exist and the script echoes an error to the screen that does
not really indicate a problem.

In our particular case, it was discovered on a unit that can be shipped
with and without WiFi. So depending on the presence of the hardware,
this error appears. Since the error is not relevant, redirecting stderr
to /dev/null will cause the ls to return '', which causes the shell
script to not do anything in the for loop. Nothing will be done by the
mac80211.sh script, and the system continues as normal.

Kind regards,

Michel Stam

-----Original Message-----
From: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org] On
Behalf Of John Crispin
Sent: Friday, October 03, 2014 19:32 PM
To: openwrt-devel at lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH] mac80211: remove error from
detectscript


On 02/10/2014 15:28, Michel Stam wrote:
> Signed-off-by: Michel Stam <m.stam at fugro.nl>
> ---
>  package/kernel/mac80211/files/lib/wifi/mac80211.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh 
> b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
> index a3b2199..2af4dc5 100644
> --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
> +++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
> @@ -65,7 +65,7 @@ detect_mac80211() {
>  		[ -n "$type" ] || break
>  		devidx=$(($devidx + 1))
>  	done
> -	for dev in $(ls /sys/class/ieee80211); do
> +	for dev in $(ls /sys/class/ieee80211 2>/dev/null); do
what error do you see ? if you see an error we should try to fix that
rather than supressing it


>  		found=0
>  		config_foreach check_mac80211_device wifi-device
>  		[ "$found" -gt 0 ] && continue
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list