summaryrefslogtreecommitdiff
path: root/include/inject.sh
AgeCommit message (Collapse)Author
2025-05-27Revert "inject.sh: simplify remktar()"Leah Rowe
This reverts commit 28f03d39cb1a7cfa8db46b3875557a530aebdd46. The commit that this reverts, broke building release roms. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27inject.sh: simplify remktar()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27inject.sh: simplify. and remove unnecessary checkLeah Rowe
checking whether archivename is empty isn't needed, because the case/switch afterward would catch this condition. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27inject.sh: add missing semicolonsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27inject.sh: condense check_releaseLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27inject.sh: remove unnecessary checkLeah Rowe
we don't handle single images anymore, so we don't need to check for it at all. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27put coreboot utils in elf/coreboot/TREELeah Rowe
not elf/UTIL/TREE This way, they are automatically deleted when a tree has to be re-built. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-26xbmk: rename xbmklocal/xbmktmp variablesLeah Rowe
shorten them Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-18inject.sh: shorten the nukemode variable nameLeah Rowe
just call it "nuke". this is what tells whether to remove vendor files from an archive. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-12inject.sh: remove the hashfiles variableLeah Rowe
we only use it once, and it's a trivial string Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-12inject.sh: define xchanged here insteadLeah Rowe
this is used here, and also needed in cbmk. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-11inject.sh: only compile nvmutil if neededLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-11inject.sh: simplified serprog checkLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-11vendor.sh: split up setvfile()Leah Rowe
split the actual bootstrapping to getvfile() setvfile only sets the config, but then it will call getvfile() to act on that config. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-10remove another confusing messageLeah Rowe
the current message says the file name, and implies that the given file has already been updated. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-10inject.sh: Remove confusing path on tar creationLeah Rowe
The path is wrong. The correct path is printed afterward. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-10inject.sh: re-add mac address confirmationLeah Rowe
it just makes the script more user-friendly Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-10inject.sh: further cleanup for vendor.shLeah Rowe
i moved out more code to vendor.sh, to reduce the amount of lbmk-only code on inject.sh this should reduce the number of merge conflicts even further, when cherry picking from lbmk to cbmk. in particular, vendor file insertion is now handled entirely through the "setvfile" function, instead of from inject.sh, which seems counterintuitive, but remember that inject.sh also does MAC addresses. therefore, the inject.sh script is now primarily for inserting MAC addresses, and handles vendor downloads in a slightly more convoluted way, but still easy enough to understand if you read it a bit. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-10inject.sh: split to vendor.sh the download partsLeah Rowe
to the extent feasible, keep lbmk-specific parts on inject.sh to a minimum. this will later be used to re-sync cbmk's inject.sh with lbmk's, because cbmk's one doesn't handle vendor files. the way this is designed now, with this patch, will make cherry-picking lbmk to cbmk easier in the future, when keeping this part of cbmk in sync with lbmk. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-10inject.sh: split up the inject functionsLeah Rowe
generally go for a more linear function order, and split up any functions. the objective is to have functions only suitable to libreboot be separate. more splitting will be done, and eventually the vendor-download functions will be split into a new file, as will several other functions. this is being done as part of an effort to bring the libreboot and canoeboot versions of inject.sh in sync, so that from now on, cherry picking between the two projects will produce fewer merge conflicts and require a lesser amount of post-merge maintenance. some other minor cleanup has also been done; for example, the "need_files" variable is redundant and was removed. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-09lbmk: use x_ instead of err, where appropriateLeah Rowe
many places in lbmk used err, because older versions of x_ did not handle globbing properly. however, use of x_ is preferable on trivial commands. the only time err() should be called is what it has to be, when x_ can't work, or when a more useful error message is needed, for context. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-09inject.sh: use direct comparison for metmpLeah Rowe
use of the e function would slow down execution, and it's mostly unnecessary in this case. the e function is only needed if we want to confirm via user message that a file exists. that is not needed here. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-09inject.sh: use subshell to speed up find_me()Leah Rowe
the current test allows a further extraction after running mecleaner, even if me.bin was found. further, any recursive calls that exit non-ze don't lot the loop acthually stop, unless we subshell that too, otherwise fx_ is returned to return 0 when a given command it runs returns 1, or more specifically: the for loop in x_ breaks. this is by design, and there's not much that can be done, but this patch should pseed up extraction a little bit, when dealing with intel me files. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-07inject.sh: simplify extract_kbc1126ec()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-07inject.sh: simplified MAC address handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-07inject.sh: Simplify patch_release_roms()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-07inject.sh: rename copytb and preprom functionsLeah Rowe
make them shorter so they go on one line again Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-07lib.sh: Simplified fx_() and removed fe_()Leah Rowe
Instead of calling fe_, prefix x_ as indicated. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-07lib.sh: support any command on find_exec()Leah Rowe
right now, we assume "find", but it adds any number of arguments next to that. change it instead to support any command, where the assumption is that it would generate a list of files and directories. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-07inject.sh: Simplify extract_intel_me_bruteforce()Leah Rowe
This is probably about as small as it's going to get. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-06inject.sh: clean up tmp me file before extractLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-06inject.sh: tidy up extract_intel_me_bruteforceLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-06inject.sh: fix oversight in me bruteforceLeah Rowe
i used i instead of 1, in the variable when running the extract_archive function. this didn't trigger since +u was set, and +e was set. in practise, then, it seems that because of this, and because my ME extract/insert test was a success, that none of the archives we use actually have a ME inside of a file inside of a given downloaded archive. still, this is technically incorrect, so fix it! Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-06inject.sh: remove unnecessary checkLeah Rowe
the call stack already falls through with a bunch of return 1s after a successful run of me_cleaner, so it's really not necessary. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-06inject.sh: don't use subshell for me bruteforceLeah Rowe
i needed it on the old version, which used cd this one stays in the same directory at all times Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-06inject.sh: insanely optimise the me bruteforceLeah Rowe
use fe_ fe_ ftw Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-06inject.sh: remove unused functionLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05inject.sh: Further simplified FSP extractionLeah Rowe
We don't need the copy command at all, since the files it copies are the only ones that the Python script does anyway, so now we just make that script output to the directory, directly, where these files must go. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05inject.sh: simplify kconfig scanningLeah Rowe
Use fe_ with a new function, scankconfig, to do the same thing. Not only is this simpler, it now also operates on all coreboot configs for a given target, whereas it previously only operated on the first one. This is useful for cases where one config might use a file that the other one does not; in practise, we don't do this yet, but it's a theoretical possibility Also: don't use the function check_defconfig, which is now redundant and has been removed. That function also conflicted with another function by the same name in mk, but fortunately didn't cause an issue in practise, due to how sh works; when vendor.sh was used, it was without running the tree commands, except under a separate lbmk instance. So this is a simplification, a feature enhancement and even a bug fix, all wrapped into one! Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05lbmk: Replace err with much simpler implementationLeah Rowe
The current implementation is insanely over-engineered, and completely unnecessary. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05inject.sh: simplify extract_intel_me_bruteforce()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05inject.sh: Remove unnecessary checkLeah Rowe
_dest is already checked in the calling function fetch(), after extract_tbfw() has been called. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05inject.sh extract_intel_me(): reduce indentationLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05inject.sh: Move FSP extraction only to extract_fspLeah Rowe
Don't do FSP-specific extraction in extract_archive, as that is not what the latter is for. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05inject.sh: tidy up intel me handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05inject.sh: tidy up the deguard commandLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04lbmk: MUCH safer err functionLeah Rowe
Don't directly call a variable. Call a function that checks the variable instead. The new err function also checks whether an exit was actually done, and exits 1 if not. If an exit was done by the given function, but the exit was zero, this is also corrected to perform an exit 1. This fixes a longstanding design flaw of lbmk. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04inject.sh: tidy up TBFW handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04inject.sh: remove useless comment blockLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-03inject.sh: minor code cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>