Age | Commit message (Collapse) | Author |
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
_dest is already checked in the calling function fetch(),
after extract_tbfw() has been called.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
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>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Some parts of lbmk set +u +e, to be reset later on
under normal conditions upon exit. We must ensure
such level of integrity in err() as well.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Otherwise, it returns if init is already done, which
later leads to build errors in coreboot.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Rely once again on err_, but still explicitly add an exit
just below, in case I made a mistake one day.
err() is essentially a trap that triggers in case I mess
up an error function, so that it doesn't reliably exit.
So, the idea is that everything calls err(), and err() is
almost never modified, or modified very carefully.
If error exits were ever broken, the result could be quite
unpredictable, so lbmk has very strict error handling, and
great care is taken to ensure that it does reliably exit.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
don't hardcode it.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
make the command style more consistent, for example
relying on x_ inside a subshell to print the command
and arguments if a command failed.
this is a good style, and i'll probably use it in other
places on lbmk.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
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>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Always certainly redundant, since if -u -e isn't
set, it'll continue to exit anyway.
However, we want to be pedantic about this, since
the safety of lbmk relies entirely on this function
NOT misbehaving.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
these were missed in a previous cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
this was added a few commits ago, but the previous commit
made me realise it's not needed at all.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
we can use remkdir here. it does the same thing.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
instead of deleting every file within
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
only initialise variables at the point they're needed.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
it could be that some were left over before, for some
reason. that isn't currently the case, but this will
avoid the possibility in future.
therefore, this is a preemptive bug fix.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
we only call it in one place. the resulting code is still
quite clear.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Use this for the sha512sum command, on the main mk
script at the function check_project_hashes().
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
the extra function isn't needed at all. awk can just
handle every line all at once.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
the initial checks are unnecessary, since i always know
what arguments are being provided.
the -f check in the for loop is now an -x instead, more
efficient and complete.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
we know that _dest is always what's set in the coreboot config,
without the ../../../ in it, so just copy both files in a single
function, and call the function twice.
if both files are done on the first call, the second call will
be skipped. if only the first file was done on the first call,
running the download script again will skip the first one, and
grab the second one.
this also avoids having to run the decat function twice, in most
cases, so it's a tiny optimisation.
this optimisation only works if both fsp files (s and m) are to
be extracted into the same directory, which is the case anyway,
and this will always be the case.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
We don't use the tbtmp variable anymore, in this function.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Don't copy it until it has been padded properly.
Otherwise, erroneous padding would result in an error,
and who knows what would be left in vendorfiles/ ?
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
To make sure any old files are removed, always re-create.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
If we're in a release work directory, TMPDIR is already
set, so the local ./tmp won't be created, which would
lead to an error.
Fix it by creating xbmklocal before checking TMPDIR.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Make it an absolute directory, relative to xbmktmp.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
this silences confusing error messages that the user
sees on the screen, that are actually benign, and it
will thus reduce the number of people who ask questions
on #libreboot irc
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
Signed-off-by: Leah Rowe <leah@libreboot.org>
|
|
it's not a lot of code, and takes less than a second.
the previous change uses x instead of ?, but this would
cause an error if the nvmutil was already built, because
the makefile might cause a build to be skipped.
therefore, force a re-build to mitigate the error.
Signed-off-by: Leah Rowe <leah@libreboot.org>
|