[PATCH v2 10/60] buildman: Move board-selection code into a function