Commit Graph

1346 Commits (042c7877e91032c46220609c8e8ab9df2f109ee3)

Author SHA1 Message Date
Leah Rowe 042c7877e9 build/roms: simplify seabios dependency check
the update/trees script checks this binary itself, before
deciding whether to recompile/compile, so we don't need
to do such checks here.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-01 17:52:23 +00:00
Leah Rowe fcf2b2bb05 build/roms: simplify grub dependency check
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-01 17:47:43 +00:00
Leah Rowe 535c9007fd add copyright 2024 leah rowe to edited files
i forgot to add 2024 on the copyright years, for my
copyright files that i edited on 1 january 2024

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-01 17:08:38 +00:00
Leah Rowe cea88fa827 git.sh: simplify submodule handling in git_prep
u-boot doesn't use submodules, so there's no point in
checking for it. now we can do with just one call to
the git submodule command, for simplicity

also, general code cleanup in this file (minor code
formatting improvements)

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-01 16:47:16 +00:00
Leah Rowe 1fcbadb8da git.sh: further simplify git_prep
the directory is checked for deletion, but it's already
checked before download, to see whether it already exists.
lbmk already exits with zero status if the directory exists,
so the check is pointless (in this function)

also, general code style/formatting cleanup

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-01 15:27:01 +00:00
Leah Rowe 48551ced3f git.sh: unify am/submodule and tree copying
do it all in a single function!

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-01 15:21:46 +00:00
Leah Rowe ce67c99f40 git.sh cleanup: git am handling (remove patchfail)
the patchfail variable was only needed in the old design,
where git am was being handled inside a subshell, and
also when we did it directly in the target directory
without using a temporary directory. with the current
design, we can just call err() and ditch the tmp repo

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-01 14:32:37 +00:00
Leah Rowe e6953dc4f0 git.sh: clean up handling of tmp_git_dir
delete it once once, and delete it much sooner, right
at the start of script/update/trees main()

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-01 12:41:43 +00:00
Leah Rowe d819403a0b git.sh: fix regression: patches before submodulse
there isn't really a problem right now, but a desired
and implemented behavioural change was that patches are
to be applied *before* updating submodules. well, the
previous commit reversed this change, under certain
conditions, such that submodules were applied first.
this patch fixes it, so that patches are done first.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-01 11:06:06 +00:00
Leah Rowe f4a14bd908 git.sh: clean up git submodule/am handling
unify all of the logic, where git am and submodule is handled

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-01 10:48:58 +00:00
Leah Rowe 11a821637d Bump GRUB to 2.12 release
Actually, it's 2 commits after 2.12, because there was a
patch added afterwards, fixing a build issue on Gentoo.

These changes are present in GRUB 2.12, relative to the
revision that we previously used on lbmk:

