summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-10-02 03:54:39 +0100
committerLeah Rowe <leah@libreboot.org>2023-10-02 03:54:39 +0100
commit7ce3f93e4492e583f5a27eb5cc66648fd2044f34 (patch)
tree64524c4329e57e8deefe4e1386f8243b4c543839
parent7b02bb9aa6e533f30f25133caf9d214ca3d5bda2 (diff)
build/boot/*: unify more logic in main()
slight sloccount reduction. light renaming of functions between the two scripts, placing more logic in main() under include/boot.sh Signed-off-by: Leah Rowe <leah@libreboot.org>
-rwxr-xr-xinclude/boot.sh3
-rwxr-xr-xscript/build/boot/roms24
-rwxr-xr-xscript/build/boot/roms_helper12
3 files changed, 14 insertions, 25 deletions
diff --git a/include/boot.sh b/include/boot.sh
index 9799039b..8570b3bc 100755
--- a/include/boot.sh
+++ b/include/boot.sh
@@ -26,7 +26,8 @@ main()
shift 2
done
- handle_targets
+ check_target
+ prepare_target
}
usage()
diff --git a/script/build/boot/roms b/script/build/boot/roms
index 48d55e27..dc6ca87f 100755
--- a/script/build/boot/roms
+++ b/script/build/boot/roms
@@ -16,20 +16,7 @@ read projectname < projectname
# main() is in include/boot.sh
-handle_targets()
-{
- [ -z "${_displaymode}" ] || _displaymode="-d ${_displaymode}"
- [ -z "${_payload}" ] || _payload="-p ${_payload}"
- [ -z "${_keyboard}" ] || _keyboard="-k ${_keyboard}"
-
- printf "Building %s ROM images\n" "${projectname}"
-
- check_targets
- build_bootroms
- confirm_targets
-}
-
-check_targets()
+check_target()
{
for x in ${boards}; do
[ -d "config/coreboot/${x}/" ] || \
@@ -37,13 +24,20 @@ check_targets()
done
}
-build_bootroms()
+prepare_target()
{
+ printf "Building %s ROM images\n" "${projectname}"
+
+ [ -z "${_displaymode}" ] || _displaymode="-d ${_displaymode}"
+ [ -z "${_payload}" ] || _payload="-p ${_payload}"
+ [ -z "${_keyboard}" ] || _keyboard="-k ${_keyboard}"
opts="${_displaymode} ${_payload} ${_keyboard}"
+
for x in ${boards}; do
x_ ./build boot roms_helper ${opts} ${x}
[ -d "bin/${x}" ] && targets="${x} ${targets}"
done
+ confirm_targets
}
confirm_targets()
diff --git a/script/build/boot/roms_helper b/script/build/boot/roms_helper
index 5685ef72..a3446334 100755
--- a/script/build/boot/roms_helper
+++ b/script/build/boot/roms_helper
@@ -32,16 +32,9 @@ eval "$(setvars "undefined" grub_scan_disk tree arch uboot_config)"
# main() is in include/boot.sh
-handle_targets()
+check_target()
{
board="${boards%% *}"
- configure_target
- build_dependencies
- build_target
-}
-
-configure_target()
-{
targetdir="${cfgsdir}/${board}"
[ -d "${targetdir}" ] || \
@@ -102,7 +95,7 @@ configure_target()
eval "payload_${_payload}=y"
}
-build_dependencies()
+prepare_target()
{
romdir="bin/${board}"
cbdir="coreboot/${board}"
@@ -122,6 +115,7 @@ build_dependencies()
build_dependency_grub
build_dependency_uboot
+ build_target
}
build_dependency_seabios()