mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-17 18:34:57 +02:00
lib.sh: new function mk() to handle trees in bulk
single-tree projects cannot be handled in bulk, e.g. ./mk -f project1 project2 project3 that is still the case, from the shell, but internally it is now possible: mk -f project1 project2 project3 mk() is a function that simply handles the given flag, and all projects specified. it does not handle cases without argument, for example you cannot do: mk -f arguments must be provided. it can be used internally, to simplify cases where multiple single-tree projects must be handled, but *also* allows multi-tree projects to be specified, without being able to actually handle trees within that multi-tree project; so for example, you can only specify coreboot, and then it would run on every coreboot tree. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -36,11 +36,9 @@ main()
|
||||
inject) shift 1; vendor_inject $@ ;;
|
||||
download) shift 1; vendor_download $@ ;;
|
||||
roms)
|
||||
if [ $# -gt 1 ] && [ "$2" = "serprog" ]; then
|
||||
x_ ./mk -b stm32-vserprog
|
||||
x_ ./mk -b pico-serprog; return 0
|
||||
fi; shift 1
|
||||
x_ ./mk -b coreboot $@ ;;
|
||||
[ $# -gt 1 ] && [ "$2" = "serprog" ] && \
|
||||
mk -b stm32-vserprog pico-serprog && return 0
|
||||
shift 1; x_ ./mk -b coreboot $@ ;;
|
||||
*)
|
||||
[ -f "$spath" ] || $err "bad command"
|
||||
$shcmd; "$spath" $@ || $err "excmd: $spath $(echo "$@")" ;;
|
||||
@@ -110,9 +108,7 @@ build_release()
|
||||
touch "$srcdir/lock" || $err "can't make lock file in $srcdir/"
|
||||
(
|
||||
cd "$srcdir" || $err "$vdir: 2 !cd \"$srcdir\""
|
||||
./mk -b coreboot || $err "$vdir: roms-all"
|
||||
./mk -b pico-serprog || $err "$vdir: rp2040"
|
||||
./mk -b stm32-vserprog || $err "$vdir: stm32"
|
||||
mk -b coreboot pico-serprog stm32-vserprog
|
||||
x_ mv bin ../roms
|
||||
) || $err "can't build rom images"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user