Commit Graph

1022 Commits (aaa0a1ff93e95b1bf7364c00b8104c6a4f66b44b)

Author SHA1 Message Date
Leah Rowe aaa0a1ff93 git.sh: rename to get.sh
it now handles more than just git, and i forsee
it handling even more in the future, e.g. rsync,
ftp, bittorrent.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:42:17 +01:00
Leah Rowe 2d691c7377 git.sh: Only create destination repo on success
Don't leave a broken cache laying around, which would
otherwise break lbmk for the user.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:42:10 +01:00
Leah Rowe 6199bc5b95 git.sh: cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:42:02 +01:00
Leah Rowe 1dd18a9a55 git.sh: Re-implement redundant git downloads
And this time it works.

I'm now calling xbmkget() which in turn calls tmpclone(),
instead of me calling tmpclone() directly.

The git-pull is done on both remotes, regardless of whether
the first succeeds. This way, if I forgot to update a mirror,
downloads would probably still work.

This also fixes an issue people were having, for example where
the gnulib repository of GRUB was always being downloaded
every time.

I'm using a new directory, XBMK_CACHE/clone, instead
of XBMK_CACHE/repo (which I used before), in case people
still have the old caches from before.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:41:53 +01:00
Leah Rowe 176c0fa1c4 rom.sh: reduce indendation in check_coreboot_utils
call it via fx_, instead of using a for loop

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:41:42 +01:00
Leah Rowe 584de778f8 release.sh: simplify release()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:41:31 +01:00
Leah Rowe ed8644177b release.sh: clean up the vdir after release
do this after moving the version directory within it.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:40:56 +01:00
Leah Rowe 2ca6337b0a release.sh: remove src_dirname variable
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:40:48 +01:00
Leah Rowe abfa2d1ec7 release.sh: build in tmp directory first
don't move to the real directory until the work
is done.

that way, a re-try can be done, while analysing
the old files. it is created based on the tmpdir,
under XBMK_CACHE/

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:40:26 +01:00
Leah Rowe d3ec7e8635 release.sh: remove unnecessary mkdir command
the following git clone command creates that directory

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:40:12 +01:00
Leah Rowe b68447e75c release.sh: split up build_release()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:39:35 +01:00
Leah Rowe 4b36ba9765 release.sh: delete tmp/cache from the tarball
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:38:11 +01:00
Leah Rowe 5861c25a7c lib.sh: remove rmgit()
We don't need to call it from git.sh, because it's
only being done when building a release anyway,
and we already run rmgit when doing a release.

The function itself is only two simple fx_ calls,
so we can just do that from build_release().

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:37:51 +01:00
Leah Rowe 1f2c8e47d4 lib.sh: remove mk()
i don't need it. i can use fx_ instead, on functions
that previously called mk().

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:37:22 +01:00
Leah Rowe 19888e2cb8 lib.sh: move xbmkget() to git.sh
in cbmk, it's only used from there.

in lbmk, it's also used from vendor.sh.

however, i plan to further expand git.sh at
some point, tidying it up so that git cloning
is also done from xbmkget, with dlop=git and
git.sh would then be renamed to get.sh

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:36:31 +01:00
Leah Rowe 9c5f59cc42 lib.sh: remove mksha512sum()
this is unused in cbmk.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:35:54 +01:00
Leah Rowe 279b7f20be lib.sh: split up try_file()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:35:31 +01:00
Leah Rowe 3347e3d314 lib.sh: move _ua to try_file()
it's only used there

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:35:25 +01:00
Leah Rowe 57f68535a2 inject.sh: remove the hashfiles variable
we only use it once, and it's a trivial string

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:34:51 +01:00
Leah Rowe d07bd53b07 inject.sh: define xchanged here instead
this is used here, and also needed in cbmk.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:33:39 +01:00
Leah Rowe 47b9a261d7 lib.sh: use fx_ in rmgit()
with fx_, i have more much granular control over
how errors are handled.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:32:53 +01:00
Leah Rowe ed9f6338af lib.sh: split up xbmkget()
it was too complicated. most of the logic has been moved
to a new function, try_file()

the for loop is handled by xbmkget(), whereas each try
is now handled in try_file()

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:32:39 +01:00
Leah Rowe 753af0a7a2 inject.sh: only compile nvmutil if needed
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:32:33 +01:00
Leah Rowe 387f4b785b inject.sh: simplified serprog check
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:32:26 +01:00
Leah Rowe 31bab5c10c remove another confusing message
the current message says the file name, and implies that
the given file has already been updated.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-14 21:31:47 +01:00
Leah Rowe 6c3ea129a4 inject.sh: Remove confusing path on tar creation
The path is wrong. The correct path is printed afterward.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-10 20:49:19 +01:00
Leah Rowe 3062f04c45 inject.sh: re-add mac address confirmation
it just makes the script more user-friendly

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-10 20:24:30 +01:00
Leah Rowe cf8ca4cdd6 inject.sh: further cleanup
this is based on lbmk commit e5af201060e

this removes more code that is not needed in cbmk's version
of inject.sh

lbmk and cbmk inject.sh are now much more in sync, in that
they are much more similar to each other than before.

the cbmk version only handles MAC addresses, and does not
do vendor file downloading or patching.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-10 20:16:23 +01:00
Leah Rowe a82ca2da5f tree.sh: only create elfdir in copy_elf()
otherwise, we create empty directories where build.list
doesn't exist, like on coreboot.

