Commit Graph

11 Commits (90ac30b163b47769695ba247b2d5cb7c43226815)

Author SHA1 Message Date
Leah Rowe 90ac30b163 update/trees: simplified crossgcc handling
only call crossgcc for coreboot and u-boot, but use
hostcc for everything else. simplify the checking of
which architecture to compile for. "arch" in target.cfg
files has been modified, to allow further simplification.

without this patch, the logic currently only *barely* avoids
using crossgcc on things like utils, and only works in practise
because, in practise, lbmk only works on x86_64 anyway.

the new logic, as per this patch, is simpler and more robust.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-21 14:18:51 +00:00
Leah Rowe 39a3de574a remove DEBUG handling in lbmk (not needed)
all it did was set -v in the shell, which doesn't yield
very useful results. this is a relic of very old design
in the libreboot build system, that is no longer needed.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-16 07:58:13 +00:00
Leah Rowe 1eb4df6748 fix several shellcheck warnings
lbmk didn't quote certain arguments in commands, or
used ! -z instead of -n, things like that. simple fixes.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-16 07:56:26 +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 5af3ae0586 lbmk: don't use status for unconditional returns
in cases where lbmk must always return from a function,
there are some cases where it relies on non-zero exit
status, which in practise is always the case, but may
change in the future if the relevant part is modified

e.g. do_something && return 0

the proper form is:
do_something
return 0

also do this for unconditional exits

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-08 06:34:12 +00:00
Leah Rowe 5f6ba01d41 include/option.sh: fix i945 bootblock copy
it wasn't being copied right

the roms under elf/ were being copied, but not the ones
under bin/ - i need to audit it further

for now, i run modify_coreboot_roms from build/roms
instead of update/trees

so, the ones under elf/ no longer have bootblocks copied.
it's only done in bin/

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-25 12:58:52 +01:00
Leah Rowe 31b35bb4ce include/git: fix error caused by sh idiosyncrasy
when [] is used right at the end of a function, or
certain loops/subshells, some sh implementations will
just return a non-zero exit

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-20 09:11:29 +01:00
Leah Rowe 182ee8e416 update/trees: don't run make if mode=fetch
this fixes a regression caused by a previous revision

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-20 08:45:57 +01:00
Leah Rowe 6af65ad430 error handling code cleanup and fixes
in some cases, use of x_ or xx_ can be error-prone,
due to the way $@ is handled; commands requiring
quotes, or with funny file names as arguments such
as spaces in the file name, or other special
characters, can make the x/xx functions break.

in those cases, where x/xx must not be used, the
commands use || err instead

in other cases, use of x/xx is superfluous, and has
been removed in some commands.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-20 05:03:16 +01:00
Leah Rowe 4e54a051ef another code cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-20 03:29:55 +01:00
Leah Rowe 8d9aeef3de lbmk: use 2-level directory structure in script/
as opposed to the current 3-level structure.

recent build system simplifications have enabled
this change, thus:

./build fw coreboot -> ./build roms
./build fw grub -> ./build grub
./build fw serprog -> ./build serprog
./update project release -> ./update release
./update project trees -> ./update trees
./update vendor download -> ./vendor download
./update vendor inject -> ./vendor inject

alper criticised that the commands were too long,
so i made them shorter!

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-20 01:00:38 +01:00