From 22a17aff77dcde48a2abf0a639905ec21321cdf3 Mon Sep 17 00:00:00 2001 From: Packet Please Date: Thu, 28 Nov 2024 02:46:19 +0100 Subject: [PATCH] build: clean up the 8 MB quirks code --- build/build.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/build/build.sh b/build/build.sh index 6a284d4..e874208 100755 --- a/build/build.sh +++ b/build/build.sh @@ -251,9 +251,22 @@ EOF info="$(echo "SELECT flashmb, rammb FROM toh WHERE firmwareopenwrtinstallurl LIKE '%$p%' OR firmwareopenwrtupgradeurl LIKE '%$p%' OR firmwareopenwrtsnapshotupgradeurl LIKE '%$p%' OR firmwareopenwrtsnapshotupgradeurl LIKE '%$p%' LIMIT 1" | sqlite3 -batch "$rootdir/tmp/toh.db")" # devices with <= 8 MB disk space + smallflash=false flashmb="$(echo "$info" | cut -d'|' -f 1 | sed -E 's/[^0-9]*([0-9]+)[^0-9]*.*/\1/')" - if [ -n "$flashmb" ] && [ "$flashmb" -le 8 ] || [ "x$p" = "xubnt_unifiac-mesh" ] || [ "x$p" = "xubnt_unifi-ap" ] || [ "x$p" = "xubnt_unifi-ap-lr" ]; then - packages="-tcpdump-mini -mtr -iperf3 -tmux -vnstat -falter-berlin-service-registrar -luci-app-falter-service-registrar -luci-i18n-falter-service-registrar-de -luci-app-statistics -luci-i18n-statistics-de -collectd-mod-rrdtool $packages" + if [ -n "$flashmb" ] && [ "$flashmb" -le 8 ] ; then + smallflash=true + fi + + # table of hardware lists flash chip capacity, not usable image space. + # some 16 MB devices with A/B partition setup need to be forced to 8 MB. + if [[ "$p" =~ ubnt_unifiac|ubnt_unifi-ap|ubnt_usw-flex ]] ; then + smallflash=true + fi + + if $smallflash ; then + packages="-falter-berlin-service-registrar -luci-app-falter-service-registrar -luci-i18n-falter-service-registrar-de $packages" + packages="-luci-app-statistics -luci-i18n-statistics-de -collectd-mod-rrdtool $packages" + packages="-tcpdump-mini -mtr -iperf3 -tmux -vnstat $packages" fi # devices with <= 32 MB RAM