Skip to content

Commit

Permalink
build: clean up the 8 MB quirks code
Browse files Browse the repository at this point in the history
  • Loading branch information
pktpls committed Nov 28, 2024
1 parent 9c44119 commit 93f1c0b
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 93f1c0b

Please sign in to comment.