Commit Graph

1801 Commits (cd1d847898078add88fd17542703806f1c30b522)

Author SHA1 Message Date
Leah Rowe a4328cb11f roms: remove dangerous runtime p/s/d options
p = payload

s = grub_scan_disk

d = displaymode

setting the payload is no longer safe, due to issue 216
and similar issues that might pop up in the future; it's
best left only to target.cfg, per board, so that we know
what config is safe/tested. don't let the user override it.

scandisk isn't safe to override because the given machine
may not have the type of device that the user specifies

displaymode is actually ok to set, because it simply whitelists
what configs pre-existing to actually use, but it's bloat

basically, the rule is this:

don't make it easy for the user to brick their hardware.
make it harder instead.

a user wily enough to go modifying their payload will probably
have read docs/maintain/ anyway and knows how to edit target.cfg
if they want another board configuration.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-14 14:51:27 +01:00
Leah Rowe 167e1a0fbe unified checks for variable initialisation
new function chkvars() does the job

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-14 13:37:03 +01:00
Leah Rowe 98724d701b lib.sh: remove the items() function
it's pretty much just doing the same thing as ls -1

remove it!

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-14 13:19:25 +01:00
Leah Rowe baea03c672 roms: simplify main()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-14 09:11:07 +01:00
Leah Rowe c8889b8d2c Libreboot 20240612 release
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-12 08:43:33 +01:00
Leah Rowe 67c95fc72d coreboot nasm: use coreboot mirror as backup
don't use the macports mirror, because it's not certain
whether those tarballs will always be there. use the
coreboot one as a backup instead, and nasm.us as main

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-12 07:50:05 +01:00
Leah Rowe 79d5d83412 haswell: add Mate's patch fixing IGD port list
fixes DP++ and adds a DP that wasn't even there before,
on all currently supported variants of these machines

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-12 07:39:14 +01:00
Leah Rowe 61a8f4b05e haswell: add Nico's patch for IGD PCI IDs
the patch fixes IGD on certain xeon processors

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-12 07:36:43 +01:00
Leah Rowe 0b37653ab9 grub: only enable nvme if needed on a board
remove nvme support from the "default" grub tree

now there are three trees:

* default: no xhci or nvme patches
* nvme: contains nvme support
* xhci: contains xhci and nvme support

this is in case a bug like lbmk issue #216 ever occurs
again, as referenced before during lbmk audit 5

there is no indication that the nvme patch causes any
issues, but after previous experience i want to be sure

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-12 00:58:22 +01:00
Leah Rowe 1952db5554 fix nasm download path for coreboot/fam15h
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-11 10:44:49 +01:00
Leah Rowe 2ee186aee3 minor code cleanup in the build system
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 18:48:58 +01:00
Leah Rowe c5441bb9f5 re-add ability to use cbfs grub.cfg as default
i removed this before, when making grub multi-tree,
because the design i used in an earlier version of
the patch actually added the grub.elf generation
to grub source itself, but then i decided to hack
around the grub build system from lbmk/cbmk instead

re-add this functionality, so that users can easily
insert their own custom grub.cfg into cbfs without
needing to re-build their image.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 16:06:07 +01:00
Leah Rowe d33556c6ae trees: exit with error if project undefined
i was originally looser about this, because i also wanted
the trees script to generically run "make" from any
directory, but this behaviour was error-prone and it is
no longer used in the build system.

disable it, in the interest of stability.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 15:58:09 +01:00
Leah Rowe 1799a33663 build: also make a lock file during release build
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 15:52:35 +01:00
Leah Rowe 78426a97e5 lib.sh: more useful lock message
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 15:44:20 +01:00
Leah Rowe e80c4b73ce create a lock file during builds
prevent duplicate main instances of the build
system from running

the lock file is deleted when the parent process
exits, alongside the tmpdir deletion

the build system must only ever be run ot one
instance at a time, per work directory

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 15:37:13 +01:00
Leah Rowe a0710ef9ca git.sh: hide e() output on for loop
this for loop is a hack to make sure that all the
sources get nuked (using nuke.list files).

hide the messages so that they do not appear when
running just any command in the trees script.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 15:27:03 +01:00
Leah Rowe 86eb566b13 lib.sh: fix regression
i was being a bit too clever about some optimisations

revert this change. otherwise, nothing will download
or build

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 15:23:50 +01:00
Leah Rowe fbcdf33f93 git.sh: download xtree *before*, not after
downloading it after means that if an error occurs
when downloading the xtree project, the main project
will still be there and nothing will mandate the
downloading of the xtree project. whereas, if we
grab the xtree project first, then the main project
won't get saved to src/

