summaryrefslogtreecommitdiff
path: root/script/trees
AgeCommit message (Collapse)Author
3 daysscript/trees: merge with mk and delete script/Leah Rowe
script/ no longer exists. this means that the only executable script in lbmk is now mk. script/trees was never called directly; instead, we used ./update trees in the past, then just ./mk. this is part of a larger audit to simplify lbmk, in preparation for the next Libreboot release. Signed-off-by: Leah Rowe <leah@libreboot.org>
3 daystrees: unify the execution of mkhelper commandsLeah Rowe
provide it in a new function: mkhelp() Signed-off-by: Leah Rowe <leah@libreboot.org>
3 daystrees: tidy up configure_project()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
3 daystrees: don't build dependencies if dry=":"Leah Rowe
build_depend is already blanked anyway, but it can't hurt to have an extra check here. Signed-off-by: Leah Rowe <leah@libreboot.org>
3 daystrees: unified handling of flagsLeah Rowe
this way, the error message will never be incorrect, which i had to fix in a recent patch. now, the same string is used for error messages and getopt. Signed-off-by: Leah Rowe <leah@libreboot.org>
3 daystrees: simplified handling of badhash/do_makeLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
3 daystrees: don't set mode on ./mk -bLeah Rowe
mode is already initialised as an empty string Signed-off-by: Leah Rowe <leah@libreboot.org>
3 daystrees: don't set mod on ./mk -dLeah Rowe
mode is already initialised as an empty string Signed-off-by: Leah Rowe <leah@libreboot.org>
3 daystrees: don't initialise mode to "all"Leah Rowe
this is not necessary. the fetch mode is still handled, as before, and no make commands will run in this case. Signed-off-by: Leah Rowe <leah@libreboot.org>
3 daystrees: clean up some commentsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
4 dayslbmk: unified PWD handling (work directory)Leah Rowe
instead of running pwd all the time, run it once in lib.sh, and export PWD. for lbmk-specific use of PWD, use xbmkpwd, which contains the value of PWD as was set by the pwd utility in lib.sh. many parts of lbmk rely on pwd, and it *must* be correct. this change adds basic error handling, since pwd can in fact return errors in some cases. Signed-off-by: Leah Rowe <leah@libreboot.org>
4 daysmove XBMKPATH to include/lib.shLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
4 dayslbmk: use pwd util, not PWD environmental variableLeah Rowe
PWD could be anything, if the user manually exported it before running lbmk. always run pwd instead, to get the real string. Signed-off-by: Leah Rowe <leah@libreboot.org>
4 daysclean 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>
4 daystrees: err if first argument is not a flagLeah Rowe
E.g. ./mk -f coreboot is valid ./mk coreboot -f is not valid Signed-off-by: Leah Rowe <leah@libreboot.org>
4 daystrees: err if no argument givenLeah Rowe
We were already covering this from the main build script, but it's good to also check it here. Signed-off-by: Leah Rowe <leah@libreboot.org>
4 daystrees: set dry=":" on ./mk -fLeah Rowe
We don't want any build commands to run, when the -f flag is used. Signed-off-by: Leah Rowe <leah@libreboot.org>
4 daystrees: clean up initialisation of the dry variableLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
4 daystrees: initialise mode to "all", not ""Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
4 daystrees: don't abuse the mode variable on -fLeah Rowe
The "mode" variable is used as a suffix for make commands, for example ./mk -m sets mode to "menuconfig", which means you want to run "make menuconfig". When fetching sources (./mk -f), I was setting mode to "fetch", and putting checks in code to avoid use of make when mode was set to "fetch". The behaviour now is identical, except that a new variable called "do_make" is set to "n" when doing ./mk -f, otherwise set to "y", and this is checked instead. This should make the meaning of the code somewhat clearer. Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daystrees: Add missing flag to error outputLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
9 dayslbmk: minor code formatting cleanupLeah Rowe
some lines were needlessly condensed, and less readable Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-01-05set up python in PATH, ensuring that it is python3Leah Rowe
we already check the python version, and set a variable for it, so that we can reliably use python3, even if python in PATH doesn't correspond to python3. for example if a system has python as python2 and python3 as python3 well, we use that when running deguard for example, but various upstream projects that we use may need python, and all of them use python3, not 2 so, re-use the python variable set up by lbmk, and set it up in PATH accordingly. this now makes the note about python3 obsolete, on docs/build.md in lbwww.git Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-01-03update my copyright years on modified scriptsLeah Rowe
there are some lbmk scripts that i modified, starting this year. update the headers. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-01-03Revert "fix more unescaped quotes in eval"Leah Rowe
This reverts commit ec6bcc1fba5fbdf8b19b3d1cf9711f3d4c9c3741.
2025-01-03fix more unescaped quotes in evalLeah Rowe
it should fix more build errors that might have appeared in the aforementioned revision, mentioned in the previous commit message Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-01-02fix lbmk shellcheck errorsLeah Rowe
There was also a condition in run_make_command that is now an OR, where it was an AND, on script/trees, to fix the use of mixed (and erroneous) OR/AND operators. I'm planning a much more invasive audit than this. These are light fixes, intended for Libreboot 20241206 rev8. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-12-30move xbmkpath to XBMK_CACHE/Leah Rowe
When doing ./mk release, the build system would create symlinks inside xbmkpath/ relative to the current work tree, which will differ from what's in PATH. Since XBMK_CACHE is already set globally, from the main work tree and the release-build work tree, that means we can know reliably that PATH is always correct if we put xbmkpath/ inside XBMK_CACHE. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-12-30Revert "Remove legacy update/vendor commands"Leah Rowe
This reverts commit 781320514623653077cda2d910b9baf150949bd1. I'm doing changes for 20241206 rev8. It was a mistake to remove these; they will be removed again, after rev8. The documentation standardised on ./mk a while ago now, and it's almost time to remove these commands. However, anyone using the old commands ought to be able to, up to and including any revision of the Libreboot 20241206 release. It is my intention that these legacy commands finally be removed for the next testing release, as part of a much wider build system audit that I'm doing between now and then. (Libreboot Build System Audit 7 is underway, and several of these early audit7 changes are going on 20241206 rev8; after that, I will create a branch named 20241206_branch off of rev8, and anything in master from then on will contain much wilder changes, with more conservative changes in 20241206_branch) Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-12-30trees: remove unnecessary subshellLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-12-30trees: only symlink host gcc/gnat to build xgccLeah Rowe
In general, we don't want to mess with the hostcc, unless we have to. To avoid other breakage, clear what we did after crossgcc has compiled. This is a follow-up to the previous patches, matching gcc to gnat versions and vice versa, when compiling crossgcc. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-12-30trees: correction on check_gnu_pathLeah Rowe
i intend for this function to work generically, matching gnat to gcc or gcc to gnat, but there was a hangover from the previous code where it specifically assumed we were matching gnat this bug manifested when i tested with gnat being v13 and gcc being v14 in path, where gcc-13 was also available in path. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-12-30trees: match gcc/gnat versions both waysLeah Rowe
on debian trixie/sid after updating from stable, sometimes gcc 13 and gnat 13 are both available, but gcc resolves to gcc-14 and gnat-14 isn't available. even when gnat-14 and gcc-14 are available, gnat will still either resolve to gnat-13, or nothing at all. in cases where gnat-14 is unavailable, but gcc and gnat 13 are both available, we should match gcc to gnat. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-12-30Merge path.sh into script/treesLeah Rowe
The code is simple enough now that I'm happy for it to just be part of the main script. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-12-30Fix globbing issue in lbmkLeah Rowe
When doing e.g. $@ we should use double quotes to prevent globbing. Thanks go to XRevan86 for pointing this out. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-12-30Mitigate Debian Trixie/Sid GCC/GNAT version mismatchLeah Rowe
When I tested Debian Trixie, and Debian Sid, I saw that GCC in PATH pointed to gcc-14, but gnat in path pointed to GNAT-13, even if you manually install gnat-14. GNAT 14 was marked experimental, but GCC 14 was marked for use, in the apt repositories. So this patch doesn't address the mismatch when doing e.g. apt-get install gcc gnat I will address the actual package dependency in a follow-up patch, on the Debian dependencies config. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-12-02Revert "trees: Allow using a custom clean command"Leah Rowe
This reverts commit 5b4c9158e5a79f8d7e776c8c4ece69dda5aa8690.
2024-12-02trees: Allow using a custom clean commandLeah Rowe
On coreboot for example, as Mate has told me, if you're making Kconfig changes and re-compiling, sometimes the actual image that you build might still have the old one in it, due to how coreboot's build system works. To mitigate this, you can just always run distclean before doing the build, but lbmk was doing just clean. In practise, we did not find any issues, but this change should be harmless, and might prevent such issues in the future. It's even possible that we might have already encountered this before and not realised, and we were just lucky that no noticeable issues were caused. It's *also* possible that the reverse is true: an issue that was previously covered up, then that issue will now be exposed. However, if that turns out to be true, then that is good because we are exposing said bugs and then we will know to fix them! Anyway, the variable in target.cfg is: cleancmd="whatever_you_want" e.g. cleancmd="distclean" You may also specify this in global mkhelper.cfg files, per project; I've already done this for SeaBIOS, coreboot and U-Boot, since all of these use Kconfig files. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-11-29trees: reset PATH per-targetLeah Rowe
Otherwise, if PATH was set before, it will be re-used again in the next pass. We previously unset CROSS_COMPILE to avoid using the wrong cross-compiler when switching to another target within a multi-tree project such as U-Boot. Well, PATH was also being set, to use coreboot xgcc first. This is fine, but the next target may not use the same one. This patch solves a similar problem to the following patch which was mentioned above: commit 637c0a1521a03e3f65de85dcc5ffd478b37a5360 Author: Leah Rowe <leah@libreboot.org> Date: Tue Nov 19 02:52:28 2024 +0000 trees: unset CROSS_COMPILE per target Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-11-19trees: unset CROSS_COMPILE per targetLeah Rowe
When building a coreboot image, if they enable the x86 U-Boot payloads, sometimes what happens is you have CROSS_COMPILE set, for i386-elf, but then it's still set to that when later building 64-bit U-Boot, which needs x86_64-elf. We currently rely on hostcc to build U-Boot. To mitigate this, unset CROSS_COMPILE in the main loop of the trees script, for building project targets. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-11-03Experimental U-Boot payload (32-bit dtb, U-Boot)Leah Rowe
NOTE: Support added for xarch target x86_64-elf, but U-Boot failed to build with this error: OBJCOPY lib/efi_loader/helloworld.efi x86_64-elf-objcopy: lib/efi_loader/helloworld_efi.so: invalid bfd target make[2]: *** [scripts/Makefile.lib:476: lib/efi_loader/helloworld.efi] Error 1 Since I'm building U-Boot for x86_64 *on* an x86-64 host, and since that is currently the recommended type of machine to use for lbmk development, and since the other x86 payloads currently don't cross compile anyway, this is an acceptable compromise for now. This is because at present, I'm not making U-Boot the primary payload on x86, instead preferring to chain it from GRUB and SeaBIOS. The target.cfg file for x86 u-boot shows xarch/xtree commented. Uncomment these to compile on crossgcc instead of hostcc. I mention 64-bit because I initially did this first, but decided to do 32-bit first. I'll work on the 64-bit one next (SPL). It's only enabled in QEMU for now. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-10-273050micro: Re-enable SeaGRUBLeah Rowe
Remove what is now unnecessary bloat, for ensuring that GRUB is the primary payload; SeaGRUB is the only preference, as per lbmk design. The SeaBIOS hanging issue was fixed, so SeaGRUB is OK now. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-10-06dell3050micro: make GRUB the primary payloadLeah Rowe
SeaBIOS is known to hang on this board. It is being investigated. Add two variable options for target.cfg files: * seabiosname * grubname This string defines where it would be located in CBFS. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-09-26Add Sony PlayStation support to LibrebootLeah Rowe
I also added a "cleanargs" argument, similar to the makeargs argument, to work around a build error. This builds the PCSX-Redux PS1 BIOS. They reverse engineered the Sony PS1 BIOS and wrote a free one under MIT license. Run this: ./mk -b pcsx-redux The file will appear: bin/playstation/openbios.bin Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-28lib.sh: new function mk() to handle trees in bulkLeah Rowe
single-tree projects cannot be handled in bulk, e.g. ./mk -f project1 project2 project3 that is still the case, from the shell, but internally it is now possible: mk -f project1 project2 project3 mk() is a function that simply handles the given flag, and all projects specified. it does not handle cases without argument, for example you cannot do: mk -f arguments must be provided. it can be used internally, to simplify cases where multiple single-tree projects must be handled, but *also* allows multi-tree projects to be specified, without being able to actually handle trees within that multi-tree project; so for example, you can only specify coreboot, and then it would run on every coreboot tree. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-26general code cleanup in the build systemLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-22trees: initialise badhash no n, not empty stringLeah Rowe
this is another alternative to the previous fix. this one is therefore now a pre-emptive fix, in case other code is written in the future that makes use of badhash. the badhash variable in a y/n variable, so initialise to n. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-19put cachedir in environmental variableLeah Rowe
XBMK_CACHE is now used, instead of hardcoding cache/ this is exported initialised to cache/, if unset. this means you can set your own directory, and it means ./update release will use the same directory. this means bandwidth wastage is further avoided. Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-17trees: hardcode makeargs for xgccLeah Rowe
if coreboot itself is being handled, crossgcc has the correct makeargs, setting the number of build threads. however, other projects can specify "xtree" pointing to a given coreboot tree, and build crossgcc for it. one workaround may be to use trees -d coreboot TREE, but then extra code would have to be written to make it avoid other things like building cbfstool, which is not required for just building crossgcc. the cleanest way to do it is to simply hardcode it. the value is set exactly the same as regular coreboot makeargs. this fixes a bug, where some builds of crossgcc are made on a single thread, rather than using XBMK_THREADS. this patch forces it to always use CPUS=$XBMK_THREADS Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-17trees: remove unnecessary commandLeah Rowe
we no longer need to remove cache/ per project, because it's removed in bulk at the end, in the main build script, when generating release archives. Signed-off-by: Leah Rowe <leah@libreboot.org>