From 8d9aeef3de28bcb908e33b804517bdeacce7be38 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 20 Oct 2023 00:17:30 +0100 Subject: lbmk: use 2-level directory structure in script/ as opposed to the current 3-level structure. recent build system simplifications have enabled this change, thus: ./build fw coreboot -> ./build roms ./build fw grub -> ./build grub ./build fw serprog -> ./build serprog ./update project release -> ./update release ./update project trees -> ./update trees ./update vendor download -> ./vendor download ./update vendor inject -> ./vendor inject alper criticised that the commands were too long, so i made them shorter! Signed-off-by: Leah Rowe --- .gitignore | 2 +- build | 46 +-- .../e6430_12mb/config/libgfxinit_corebootfb | 2 +- .../coreboot/e6430_12mb/config/libgfxinit_txtmode | 2 +- .../hp2170p_16mb/config/libgfxinit_corebootfb | 2 +- .../hp2170p_16mb/config/libgfxinit_txtmode | 2 +- .../hp2560p_8mb/config/libgfxinit_corebootfb | 2 +- .../coreboot/hp2560p_8mb/config/libgfxinit_txtmode | 2 +- .../hp2570p_16mb/config/libgfxinit_corebootfb | 2 +- .../hp2570p_16mb/config/libgfxinit_txtmode | 2 +- .../hp8200sff_4mb/config/libgfxinit_corebootfb | 2 +- .../hp8200sff_4mb/config/libgfxinit_txtmode | 2 +- .../hp8200sff_8mb/config/libgfxinit_corebootfb | 2 +- .../hp8200sff_8mb/config/libgfxinit_txtmode | 2 +- .../hp8300usdt_16mb/config/libgfxinit_corebootfb | 2 +- .../hp8300usdt_16mb/config/libgfxinit_txtmode | 2 +- .../hp8470pintel_16mb/config/libgfxinit_corebootfb | 2 +- .../hp8470pintel_16mb/config/libgfxinit_txtmode | 2 +- .../hp9470m_16mb/config/libgfxinit_corebootfb | 2 +- .../hp9470m_16mb/config/libgfxinit_txtmode | 2 +- .../coreboot/t1650_12mb/config/libgfxinit_txtmode | 4 +- .../coreboot/t420_8mb/config/libgfxinit_corebootfb | 2 +- .../t420s_8mb/config/libgfxinit_corebootfb | 2 +- .../coreboot/t420s_8mb/config/libgfxinit_txtmode | 2 +- .../t430_12mb/config/libgfxinit_corebootfb | 2 +- .../coreboot/t430_12mb/config/libgfxinit_txtmode | 2 +- .../t440plibremrc_12mb/config/libgfxinit_txtmode | 2 +- .../t440pmrc_12mb/config/libgfxinit_corebootfb | 2 +- .../t440pmrc_12mb/config/libgfxinit_txtmode | 2 +- .../coreboot/t520_8mb/config/libgfxinit_corebootfb | 2 +- config/coreboot/t520_8mb/config/libgfxinit_txtmode | 2 +- .../t530_12mb/config/libgfxinit_corebootfb | 2 +- .../coreboot/t530_12mb/config/libgfxinit_txtmode | 2 +- .../w530_12mb/config/libgfxinit_corebootfb | 2 +- .../coreboot/w530_12mb/config/libgfxinit_txtmode | 2 +- .../coreboot/w541_12mb/config/libgfxinit_txtmode | 2 +- .../w541mrc_12mb/config/libgfxinit_corebootfb | 2 +- .../w541mrc_12mb/config/libgfxinit_txtmode | 2 +- .../coreboot/x220_8mb/config/libgfxinit_corebootfb | 2 +- config/coreboot/x220_8mb/config/libgfxinit_txtmode | 2 +- .../x230_12mb/config/libgfxinit_corebootfb | 2 +- .../coreboot/x230_12mb/config/libgfxinit_txtmode | 2 +- .../x230_16mb/config/libgfxinit_corebootfb | 2 +- .../coreboot/x230_16mb/config/libgfxinit_txtmode | 2 +- .../x230edp_12mb/config/libgfxinit_corebootfb | 2 +- .../x230edp_12mb/config/libgfxinit_txtmode | 2 +- .../x230t_12mb/config/libgfxinit_corebootfb | 2 +- .../coreboot/x230t_12mb/config/libgfxinit_txtmode | 2 +- .../x230t_16mb/config/libgfxinit_corebootfb | 2 +- .../coreboot/x230t_16mb/config/libgfxinit_txtmode | 2 +- include/git.sh | 2 +- include/option.sh | 4 +- script/build/fw/coreboot | 416 --------------------- script/build/fw/grub | 82 ---- script/build/fw/serprog | 81 ---- script/build/grub | 82 ++++ script/build/roms | 416 +++++++++++++++++++++ script/build/serprog | 81 ++++ script/update/project/release | 247 ------------ script/update/project/trees | 297 --------------- script/update/release | 247 ++++++++++++ script/update/trees | 297 +++++++++++++++ script/update/vendor/download | 244 ------------ script/update/vendor/inject | 248 ------------ script/vendor/download | 244 ++++++++++++ script/vendor/inject | 248 ++++++++++++ vendor | 1 + 67 files changed, 1684 insertions(+), 1699 deletions(-) delete mode 100755 script/build/fw/coreboot delete mode 100755 script/build/fw/grub delete mode 100755 script/build/fw/serprog create mode 100755 script/build/grub create mode 100755 script/build/roms create mode 100755 script/build/serprog delete mode 100755 script/update/project/release delete mode 100755 script/update/project/trees create mode 100755 script/update/release create mode 100755 script/update/trees delete mode 100755 script/update/vendor/download delete mode 100755 script/update/vendor/inject create mode 100755 script/vendor/download create mode 100755 script/vendor/inject create mode 120000 vendor diff --git a/.gitignore b/.gitignore index 719fb150..f743fddb 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,7 @@ /push /version /versiondate -/vendor/ +/vendorfiles/ *me.bin *sch5545ec.bin /mrc/ diff --git a/build b/build index 09b08403..80ee1827 100755 --- a/build +++ b/build @@ -11,7 +11,7 @@ set -u -e . "include/err.sh" . "include/option.sh" -eval "$(setvars "" mode option aur_notice tmpdir)" +eval "$(setvars "" option aur_notice tmpdir)" tmpdir_was_set="y" set | grep TMPDIR 1>/dev/null 2>/dev/null || tmpdir_was_set="n" @@ -39,8 +39,10 @@ buildpath="./script/${linkname}" main() { xx_ id -u 1>/dev/null 2>/dev/null - initialise_command $@ - shift 2 + [ $# -lt 1 ] && fail "Too few arguments. Try: ${0} help" + [ "${1}" = "dependencies" ] && xx_ install_packages $@ && lbmk_exit 0 + + initialise_command $@ && shift 1 check_git check_project "fail" @@ -51,22 +53,13 @@ main() initialise_command() { - [ $# -lt 1 ] && fail "Too few arguments. Try: ${0} help" - - mode="${1}" - [ "${mode}" != "dependencies" ] || xx_ install_packages $@ [ "$(id -u)" != "0" ] || fail "this command as root is not permitted" - [ "${mode}" = "help" ] && usage ${0} && lbmk_exit 0 - if [ "${mode}" = "list" ]; then - items "${buildpath}" - lbmk_exit 0 - elif [ $# -lt 2 ]; then - usage ${0} - lbmk_exit 1 - fi - - option="${2}" + case "${1}" in + help) usage ${0} && lbmk_exit 0 ;; + list) items "${buildpath}" && lbmk_exit 0 ;; + esac + option="${1}" } install_packages() @@ -83,16 +76,13 @@ install_packages() . "config/dependencies/${2}" xx_ ${pkg_add} ${pkglist} - [ "${aur_notice}" = "" ] || \ - printf "You must install AUR packages: %s\n" "${aur_notice}" 1>&2 - - lbmk_exit 0 + [ -z "${aur_notice}" ] && return 0 + printf "You must install AUR packages: %s\n" "${aur_notice}" 1>&2 } execute_command() { - [ "$option" = "list" ] && xx_ items "$buildpath/$mode" && lbmk_exit 0 - lbmkcmd="${buildpath}/${mode}/${option}" + lbmkcmd="${buildpath}/${option}" [ -f "${lbmkcmd}" ] || fail "Invalid command. Run: ${linkpath} help" "${lbmkcmd}" $@ || fail "execute_command: ${lbmkcmd} ${@}" } @@ -101,17 +91,11 @@ usage() { progname=${0} cat <<- EOF - USAGE: ${progname}