diff --git a/tools/userland.sh b/tools/userland.sh index b1874eeb9e..5ac1ba96d8 100755 --- a/tools/userland.sh +++ b/tools/userland.sh @@ -439,8 +439,14 @@ ensure_submodules() # checked out, '+' for one at the wrong commit, ' ' for the pinned one. # (The prefix is glued to the hash, so the test is on the first character # of the line, not on a field.) + # + # refs/ is left out: those are reference trees (the Linux kernel alone is + # tens of gigabytes) that tools/srctree-stage.sh keeps out of the source + # set and no build step reads. Checking them out turned a fresh clone's + # `make release` into a 36 GB download (measured 2026-11-23). need=$(cd "$TOP" && git submodule status 2>/dev/null | - awk 'substr($0, 1, 1) == "-" || substr($0, 1, 1) == "+" { print $2 }') + awk 'substr($0, 1, 1) == "-" || substr($0, 1, 1) == "+" { print $2 }' | + grep -v '^refs/') [ -n "$need" ] || return 0 echo "userland: submodules at their pin: $(echo $need)" # A submodule that cannot be fetched (a private tree this build does not