Commit Graph

548 Commits (03f7a7b53a447b51cf20c8b980201533e93ddc3a)

Author SHA1 Message Date
Leah Rowe 03f7a7b53a rom.sh: disable seabios-as-primary if grub is main
the way it worked, the roms were still named seagrub
and the seabios rom would be compiled, but with the wrong
path, so seabios wouldn't be executed; seabios would hang
anyway, on this board.

instead, engineer it in such a way as to disable seabios_
images on such setups. also, rename seagrub_ to grub_.

i normally only permit seagrub, and not grub, but i make an
exception for 3050micro because we know grub works, but seabios
currently hangs on this board (which means no bsd).

dell optiplex 3050 micro isn't actually supported in canoeboot,
but the workaround patch for enabling grub as primary payload
was added so that cbmk will maintain parity with lbmk.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-10-06 10:42:03 +01:00
Leah Rowe b6036e81d2 coreboot target.cfg: permit GRUB as primary payload
Dell OptiPlex 3050 Micro support was added to Libreboot,
which we can't add in Canoeboot, but SeaBIOS hung on that
board so we made GRUB the primary payload on that board.

SeaGRUB is still enforced on all Canoeboot targets at
present, but we want cbmk to maintain parity with lbmk.

Therefore, import this functionality into cbmk, but without
actually using it.

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-10-06 10:39:12 +01:00
Leah Rowe 4c08c390dd git.sh: fix error with cache re-download
in some cases, on a fresh clone, the cached repo already
exists but lbmk tries to download it again. work around
this by checking that the directory exists; it's in the
main if statement, so that the "else" still applies. as
a result, the fallback to a live repo would un-fall back
to doing git-pull if the cached directory exists exists.

if it doesn't seem to make sense, it's because it doesn't.
this whole function needs to be rewritten better.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-10-06 10:19:16 +01:00
Leah Rowe 018486d912 add swig to fedora dependencies
needed when compiling u-boot

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-10-06 10:19:07 +01:00
Nicholas Chin 9a91abd9ef config/coreboot: Add Dell Latitude E4300
Add patches to convert the E6400 port into a GM45 Latitude variant and
add the E4300 as another variant, and create a config for the E4300.
Tested on my E6400 and E4300.

Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
2024-10-06 10:17:26 +01:00
Leah Rowe 8cb66ef10e Add Sony PlayStation support to Canoeboot
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

Yes. PlayStation support. It's even RYF-friendly:

* Replace BIOS chip with PCSX-Redux's open BIOS
* Install PsNee modchip (libre modchip firmware)
* Install PicoStation (libre optical disc drive emulator)
* Libre SDKs are available e.g. PSn00bSDK

I added this to Libreboot, because I'm working on a fork of
DuckStation. DuckStation recently went proprietary, so I'm making
a fork (soon to be launched) that is based on the libre version,
and I was told of PCSX-Redux's Open BIOS, so I decided to add it
to the *boot projects.

Signed-off-by: Leah Rowe <leah@libreboot.org>
Signed-off-by: Leah Rowe <info@minifree.org>
2024-10-06 09:38:17 +01:00
Leah Rowe 1b6d56e4bf config/git: Import pcsx-redux
We don't need the entire emulator, but we will be using
a specific part: src/mips/openbios

third_party/uC-sdk submodule is included, because it
contains the necessary header files when building open bios.

I will be adding Sony Playstation support to Canoeboot,
alongside a new emulator project to be announced soon.

Yes, RYF playstation is possible. A real playstation can
run this BIOS. Then disable the copy protection from the
CD controller by installing a modchip (PsNee runs free
modchip firmware), and picostation is also libre if you want
something to boot software from SD card instead of CD-R.

Very hackable 90s games console. Libre SDKs also exist that
are quite powerful, so you can actually use this machine while
avoiding all proprietary software of any kind.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-10-06 09:36:15 +01:00
Leah Rowe c424795611 remove unused coreboot tree
the coreboot413 tree is only needed for the cbfstool
revision that it has, and only on lbmk. i accidentally
added it, in the recent cbmk revision updates.

Signed-off-by: Leah Rowe <info@minifree.org>
2024-08-15 00:30:07 +01:00
Leah Rowe 1d9f56bdf7 update config/submodule/coreboot
i forgot to update it, when updating coreboot revs based
on lbmk.

