Commit Graph

1244 Commits (2e6073f2a7a84a527e32bcd7540d4bee7c758860)

Author SHA1 Message Date
Leah Rowe a823bab365 include/git: support applying patch subdirectories
This is done recursively, with the following rule:
files first, then directories.

Where all patch files are applied from within the
patch directory, subdirectories (within the patch
directory) are then tried in alphanumerical order.

Then, within each subdirectory tried, the same rule
is once again applied. This is done recursively,
until every patch file is applied.

The code no longer applies *.patch, but instead any
file. Additionally, symlinks are avoided.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-25 12:00:43 +01:00
Leah Rowe 3738ec90ec update/project/*: unified patch handling
Handle patches by a function at include/git.sh

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-25 11:49:13 +01:00
Leah Rowe cd3225d845 update/project/trees: remove extra.sh handling
This functionality has never been used, except in the
erstwhile osboot project, and even then only experimentally.

It was intended for use with coreboot's gerrit site, but
it became Libreboot project policy that this not be relied
upon, instead preferring to include patches directly within
lbmk. This functionality can be re-added, if necessary.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-25 10:57:10 +01:00
Leah Rowe 42c9d7d28c build/grub/*: move common strings to variables
also general cleanup of these scripts

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-25 03:06:43 +01:00
Leah Rowe e94ba1f7c0 build/grub/payload: split up main()
also: the grub-mkstandalone command didn't have
a || at the end, even though it did specify an err
call. This has been corrected, so that the command
now defers to err() under fault conditions.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-25 02:57:45 +01:00
Leah Rowe b727f9666b util/: use SPDX license and copyright headers
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-25 02:49:34 +01:00
Leah Rowe 208620198c Update email address for Leah Rowe copyrights
also, some of them were out of date; years now updated.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-25 02:27:26 +01:00
Leah Rowe cc1642096e Use SPDX license headers on all scripts
This results in much cleaner copyright and license declarations.
SPDX headers are legally recognised and make auditing easier.

Also, remove descriptions of each script, from each script.
Libreboot documentation at docs/maintain/ describes them.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-25 02:19:48 +01:00
Leah Rowe a7b767a47b update/repos: concatenate multiple revision files
With this change, it's still possible to have a single
file at config/git/revisions, but this has been scrapped.

Instead, multiple files now exist under config/git/ with
the same modules declared, but the files are separated
logically. List of files under config/git:

* bios_extract
* biosutilities
* coreboot
* flashrom
* grub (gnulib also defined here)
* me_cleaner
* memtest86plus
* seabios
* serprog (multiple projects defined)
* u-boot
* uefitool

The rationale behind this change is simple: in the future,
we will stop relying on build systems within imported
projects for the import of git submodules. Instead, we
will handle them directly in lbmk.

Additionally, a Linux payload is planned for Libreboot, made
easier by the recent audit (script handle/make/config makes
it easy to integrate Linux, and handle cross-compilers for
userland utilities); a "linux" file under config/git/ could
also define rules for each project besides linux, such as
musl libc, busybox and other utilities.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-25 00:51:03 +01:00
Leah Rowe 7966f9111d handle/make/config: run fail() on error, not err()
This was an oversight, during a previous audit.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-24 18:57:01 +01:00
Leah Rowe 2d0e978c94 update grub revision
It's now 44 revisions above 2.12-rc1, not 17 above.

The additional patches (in GRUB master) contain several
important fixes, including cryptodisk and ZFS fixes plus
a few other interesting changes, namely:

14c95e57fddb6c826bee7755232de62efc8eb45b:
kern/misc: Make grub_vsnprintf() C99/POSIX conformant

296d3ec835ed6e3b90d740e497bb534f14fe4b79:
disk/cryptodisk: Fix missing change when updating to use grub_uuidcasecmp()

42a831d7462ec3a114156d56ef8a03e1d47f19e7:
ZFS: support inode type embed into its ID

96446ce14e2d1fe9f5b36ec4ac45a2efd92a40d1:
ZFS: Fix invalid memcmp

444089eec6042250ce3a7184cb09bd8a2ab16808:
ZFS: Don't iterate over null objsets

7ce5b4911005b2a0bfd716d92466b6711844068c:
ZFS: Check bonustype in addition to dnode type

There are more patches than this, but these are the
ones that strike me as interesting for Libreboot.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-24 18:03:14 +01:00
Leah Rowe 905f3d8e7b util/nvmutil: remove xorswap() macro
it's only used once, so just do it once.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-19 16:51:37 +01:00
Leah Rowe 231015ef89 util/nvmutil: make setWord a macro
253 sloccount on nvmutil.c now, versus 258

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-19 16:18:13 +01:00
Leah Rowe d9bed11501 util/nvmutil: further optimise swap command
don't swap pointers at all. handle it in the for loop.

258 sloccount now, versus 261.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-19 16:05:34 +01:00
Leah Rowe 5e8013601a util/nvmutil: use correct comparisons on pointers
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-19 16:01:26 +01:00
Leah Rowe 137a548b04 util/nvmutil: optimise swap command
handle it exclusively in writeGbeFile()

this reduces nvmutil.c sloccount to 261, versus 265

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-19 15:56:55 +01:00
Leah Rowe 4d44820163 util/nvmutil: don't use err_if on argc check
at this stage in the code, the file name will be NULL
value, so it would be improper to use it in a string.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-18 16:48:26 +01:00
Leah Rowe 0897a0be17 util/nvmutil: always print filename in err_if
the previous code size optimisations removed mention
of the file name, on file-related err() calls.

almost every error the user runs across will be file
related, so put the path on err() called from err_if()

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-18 16:42:49 +01:00
Leah Rowe 9a92524a47 util/nvmutil: remove SIZE_8KB define
use SIZE_4KB << 1 when needing 8KB size

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-18 16:36:45 +01:00
Leah Rowe 5a129cea11 util/nvmutil: remove xpread/xpwrite macros
use err_if instead

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-18 16:32:37 +01:00
Leah Rowe ac0e49996a util/nvmutil: remove unnecessary xclose macro
it is only used once. use err_if instead.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-18 16:26:03 +01:00
Leah Rowe 83e6cfb294 util/nvmutil: simplify pledge and unveil handling
there is no need to have these as defines, when err_if
exists; get rid of xunveil and xpledge. use the bare
pledge and unveil functions directly, with err_if().

268 sloccount now on nvmutil.c, versus 289 sloccount
before this change, with no loss of functionality.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-18 15:50:44 +01:00
Leah Rowe 7bb92acd50 Merge pull request 'merge serprog scripts' (#131) from Riku_V/lbmk:master into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/131
2023-09-16 23:29:42 +00:00
Riku Viitanen 3c30e1e3dd merge serprog scripts
13 sloc reduction

Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-09-16 21:49:45 +03:00
Leah Rowe f8704c0a0d lbmk: more verbose error messages
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-16 11:37:20 +01:00
Leah Rowe a1db59a583 lbmk: reduce indentation in execute_command()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-16 11:28:26 +01:00
Leah Rowe a9ea277e56 lbmk: fail if ./build command options fails
non-zero exit, whereas it was previously an unhandled
non-zero exit as per -e - now it is simply more verbose.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-16 11:25:35 +01:00
Leah Rowe f1f5b91a85 lbmk: simplify execute_command()
if ./build command options fails, it just means that
lbmk would next check whether ./buildpath mode list exists,
which it never will because that would violate lbmk design.

the generic "help" output is more than sufficient, and tells
the user to check "list" anyway, so there's no point in saying
it here. simplify this function.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-16 11:24:03 +01:00
Leah Rowe 662b926630 lbmk: remove "./buildpath mode all"
for example: ./build boot all

the "all" function is a relic from a much older lbmk
design, where for example we might have done:

./build clean all
./download all

this is no longer used, nor is this currently relevant
for the types of scripts present in lbmk.

we can always re-add this function later if needed,
but for now? remove unwanted code.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-16 10:58:04 +01:00
Leah Rowe 4c7343088b lbmk: break up main()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-16 10:56:40 +01:00
Leah Rowe 5f197023db lbmk: always use lbmk_exit for exits
there were certain edge cases where TMPDIR wasn't
being cleaned. this patch will fix that.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-16 10:39:04 +01:00
Leah Rowe 3400e5a12b rel/src: fix multi-line command
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-12 16:25:20 +01:00
Leah Rowe 4df3d09b01 remove ich9utils entries from .gitignore
they are not needed anymore

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-12 14:51:34 +01:00
Leah Rowe 20bf3a19cd Merge pull request 'make clean stm32-vserprog for release' (#130) from Riku_V/lbmk:makeclean into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/130
2023-09-12 13:50:22 +00:00
Riku Viitanen c3ac62b173 serprog: list available boards
Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-09-12 02:53:23 +03:00
Riku Viitanen 24185bca42 fix typo serprog -> vserprog
Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-09-11 14:42:43 +03:00
Riku Viitanen ccb36aa652 make libopencm3 correctly
Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-09-11 14:35:00 +03:00
Riku Viitanen 5737abf0ed make clean libopencm3
Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-09-11 11:58:16 +03:00
Riku Viitanen 0bed0c35f3 Download libopencm3 before building
Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-09-11 11:39:13 +03:00
Leah Rowe c400916e33 coreboot/hp8200sff_4mb: fix bad ifd path in config
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-11 00:43:25 +01:00
Riku Viitanen 3d77b8a0b9 download and copy serprog related src
Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-09-11 01:08:34 +03:00
Riku Viitanen 7dc8632514 clean up pico-serprog for release
moved cmake files into a separate build directory.
this can just be deleted for the source release.

might as well use cmake for the actual build too.
that makes repeated builds faster for some reason.

Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-09-11 01:01:32 +03:00
Riku Viitanen 34d3629ebf make clean stm32-vserprog for release
Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-09-10 22:52:26 +03:00
Leah Rowe 087f0e066a make lbmk help text actually vaguely helpful
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-10 19:25:22 +01:00
Leah Rowe 093d40eec2 build/release/src: be more thorough deleting .git
a few were missed. nuke all of it from orbit.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-10 17:45:56 +01:00
Leah Rowe 630a65462f build/release/src: delete elf/ in srcdir
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-10 17:23:37 +01:00
Leah Rowe 0543350d44 handle/make/file: run make-clean first
flashrom distclean resulted in zero status upon exit,
but did not remove the actual flashrom binary.

our logic was to run distclean and defer to clean;
now, we run clean and *then* run distclean, but we
do not throw an error if distclean fails. (we do
throw one if clean fails)

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-10 17:17:33 +01:00
Leah Rowe 12f9afe622 build/release/src: remove cbutils/ in srcdir
the builds were being created within that srcdir,
because build/release/src runs lbmk commands within
it, and one of them is building (re-building) it.

there's no point addressing this, other than rm -Rf

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-10 17:08:08 +01:00
Leah Rowe fe00ab4e91 build/release/src: remove errant code
the main lbmk script already creates these files,
and these files are then copied by build/release/src
so we don't need to re-create them here

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-10 17:04:59 +01:00
Leah Rowe be4ed54023 handle/make/config: distclean once per tree
previously, it was possible that the distclean or
crossgcc-clean modes were being executed on the same
project tree, needlessly. this patch fixes that.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-10 16:55:36 +01:00