Commit Graph

1191 Commits (2c7f83bc83d86aa3d7b9e961f6f9fef40f17cecf)

Author SHA1 Message Date
Leah Rowe 5494ffb3d1 build/firmware/coreboot: confirm compiled roms
return with error status if no images were compiled

if a rom image fails to compile, then it will also
exit with error status, but sometimes you can pass
argument "cros" or "default", and it would not give
you rom images due to no target.cfg files, but these
are also ignored because of that.

this restores the same behaviour that existed before,
for this final error check.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-06 03:03:31 +01:00
Leah Rowe ce10c1b38c build/firmware/coreboot: support "all" without all
with no argument specified, it is now possible to build
every rom image.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-06 02:53:37 +01:00
Leah Rowe 2d483d2f5c move build/release/* to update/release
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-06 02:33:53 +01:00
Leah Rowe 315d0c4572 mv build/fw/serprog,build/boot/roms build/firmware
./build boot roms is now: ./build firmware coreboot

./build fw serprog is now: ./build firmware serprog

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-06 02:26:18 +01:00
Leah Rowe 863081c369 remove build symlink, rename lbmk to build
re-link update to build

build/update are the only two build modes now

i'm on a crusade to reduce the number
of files and directories, and reduce the number
of source lines, while not reducing functionality

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-06 02:12:52 +01:00
Leah Rowe 2d16e1ee47 rename build/project/trees to update/project/build
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-06 01:59:13 +01:00
Leah Rowe 1c2de7f962 unify build/grub/* to build/coreboot/grub
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-06 01:34:14 +01:00
Leah Rowe 176722a841 unify handle/make/* into build/project/trees
Just one script.

Just one.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-06 01:16:39 +01:00
Leah Rowe 9d419e77a0 handle/make/*: unified main() function
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-05 22:51:05 +01:00
Leah Rowe 106841024a general code cleanup in shell scripts
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-05 22:16:07 +01:00
Leah Rowe cad7648a26 build/boot/*: merge all logic into one script
for the first time ever, this is a single script.
with recent simplifications in how variables are
handled, and techniques i've developed during
auditing, it's now feasible design-wise for this
to be a single script, without a helper script.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-05 03:48:05 +01:00
Leah Rowe 923a96c18e check git/version: properly call err()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-04 10:02:59 +01:00
Leah Rowe 1223bfaeef check_git: call fail() first (fallback to err)
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-04 10:00:12 +01:00
Leah Rowe 727dc7ff2f more verbosely print git config error
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-04 09:57:42 +01:00
Leah Rowe fbd464b4f7 include/err.sh: checkgit,checkversion
call these as functions, instead of executing scripts

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-04 08:06:10 +01:00
Leah Rowe e638c3e411 update/project/trees: remove errant assignments
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-03 13:36:48 +01:00
Leah Rowe 68e1787cec update/project/trees: split up main()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-03 13:21:30 +01:00
Leah Rowe 5de8eda21c general code cleanup in shell scripts
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-03 12:59:49 +01:00
Leah Rowe 334aa1f7c9 handle/make/config: fix formatting on variables
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-03 03:10:40 +01:00
Leah Rowe 8097baa0bd handle/make/file: check for all default makefiles
Previously, this script only checked for "Makefile",
but "makefile" is another valid name; additionally, if
GNU Make is used, "GNUmakefile" is an accepted default.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 23:46:20 +01:00
Leah Rowe 0db6c0a4a8 update/blobs/download: remove errant comment
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 22:39:25 +01:00
Leah Rowe 3af63fb8b7 handle/make/file: exit 0 if no makefile
There is no reason to err if no Makefile exists.

Just exit with zero status. This makes the following
command work:

./handle make file -c util/*

Within util/, there is me7 update parser which does
not have a makefile (it's a python script).

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 22:37:09 +01:00
Leah Rowe ad74b4c281 handle/make/file: run extra arg before, not after
The previous patch to the file was correct, except for
off by one at the end, resulting in no argument being
passed for project names.

Now the extra commands are run *before* handle_dependencies,
instead of running at the end of main. This prevents error.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 22:21:42 +01:00
Leah Rowe 2e60e11798 grub.cfg: disable the pager
The pager causes trouble in some cases, where the user has
to press enter at boot time depending on the configuration.

Interactive use is one thing, but we should leave this
disabled for smoother experience. If the user *wishes* to
use the shell, they can always just enable the pager
themselves by doing:

set pager=1

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 22:03:10 +01:00
Leah Rowe d9719cae49 handle/make/file: do multiple project arguments
At the end of the function, this script will now
run itself again if there are more arguments. This
enables the following:

./handle make file -c project1 project2 project3

Whereas previously, it could only do this:

./handle make file -c project1

Substitude -b and it's the same.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 22:00:59 +01:00
Leah Rowe cb29c96c74 lbmk: simplify/correct exit commands / cleanup
general code cleanup, but a few exit commands were also
wrong. for example, relying on listitems to always return
zero status and then calling lbmk_exit 1

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 09:03:10 +01:00
Leah Rowe 9dce8236ef update/project/trees: fix error handling on mkdir
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 05:56:14 +01:00
Leah Rowe 0f86a393ac update/project/trees: optimise error handling
some x_ calls are made that aren't needed. this is now
corrected. additionally, some x_ calls were being made
that are quite error-prone, like ones that use $PWD.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 05:47:49 +01:00
Leah Rowe 67ac799d49 update/project/trees: simplified error handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 05:21:20 +01:00
Leah Rowe d38b958d7a include/err x_(): more verbose error message
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 04:57:51 +01:00
Leah Rowe 8886f9958f include/err: remove unused variable
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 04:56:53 +01:00
Leah Rowe cd2caecb73 update/project/trees: general code cleanup
reduced sloccount, without reducing functionality

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 04:53:22 +01:00
Leah Rowe bcbd3734b3 update/project/trees: rm yet another rm line
good lord, redundancy is indeed redundant.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 04:43:18 +01:00
Leah Rowe 0a63dce35e update/project/trees: remove one more rm line
the one at the end of main is unnecessary, because
it's handled inside the for loop.

this file isn't used anywhere else, so it's OK.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 04:41:48 +01:00
Leah Rowe 91c0f942f3 update/project/trees: remove redundant rm command
as it turns out, i delete "seen" inside the for loop,
which is a more thorough way to do it.

thus, the first rm command is unnecessary.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 04:40:11 +01:00
Leah Rowe 7bead4f55a update/project/trees: remove unnecessary linebreak
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 04:38:55 +01:00
Leah Rowe 1dd97470e7 update/project/trees: rm "seen" in the right place
it must be done *after* setting cfgsdir

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 04:37:29 +01:00
Leah Rowe a3b3196d6c build/grub/payload: remove unnecessary linebreaks
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 04:32:50 +01:00
Leah Rowe 3fcad603b2 build/coreboot/utils: remove unnecessary check
the file check is sufficient (target.cfg)

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 04:17:50 +01:00
Leah Rowe 0a711ebc66 build/coreboot/utils: simplify argument handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 04:16:43 +01:00
Leah Rowe 7ce3f93e44 build/boot/*: unify more logic in main()
slight sloccount reduction. light renaming of
functions between the two scripts, placing more
logic in main() under include/boot.sh

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 03:54:39 +01:00
Leah Rowe 7b02bb9aa6 do not handle errors on mktemp in shell scripts
errors are not defined for mktemp, and the /tmp file
system should be assumed reliable.

if /tmp is *unreliable*, then this is not something that
lbmk either can or should fix; the user clearly has
bigger problems.

manpages for mktemp do not define errors. it is assumed
to be completely reliable.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02 03:39:10 +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 5f914a4d00 build/boot/roms: optimise main() for code size
handle everything in the getopts loop

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-01 04:30:02 +01:00
Leah Rowe 92c6da7b21 build/boot/roms_helper: shorten variable names
also: further reduce the number of arguments passed,
to certain functions as and when feasible, in cases
where those are global variables that never change.

the cbfstool argument in mkUbootRom wasn't even used.
that function was only using the global variable, which
again is only set once.

i also shortened a few messages, removed a few errant
line breaks and reduced sloccount by exactly 1 in main()
by re-arranging how the shift command is used.

it's mainly about shortening variable names, to then
reduce the number of line breaks, but it's a surgical
code size reduction in build/boot/roms.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-01 04:08:30 +01:00
Leah Rowe 2a6fcf7022 build/boot/roms: dont do init/displaymode argument
These are only ever initialised globally, and set once.
Other instances where they are set are only in cases
where they are passed as argument, at the start of
a function, so they are being *needlessly* re-set.

Set them only once and use them globally.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-01 01:18:20 +01:00
Leah Rowe 42d4fa9b12 include/boot.sh: simplify variable initialisation
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-01 01:17:59 +01:00
Leah Rowe 9bc9dddf64 build/boot/roms_helper: simplify rom file handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30 23:23:09 +01:00
Leah Rowe c477599c78 build/boot/roms_helper: general code cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30 22:27:39 +01:00
Leah Rowe 26fc3f1325 general code formatting cleanup in shell scripts
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30 20:06:29 +01:00