summaryrefslogtreecommitdiff
path: root/script
AgeCommit message (Collapse)Author
2024-06-30trees: handle all projects if project undefinedLeah Rowe
e.g. ./update trees -f if passed, this command would download every tree similarly, the -c option can be used in this way. this solves a longstanding issue: on the current, much more efficient design, it was not possible to systematically clean every project. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-30trees and git.sh: tidy up global variablesLeah Rowe
some of the variables only initialised in git.sh are also used in the trees script, which is technically ok because git.sh is included from the trees script, but it makes more sense to declare them in the latter. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-30trees: simplified distclean directory checkLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-30trees: only do bare multi-tree clone on gitLeah Rowe
i forgot to add the check for CHANGELOG Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-30trees: simplified multi-tree bare repo cloneLeah Rowe
the git_prep function already creates the given directory where source code goes, so we don't need to do it from the trees script. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-30trees run_make_command: simpler distclean handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-30trees: condense copy_elf() a bitLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-30trees: add return to handle_defconfig()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-30trees: rename check_config to check_defconfigLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-30trees: remove variable "config_name"Leah Rowe
it's only ever used once, so just use the value that it's set to, without declaring the variable itself Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-30trees: rename variable "config" to defconfigLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-30trees: remove unnecessary commontsLeah Rowe
behaviour described there is obvious just from analysing the while loop condition Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-30trees: condense run_make_command() a bitLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-30trees: condense handle_makefile() a bitLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-30trees: mv load_project_config load_target_configLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-30trees, multi: download bare project *before* treesLeah Rowe
when downloading multi-tree projects, the rev can be reset to HEAD instead of the actual rev for a given target. this occurs when the bare repo (e.g. src/coreboot/coreboot) does not exist and has to be downloaded first. bare repository downloading does not rely on target.cfg, in this context, only pkg.cfg, but it uses the same variable names (e.g. "rev"). instead of using a separate variable name, thus increasing code complexity (which is the exact opposite of what i want to do), do the bare repository download first. this means that the git.sh script is much cleaner now, for multi-tree projects, in that it *only* copies the bare repo then runs git_prep; in that context, the bare repo is cloned directly by calling the relevant function from script/trees, which is the same behaviour as when cloning single-tree project sources. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-30trees: unified multi-tree configuration handlingLeah Rowe
the same function that loads configurations for single-tree projects has been merged with the function for multi-tree configs in git.sh, and that functionality has been removed from git.sh; now it is all unified in the trees script. as the saying goes: write one program to do one thing well. the purpose of git.sh is to download source code, but not to handle configuration files; the latter is meant to be handled by the trees script, which then calls into git.sh before running the build logic for that given project. additionally: the "seen" files are no longer handled, at all. the logic there was added ages ago, because at the time, i was considering whether to separate configuration into a new repository, so that users could more easily make their own configuration, so it was a guard against misconfiguration. however, that decision was canceled and we're always very careful not to introduce a loop; if a loop does occur, the worst that can possibly happen is you waste some CPU cycles. Instead, print (on standard output) what config file is being used, so the operator can see when an infinite loop occurs. ALSO: remove _setcfgarg in load_project_config() it was used to skip when a target.cfg file didn't exist, specifically on single-tree projects, but this is now handled using -f instead, on the while loop inside that function, so _setcfgarg is now a redundant variable. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-29trees: unified handling of source downloadsLeah Rowe
run it from load_project_config() Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-29git.sh: rename Fetch_project_trees fetch_targetsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-29git.sh: rename fetch_project_repo to fetch_projectLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-29trees: better skip-clean string in handle_src_treeLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-29trees: add return to check_coreboot_utils()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-29trees: simplify "utilmode" variable initialisationLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-29trees mkpayload_grub: remove unnecessary checkLeah Rowe
these variables are initialised empty, then populated by reading a configuration file. it may be that in some cases, we want these variables to be empty. besides that, the "setcfg" command before it will throw an error if the module file is missing, and it is assumed that the variables would be set there. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-28tidy up some setvars listsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-28roms: explicitly shift by 1 on the "all" targetLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-28roms: add return value for the list commandLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-28roms: build u-boot *before* checking ubootelfLeah Rowe
the current check is flawed, because if u-boot doesn't exist, but a given build would be the file verified by the first check, the check would still fail even after then building u-boot. building it first will make this check pass, under such a condition. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-28remove more unnecessary checks on trees commandsLeah Rowe
the trees script already performs these checks Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27trees: don't hardcode use of mkpayload_grubLeah Rowe
instead, make it a helper function, defined in target.cfg this means that we can also do the same with other projects in the future, and it is expected that we will have to. these helper functions are used in cases where we want additional actions to be performed. actually, the helper could be anything. for example, you could write: mkhelper="./build foo bar" and it would do that (at the point of execution, PWD is the root directory of the build system) Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27trees: simplify single/multi handling in main()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27trees: rename build_projects to build_projectLeah Rowe
the script used to support building multiple single-tree projects, but this behaviour was buggy and unused, so it was removed. rename the build_projects variable accordingly. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27trees: err if target.cfg not given if multi-treeLeah Rowe
it was always by design that an error should occur, if a target.cfg file does not exist on multi-tree projects, but we previously did not support target.cfg files on single-tree projects. single-tree target.cfg support was later added, and it was done by making target.cfg optional there, but i accidentally made it optional on multi-tree projects. in practise, all multi-tree projects included target.cfg, but this was not being enforced in code. this patch should fix the issue. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27trees: set btype if target.cfg doesn't existLeah Rowe
set it to "auto", because otherwise it'll be unset, which means that kconfig type is assumed. the build system is designed in such a way that multi-tree is assumed, if the target build system uses kconfig files. target.cfg is optional on single-tree but not multi-tree, so it's ok to set something here. basically, kconfig-type projects will never be single-tree. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27roms: remove unnecessary assignment to cbdirLeah Rowe
cbdir isn't used in this script Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27trees: avoid kconfig make commands genericallyLeah Rowe
don't hardcode the check based on whether the current project is grub. instead, define "btype" in target.cfg if unset, we assume kconfig and permit kconfig commands e.g. make menuconfig, make silentoldconfig, etc this is to avoid the deadliest of sins: project-specific hacks Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27trees: condense elfcheck() a bitLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27trees: shorten the final confirmation messageLeah Rowe
must stay below 80 characters per line Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27lib.sh: simplified TMPDIR handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27trees: remove redundant space in printfLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27trees: explicitly err if OPTARG is not setLeah Rowe
we currently rely on -e to make this happen Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27trees: only permit one single-tree projectLeah Rowe
the current logic for handling multiple single-tree projects is quite error-prone, and uses recursion. since we don't actually use it this way, remove that feature. the most correct way to do it is with a for loop. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27trees: call err if multiple flags are providedLeah Rowe
this script is designed to only run a single flag. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27trees: explicitly set mode for -bLeah Rowe
doing nothing means that if a flag is passed, and then another flag overriding it, the resulting action will not be correct; only one flag should be provided anyway, but some users may feel a bit more adventurous. mitigate it. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-27roms: re-add compression of coreboot imagesLeah Rowe
i accidentally removed this feature, during prior cleanup. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-25roms: build coreboot *after* checking variablesLeah Rowe
otherwise, release=n is ignored and an image is built in the elf/ directory, even if it's still skipped for bin/ avoid doing unnecessary work per-release by checking the variables before building coreboot via script/trees Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-25lib.sh: simplify use of environment variablesLeah Rowe
don't have a separate variable for them. just export them directly and use them directly. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-24roms main(): confirm what serprog images are builtLeah Rowe
just like we do for coreboot images, do it for serprog. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-24roms: remove unused variable nameLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-24roms: remove redundant printfLeah Rowe
we don't need this message here, because the final confirmation at the end of main() says which targets were built. saying what individual rom images were built is just needless bloat, especially with the new simplified lbmk design; we no longer provide lots of rom images with different keymaps, because we now expect the user to insert a gkb file themselves with cbfstool. Signed-off-by: Leah Rowe <leah@libreboot.org>