summaryrefslogtreecommitdiff
path: root/script/update/blobs
AgeCommit message (Collapse)Author
2023-10-07update/blobs: don't needlessly re-build uefitoolLeah Rowe
during the switch to src/ for all downloads, i overlooked that the path check was hardcoded. now the check for this binary is corrected. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07put all src downloads under src/Leah Rowe
build/release/src was partly re-written to accomodate this memtest86plus was patched to have a central Makefile, and lbmk modified to use that, rather than mess with build32 and build64. the central Makefile just builds both targets or cleans both targets Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-06rename build/project/trees to update/project/buildLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-06unify handle/make/* into build/project/treesLeah Rowe
Just one script. Just one. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-03general code cleanup in shell scriptsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02update/blobs/download: remove errant commentLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-01Greatly simplify error handling in shell scriptsLeah Rowe
Instead of having detailed error messages, run most commands through a function that calls err() under fault conditions. Where detail is still required, err() is still called manually. Where it isn't, the error message is simply whatever command was executed to cause the error. This results in a massive sloccount reduction for lbmk; specifically, 178 sloc reduction, or a 8.1% reduction. The total sloccount is now 2022, for shell scripts. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30general code formatting cleanup in shell scriptsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30simplify initialising variables in shell scriptsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30update/*/*: unified scanning of revisions/sourcesLeah Rowe
update/blobs/download and update/project/repo both use the same logic, for setting variables with awk and a specially formatted configuration file. unify this logic under include/option.sh, and use that. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-29blobs/download: move helpers to include/blobutilLeah Rowe
mkdirs() should be in include/blobutil.sh, as should extract_archive(), because that is primarily where they are used. script/update/blobs/download calls these functions aswell, but it sources include/blobutil.sh so it's OK. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-29include/blobutil: try curl first, then wgetLeah Rowe
Don't use only wget. Some systems may only have curl. The user can always install wget anyway, but why not support both? I've added the right user agent string. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-29include/blobutil: simplify check_defconfig()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-29blobs/download: do IntelME extract in one functionLeah Rowe
Just one function. Just one. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-29blobs/download: do final check of _dest in fetch()Leah Rowe
This way, the file is checked regardless of what type of blob is handled, not just Intel ME. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-29blobs/download: don't pass dl_path as argumentLeah Rowe
Because fetch() is only called now from blobs/download, we can reliably know what dl_path should be. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-29blob scripts: unified handling of blob destinationLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-29remove unused variables in blob scriptsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-29merge include/fetch.sh, blobutil.sh, defconfig.shLeah Rowe
They are only ever used by script/update/blobs/*, so put them all in blobutil.sh. This cuts down on the number of scripts in lbmk. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-29update/blobs/*: simplify mrc.bin handlingLeah Rowe
mrc.bin is now handled by include/mrc.sh, adapted from now-deleted script/update/blobs/mrc much of the logic has been re-written or adapted for inside script/update/blobs/download mrc links/hashes now defined in config/blobs/sources the new code is simpler (and smaller). in addition, lbmk can now easily handle mrc.bin files for other platforms such as broadwell. watch this space. the full .zip download is now cached, like with other vendor downloads. this means it won't be re-downloaded if it was already downloaded before. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-29update/blobs/*: unified download/checksum logicLeah Rowe
Use the same logic between blobs/download and blobs/mrc. The logic is taken from blobs/download. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-28blobs/download: remove unnecessary linebreaksLeah Rowe
generally condense the code, but not in a way that makes the code unreadable. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-28blobs/download: remove unnecessary messagesLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-28blobs/download: simplify downloading of filesLeah Rowe
individual functions for downloading each archive have been removed. instead, eval is used in fetch_update(), which is now renamed to fetch(). Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-28blobs/download: remove unnecessary error pipesLeah Rowe
the called functions directly call err() under fault condition, so this additional handling is redundant. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-28blobs/download: unified archive extractionLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-27move build/command/options to include/option.shLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-27blobs/download: unified blobdir handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-27blobs/download: unified archive extractionLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-27blobs/download: remove errant debug lineLeah Rowe
i added that echo command when working on the function in question, but it's not needed now. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-27remove script/update/blobs/extractLeah Rowe
This script is incomplete, buggy and its use is ill advised. This script can be re-added later, when more work is done. The download and/or inject script is recommended. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-27blobs/download: simplify fetch_update()Leah Rowe
Do not specifically name types of firmware. Instead, pass the URLs and checksum as direct arguments. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-27blobs/download: greatly simplify sources handlingLeah Rowe
remove the giant case/esac list, and set variables directly. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-27blobs/download: simplify defconfig handlingLeah Rowe
use the variable names directly, as defined in defconfig. do not hardcode the if/else chain in detect_firmware, use eval instead. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-26simplify getopts loops in shell scriptsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-25Update email address for Leah Rowe copyrightsLeah Rowe
also, some of them were out of date; years now updated. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-25Use SPDX license headers on all scriptsLeah Rowe
This results in much cleaner copyright and license declarations. SPDX headers are legally recognised and make auditing easier. Also, remove descriptions of each script, from each script. Libreboot documentation at docs/maintain/ describes them. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-10build/boot/roms stragglers: properly handle errorsLeah Rowe
there were a few missing err calls i actually went through all of lbmk and found no instances where err calls were missing except in build/boot/roms_helper Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-09scripts: use printf, not echo, where appropriateLeah Rowe
printf has more universal behaviour, across various implementations of sh, so it's better to use this. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-09update/blobs printf statements: use double quotesLeah Rowe
single quotes are not valid Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-09scripts: better handling of printf: stdout/stderrLeah Rowe
in some cases, messages that should be considered errors or warnings, were being written to the standard output, rather than written as error messages. also: one or two printf statements should specifically avoid printing errors (to any file); in these cases, stdout has been redirected to /dev/null Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-09blobs/download: don't use the -B option in makeLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-09blobs/inject: add error condition on rm commandLeah Rowe
this was overlooked, earlier on in lbmk audit 2 Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-09blobs/inject: fix checksum validation if no-ucodeLeah Rowe
on e6400_4mb, the release build scripts remove nvidia's vga rom which is used on dgpu models. however, microcode is also removed in separately copied rom images the inject script was inserting vgaroms directly into these no-microcode roms, but the microcode blob is bigger than the vga rom, and cbfstool inserts into the first available free spot within cbfs, so it was inserting into the spot where cpu microcode went. this caused the rom checksum to not match what was generated during build/release/roms being executed the only real fix is to guarantee offsets within cbfs for all files, by recording what offsets were used and then calculating that during insertion so this patch is a workaround, but fixes the issue. the workaround is: don't insert blobs directly on no-microcode roms, instead insert only on microcode-based roms, then re-copy those roms and remove microcode in aptly named copies it's a bit more convoluted, but works perfectly fine. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-09use sha512sum to check downloads, not sha1sumLeah Rowe
sha-1 has known collision issues, which may not be readily exploitable yet (in our context), but we should ideally use a more secure method for checking file integrity. therefore, use sha-2 (sha512sum) for checking files. this is slower than sha-1, but checksum verification is only a minor part of what lbmk does, so the overall effect on build times is quite negligible. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-05update/blobs/inject: use tmp/romdir, not TMPDIRLeah Rowe
we are copying large numbers of ROM images, and the host system may have /tmp under a tmpfs; that same host system may or may not have a lot of memory. respect the user's machine. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-04curl/wget downloads: set re-try count to 3Leah Rowe
explicitly set the count to 3, so that a maximum of 3 attemps are made per download, barring fatal errors such as http 404. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-04update/blobs: unify global variablesLeah Rowe
they all more or less use the same variables, so put them all under include/blobutil.sh Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-04update/blobs/*: unify checking of defconfig filesLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-04update/blobs/extract: replace errant target codeLeah Rowe
check based on whether defconfigs are available, which are used extensively, rather than checking based on whether target.cfg is available, which is not used Signed-off-by: Leah Rowe <leah@libreboot.org>