we already create a directory when needed, when actually
copying elf files, so let's just leave it at that.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-10 18:22:30 +01:00
Leah Rowe 33debfcf1c tree.sh: simplified srcdir check on make-clean
this is the check that ksips a given target if the tree
directory does not exist, on the clean command.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-10 18:22:25 +01:00
Leah Rowe 2acdfefdf9 inject.sh: bring in sync with lbmk 0f931b508a8
see lbmk commit:
0f931b508a8eb34e70b2ed3628ac4fe74f22b8e8
from 10 May 2025

The lbmk version of inject.sh also contained logic to
download vendor files, which cbmk doesn't and won't support.

This made merging patches between the two projects harder, so
lbmk's version has been modified to mostly only include the MAC
address related code on inject.sh, just like the Canoeboot one.

On lbmk, extra functionality for vendor files is now provided
on include/vendor.sh, which cbmk lacks (and will never have).

With a few minor alterations, this script is now very much in
sync with the lbmk version.

In fact, just to provide the point, here is the diff between
lbmk's version of inject.sh, compared to the version in cbmk
introduced by this commit. Observe:

(< is a subtracted line, and > is an added line. So the < shows
what was removed from lbmk's version when adding to cbmk, and
the > lines show what cbmk added to its version).

yes me cbmk$ colordiff ../lbmk/include/inject.sh include/inject.sh
89,90d88
< 	[ -n "$vcfg" ] && check_vcfg
<
94,95d91
< 	mecleaner="$xbmkpwd/$cbdir/util/me_cleaner/me_cleaner.py"
< 	kbc1126_ec_dump="$xbmkpwd/$cbdir/util/kbc1126/kbc1126_ec_dump"
103,104d98
< 	[ "$nukemode" = "nuke" ] || x_ ./mk download "$board"
<
112,113c106,107
< 		e "$tmpromdir/$_hashes" f && \
< 		    has_hashes="y" && hashfile="$_hashes" && break; :
---
> 		e "$tmpromdir/$_hashes" f && err \
> 		    "'$archive': vendorfile insertion unsupported"
118,120d111
< 	fx_ prep x_ find "$tmpromdir" -maxdepth 1 -type f -name "*.rom"
< 	( check_vendor_hashes ) || err "Can't verify hashes for '$archive'"; :
<
129d119
< 	setvfile && return 1; :

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-10 18:20:44 +01:00
Leah Rowe a170ab4118 cbmk: use x_ instead of err, where appropriate
many places in cbmk used err, because older versions
of x_ did not handle globbing properly.

however, use of x_ is preferable on trivial commands.

the only time err() should be called is what it has
to be, when x_ can't work, or when a more useful error
message is needed, for context.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-10 18:09:43 +01:00
Leah Rowe 5cdd377547 mk: use zero exit instead, to run trees
that way, with set -u -e, we aren't risking some
buggy sh implementations from causing an error exit
where it shouldn't.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-10 18:06:27 +01:00
Leah Rowe c022a14c9e remove useless comment
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-10 18:05:47 +01:00
Leah Rowe c9325f234e mk: remove unnecessary line break
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-10 18:05:37 +01:00
Leah Rowe e22593f037 mk: re-split tree logic to include/tree.sh
I really think mk should just be a small stub.

Better to keep everything separate.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-10 18:03:45 +01:00
Leah Rowe c463e8a52d mk: move release functions to idnclude/release.sh
The idea with mk is that it's meant to basically be a
stub for running everything else, while mainly having
the trees logic within it (what was once script/trees).

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-10 18:03:32 +01:00
Leah Rowe 966a6377a0 mk: add missing error handli for mk -f
on the release command, that is

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-08 22:19:29 +01:00
Leah Rowe 718697c0e6 git.sh: re-write tmpclone without caching
remove caching for now. it's buggy as hell.

will re-write the caching feature next.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-08 22:19:22 +01:00
Leah Rowe a5c5089eda git.sh: use setvars for fail variables
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-08 22:19:17 +01:00
Leah Rowe 7b2671ea26 git.sh: hard fail if git am fails
similar to the last patch, we must ensure that the
inability to patch will cause a hard exit, regardless
of any redundancy we have for cloning.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-08 22:19:12 +01:00
Leah Rowe 45b6d3b3ba git.sh: Hard fail if reset fails
We allow a re-try when cloning fails, to account
for redundancy, but resetfail currently doesn't
cause any error exit at all.

This patch mitigates that bug.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-08 22:19:06 +01:00
Leah Rowe e320ce60a7 init.sh: Only check XBMK_CACHE if it exists
Otherwise, if it doesn't exist, the current check will
wrongly exit with error status, preventing you from
running the build system at all!

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-08 22:19:01 +01:00
Leah Rowe d99bc55f4a also fix the other grub trees
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-08 16:09:59 +01:00
cqst c15ee8fc32 fix trying to boot all logical volumes after unlocking an encrypted volume 2025-05-08 16:09:47 +01:00
Leah Rowe 63cef86bdb init.sh: remove useless export
we already reset to n if not y, afterward

just rely on that

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-08 16:09:41 +01:00
Leah Rowe 0a3793ad4e init.sh: also allow XBMK_RELEASE=Y or N
as opposed to =n or =y

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-08 16:09:34 +01:00
Leah Rowe 433b5de916 init.sh: Resolve XBMK_CACHE via readlink
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-08 16:09:26 +01:00
Leah Rowe 5d2c94a8bd init.sh: check XBMK_CACHE is a directory instead
it doesn't matter if it's not a file. that's the wrong check.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-08 16:09:20 +01:00
Leah Rowe f0a0f678bf init.sh: export LOCALVERSION in set_env
Don't do it in set_version

Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-08 16:09:14 +01:00