Commit Graph

20 Commits (1e534e7dda107085236794c124bc546f285e877a)

Author SHA1 Message Date
Leah Rowe a76dda9330 vendor.sh: remove unnecessary assignment
dl_fail is set to n and then immediately to y afterward

why?

clearly i was dehydrated

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-31 17:27:13 +01:00
Leah Rowe 47f582d463 ./vendor download: skip if blob path is /dev/null
We use a path of /dev/null pointing to a ROM for
Fam15h AMD boards, to add fake PIKE2008 images.

This is to mitigate a hang in SeaBIOS, but now with
recent changes, this causes the command below to
download coreboot, when it should just exit saying
no vendor files needed. Prevent accidentally wasted
bandwidth. The command was:

./vendor download kcma_d8_rdimm_16mb

This now correctly does the following:
$ ./vendor download kcma_d8_rdimm_16mb
Vendor files not needed for: kcma_d8_rdimm_16mb

The joys of programming a build system in sh!

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-29 03:25:33 +01:00
Leah Rowe e9b9e825f1 ./vendor download: more fine-tuned error control
By default, the build system does set -u -e

Some errors are unavoidable and have to be handled, so
we have to set +u +e (turn off error handling in sh),
when downloading vendor files, but only certain parts of
vendor.sh trigger errors (which cause an exit).

Replace the current bazooka approach with a more fine
grained approach, turning error handling back on again
when it is safe to do so.

In the parts of the code where it is disabled, the code
is written very, very carefully, with errors still handled
manually, but more careful auditing is required.

This change has been tested and makes the command much
safer to run. In security (or any bug auditing), it is
the principle of least privilege that holds true.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-29 02:07:38 +01:00
Leah Rowe 0dd0dfaf3d vendor.sh: don't error on main targets
e.g. coreboot/default contains no config directory, so
the old logic would be trying to do:

.

which is obviously invalid

now for example:

$ ./vendor download default
Vendor files not needed for: default

and it will exit with zero status

the only thing that should ever return non-zero status
is when you define a target that does not exist, config
or no.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-29 00:48:18 +01:00
Leah Rowe 5c14e8e1bc general code cleanup in the build system
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-26 07:22:44 +01:00
Leah Rowe 5b5dccd630 vendor.sh: further simplify config handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-18 19:51:40 +01:00
Leah Rowe 8418ea9ab2 vendor.sh: greatly simplified config handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-18 19:45:52 +01:00
Leah Rowe 53b394f583 vendor.sh: move config checks to detect_firmware
they will later be removed, as part of unification against
other files that perform the same tasks

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-18 19:28:15 +01:00
Leah Rowe bb7255c34b vendor.sh: print an error upon ill-defined target
previously, it was attempting to load the configs and silently
failing. we must provide feedback to the user.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-18 11:25:28 +01:00
Leah Rowe 3f73f3d0b4 vendor.sh: remove redundant check
we literally do this check twice, in immediate succession.

avoid wasted i/o

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-18 11:20:56 +01:00
Leah Rowe 32923f5608 vendor.sh: simplify defconfig check
re-use check_defconfig from option.sh

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-18 11:14:39 +01:00
Leah Rowe 839ef680cd lbmk: allow easier sync with cbmk
an equivalent change has been made in cbmk.

certain lbmk-specific variable names have been made
generic, with certain functions and other variables
moved around.

i maintain sync between libreboot and canoeboot, where
both projects can have the same behaviours, and most of
the merge conflicts have to do with variable names
containing "LBMK", "lbmk", "cbmk" or "CBMK", or
indeed "canoeboot" and "libreboot"

LBMK/lbmk/CBMK/cbmk variables between canoeboot and
libreboot now contain the string XBMK/xbmk

it should now be *much* easier to merge build system
changes between lbmk and cbmk.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-16 03:56:52 +01:00
Leah Rowe cc33974150 remove haswell mrc blob (libre raminit stable now)
broadwell mrc is retained, because it's needed on 820 g2

it's no longer needed on haswell, because nri is stable. nri
is short for "native ram initialisation", and libreboot provides
this for: thinkpad t440p, thinkpad w541, dell optiplex 9020 mt,
and dell optiplex 9020 sff

remove, in line with libreboot's binary blob reduction policy

previous revisions, prior to the recent release, stated that
it would be retained for compatibility, but it's really not
right to retain it, because doing so violates libreboot's policy

the recent release excluded mrc-based rom images for haswell
machines, providing only those rom images that use the libre
raminit, while retaining support for mrc in the build system, so
that users could still run the lbmk inject script on older release
roms that use mrc

again: libreboot's binary blob reduction policy is very clear:

https://libreboot.org/news/policy.html

it is a policy that can be summarised, thus:

if a blob can be avoided, it must be avoided.

therefore, we will avoid the Haswell MRC raminit blob

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-11 19:12:11 +01:00
Leah Rowe 029291e549 merge script/vendor/* into include/vendor.sh
stub it from the main build script

the commands remain identical:
./vendor download arguments_here
./vendor inject arguments_here

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-11 05:57:49 +01:00
Leah Rowe c14461a56b delete include/vendor.sh and merge elsewhere
move it all to other files where items are used, and not
used anywhere else. this reduces the size of vendor.sh.

also remove a few redundant variables, or variables that
are not meaningfully used.

a few items have been moved to include/option.sh

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-15 13:00:14 +01:00
Leah Rowe d8c2c24507 vendor.sh: move some functions to vendor/download
they are the functions only used by the download
script, so they don't belong in vendor.sh

an include file should only contain variables and
functions used by multiple main scripts

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-15 10:01:16 +01:00
Leah Rowe 3f8636ff67 vendor/inject: simplified file handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-14 08:55:48 +01:00
Leah Rowe ec0b38afb3 update/release: nuke roms using the inject script
This way, the handling of configs is unified into one
script, which reduces the possibility of bugs later,
and it reduces the repetition of code.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-14 03:31:45 +01:00
Leah Rowe 09881212c3 use me_cleaner from coreboot instead of upstream
coreboot closely matches upstream, whose current release
is version 1.2 from 2018, and coreboot has not changed it
in any meaningful way.

the upstream did add patches since, but they are documentation
patches only.

this means: we do not need to use the upstream version

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-12 22:21:02 +01:00
Leah Rowe 62cc895c3c rename blob/ to vendor/
in the future, we may start downloading files that aren't
blobs, such as mxm port configs (on mainboards that use
MXM graphics)

this directory will contain all of those files

generally change the language used, across lbmk, to make
use of "vendorfile" instead of "blob"

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 01:23:11 +01:00