summaryrefslogtreecommitdiff
path: root/script/build
AgeCommit message (Collapse)Author
2023-10-20lbmk: use 2-level directory structure in script/Leah Rowe
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-19minor code cleanup in shell scriptsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-15delete include/vendor.sh and merge elsewhereLeah Rowe
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-14build/fw/coreboot: Fix misuse of raw u-boot.bin as payloadAlper Nebi Yasak
The "u-boot.bin" file generated by U-Boot builds is a raw binary. When adding payloads to a CBFS, we need to use ELF files with add-payload or manually pass the entry point and load address of the payload binary with add-flat-binary. We primarily use the "u-boot.elf" which gets build with the REMAKE_ELF option, as it also has the necessary device-tree binary that U-Boot usually needs to work. When the option is not set (e.g. for QEMU), we need to use the "u-boot" file which is an ELF. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-13put space in the warning message about elf/Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-13only build cbutils if requiredLeah Rowe
it's sometimes done unconditionally. this change ensures that it is not repeated needlessly. i observed otherwise that cbfstool would be re-built from time to time, even if it was built. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-10build/fw/coreboot: fix bad commands in help textLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-10build/fw/coreboot: warning about bin/ versus elf/Leah Rowe
also rename elf/coreboot to something scary some users were flashing roms built under elf/, which lack payloads. lbmk builds no-payload roms (and payloads) under elf/ then inserts them, creating full (flashable) images under bin/ Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-09disable 32-bit memtest86plus, only build 64-bitLeah Rowe
some users reported build errors. technically, there's nothing wrong with lbmk but it relies on hostcc, and hostcc is hit or miss when it comes to cross compiling 32-bit, depending on the build system of whatever project. lbmk needs to handle cross compilation. for now, i'm just disabling memtest86plus on non-64-bit hosts. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07build/fw/coreboot: reset grub background each timeLeah Rowe
the script used to be called once per target, now it handles every target. the grub background image wasn't being set, so if it changed at build time, it would stay changed. keep the default in place for each run, while still allowing target.cfg files to change it per target. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07update/project/*: merge to update/project/treesLeah Rowe
Just one script. Just one! Well, two, but the 2nd one already existed: logic in update/project/trees and update/project/repo was merged into include/git.sh and update/project/build was renamed to update/project/trees; an -f option was added, which calls the functions under git.sh so git clones are now handled by the main build script (for handling makefiles and defconfigs) but the logic there is a stub, where git.sh does all the actual heavy lifting this cuts the file count down by two, and reduces sloccount a reasonable amount because much of the logic already exists in the build script, when it comes to handling targets. git.sh was adjusted to integrate with this, rather than act standalone Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07build/fw/grub: re-add end confirmation messageLeah Rowe
otherwise, if src/grub/ was already compiled, this would not print anything on the screen. however, the files will have been created under elf/grub this message just makes lbmk a bit more user friendly Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07build/coreboot/grub: move to build/fw/grubLeah Rowe
This eliminates an additional subdirectory. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07use quotes when checking empty strings in scriptsLeah Rowe
this is far less error-prone Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07build/fw/coreboot: fix error "unexpected operator"Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07build/coreboot/util: merge to update/project/buildLeah Rowe
The benefit now is that it can be cleaned. E.g. ./update project build -b coreboot utils ./update project build -b coreboot utils default ./update project build -c coreboot utils ./update project build -c coreboot utils default the update/project/build script checks when arguments are provided after the project name. if the first one is "utils", then it acts in the same way as the old build/coreboot/util script Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07build/fw/coreboot: don't support no-all all argLeah Rowe
it's buggy. "./build fw coreboot" was made to work, but it caused lots of unknown issues when mixing other args the old way wasn't broken. now, once again, you must pass the "all" argument. e.g.: ./build fw coreboot all Also, the confirmation messages at the end are a bit clearer, when listing which ROM images were compiled. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07build/fw/coreboot: correctly check built targetsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07unified projectname/version/versiondate handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07rename blob/ to vendor/Leah Rowe
in the future, we may start downloading files that aren't blobs, such as mxm port configs (on mainboards that use MXM graphics) this directory will contain all of those files generally change the language used, across lbmk, to make use of "vendorfile" instead of "blob" Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07put all src downloads under src/Leah Rowe
build/release/src was partly re-written to accomodate this memtest86plus was patched to have a central Makefile, and lbmk modified to use that, rather than mess with build32 and build64. the central Makefile just builds both targets or cleans both targets Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-06rename build/firmware/ to build/fw/Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-06build/firmware/coreboot: confirm compiled romsLeah Rowe
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-06build/firmware/coreboot: support "all" without allLeah Rowe
with no argument specified, it is now possible to build every rom image. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-06move build/release/* to update/releaseLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-06mv build/fw/serprog,build/boot/roms build/firmwareLeah Rowe
./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-06rename build/project/trees to update/project/buildLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-06unify build/grub/* to build/coreboot/grubLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-06unify handle/make/* into build/project/treesLeah Rowe
Just one script. Just one. Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-05handle/make/*: unified main() functionLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
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-04include/err.sh: checkgit,checkversionLeah Rowe
call these as functions, instead of executing scripts Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-03general code cleanup in shell scriptsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02handle/make/file: do multiple project argumentsLeah Rowe
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-02build/grub/payload: remove unnecessary linebreaksLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02build/coreboot/utils: remove unnecessary checkLeah Rowe
the file check is sufficient (target.cfg) Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-02build/coreboot/utils: simplify argument handlingLeah Rowe
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-02do not handle errors on mktemp in shell scriptsLeah Rowe
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-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-10-01build/boot/roms: dont do init/displaymode argumentLeah Rowe
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-09-30build/boot/roms_helper: simplify rom file handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30build/boot/roms_helper: general code cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30general code formatting cleanup in shell scriptsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-30simplify initialising variables in shell scriptsLeah Rowe
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>