Properly handle case where /etc/platform is empty
If hnvram is broken, /etc/platform is empty. Fix two predicates that do
not return the intended result in this situation. For example, the
predicate
contains "GFRG200 GFRG210 GFRG250" "$(cat /etc/platform)"
returns true if /etc/platform is empty.
Without this change, the kernel is flooding the console with this error
message:
mwifiex_pcie: info: mwifiex_pcie_interrupt: card= (null) adapter=
(null)
I suspect that there is a race condition where it runs
echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove
while the mwifiex interrupt handler is still registered.
This problem has been observed on a Prowl with a broken HNVRAM
partition.
Change-Id: I8ef20543026a1dab612820ec797850ad6d2523c4
diff --git a/fs/skeleton/etc/init.d/network b/fs/skeleton/etc/init.d/network
index 2b15d8e..4edcc21 100755
--- a/fs/skeleton/etc/init.d/network
+++ b/fs/skeleton/etc/init.d/network
@@ -152,10 +152,10 @@
# On GFRG250, the Quantenna PCIe module has not initialized by the time the
# kernel enumerates PCIe devices. For development, also include GFRG200 and
# GFRG210.
- if contains "GFRG200 GFRG210 GFRG250" "$(cat /etc/platform)"; then
+ if contains ",GFRG200,GFRG210,GFRG250," ",$(cat /etc/platform),"; then
echo 1 > /sys/bus/pci/rescan
fi
- if contains "GFHD254" "$(cat /etc/platform)" && ! startswith "$(uname -r)" "3"; then
+ if contains ",GFHD254," ",$(cat /etc/platform)," && ! startswith "$(uname -r)" "3"; then
echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove
sleep 1
echo 1 > /sys/bus/pci/rescan