Commit Graph

12 Commits (4e06779948744b3d7c09b3749ddc06e0b9e73732)

Author SHA1 Message Date
Leah Rowe 0aca6332ee lbmk scripts: shorter code lines
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-24 09:04:36 +00:00
Leah Rowe fa25414bab mrc.sh: run debugfs from extract_partition
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-22 08:36:23 +00:00
Leah Rowe 8a87572227 mrc.sh: general code cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-22 06:34:14 +00:00
Leah Rowe 493ebdfb74 mrc.sh: remove redundant extraction logic
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-21 16:16:11 +00:00
Leah Rowe 1153bc3b6c mrc.sh: don't run the shellball. use unzip.
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-21 15:52:03 +00:00
Leah Rowe 2e779a5495 handle errors on exits from subshells
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-12-11 05:21:27 +00:00
Leah Rowe e86af9a60a 20231021hotfix: replace x_ with err in some places
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-22 12:34:45 +01:00
Leah Rowe 0b98c9b00c minor code cleanup in shell scripts
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-19 23:36:56 +01:00
Leah Rowe c14461a56b delete include/vendor.sh and merge elsewhere
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-15 13:00:14 +01:00
Leah Rowe 8c03b886c4 Greatly simplify error handling in shell scripts
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-10-01 22:47:02 +01:00
Leah Rowe 2b7ae8e204 blob scripts: unified handling of blob destination
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-29 20:29:13 +01:00
Leah Rowe 710171f92b update/blobs/*: simplify mrc.bin handling
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-29 16:40:49 +01:00