Setting CONFIG_GOLANG_EXTERNAL_BOOTSTRAP_ROOT on its own only skips the
initial bootstrap step; OpenWrt still builds the rest of the chain from
source because CONFIG_GOLANG_BUILD_BOOTSTRAP defaults to y. Add --external,
which clears that symbol so the installed toolchain builds host Go directly.
Fix the "no Go installed" detection, which never fired. An unmatched glob is
left as a literal, so the array held the pattern itself and the script wrote
CONFIG_GOLANG_EXTERNAL_BOOTSTRAP_ROOT="/usr/lib/go-go-*/" and reported
success. nullglob alone is not enough either, since it only drops words that
contain a wildcard and the literal candidate paths survive regardless, so
each candidate is now checked for existence.
Also pick the Go version by asking bin/go rather than parsing the directory
name, warn when the installed Go is older than the bootstrap version the
tree expects, replace every existing form of a symbol instead of appending
a duplicate, and run make defconfig afterwards.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>