this makes the build system a bit more resilient under
fault conditions, but otherwise doesn't change behaviour.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 11:55:30 +01:00
Leah Rowe 6a3d8a9600 git.sh: fix deletion path in nuke()
i accidentally forgot to include src/ in the prefix

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 11:43:47 +01:00
Leah Rowe 3478b28821 lib.sh: less confusing error in download()
don't say "file missing", because it may be present!

instead, say that the download failed. this covers both
contexts: internet failed and thus no file present, or
the file is present but checksum verification failed.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 11:07:07 +01:00
Leah Rowe f3f5b99cec lib.sh: hide stderr on download()
on the initial check, the output is confusing because
it will say "checksum verification failed" if the
file doesn't already exist, but then goes to download.

only say checksum failed if a download occured, and the
check failed, otherwise report nothing except that the
file already exists.

this will not reduce the ability to debug issues later
on, and it will reduce the amount of confusion for users.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 11:04:25 +01:00
Leah Rowe 3440e1f651 lib.sh: simplify download()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 11:04:08 +01:00
Leah Rowe 75b39dbeb1 lib.sh: fix redundancy in download()
it was only downloading the main url, even when
it should use the backup.

fix it by actually using the for loop variable.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 10:58:19 +01:00
Leah Rowe 26df6e7ab2 lib.sh: simplify singletree()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 10:55:33 +01:00
Leah Rowe 9cdf419295 git.sh: further simplify nuke()
it's a very compact nuke

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 10:49:58 +01:00
Leah Rowe 1cede024d6 git.sh: simplify link_crossgcc()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 10:48:28 +01:00
Leah Rowe 77e482aae6 git.sh: simplify nuke()
do not over-engineer such a trivial thing.

