contrib/package: fix broadcom arch detection in remote-update
[project/luci.git] / contrib / package / remote-update / files / usr / sbin / remote-update
index bffc449..e767915 100755 (executable)
@@ -8,26 +8,23 @@ local NL='
 
 find_architecture()
 {
-       opkg list_installed 'base-files-*' | \
-               sed -ne 's/base-files-\([^ ]\+\).*/\1/p'
+       local ifs="$IFS"; IFS="-"
+       set -- $(opkg list_installed kernel)
+       IFS="$ifs"
+
+       echo "$3"
 }
 
 find_image()
 {
        case "$1" in
                atheros)
-                       if grep -q '"vmlinux.bin.l7"' /proc/mtd; then
-                               echo "openwrt-fonera-combined.img"
-                       else
-                               echo "openwrt-ubiquity-combined.img"
-                       fi
+                       echo "openwrt-atheros-combined.img"
                ;;
                ar71xx)
-                       if grep -q '"kernel"' /proc/mtd; then
-                               echo "openwrt-ar71xx-combined.img"
-                       fi
+                       echo "openwrt-ar71xx-combined.img"
                ;;
-               brcm-2.4)
+               brcm)
                        echo "openwrt-brcm-2.4-squashfs.trx"
                ;;
        esac