* b835601c7 build: Include grub-core/extra_deps.lst in dist
* 8961305b4 Bump version to 2.13
* 5ca9db22e Release 2.12
* 477a0dbd5 efi: Add support for reproducible builds
* dcc1af5d6 efi: Generate stack protector canary at build time if urandom is available
* e424e945c efi: Initialize canary to non-zero value
* 7c8ae7dcb gfxmenu/gui_image: Fix double free of bitmap
* 63fc253fc commands/acpi: Fix calculation of ACPI tables addresses when processing RSDT and XSDT
* f20123072 libnvpair: Support prefixed nvlist symbol names as found on NetBSD
* a13df3d15 bootstrap: Don't check gettext version
* 6d2aa7ee0 kern/mm: Use %x and cast for displaying sizeof()
* b3d49a697 configure: Add RPATH for freetype on NetBSD
* 52dbf66ea configure: Add *BSD font paths
* 2d6a89980 autogen: Accept python3.10 as a python alternative
* 3d4cb5a43 build: Rename HAVE_LIBZFS to USE_LIBZFS
* e4dbe5cfa gnulib: Tolerate always_inline attribute being ignored
* 31e47cfe2 util/editenv: Don't use %m formatter
* f5905f656 osdep/bsd/hostdisk: Fix NetBSD compilation
* cb1824a87 osdep/generic/blocklist: Fix compilation
* 2f3faf02c disk/diskfilter: Remove unused variable
* 3815acc57 build: Tolerate unused-but-set in generated lexer/bison files
* c129e44e7 loader/i386/bsdXX: Fix loading after unaligned module
* 89fbe0cac grub-core/Makefile.am: Make path to extra_deps.lst relative to $(top_srcdir)/grub-core
* 353beb80c util/grub-install: Move platdir path canonicalization after files were copied to grubdir
* f18a899ab util/grub-mkstandalone: Ensure deterministic tar file creation by sorting contents
* ed74bc376 util/grub-mkstandalone: Ensure stable timestamps for generated images
* 069cc46c9 net/http: Fix gcc-13 errors relating to type signedness
* e7a831963 templates: Reinstate unused version comparison functions with warning
* 3f9eace2d util/grub-install: Delay copying files to {grubdir,platdir} after install_device was validated
* e60015f57 efi: Set shim_lock_enabled even if validation is disabled
* e35683317 docs: Improve bli module documentation
* 57059ccb6 bli: Add explicit dependency on the part_gpt module
* 154dcb1ae build: Allow explicit module dependencies
* 17c68472d kern/ieee1275/init/ppc64: Display upper_mem_limit when debugging
* 5f8e091b6 kern/ieee1275/init/ppc64: Fix a comment
* dc569b077 kern/ieee1275/ieee1275: Display successful memory claims when debugging
* 0ac3d938a loader/powerpc/ieee1275: Use new allocation function for kernel and initrd
* 2a9a8518e kern/ieee1275/cmain/ppc64: Introduce flags to identify KVM and PowerVM
* 679691a13 kern/ieee1275/init/ppc64: Rename regions_claim() to grub_regions_claim()
* d49e86db2 kern/ieee1275/init/ppc64: Add support for alignment requirements
* fe5d5e857 kern/ieee1275/init/ppc64: Return allocated address using context
* ea2c93484 kern/ieee1275/init/ppc64: Decide by request whether to initialize region
* 0bb59fa9a kern/ieee1275/init/ppc64: Introduce a request for regions_claim()
* aa7c13226 fs/xfs: Add large extent counters incompat feature support

Most notable in the above log, that are beneficial to Libreboot
users, are:

aa7c13226 which improves XFS support (large extents), which is default
now on many setups.

ed74bc376 which introduces more stable timestamp generation when using
grub-mkstandalone. this is what lbmk uses to generate grub.elf, whereas
grub previously only implemented this fix on mkimage which we don't use

f18a899ab which ensures deterministic (reproducible) tar file creation
by sorting contents (file names / directories). this is done by sorting
the entries

f5905f656 which improves grub build system reliability on netbsd and
openbsd systems - useful for us because an ambition of lbmk is to port
the build system to run on bsd systems, and we will still want grub -
several other of the changes here are beneficial for BSD aswell, all
or most of them by Vladimir Serbinenko

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-31 19:57:30 +00:00
Leah Rowe f3098f566c git.sh multi-tree: grab submodules *after* patches
right now, if we want to patch a project such that certain
submodules are no tdownloaded, or diffreent submodules are
downloaded, or current ones are downloaded from other
locations, we cannot do this, because we apply submodule
updates *before* applying patches.

therefore, we should change it so that they are applied
*after* installing patches.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-30 20:30:49 +00:00
Leah Rowe 5fb6e36f03 update/trees: clean up the coreboot-version check
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-30 20:30:24 +00:00
Leah Rowe 4c9ee172be update/trees: support custom make/autogen argument
this is now used in grub, for the FS_PAYLOAD_MODULES
option in the make command

lbmk should generalise as much logic as possible. in
some parts of it, logic is hurrently hardcoded, specific
to a given project that lbmk uses, but lbmk is essentially
a source-based package manager, like what you might find
on a small linux distro, so we need to try to
be as generic as possible.

lbmk is the "build system of build systems", so it has to
work generically with as many of them as possible

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-30 19:25:26 +00:00
Leah Rowe c6a0e4952e update/trees: generic cmake handling
it is no longer hardcoded just to be handled for uefiextract.

it is now defined as cmakedir in target.cfg, for a single or
multi tree project. if multi tree, it is applied to the specific
tree, and has to be defined per tree

the way it works is: as per cmakelist, a project will define
which directory is to be built, and it will then generate
a makefile in the main source tree (the build tree in cmake
language, where the main CMakeLists.txt file exists)

when the makefile has been generated, the project is then treated
like any other project. the way cmake works, if a makefile has
already been generated by it, in a given directory, running it
again will fail and not affect anything; if it fails but the
makefile doesn't exist, then something is wrong, but if the
makefile does exist, then it's all fine and nothing happens