seriously. all we're doing is nuking some files.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 10:42:10 +01:00
Leah Rowe 42e979509b Merge pull request 'Add dependency scripts for Fedora 40 and Ubuntu 24.04' (#220) from fuel-pcbox/lbmk:master into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/220
2024-06-09 06:42:26 +00:00
Leah Rowe a0eb79dfd8 add crossgcc tarballs to config/submodules/
support redundant downloads, and enable inclusion of these
tarballs inside release archives, for offline builds.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-09 06:55:25 +01:00
Leah Rowe b0d1ad32fa git.sh: support downloading *files* as submodules
when we download coreboot, we currently don't have a way to
download crossgcc tarballs, so we rely on coreboot to do it,
which means running the coreboot build system to do it; which
means we don't get them in release archives, unless we add
very hacky logic (which did exist and was removed).

the problem with coreboot's build system is that it does not
define backup links for each given tarball, instead relying
on gnu.org exclusively, which seems OK at first because the
gnu.org links actually return an HTTP 302 response leading
to a random mirror, HOWEVER:

the gnu.org 302 redirect often fails, and the download fails,
causing an error. a mitigation for this has been to patch the
coreboot build system to download directly from a single mirror
that is reliable (in our case mirrorservice.org).

while this mitigation mostly works, it's not redundant; the
kent mirror is occasionally down too, and again we still have
the problem of not being able to cleanly provide crossgcc
tarballs inside release archives.

do it in config/submodules, like so:

module.list shall say the relative path of a given file,
once downloaded, relative to the given source tree.

module.cfg shall be re-used, in the same way as for git
submodules, but:

subfile="url"
subfile_bkup="backup url"

do this, instead of:

subrepo="url"
subrepo_bkup="backup url"

example entries in module.list:

util/crossgcc/tarballs/binutils-2.41.tar.xz
util/crossgcc/tarballs/gcc-13.2.0.tar.xz
util/crossgcc/tarballs/gmp-6.3.0.tar.xz
util/crossgcc/tarballs/mpc-1.3.1.tar.gz
util/crossgcc/tarballs/mpfr-4.2.1.tar.xz
util/crossgcc/tarballs/nasm-2.16.01.tar.bz2
util/crossgcc/tarballs/R06_28_23.tar.gz

the "subrev" variable (in module.cfg) has been renamed
to "subhash", so that this makes sense, and that name is
common to both subfile/subrepo.

the download logic from the vendor scripts has been re-used
for this purpose, and it verifies files using sha512sum.
therefore:

when specifying subrepo(git submodule), subhash will still
be a sha1 checksum, but:

when specifying subfile(file, e.g. tarball), subhash will
be a sha512 checksum

the logic for both (subrepo and subfile) is unified, and
has this rule:

subrepo* and subfile* must never *both* be declared.

the actual configuration of coreboot crossgcc tarballs
will be done in a follow-up commit. this commit simply
modifies the code to accomodate this.

over time, this feature could be used for many other files
within source trees, and could perhaps be expanded to allow
extracting source tarballs in leiu of git repositories, but
the latter is not yet required and thus not implemented.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-08 05:44:53 +01:00
Leah Rowe 1a44fcfacf git.sh: remove unnecessary line break
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-08 02:17:23 +01:00
Leah Rowe 74ae84afba vendor.sh: add a return at the end of mkdirs
i don't like that it's not there, because of the quirks
in sh behaviour. put it there to put my mind at ease.

otherwise, this doesn't change any behaviour.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-08 01:59:46 +01:00
Leah Rowe c202dc612e vendor.sh: move download logic to lib.sh
in future revisions, i will make tarballs become subfiles,
to complement submodules. e.g. crossgcc tarballs in coreboot

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-08 01:55:15 +01:00
Leah Rowe 08d0a1d5d8 lib.sh: shorten a string in e()
line exceeds 80 characters

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-08 01:22:21 +01:00
Leah Rowe 9b00b30a4f move uefiextract to elf/uefitool/
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 21:30:43 +01:00
fuel-pcbox 046007b466 Add dependency scripts for Fedora 40 and Ubuntu 24.04 2024-06-07 13:02:40 -05:00
Leah Rowe 05d301bdee git.sh: fix submodule path
i accidentally cloned to tmpdir rather than tmpgit

oops!

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 16:54:05 +01:00
Leah Rowe 7e15859be6 git.sh: simplify prep_submodules()
copying the module list into tmpdir/ no longer makes sense,
because it was only done before when we supported either
running the list from "git submodule update", or module.list.

since we only support handling of module.list, we can
greatly simplify this function.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 16:28:01 +01:00
Leah Rowe acd3608bb1 git.sh: unified handling of git clone/reset/am
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 16:19:43 +01:00
Leah Rowe 668bcbf69c trees: simplified copy_elf() handling
don't create elfdir, create dest_dir, which is elfdir
plus the location within it

only create dest_dir within copy_elf, which is only
called if actually compiling the code

this avoids creating empty elf directories, and it
generally cleans up all handling, unifying the
handling of directories into a single function,
namely copy_elf() which already exists

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 15:04:24 +01:00
Leah Rowe 3eef7f37f2 git.sh: simplify submodule handling
there were stragglers remaining, from when we used to
actually run "git submodule update", but this was removed.

clean up the submodule functions and merge them together.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 14:40:59 +01:00
Leah Rowe 4b1b1f5098 git.sh: provide feedback for repository downloads
otherwise, it's not clear to the operator what's happening

i'm normally against such verbose feedback, because it's bloat,
but this minimal amount of feedback will make the build system
more pleasant to use, especially during testing.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 14:25:01 +01:00
Leah Rowe d43247683b git.sh: download "depend" projects *before*
don't do it after, because that means the main project
is saved under src/ before we know whether the subrepo
was downloaded.

the "depend" variable (in config/git/) is no longer used
for projects that go in subdirectories of a parent; now,
we use config/submodules/ for this type of dependency.

download the "depend" projects (as per config/git/) first.
this way, if they fail, the main one will fail, but if
they succeed and main fails, you can just run the main
download again and it won't fail.

this fixes a bug where, depending on how you download a
set of projects and depending on the order which you do so,
a given project can become un-downloadable on current design,
because git will complain that a directory already exists.

this fix is done not only in code (by this commit), but
by prior configuration changes.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 14:16:58 +01:00
Leah Rowe a4549e935e git.sh: reduced indentation in fetch_submodule
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 12:58:28 +01:00
Leah Rowe 11c47ba7dd git.sh: reduced indentation in prep_submodules
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 12:55:30 +01:00
Leah Rowe 9c1ea8f93a git.sh: *never* run git submodule update
only use config/submodules/ which the build system then
uses to run git clones manually, replicating the submodules
feature. we must never use a project's own gitmodules feature,
because we can't easily control it. better to let it break first,
and then figure out what modules to add manually, so that we
have only what we need for each project.

it's done this way, because git's own submodules feature
doesn't have very good error checking in general, nor
does it have good redundancy.

with the current design, we can declare backup repositories
for each submodule.

we replicate it precisely. for example:

3rdparty/vboot

this is a coreboot submodule, and we handle that in the
coreboot trees.

however, our current design also allows you to do this even
if the upstream repository does not contain a .gitmodules file

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 12:52:52 +01:00
Leah Rowe 137321ebc0 lib.sh: rename variable for clarity
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 12:50:16 +01:00
Leah Rowe 7bfb1d621f trees: don't check empty path in copy_elf()
it could lead to some whackiness later on

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 12:04:28 +01:00
Leah Rowe 0b7566cb78 trees: fix build issue caused by bad elf check
we're not checking for bad elfs, but the check itself was bad

due to a quirk in how sh works. really, really obscure bug.

fixed now!

if the given directory didn't actually exist, or there were no
files in it, it'd be searching for the file named "*"

which is obviously wrong

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-07 11:29:36 +01:00