From 59dba6cfcdc6c154e4d46c14c42e7b6f0b84c7b5 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 16 Aug 2023 21:34:21 +0100 Subject: merge coreboot/u-boot download logic to one script they are fundamentally the same, in an lbmk context. they are downloaded in the same way, and compiled in the same way! (Kconfig infrastructure, board-specific code, the way submodules are used in git, etc) ~200 sloc reduction in resources/scripts the audit begins Signed-off-by: Leah Rowe --- resources/scripts/build/module/cbutils | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'resources/scripts/build/module') diff --git a/resources/scripts/build/module/cbutils b/resources/scripts/build/module/cbutils index 8d4e2f2f..45739e95 100755 --- a/resources/scripts/build/module/cbutils +++ b/resources/scripts/build/module/cbutils @@ -41,34 +41,34 @@ build_for_mainboard() { board="${1}" [ ! -d "resources/coreboot/${board}" ] && \ continue - [ ! -f "resources/coreboot/${board}/board.cfg" ] && \ + [ ! -f "resources/coreboot/${board}/target.cfg" ] && \ continue - cbtree="undefined" - . "resources/coreboot/${board}/board.cfg" # source - if [ "${cbtree}" = "undefined" ]; then - printf "build/cbutils: improper cbtree definition for '%s'" \ + tree="undefined" + . "resources/coreboot/${board}/target.cfg" # source + if [ "${tree}" = "undefined" ]; then + printf "build/cbutils: improper tree definition for '%s'" \ "${board}" return 1 fi - buildutils "${cbtree}" || return 1 + buildutils "${tree}" || return 1 } buildutils() { - cbtree="${1}" - if [ ! -d "coreboot/${cbtree}/" ]; then - ./download coreboot $cbtree || return 1 + tree="${1}" + if [ ! -d "coreboot/${tree}/" ]; then + ./fetch_trees coreboot $tree || return 1 fi for util in cbfstool ifdtool; do - [ -f "cbutils/${cbtree}/${util}" ] \ + [ -f "cbutils/${tree}/${util}" ] \ && continue - if [ ! -d "cbutils/${cbtree}" ]; then - mkdir -p "cbutils/${cbtree}" || return 1 + if [ ! -d "cbutils/${tree}" ]; then + mkdir -p "cbutils/${tree}" || return 1 fi - utildir="coreboot/${cbtree}/util/${util}" + utildir="coreboot/${tree}/util/${util}" make distclean -C "${utildir}" || return 1 make -j$(nproc) -C "${utildir}" || return 1 - mv "${utildir}/${util}" "cbutils/${cbtree}" || return 1 + mv "${utildir}/${util}" "cbutils/${tree}" || return 1 make distclean -C "${utildir}" || return 1 done } -- cgit v1.2.1