get_binhost: Miscellaneous improvements

Move the binhost files out of the sysroot

Storing them in the sysroot leads to conflicts with setup_board:
before any emerging can take place all "source" references in
make.conf need to be resolved. But in a newly created sysroot the
make.conf.binhost file wouldn't exist, causing errors. You can work
around this by manually creating it beforehand, but it's a pain and
it doesn't interact nicely with things like "build_packages --cleanbuild".

Update all boards at once

Since we don't need the sysroot to already exist, we can search across
all postsumbit builders and create files for every available board at
once.

Unfortunately there doesn't seem to be any way to get the profile in
use from the builder attributes, or as a variable available in
make.conf, and portage handles multiple binhosts poorly, so for boards
with multiple profiles in use (such as amd64-generic-asan-fuzzer) we
just have to guess the right one. By default we use
{board}-postsubmit, but the user can specify a builder on the
commandline.

BUG=none
TEST=Manually tested

Change-Id: I4cddd52dd9d5390f459bb86ec6f86e1df622ba12
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/3092895
Commit-Queue: Fergus Dall <sidereal@google.com>
Tested-by: Fergus Dall <sidereal@google.com>
Reviewed-by: David Munro <davidmunro@google.com>
1 file changed