diff options
author | Leah Rowe <leah@libreboot.org> | 2023-08-16 21:34:21 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-08-16 22:40:34 +0100 |
commit | 59dba6cfcdc6c154e4d46c14c42e7b6f0b84c7b5 (patch) | |
tree | 59147fae1f05a32c954772cd22ffab1405aaad0b /resources/scripts/build/module | |
parent | 2453c303e64b3b3c2480564106ea77d89af624d8 (diff) |
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 <leah@libreboot.org>
Diffstat (limited to 'resources/scripts/build/module')
-rwxr-xr-x | resources/scripts/build/module/cbutils | 28 |
1 files changed, 14 insertions, 14 deletions
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 } |