Signed-off-by: Leah Rowe <info@minifree.org>
2024-08-14 23:41:25 +01:00
Leah Rowe 01331db17f lib.sh: more verbose error in x_
part of the command was cut off in the output

Signed-off-by: Leah Rowe <info@minifree.org>
2024-08-14 22:15:55 +01:00
Leah Rowe c0ce9121a6 flashprog: bump to 639d563 (2024-08-02)
The workaround-mx patch was rebased on one section in spi.c,
because that part in upstream added QPI support; in the newly
rebase mx patch, the workaround_mx behaviour is only
honoured if QPI (Quad SPI) is not in use.

Quad SPI is not used in practise, on the machines where this
workaround is intended (GM45 ThinkPads with Macronix chips).

This imports the following upstream changes:

* 639d563 README: Update flashprog.org URLs
* cbbd601 README: Update dependency list and Linux package names
* 79451f1 README: Rename "Packaging" -> "Source Packaging"
* 5b4695c README: Dial laptop warning down a little
* 7224085 udev rules: Add some more IDs
* 448457a ch347_spi: Add CH347F ID and loop over the entries
* e39549b ch347_spi: Search for compatible USB interface
* dfd0647 ich_descriptors: Refactor component density handling
* b2ad9fd ich_descriptors: Make use of SPI_ENGINE_PCH100 marker
* 140e22f chipset_enable: Make use of SPI_ENGINE_PCH100 marker
* 869f0e7 ichspi: Use `swseq_data' on ICH7 paths too
* eeee91b ichspi: Replace all switch/case on `ich_generation'
* ecba1d8 ichspi: Drop redundant bail-out cases in ich_set_bbar()
* e8babf4 ichspi: Use a single check to enable hwseq for PCH100+
* fda324b ichspi: Introduce SPI_ENGINE_PCH100 marker
* a1f6476 ichspi: Split ICH7 init out
* 3f75d44 ich_descriptors: Remove `Dual Output Fast Read' for newer gens
* 2862011 spi25: Try to set volatile quad-enable (QE) automatically
* 4ac536b spi25_statusreg: Allow to write (non-)volatile bits specifically
* b1d2bae dediprog: Fix and enable 4BA modes for SF600Plus-G2
* d0afeef dediprog: Disable 4BA modes for SF100 w/ protocol v2
* 1b1deda Implement QPI support
* a1b7f35 dediprog: Implement multi-i/o reads
* 008a44f dediprog: Split read/write command preparation by protocol
* 4760b6e spi25: Implement multi-i/o reads
* 0c9af0a spi25: Check quad-enable (QE) bit
* 930d421 spi25: Introduce generic spi_prepare_io()/spi_finish_io()
* 8d0f465 spi25: Extract 4BA preparations into new `spi25_prepare.c`
* 044c9dc Add FT4222H support
* fc7c13c linux_gpio2_spi: Implement multi i/o
* 5fc3154 bitbang_spi: Implement multi-i/o
* d16a911 bitbang_spi: Move API into its own header file
* 226bb87 flashchips: Add missing QE-bit definitions
* 4fa39c5 flashchips: Fill multi-i/o gaps in MX25U family
* 5f50999 flashchips: Fill multi-i/o gaps in MX25R family
* 46552c8 flashchips: Fill multi-i/o gaps in MX25L family
* 96786d0 flashchips: Fill quad-i/o gaps in XM25Q family
* a26a3c6 flashchips: Fill dual-i/o gaps in W25X family
* 2133f59 flashchips: Fill quad-i/o gaps in W25Q family
* 68573af flashchips: Split GD25Q127C and GD25Q128C
* 4da971f flashchips: Fill quad-i/o gaps in GD25*Q families
* f7e2d97 spi: Allow to define a quad-enable (QE) configuration bit
* 1412d9f spi: Rework FEATURE_QPI
* d518563 spi: Prepare for multi i/o and dummy bytes
* bd72a47 spi25_statusreg: support reading/writing configuration register
* 3d728e7 spi25_statusreg.c: support reading security register
* a358b14 flashchips: Split W25Q64.W -> W25Q64DW | W25Q64FW/W25Q64JW...Q
* 3127db1 manibuilder: Drop legacy flashrom tag collections
* 619d9c0 manibuilder: Use `test_build.sh'
* 6560bba manibuilder/almalinux: Install `diffutils' for new `test_build.sh'
* c7b549e test_build.sh: Compare output for -L of Make and Meson builds
* 72b30a0 test_build.sh: Don't try to run cross-compiled programs
* 3d2f212 test_build.sh: Allow to override Make and Meson commands
* 4eb9748 test_build.sh: Run tests for both Make and Meson builds
* 8279457 manibuilder: Add Alpine Linux 3.18 & 3.19 images
* 15e9b10 manibuilder/alpine: Install libjaylink-dev when available
* b8b3593 manibuilder: Add images for Fedora 38..40
* 7b05f09 manibuilder: Add images for Ubuntu 24.04 "Noble Numbat"
* 5e8b339 manibuilder/anita: Add NetBSD 10.0 i386 & amd64 images
* 61da8c7 manibuilder/anita: Export library path for libusb
* 39152af manibuilder: Set sourcearcade.org as default source
* 20073e7 Properly clear erase-block selection when bigger block is chosen
* 3824c8d ichspi: Allow all opcodes when the "opmenu" isn't locked
* 0d4354e flashchips: Add W25Q32JV-.M

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-08-14 22:15:49 +01:00
Leah Rowe 4d53d491c2 seabios/default: bump to ec0bc256 (2024-06-24)
This brings in a single change:

commit ec0bc256ae0ea08a32d3e854e329cfbc141f07ad
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Mon Jun 24 10:44:09 2024 +0200

    limit address space used for pci devices, part two

This increases compatibility with i686 hosts, when allocating
memory for pci devices.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-08-14 22:15:44 +01:00
Leah Rowe 8d6376e61e grub/*: Bump to rev b53ec06a1 (2024-06-17)
Of note: upstream has made several improvements to memory
management, and several fixes to file systems.

User-friendly change to LUKS: if the passphrase input failed,
the user is prompted again for the correct passphrase, instead
of GRUB just failing. Similar to cryptsetup luksOpen behaviour
under Linux.

This pulls in the following changes from upstream (gnu.org):

* b53ec06a1 util/grub-mkrescue: Check existence of option arguments
* ab9fe8030 loader/efi/fdt: Add fdtdump command to access device tree
* 0cfec355d osdep/devmapper/getroot: Unmark 2 strings for translation
* f171122f0 loader/emu/linux: Fix determination of program name
* 828717833 disk/cryptodisk: Fix translatable message
* 9a2134a70 tests: Add test for ZFS zstd
* f96df6fe9 fs/zfs/zfs: Add support for zstd compression
* 55d35d628 kern/efi/mm: Detect calls to grub_efi_drop_alloc() with wrong page counts
* 61f1d0a61 kern/efi/mm: Change grub_efi_allocate_pages_real() to call semantically correct free function
* dc0a3a27d kern/efi/mm: Change grub_efi_mm_add_regions() to keep track of map allocation size
* b990df0be tests/util/grub-fs-tester: Fix EROFS label tests in grub-fs-tester
* d41c64811 tests: Switch to requiring exfatprogs from exfat-utils
* c1ee4da6a tests/util/grub-shell-luks-tester: Fix detached header test getting wrong header path
* c22e052fe tests/util/grub-shell: Add flexibility in QEMU firmware handling
* d2fc9dfcd tests/util/grub-shell: Use pflash instead of -bios to load UEFI firmware
* 88a7e64c2 tests/util/grub-shell: Print gdbinfo if on EFI platform
* b8d29f114 configure: Add Debian/Ubuntu DejaVu font path
* 13b315c0a term/ns8250-spcr: Add one more 16550 debug type
* 8abec8e15 loader/i386/multiboot_mbi: Fix handling of errors in broken aout-kludge
* d35ff2251 net/drivers/ieee1275/ofnet: Remove 200 ms timeout in get_card_packet() to reduce input latency
* 86df79275 commands/efi/tpm: Re-enable measurements on confidential computing platforms
* 0b4d01794 util/grub-mkpasswd-pbkdf2: Simplify the main function implementation
* fa36f6376 kern/ieee1275/init: Add IEEE 1275 Radix support for KVM on Power
* c464f1ec3 fs/zfs/zfs: Mark vdev_zaps_v2 and head_errlog as supported
* 2ffc14ba9 types: Add missing casts in compile-time byteswaps
* c6ac49120 font: Add Fedora-specific font paths
* 5e8989e4e fs/bfs: Fix improper grub_free() on non-existing files
* c806e4dc8 io/gzio: Properly init a table
* 243682baa io/gzio: Abort early when get_byte() reads nothing
* bb65d81fe cli_lock: Add build option to block command line interface
* 56e58828c fs/erofs: Add tests for EROFS in grub-fs-tester
* 9d603061a fs/erofs: Add support for the EROFS
* 1ba39de62 safemath: Add ALIGN_UP_OVF() which checks for an overflow
* d291449ba docs: Fix spelling mistakes
* 6cc2e4481 util/grub.d/00_header.in: Quote background image pathname in output
* f456add5f disk/lvm: GRUB fails to detect LVM volumes due to an incorrect computation of mda_end
* 386b59ddb disk/cryptodisk: Allow user to retry failed passphrase
* 99b4c0c38 disk/mdraid1x_linux: Prevent infinite recursion
* b272ed230 efi: Fix stack protector issues
* 6744840b1 build: Track explicit module dependencies in Makefile.core.def

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-08-14 22:15:04 +01:00
Leah Rowe 4564c44ebe coreboot/default: bump to 97bc693ab (2024-07-29)
same as the recent update in lbmk, but adapted for cbmk,
e.g. the patches to disable microcode blobs by default.

i copied it from the lbmk update but updated nuke.list
and excluded certain patches not needed in canoeboot, such
as the new dell latitude patches and haswell nri

The coreboot/dell tree was also merged to /default, just
like in lbmk. This puts Canoeboot completely  in sync,
but with deblobbing as is customary for Canoeboot.

Signed-off-by: Leah Rowe <info@minifree.org>
2024-08-14 22:13:28 +01:00
Leah Rowe e4d2c38903 uefitool: Only define ACCESSPERMS on *nix
I re-read the modified code, and it has defines in place
for building on Windows; I was defining ACCESSPERMS
universally, but it should only be defined for non-Windows
systems, which the context in this code means Linux/BSD.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-08-14 21:48:53 +01:00
Leah Rowe 1274291628 uefitool: Add patch working around musl libc issue
musl libc is very conservative in what it implements,
preferring a very "pure" libc implementation. this means
that it lacks many of the niceties found in others like
the GNU C Library; the latter implements many BSD libc
extensions, for example.

ACCESSPERMS is a #define in BSD libc that does:
S_IRWXU | S_IRWXG | S_IRWXO

Essentially, it provides a bitwise OR providing chmod 0777,
which can be used as shorthand in calls to functions such
as mkdir() available in all libc implementations.

In the case of uefitool, this define is indeed used on mkdir.
Conditionally re-define ACCESSPERMS, if undefined, so that musl
libc can be used when building uefitool.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-08-14 21:48:46 +01:00
Leah Rowe 8b74fe2c14 lib.sh: new function mk() to handle trees in bulk
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-28 15:40:56 +01:00
Leah Rowe 7942aff43d general code cleanup in the build system
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-26 20:53:06 +01:00
Leah Rowe bd517a3d27 rom.sh: don't dry-run mkcoreboottar
same as the last change. make the main function a wrapper
that dry-runs the real function.

if the "dry" variable is blank, it executes.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-22 23:49:00 +01:00
Leah Rowe 64e990212a rom.sh: don't run mkcorebootbin on trees -d
don't let it execute during dry builds

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-22 23:48:54 +01:00
Leah Rowe acac32f065 support ./mk in place of ./update trees
it's a shortcut command. a new symlink.

./update trees -b flashprog

can instead do:

./mk -b flashprog

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-22 23:48:48 +01:00
Leah Rowe 3fd2769bf6 trees: initialise badhash no n, not empty string
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-22 20:13:57 +01:00
Leah Rowe c5364e6d4e rom.sh: fix buggy deletion of cbutils
when badhash=y, the utils should be deleted, but
the check is deleting if badhash isn't n. if the
hash check isn't being performed, then this will
always be the case and the utils are always deleted.

make it positively delete the file only if badhash=y,
not when it isn't n. while this may not sound very
different, it will prevent the utils being deleted and
re-build endlessly in other cases, like when building
release archives and running the inject --nuke mode
on every image that gets built.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-22 20:13:45 +01:00
Leah Rowe 792efc659f rom.sh: also add grub to seabios images
we want multiple seagrub images made, with different
keymaps, but we only want one non-seagrub image.

however, we also want grub in the non-seagrub image.
it just means that seabios is primarily what the user
wants, and they might occasionally use grub, whereas
the seagrub images are for people who primarily want
grub but may occasionally access the seabios menu.

right now, the seabios images really only contain seabios,
but there's no harm in adding grub to them.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-22 20:13:30 +01:00
Leah Rowe 6ddc02a7b7 rom.sh: copy tmprom to TMPDIR for modification
don't rely on build/coreboot.rom staying in place,
because sometimes it can get purged under certain
conditions, due to idiosyncrasies in the coreboot
build system, even when we don't explicitly clean it

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-22 20:13:18 +01:00
Leah Rowe d08b175a0d rom.sh: re-add seabios-only roms and grub keymaps
this time, only handle multiple keymaps on seagrub
images. for images where seabios is first but does
not immediately load grub, whether grub is still
available in flash, just do one image (US Qwerty)

this still results in fewer images per target than
Libreboot 20240612, but should prevent most users
from being annoyed. i got a few people asking
repeatedly, and i hadn't documented yet how to add
keymap.gkb or how to remove bootorder, to get a
different keymap or disable seagrub respectively.

i anticipate that i'll get such questions a lot, even
if i do document it, so i'm reversing that decision.

it doesn't result in much extra code. the new design
in lbmk makes this sort of thing much simpler.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-22 09:32:21 +01:00
Leah Rowe f0c25c7258 include/rom.sh: use ccache when building coreboot
ccache now required, in build dependencies

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-21 22:30:53 +01:00
Leah Rowe 16f9ad55ca put cachedir in environmental variable
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-19 15:02:00 +01:00
Leah Rowe 6b2653f8cd git.sh: warn when a cached clone fails
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-19 15:01:33 +01:00
Leah Rowe 1458e1108e git.sh: fix typo in git command
the || : condition should be used, whereas i just
wrote : by mistake. this was done in a previous change.

fix it now.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-19 15:01:27 +01:00
Leah Rowe 20b076714c git.sh: fix lack of error exits on fault
a previous change made it more redundant, falling back
on old behaviour (direct downloading, not cached), but
the way it's done means that the function never returns
an error condition in practise.

this patch fixes it.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-19 15:01:17 +01:00
Leah Rowe a7f9a7bb6f build: remove tmp/ on release archives
i overlooked this before. remove it. the directory
happened to be empty when i tested archives, but it's
still not a good thing that we have it. remove it!

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-19 15:00:57 +01:00
Leah Rowe 71091e03a7 trees: hardcode makeargs for xgcc
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-18 02:18:23 +01:00
Leah Rowe 1bc484dbf6 allow using coreboot's build system to add payload
lbmk must still define payloads, but specific configs
may use coreboot's build system instead.

you might use this to add your own config with, say,
tianocore payload, using coreboot.git to build it,
rather than using lbmk's choice of payloads.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-18 02:18:02 +01:00
Leah Rowe 93a476b4fc trees: remove unnecessary command
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>
2024-07-18 02:17:30 +01:00
Leah Rowe ae3966a02f build: remove cache/ on making releases
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-18 02:17:17 +01:00
Leah Rowe 0cf0fdcfc3 unify caching of files into cache/
hash/ becomes cache/hash/

repo/ becomes cache/repo/

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-18 02:16:37 +01:00
Leah Rowe 8bb3730e7b cache downloaded files(module) to cache/file/HASH
lib.sh download() is used by subfile handling in git.sh,
e.g. crossgcc tarballs.

they are not currently cached, but are downloaded directly
in place.

cache them, under cache/file/, saved with the name equal
to the checksum, so: cache/file/CHECKSUM

if the given cached file exists, use it as-is for simple
copy, instead of curl. this avoids re-downloading a lot of
crossgcc tarballs, where different coreboot trees may use
some archives that are the same throughout.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-18 02:14:23 +01:00
Leah Rowe 0d55d7b23a git.sh: remove previous tmprepo if args>5
if doing a retry, the directory may still exist, which
would make git clone yield an error response; the existing
directory will have been the one that failed to reset, so
let's delete it.

the one deleted is not the cache (repo/PROJECT/), thus
otherwise maintaining current behaviour.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-18 02:13:00 +01:00
Leah Rowe 3e2e5ecf5a git.sh: try direct clone if cached git fails
normally, a project is cached at repo/PROJECT/, and
cloned from there to the final destination.

errors lead to a calling of $err, but this will result
in a return if done from inside a subshell, of non-zero
value, so use this to re-try with a 6th argument when
calling tmpclone().

in most cases, this fallback will never kick in, but
it will kick in resetting or patching the cached clone
fails; specifically, we are interested in the reset part.

a given project name may change repositories in lbmk at
a given time. if this happens, and the old one is cached,
the overall result of this patch is that lbmk will fall
back to the old behaviour, where git urls are tried
directly, without caching.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-18 02:12:31 +01:00
Leah Rowe 03c9670fef git.sh: re-try git pull three times
mitigate jittery internet connections

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-18 02:12:20 +01:00
Leah Rowe 055c9be15b trees: auto-delete+auto-rebuild if project changes
actual source code is not scanned, but config directories are
scanned. simply get the checksum of each file under config/
pertaining to a given project/tree, and also for the given
target. coreboot utilities are also handled.

if it changes, in any way, delete and re-build automatically.

such deletions should probably still be done manually, as part
of understanding the build system, but this change should make
the build system much easier to use during development.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-18 02:10:58 +01:00
Leah Rowe 2d794a8385 trees: also remove single-tree repo/p/
single-tree repos were not previously cached, but now
they are and they have to be handled.

this, as also alluded to in the previous commit, is done
when preparing release archives (XBMK_RELEASE=y)

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-18 02:10:46 +01:00
Leah Rowe b564f5b848 trees: remove repo/p, not src/p/p
repo/p/ does not have its revision reset, so it
changes unpredictably, and it's not used in builds.

this used to be src/p/p/ - the context here is multi-tree
projects, in source archives.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-18 02:10:37 +01:00
Leah Rowe c44ff5ac47 git.sh: don't download to src/project/project/
re-use repo/project/

this means that single- and multi-tree projects now
have a unified cached git repo location, as per the
new rules, thus saving on disk space usage.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-18 02:10:13 +01:00
Leah Rowe 3590a53ed1 git.sh: cache git downloads to repo/
do it based on the URL, e.g. https://review.coreboot.org/coreboot
becomes repo/coreboot

the downside is if you have two projects with repo urls specifying
the same string at the end, but this isn't the case at the moment
and likely won't be the case, but it's a theoretical issue.

this saves on bandwidth when downloading identical submodule repos
between multiple trees within the same multi-tree project

for example, coreboot 3rdparty/vboot is no longer downloaded more
than once, instead cloned locally on subsequent downloads.

if repo/DIR exists, git-pull is attempted, but errors do not result
in a non-zero exit, by design.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-18 02:09:49 +01:00
Leah Rowe 2823ccc438 remove util/autoport
upstream has merged all of the changes that it contained,
so we don't need this anymore. we'll have the newer upstream
changes on the next general revision updates for coreboot,
within config/coreboot/

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-18 02:08:30 +01:00
Leah Rowe a29453023c trees: move dependency building to new function
configure_project is a bit big. move the dependencies
build logic to a new function.

it may be desirable in future to make the way that
function works the way all build commands are done.

for example:

./update trees -b coreboot x230_12mb

would become:

./update trees -b coreboot/x230_12mb

this would enable to mix and match multi/single tree
projects. for now, leave things as they are.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-07-18 02:08:12 +01:00
Alper Nebi Yasak a9997082d7 u-boot: Fix display initialization on gru boards
U-Boot has migrated to using upstream device-tree files for gru boards,
but the clock driver doesn't yet support setting rates for a certain
clock that upstream uses for the eDP display. It happens to work without
it, so for now remove the clock setting until the driver is fixed.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-07-12 16:41:34 +01:00
Alper Nebi Yasak 5b170de055 u-boot: Avoid breaking build for U-Boot-only binman images
Commit 46e01c0e1dad ("u-boot: Avoid building U-Boot-only binman images")
added a patch that prevents an error while building U-Boot, due to some
U-Boot images needing a copy of BL31 that we are not passing in.

Removing build instructions for these images isn't really necessary,
when we can instead tell the build tool that it shouldn't exit with an
error. It checks a BINMAN_ALLOW_MISSING environment variable for this,
but just unconditionally replace the check with the argument.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-07-12 16:41:25 +01:00