at present, this is only used for uefiextract, which is part
of src/uefitool

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-30 19:03:03 +00:00
Leah Rowe 30337b8fa5 update/trees: avoid namespace clash in function
the logic of the previous commit was correct, but one
of the functions was named the same as another function
used in this file, causing a namespace conflict, and
a build error

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-30 16:46:49 +00:00
Leah Rowe b061558104 update/trees: dont hardcode autoconf/bootstrap arg
at present, the bootstrap and configure script is only
directly executed for grub, because grub is the only
project that uses them in lbmk

however, when i start adding linuxboot support, i will
have to start building a lot of projects, some of which
make use autoconf and bootstrap scripts

e.g.

./bootstrap --foo
./configure --bar

the "bootstrap" script is often used on GNU programs,
because they like to over-engineer absolutely everything

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-30 16:03:29 +00:00
Leah Rowe eb3a8e2b53 unify script/update/trees and script/build/grub
the script can now also handle autoconf build systems,
whereas this could previously only be done for grub.

with this change, the overall sloccount is also lower

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-30 13:53:45 +00:00
Leah Rowe 34ded35fa6 lbmk scripts: general code cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-28 16:34:45 +00:00
Leah Rowe 4e06779948 disable u-boot on x86 qemu
it's not well-tested and currently doesn't build

this is for later

remove for now

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-28 14:48:31 +00:00
Leah Rowe bc87b5f67e lbmk scripts: general code cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-27 17:26:37 +00:00
Leah Rowe 0c1d08d8b1 build/serprog: err if basename fails
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-27 17:20:55 +00:00
Leah Rowe eff9130b7a update/trees: further simplify crossgcc handling
arch no longer needs to be set, on multi-tree projects,
and it has been renamed to xarch

the new behaviour is: if xarch is set, treat it as a
list of crossgcc targets and go through the list. set
the first one as the target, for what lbmk builds, but
build all of the defined crossgccc targets

crossgcc_ada is now xlang, and defines which languages
to build, rather than whether to build gcc-gnat

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-27 16:07:32 +00:00
Leah Rowe 6752780f46 coreboot: update hp elitebook configs
i had to run make-oldconfig on all of them, because
of the port that riku added the other day. lbmk doesn't
use defconfigs, it uses full configs, so we have to
make sure they're kept in sync

this patch is the result of running the following command
in a fresh clone of lbmk:

./update trees -u coreboot

