From 8d9aeef3de28bcb908e33b804517bdeacce7be38 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 20 Oct 2023 00:17:30 +0100 Subject: [PATCH] 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 +- .../e6430_12mb/config/libgfxinit_txtmode | 2 +- .../hp2170p_16mb/config/libgfxinit_corebootfb | 2 +- .../hp2170p_16mb/config/libgfxinit_txtmode | 2 +- .../hp2560p_8mb/config/libgfxinit_corebootfb | 2 +- .../hp2560p_8mb/config/libgfxinit_txtmode | 2 +- .../hp2570p_16mb/config/libgfxinit_corebootfb | 2 +- .../hp2570p_16mb/config/libgfxinit_txtmode | 2 +- .../config/libgfxinit_corebootfb | 2 +- .../hp8200sff_4mb/config/libgfxinit_txtmode | 2 +- .../config/libgfxinit_corebootfb | 2 +- .../hp8200sff_8mb/config/libgfxinit_txtmode | 2 +- .../config/libgfxinit_corebootfb | 2 +- .../hp8300usdt_16mb/config/libgfxinit_txtmode | 2 +- .../config/libgfxinit_corebootfb | 2 +- .../config/libgfxinit_txtmode | 2 +- .../hp9470m_16mb/config/libgfxinit_corebootfb | 2 +- .../hp9470m_16mb/config/libgfxinit_txtmode | 2 +- .../t1650_12mb/config/libgfxinit_txtmode | 4 +- .../t420_8mb/config/libgfxinit_corebootfb | 2 +- .../t420s_8mb/config/libgfxinit_corebootfb | 2 +- .../t420s_8mb/config/libgfxinit_txtmode | 2 +- .../t430_12mb/config/libgfxinit_corebootfb | 2 +- .../t430_12mb/config/libgfxinit_txtmode | 2 +- .../config/libgfxinit_txtmode | 2 +- .../config/libgfxinit_corebootfb | 2 +- .../t440pmrc_12mb/config/libgfxinit_txtmode | 2 +- .../t520_8mb/config/libgfxinit_corebootfb | 2 +- .../t520_8mb/config/libgfxinit_txtmode | 2 +- .../t530_12mb/config/libgfxinit_corebootfb | 2 +- .../t530_12mb/config/libgfxinit_txtmode | 2 +- .../w530_12mb/config/libgfxinit_corebootfb | 2 +- .../w530_12mb/config/libgfxinit_txtmode | 2 +- .../w541_12mb/config/libgfxinit_txtmode | 2 +- .../w541mrc_12mb/config/libgfxinit_corebootfb | 2 +- .../w541mrc_12mb/config/libgfxinit_txtmode | 2 +- .../x220_8mb/config/libgfxinit_corebootfb | 2 +- .../x220_8mb/config/libgfxinit_txtmode | 2 +- .../x230_12mb/config/libgfxinit_corebootfb | 2 +- .../x230_12mb/config/libgfxinit_txtmode | 2 +- .../x230_16mb/config/libgfxinit_corebootfb | 2 +- .../x230_16mb/config/libgfxinit_txtmode | 2 +- .../x230edp_12mb/config/libgfxinit_corebootfb | 2 +- .../x230edp_12mb/config/libgfxinit_txtmode | 2 +- .../x230t_12mb/config/libgfxinit_corebootfb | 2 +- .../x230t_12mb/config/libgfxinit_txtmode | 2 +- .../x230t_16mb/config/libgfxinit_corebootfb | 2 +- .../x230t_16mb/config/libgfxinit_txtmode | 2 +- include/git.sh | 2 +- include/option.sh | 4 +- script/build/{fw => }/grub | 2 +- script/build/{fw/coreboot => roms} | 24 +++++----- script/build/{fw => }/serprog | 4 +- script/update/{project => }/release | 12 ++--- script/update/{project => }/trees | 12 ++--- script/{update => }/vendor/download | 8 ++-- script/{update => }/vendor/inject | 12 ++--- vendor | 1 + 60 files changed, 106 insertions(+), 121 deletions(-) rename script/build/{fw => }/grub (97%) rename script/build/{fw/coreboot => roms} (95%) rename script/build/{fw => }/serprog (95%) rename script/update/{project => }/release (94%) rename script/update/{project => }/trees (96%) rename script/{update => }/vendor/download (97%) rename script/{update => }/vendor/inject (94%) 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}