summaryrefslogtreecommitdiff
path: root/script/build/boot/roms
AgeCommit message (Collapse)Author
2023-10-05general code cleanup in shell scriptsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-05build/boot/*: merge all logic into one scriptLeah Rowe
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-02build/boot/*: unify more logic in main()Leah Rowe
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-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-10-01build/boot/roms: optimise main() for code sizeLeah Rowe
handle everything in the getopts loop Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-01build/boot/roms_helper: shorten variable namesLeah Rowe
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-09-30build/boot/roms: only do 1 custom kbd/payload/modeLeah Rowe
-k, -p and -d let you set keymap, payload and displaymode respectively, but the handling for this is buggy when passing multiple arguments. Support only one argument, for simplicity. This is how people use them anyway, and it makes lbmk less buggy. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30build/boot/roms: move usage() to include/boot.shLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30build/boot/*: unified main() functionLeah Rowe
The *same* main() function is now used on both scripts. However, merging both scripts together would be less efficient on sloccount, and would be error-prone. The purpose of having roms_helper is that the variables get re-initialised the same way each time, for each board, automatically. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30build/boot/roms: split up handle_targets()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30build/boot/roms: check all targets before buildingLeah Rowe
If one of them doesn't exist, error out. Previously, a build would start but then it would error out later on. This implements the mentality: fail early, fail hard Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30build/boot/roms: merge handle_targets/build_targetLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30build/boot/roms: only run confirm_targets onceLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30build/boot/roms: rename buildrom to build_targetLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30build/boot/roms: split up main()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30build/boot/roms: simplify buildrom() handlingLeah Rowe
Only one for loop is required. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30build/boot/roms: support "all" if argument passedLeah Rowe
e.g. -k ukqwerty previously, this would not work: ./build boot roms -k ukqwerty all only this would work: ./build boot roms all this patch fixes the bug. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30build/boot/roms: move help() to bottom of fileLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-27move build/command/options to include/option.shLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-25Update email address for Leah Rowe copyrightsLeah Rowe
also, some of them were out of date; years now updated. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-25Use SPDX license headers on all scriptsLeah Rowe
This results in much cleaner copyright and license declarations. SPDX headers are legally recognised and make auditing easier. Also, remove descriptions of each script, from each script. Libreboot documentation at docs/maintain/ describes them. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-04build/boot/roms: don't create empty bin/ directoryLeah Rowe
also: only return zero status if rom images were succesfully built, and print a list of each rom image directory based on what was actually compiled, rather than just saying that the rom images are stored under bin/ Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-04merge config/ and resources/Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-03Less cat abuseRiku Viitanen
More than 90% of cats were thus terminated. read (shell built-in) is better at reading, and dogs are better pets. Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-08-27move resources/scripts/ to script/Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>