i should probably switch to defconfigs.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-25 18:51:35 +00:00
Leah Rowe 15298985af Merge pull request 'Add HP 8300 CMT port' (#173) from Riku_V/lbmk:hp8300cmt into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/173
2023-12-24 21:37:12 +00:00
Riku Viitanen 74147ea48a Add HP 8300 CMT port
Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-12-24 18:34:34 +02:00
Leah Rowe 0aca6332ee lbmk scripts: shorter code lines
while seemingly pedantic, this does actually make code
easier to read. mostly just switching to shorthand for
variable names, where no expansions or patterns are used

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-24 09:04:36 +00:00
Leah Rowe 575332f221 fix flashrom build error (implicit enum typecast)
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-24 08:54:35 +00:00
Leah Rowe b4ab30577f lbmk scripts: general code cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-24 06:32:19 +00:00
Leah Rowe 38a7aa3196 build/roms: rename two functions for clarity
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-24 06:02:12 +00:00
Leah Rowe 746d9cadda build: remove test command
i left this in here during the last change

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23 18:02:09 +00:00
Leah Rowe 655d3cdc88 lbmk scripts: general code cleanup/optimisation
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23 17:51:32 +00:00
Leah Rowe 25f9d9480f git/pico-serprog: update revision again
riku committed a new patch, that fixes build errors
when PICO_DEFAULT_LED_PIN is not defined, on a given
board. in such cases, riku's new patch just disables
handling of the status LED, but LEDs continue to work
on boards where it is defined.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23 13:06:30 +00:00
Leah Rowe e0fee7a437 git/pico-serprog: update revision
the new revision sets drive level to 12mA instead
of the default 4mA. 16-20mA is the maximum tolerated
level for data lines, on most flash ICs, so 12mA is
relatively safe.

riku did this a while ago, tested on pico pi.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23 12:21:29 +00:00
Leah Rowe a48b3841d7 build/roms: improved error handling for roms
the rom functions print a path to the rom they built,
which is then used, but these are called inside what
are essentially subshells, and we had no error handling

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23 12:16:14 +00:00
Leah Rowe 33695a56ae build/roms: remove redundant check
cros roms are always using libgfxinit, with a coreboot
framebuffer, so the "normal" initmode is never used.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23 11:43:36 +00:00
Leah Rowe d5f8f6572e dell/e6400nvidia_4mb: new configuration (nvidia)
the e6400_4mb target has libgfxinit and (if seabios) vgarom
initialisation, but has issues on the nvidia model, even when
using nomodeset. with this target, e6400nvidia_4mb, only
the vgarom initialisation is used, libgfxinit is disabled.

on nvidia models, this one should work a little bit better.
specifically: nouveau crashes on this machine, with libreboot
installed, but you can use nomodeset. however, when libgfxinit
is also enabled, nomodeset no longer works properly.

so this target disables all video initialisation in coreboot.
only seabios will initialise anything video-related, by
executing the vga option rom.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23 09:25:06 +00:00
Leah Rowe 9d5d98ebae set version/projectname properly
lbmk used to set version/versiondate directly in
err.sh, but now it's handled there by a function,
which is called by the main script.

script/update/release hadn't yet been adapted. the
only change necessary is to call check_project()

script/update/trees also makes use of it

script/build/roms is using "projectname"

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23 08:54:45 +00:00
Leah Rowe aa525142aa update/trees: fix infinite loop
when make-all is being executed on a coreboot tree,
the "./vendor download target" command is used, where
target is the tree/board name.

that script then checks whether cbfstool and ifdtool
are built, and if they're not, they then call
./update trees -b coreboot utils bla bla bla

in this scenario, project=coreboot and mode="", meaning
make-all, and the same check that checks whether the
vendor download script should be run, is executed,
which in turn then checks cbutils again

fix the infinite loop by checking whether it was coreboot
utils, as opposed to *firmware*, that is to be built, before
running ./vendor download

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23 08:34:55 +00:00
Leah Rowe 465077bc4a vendor/download: check whether configs exist first
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23 07:48:15 +00:00
Leah Rowe 392932797b vendor/inject: fix dodgy error check (cd command)
the x_ function doesn't handle arguments with spaces
well, and this cd command is going to an asterisk, so
it's unknown what the resultant string will be.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23 07:11:12 +00:00
Leah Rowe f44b99c808 don't delete microcode updates in rom images
at present, lbmk can remove microcode updates on images for
a given target, if the target specifies
microcode_required="n" in target.cfg

lbmk then provides images with microcode, and images without,
in a given release. although the user can also remove them
manually, this just makes it a bit more convenient, for those
users who do wish to run without the updates. this functionality
is provided only on those platforms where no-microcode is tested.

well, this behaviour implements a compromise on libreboot policy,
which is to always include microcode updates by default. see:
Binary Blob Reduction Policy

the *canoeboot* project now exists, developed in parallel with
libreboot, and it ships without microcode updates, on the same
targets where lbmk also handled this.

running without microcode updates is foolish, and should not
be encouraged. clean up lbmk by not providing this kludge.

the libreboot documentation will be updated, telling such users
to try canoeboot instead, or to remove the update from a given
libreboot rom - this is still possible, and mitigations such as
PECI disablement on GM45 are still in place (and will be kept),
so that this continues to work well.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23 06:59:48 +00:00
Leah Rowe 72cd169ee5 update/release: don't test ./vendor inject
the purpose of script/update/release is not to test the
build system, but to build release archives.

testing of lbmk is done during the course of development.

remove this bloat from the release script. we run the nuke
mode anyway, to scrub blobs from releases, which will more
or less test the logic in that script (the only difference
is that it runs e.g. ifdtool --nuke instead of -i).

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23 04:41:25 +00:00
Leah Rowe e8eb52f8d7 update/release: don't insert crossgcc tarballs
why are we distributing gcc at all?

the coreboot build system downloads it at build time,
and the GNU rsync mirrors aren't going anywhere.

simplify script/update/release by not handling gcc.
this means: release archives will no longer contain gcc.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23 04:29:50 +00:00
Leah Rowe b0e5fc9d9c lbmk scripts: general code cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-23 02:52:30 +00:00
Leah Rowe b111f4840a build/serprog: general code cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-22 11:53:14 +00:00
Leah Rowe 2f98ca6dab build: simplified TMPDIR handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-22 10:50:17 +00:00
Leah Rowe ab65ea4c99 general code cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-22 10:24:00 +00:00
Leah Rowe fa25414bab mrc.sh: run debugfs from extract_partition
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-22 08:36:23 +00:00
Leah Rowe 8a87572227 mrc.sh: general code cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-22 06:34:14 +00:00