summaryrefslogtreecommitdiff
path: root/include/rom.sh
AgeCommit message (Collapse)Author
16 hoursxbmk: rename the "dry" variable to if_not_dry_runLeah Rowe
and add a line break where it is used now it is essentially a macro of sorts, used in terms of syntax, to mean the same as: if [ "$dry" != ":" ]; do thing fi in this case, we say: $if_not_dry_build \ thing yes. macros in sh are a thing. Signed-off-by: Leah Rowe <leah@libreboot.org>
19 hoursxbmk: remove the setcfg functionLeah Rowe
this allows me to remove several eval calls, and the errors relating to configs can now show exactly which function they occured in, allowing for easier debugging. once again, eval should be used sparingly if at all. Signed-off-by: Leah Rowe <leah@libreboot.org>
21 hoursxbmk: general cleanup: unroll condensed code linesLeah Rowe
i overlooked a number of lines, during previous cleanup Signed-off-by: Leah Rowe <leah@libreboot.org>
3 daysrom.sh: remove superfluous eval statementLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysrom.sh: support "fspgop" init modeLeah Rowe
for all intents and purposes, this functions like libgfxinit corebootfb, but uses intel fsp's video initialisation instead of coreboot's native initialisation code this is currently in use on the x2e n150 mainboard, whose config is dubiously named "libgfxinit_corebootfb" now the config can be renamed, and will be, in the next commit. Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysrom.sh: remove TODO noteLeah Rowe
the return is necessary when release=n while doing release builds, because it prevents a build error since the given images don't exist in that scenario. Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysxbmk: tidy up some if statementsLeah Rowe
this is an extension of the previous work to unroll most of the condensed code lines. Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysmake notices a bit more readableLeah Rowe
add line breaks, so that the license and author are visually separated. this makes it easier to read. Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysxbmk: cleanup of recent code refactoringLeah Rowe
be a bit less pedantic about if else clauses. leave the big ones still with then on separate lines, where else is specified. also unroll a few condensed code lines where i missed a few. sloccount 2303 in lbmk. that's still only slightly bigger than libreboot 20260907 which was 2180, and still much smaller than libreboot 20230625 which was 3322. this is *without* the condensed codelines, so now the only thing that's reduced is the overall amount of logic present in the build system. and i should clarify that lbmk is presently much more powerful than both of those two versions (20160907/20230625). the 2016 one is useful for comparison historically, since that was the last major version of libreboot prior to the great second coming of leah in 2021; and the 2023 june release was basically the last one before the great audits of 2023 to 2025 began. not to brag (not much anyway), but all of this means that lbmk is an insanely efficient build system, considering all the features it has and what it does. i unrolled the condensed code style in lbmk, making the scripts a lot easier to read, because i received complainst about the condensed style previously used; nicholas chin and alper nebi yasak both told me that it sucked, and riku viitanen had hinted at that same fact several months prior. so hopefully now, lbmk is a bit nicer. those and other people often find it challenging to challenge me because for reason they assume i'll get upset and fly off the handle, but it's the opposite. i want constant criticism, so that i know to improve! Signed-off-by: Leah Rowe <leah@libreboot.org>
12 daysrom.sh: unroll condensed code linesLeah Rowe
ditto to last commit Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-18Revert "xbmk: don't use backticks for command substitution"Leah Rowe
This reverts commit 4999a49de39667b3239fc2010d0e99c958b29417.
2025-09-13xbmk: much more verbose error messagesLeah Rowe
use the new functionality in err(), whereby a given function name and arguments can be provided, for debugging purposes. something similar was already done in a few places, and replaced with this unified functionality. this patch will make xbmk much easier to debug, under fault conditions. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-11xbmk: don't use backticks for command substitutionLeah Rowe
the newer way handles escaped characters better, and it can be nested more easily. it's also more readable. personally, i prefer the old way, because it's more minimalist, but it occurs to me that a lot of people nowadays don't know about backticks, but they do know of the modern way. to make the code more readable, i have modernised it. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-02rom.sh: simplify rmodtool copy handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-01lib.sh and rom.sh: stricter mktemp usageLeah Rowe
error out under fault condition Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-08-23rom.sh: safer use of cat in copyps1biosLeah Rowe
the output to a file also has its own error handling, but x_ can be used safely to provide additional assurance that the script will break if an error occurs. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-08-01rom.sh: Don't run mkhelpers if release=nLeah Rowe
This fixes the following error on ./mk release: cp: cannot stat 'elf/coreboot/default/d510mo/libgfxinit_txtmode/coreboot.rom': No such file or directory I recently re-wrote the handling of coreboot images, and I overlooked this entirely. When a given target specifies release=n, it has to be skipped, so builds are not done. The "release" variable is already checked, in mkcoreboottar. Let's also put it in the other mkhelper functions, to make sure there are no errors. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-07-10rom.sh: Don't build coreboot utils if dry=":"Leah Rowe
This fixes a build error when doing ./mk release, after a regression caused by the last few commits. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-07-10cache coreboot builds in elf/ againLeah Rowe
This was a problem when I did it before, because individual target builds weren't automatically re-compiled when needed. The recent design improvements in lbmk enable this to be done again. Cached images in elf/ have no payloads, so they are a liability, therefore they are padded by one byte to prevent flashing. This solves the problem that the previous caching had. With this change, modifying payloads can be tested without needing to re-build coreboot each time. The cached coreboot builds are also automatically re-built when needed, which is another improvement this time, compared to the last time coreboot builds were cached in this manner. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-07-08tree.sh: Place target builds under tree/target/Leah Rowe
as opposed to target/ for example: image the command: ./mk -b u-boot amd64coreboot This would put the U-Boot binaries here: elf/u-boot/amd64coreboot/default/ With this change, they now go here: elf/u-boot/x86_64/amd64coreboot/default/ This solves a problem that existed previously, where you could modify a given tree in a multi-tree project, but cached builds for targets branching separately off of each tree would not be deleted, and thus not re-built. This accomplishes such a result, without needing to further check hashes of individual targets. The latter will still be done, in a future change, because this change doesn't fix another problem: If you change a given config, e.g. targetname "foo" which uses tree "bar", elf/foo/ would not be removed automatically for re-build. So this change only deletes individual target builds when their master tree changes. Where the target and tree are the same, this also means elf/tree/target/ for example: seabios/default would create binaries in: elf/seabios/default/default/ not: elf/seabios/default/ Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-07-08rom.sh: bump pcsx-redux copyright date to 2025Leah Rowe
it's 2019-2025 now, not 2019-2024, because i recently imported new pcsx-redux upstream changes that go up to June 2025. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-27put coreboot utils in elf/coreboot/TREELeah Rowe
not elf/UTIL/TREE This way, they are automatically deleted when a tree has to be re-built. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-26xbmk: rename xbmklocal/xbmktmp variablesLeah Rowe
shorten them Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-25rom.sh: simplify mkcoreboottar()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-25rom.sh: rename mkvendorfilesLeah Rowe
it mainly does general tasks, like handling utils and enabling ccache. the vfiles are a small part. rename the function accordingly. it is called by premake, so let's call it corebootpremake. this change will also make sense when cherry-picked into cbmk, which does not handle vfiles at all. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-25rom.sh: simplify ccache handling for corebootLeah Rowe
we simply do not need to run the make-oldconfig command at all, and after removing it, the "cook" function seemed quite redundant so i merged it with mkvendorfiles() Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-25rom.sh: simplify u-boot payload handlingLeah Rowe
define it with a single variable, rather than several. this allows several checks to be greatly simplified. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-22rom.sh: skip copyps1bios on dry buildsLeah Rowe
otherwise, ./mk -d (without arguments) will fail. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-12rom.sh: reduce indendation in check_coreboot_utilsLeah Rowe
call it via fx_, instead of using a for loop Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-07lib.sh: Simplified fx_() and removed fe_()Leah Rowe
Instead of calling fe_, prefix x_ as indicated. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-07build serprog using fe_ *defined inside mkhelper*Leah Rowe
sh macros ftw Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-07rom.sh: build serprog images with fe_Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-07lib.sh: support any command on find_exec()Leah Rowe
right now, we assume "find", but it adds any number of arguments next to that. change it instead to support any command, where the assumption is that it would generate a list of files and directories. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05rom.sh: Print the rom image path being generatedLeah Rowe
This message used to exist, and it's a nice feedback for the user, to confirm that the build went OK. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05rom.sh: Safer cprom()Leah Rowe
Don't insert special files like GRUB keymaps after copying to the final destination. Instead, copy the tmprom to /tmp and operate on that, in these instances. This is less efficient, depending on the user's configuration; if /tmp is on the same file system as the user's xbmkpwd, it should be fine. However, the actual performance hit isn't that bad in practise, on most setups. If the user's /tmp is a tmpfs, then that means using tmpfs, but it's one image at a time. It should be OK. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05rom.sh: specifically check keymaps in cprom()Leah Rowe
"not seauboot" is a valid check at present, but if i start supporting other arguments in the future, this code would have to change. therefore, i change it in advance, on that theory. this new check is more technically correct. these lines are triggered when inserting grub keymaps. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-05rom.sh: simplify mkseagrub()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-04lbmk: MUCH safer err functionLeah Rowe
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>
2025-05-04rom.sh: tidy up copyps1bios()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-30serprog: Remove pico2 support for the time beingLeah Rowe
Many users report bugs, so I'm reverting lbmk back to only supporting the rp2040 dongles for the time being. The documentation will be updated to reflect this. Pico2 support will be re-added at a later date, once more testing has been done, and fixes made if necessary.
2025-04-26move variables out of init.sh to othersLeah Rowe
move them where they are used, or if they are used in many places, move them to lib.sh Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-26lib.sh: move cbfs() to rom.shLeah Rowe
it is only ever used there, so move it there Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-17lbmk: don't handle TMPDIR directlyLeah Rowe
lbmk creates TMPDIR as /tmp/xbmk_*, but it's theoretically possible that something could re-export it by mistake. this change retains the same initialisation, but further use is now via a new variable "xbmktmp", that stores the value of TMPDIR upon lbmk's initialisation of it. this reduces the chance of such a bug in the future, as described above, so it is a preemptive/preventative fix. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-17rom.sh: minor cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-17rom.sh: remove unnecessary checkLeah Rowe
the cbfs function will call cbfstool, which will perform the same check, and the same error condition would cause the same exit behaviour in lbmk. the error message would also provide output that is just as useful for debugging. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-17lbmk: minor cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-12rom.sh: tidy up error handlingLeah Rowe
same as the last change Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-12rom.sh: minor cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-11clean up a few semicolons in the build systemLeah Rowe
several code lines were condensed together, which make them less readable. make the code more readable by having separate commands on separate lines. i previously did this during my manic build system audits of 2023 and 2024; condensing lines like this is overly pedantic and serves no real purpose. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-04-06lbmk: minor code formatting cleanupLeah Rowe
some lines were needlessly condensed, and less readable Signed-off-by: Leah Rowe <leah@libreboot.org>