diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-09-13 22:45:27 +0100 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-09-14 00:05:48 +0100 |
| commit | 5fb0d1098f33a7806ec2a8daba0cd4c4d747562b (patch) | |
| tree | 5e042fa5a3d9ddff451d61595397a391b48b7d46 /mk | |
| parent | dcaa15ab01952b9eccfc906b2250721d9d22d891 (diff) | |
mk: simplified command handling
just do includes in mk again. common.sh was stupidly
small, just pointless.
replace the entire command dispatcher with eval, printf
and awk, because i can, and it further reduces sloccount.
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'mk')
| -rwxr-xr-x | mk | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -23,18 +23,26 @@ commandv="`readlink -f "$xbarg0" 2>/dev/null`" cd "${commandv%/*}" || exit 1 -. "include/common.sh" +. "include/lib.sh" +. "include/env/init.sh" +. "include/env/get.sh" -if xeq main "${1-}" \ - $xbcommands; then +. "include/fw/vendor.sh" +. "include/fw/mrc.sh" +. "include/fw/inject.sh" +. "include/fw/rom.sh" - "$@" || exit 1 - exit 0 -fi +. "include/mk/release.sh" + +_f="${1-}" +shift 1 2>/dev/null || : + +eval "$(printf "version release download inject\n" | awk '{ for (i=1; i<=NF; \ + i++) $i = "[ \""$i"\" = \"$_f\" ] && x_ "$i" \"$@\" && exit 0;"; print }')" . "include/mk/tree.sh" -trees "$@" || exit 0 +trees "$_f" "$@" || exit 0 x_ touch "$mkhelpercfg" |
