From 99652baa969d5312c87a6ea8debe048ffc955567 Mon Sep 17 00:00:00 2001 From: shmalebx9 Date: Sat, 26 Nov 2022 12:45:40 -0700 Subject: fix injection script --- resources/scripts/blobs/inject | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'resources/scripts') diff --git a/resources/scripts/blobs/inject b/resources/scripts/blobs/inject index fbf5fe4d..1d21845c 100755 --- a/resources/scripts/blobs/inject +++ b/resources/scripts/blobs/inject @@ -3,9 +3,9 @@ # SPDX-FileCopyrightText: 2022 Caleb La Grange # SPDX-License-Identifier: GPL-3.0-only -Error_out(){ +Fail(){ if [ ! -z ${@+x} ]; then - printf "ERROR: ${@}\n" + printf "\nERROR: ${@}\n" fi cat <<- EOF @@ -26,12 +26,12 @@ Modify_gbe(){ _gbe_location=${CONFIG_GBE_BIN_PATH#../../} if [ ! -f util/nvmutil/nvm ]; then - ( cd util/nvmutil/ && make ) + make -C /util/nvmutil || Fail 'failed to build nvmutil' fi _gbe_tmp=$(mktemp -t gbeXXXX.bin) cp ${_gbe_location} ${_gbe_tmp} - ./util/nvmutil/nvm ${_gbe_tmp} setmac ${new_mac} || Error_out 'failed to modify mac address\nmake sure the mac address in the correct format' + ./util/nvmutil/nvm ${_gbe_tmp} setmac ${new_mac} || Fail 'failed to modify mac address\nmake sure the mac address in the correct format' ./coreboot/default/util/ifdtool/ifdtool -i GbE:${_gbe_tmp} ${rom} -O ${rom} || exit 1 @@ -110,17 +110,16 @@ do done if [ -z ${rom+x} ]; then - Error_out 'no rom specified' + Fail 'no rom specified' elif [ ! -f "${rom}" ]; then - Error_out "${rom} is not a valid path" + Fail "${rom} is not a valid path" elif [ -z ${board+x} ]; then board=$(Detect_board) || \ - Error_out 'no board specified' + Fail 'no board specified' fi if [ ! -d "resources/coreboot/${board}/" ]; then - printf "board ${board} not found\n" - Error_out + Fail "board ${board} not found" fi if [ ! -d coreboot/default ]; then @@ -130,12 +129,12 @@ fi if [ ! -f "coreboot/default/util/ifdtool/ifdtool" ]; then printf "building ifdtool from coreboot\n" -( cd coreboot/default/util/ifdtool && make ) + make -C coreboot/default/util/ifdtool || Fail 'could not build ifdtool' fi if [ ! -f "coreboot/default/util/cbfstool/cbfstool" ]; then printf "building cbfstool from coreboot\n" -( cd coreboot/default/util/cbfstool && make ) +make -C cd coreboot/default/util/cbfstool || Fail 'could not build ifdtool' fi ./blobutil download ${board} && Patch -- cgit v1.2.1