summaryrefslogtreecommitdiff
path: root/include/mrc.sh
AgeCommit message (Collapse)Author
2024-01-10NEW MAINBOARD: HP EliteBook 820 G2Leah Rowe
This is of Broadwell platform, one generation above Haswell. Of note: this uses HP Sure Start. Although the flash is 16MB, our CBFS section (and IFD configuration) assumes 12MB flash, so the final 4MB will be left unflashed on installation, after blanking the private flash. The coreboot documents have more information about this. Some minor design changes in lbmk were made, to accomodate this port: Support for extracting refcode binaries added (pulled from Google recovery images). The refcode file is an ELF that initialises the MRC and the PCH. It is also responsible for enabling or disabling the Intel GbE device, where Google does not enable it, but lbmk modifies it per the instructions on the coreboot documentation, so as to enable Intel GbE. Google's recovery image stores the refcode as a stage file, but coreboot changed the format (for CBFS files) after 4.13 so coreboot 4.13's cbfstool is used to extract refcode. This realisation made me also change the script logic to use a cbfstool and ifdtool version matching the coreboot tree, for all parts of lbmk, whereas lbmk previously used only the default tree for cbfstool/ifdtool, on insertion and deletion of vendor files - it was 81dc20e744 that broke extraction of refcode on google's recovery images, where google used an older version of cbfstool to insert the files in their coreboot ROMs. A further backported patch has been added, copying coreboot revision f22f408956 which is a build fix from Nico Huber. Iru Cai submitted an ACPI bugfix after the revision lbmk currently uses, for coreboot/default, and this fix is needed for rebooting to work on Linux 6.1 or higher. This patch has been backported to lbmk, while it still uses the same October 2023 revision of coreboot. Broadwell MRC is inserted at the same offset as Haswell, so I didn't need to tweak that. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-24lbmk scripts: shorter code linesLeah Rowe
while seemingly pedantic, this does actually make code easier to read. mostly just switching to shorthand for variable names, where no expansions or patterns are used Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-22mrc.sh: run debugfs from extract_partitionLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-22mrc.sh: general code cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-21mrc.sh: remove redundant extraction logicLeah Rowe
the extract_archive function already provides use of unzip, and works just fine (for mrc.bin extraction) Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-21mrc.sh: don't run the shellball. use unzip.Leah Rowe
the shellball (for extracting the coreboot rom, to get at mrc.bin) contains lines that are not posix-friendly. specifically, the "local" command is used, and this is not defined for posix sh. the shellball is essentially just a bunch of shell functions that compress/decompress the zip file, containing the firmware update. you can modify the files and re-run the shellball to recompress, though lbmk just uses the decompress function. as pointed out by Nicholas Chin, it is possible to just run "unzip" directly on the update, to get at bios.bin. we don't really need all the extra checks performed by the shellball, so let's just bypass it altogether. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-11handle errors on exits from subshellsLeah Rowe
most of these are probably redundant, and will never be called, but lbmk needs to be as safe as possible under fault conditions. fail early, fail hard. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-2220231021hotfix: replace x_ with err in some places20231021fixLeah Rowe
keymaps weren't being set in keymay.cfg of cbfs, due to use of x_ in the rom script, and x_ doesn't handle quotes or spaces in arguments well. i'm going to remove use of x_ and xx_ (it's in my todo), for next release. for now, hot patch the release. i've gone through and replaced use of x_ with || err, in some places. not just the keymap.cfg command, but others too. in case there are more issues we missed. this commit is being tagged "20231021fix" and i'm using this tag to re-build the 20231021 release. i'll just replace the tarballs in rsync and add errata to the news page announcing the release. all i did was break peoples umlauts, i didn't brick their machines fortunately! very minor bug. anyway, x_/xx_ is a great idea, but sh isn't really designed for that style of programming. i'll go back to using just || err in the next release. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-19minor code cleanup in shell scriptsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-15delete include/vendor.sh and merge elsewhereLeah Rowe
move it all to other files where items are used, and not used anywhere else. this reduces the size of vendor.sh. also remove a few redundant variables, or variables that are not meaningfully used. a few items have been moved to include/option.sh 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-29blob scripts: unified handling of blob destinationLeah Rowe
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>