mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-12 19:04:59 +00:00
util: update flash_ec to handle unibuild emerge paths
If a baseboard exists in the build.mk for a board, use that as the unibuild path. BRANCH=none BUG=b:77128456 TEST=tested the following command with correct results: flash_ec --board=yorp (baseboard) flash_ec --board=bip (baseboard) flash_ec --board=grunt (non-baseboard) Change-Id: Ic4573cb01849275d1333ff9e715f69a4c95444b0 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/986753 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
@@ -463,6 +463,10 @@ flash_ec: $(out)/ec.bin
|
||||
flash_dfu: $(out)/ec.bin
|
||||
sudo ./$(BDIR)/dfu $(out)/ec.bin
|
||||
|
||||
.PHONY: print-baseboard
|
||||
print-baseboard:
|
||||
@echo "${BASEBOARD}"
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-rm -rf $(out)
|
||||
|
||||
@@ -222,7 +222,6 @@ function get_servo_type() {
|
||||
}
|
||||
|
||||
BOARD=${FLAGS_board}
|
||||
BOARD_ROOT=/build/${BOARD}
|
||||
|
||||
in_array() {
|
||||
local n=$#
|
||||
@@ -412,13 +411,21 @@ else
|
||||
EC_FILE=ec.bin
|
||||
fi
|
||||
|
||||
EMERGE_BUILD=${BOARD_ROOT}/firmware/${EC_FILE}
|
||||
|
||||
LOCAL_BUILD=
|
||||
if [[ -n "${EC_DIR}" ]]; then
|
||||
LOCAL_BUILD="${EC_DIR}/build/${BOARD}/${EC_FILE}"
|
||||
fi
|
||||
|
||||
# Get baseboard from build system if present
|
||||
BASEBOARD=$(make --quiet -C ${EC_DIR} BOARD=${BOARD} print-baseboard)
|
||||
|
||||
if [[ -n "${BASEBOARD}" ]]; then
|
||||
EMERGE_BUILD=/build/${BASEBOARD}/firmware/${BOARD}/${EC_FILE}
|
||||
else
|
||||
EMERGE_BUILD=/build/${BOARD}/firmware/${EC_FILE}
|
||||
fi
|
||||
|
||||
# Find the EC image to use
|
||||
function ec_image() {
|
||||
# No image specified on the command line, try default ones
|
||||
|
||||
Reference in New Issue
Block a user