From 38a77ae9d28a30f33be903e828bf6e7f4d194fed Mon Sep 17 00:00:00 2001 From: Packet Please Date: Mon, 25 Nov 2024 03:56:11 +0100 Subject: [PATCH] fixup: build: more robust Table-of-Hardware queries --- build/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.sh b/build/build.sh index 170e61d..81677db 100755 --- a/build/build.sh +++ b/build/build.sh @@ -251,13 +251,13 @@ 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 - flashmb="$(echo "$info" | cut -d'|' -f 1 | grep -E -o '[0-9]+' | head -n1)" + 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" ]; then packages="-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" fi # devices with <= 32 MB RAM - rammb="$(echo "$info" | cut -d'|' -f 2 | grep -E -o '[0-9]+' | head -n1)" + rammb="$(echo "$info" | cut -d'|' -f 2 | sed -E 's/[^0-9]*([0-9]+)[^0-9]*.*/\1/')" if [ -n "$rammb" ] && [ "$rammb" -le 32 ]; then packages="zram-swap $packages" fi