Commit Graph

290 Commits (fsdg20230625)

Author SHA1 Message Date
Leah Rowe e1df640578 uboot: delete blobs, based on blobs.list file
and with that, censored-libreboot is now complete, ready
for a first release :)

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-07-10 01:52:45 +01:00
Leah Rowe b55cc19f41 coreboot: AMD Fam10/15: don't build GCC-GNAT
do this with board.cfg option:

crossgcc_ada="n"

add this environmental variable when building
crossgcc, if crossgcc_ada="n":

BUILD_LANGUAGES=c

This avoids building the GNAT/Ada compiler in GCC.
Coreboot 4.11 is only used for some AGESA boards
that don't need Ada (their video init is the old
style, written in C, it's not libgfxinit)

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-07-09 11:20:56 +01:00
Leah Rowe 0f09c0d72b download/coreboot: re-add book-burning support
see:

https://en.wikipedia.org/wiki/Book_burning

i'll actually update blobs.list for each coreboot rev
in a subsequent commit. this logic was taken from an
old libreboot revision, which uses different coreboot
revisions. as i write this, i'm running deblob-check
from linux-libre deblob scripts.

my process is: i just check each file and decide whether
it's a blob, or like, test data. in some cases it flags
other false positives, like... a C source file that has
a bunch of magic numbers in it for things (not a blob)

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-07-08 23:45:57 +01:00
Leah Rowe 2bbb4c839a remove blobutil and boards/utils needing/for blobs
delete all blobs. TODO: actually deblob coreboot/uboot
when downloading. i'll that in a little while, in an
upcoming commit.

yes.

purge it all, in fsf style. censor what the fsf doesn't like.

so that they can feel good about having less, because
ideological purity is better than helping more people
use coreboot, yes?

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-07-08 22:09:58 +01:00
Leah Rowe f34e07ae27 build/boot/roms: fix coreboot-version in releases
This error was observed, in the coreboot build system:

In file included from src/lib/version.c:4:
build/build.h:10:32: error: 'libreboot' undeclared here (not in a function)
   10 | #define COREBOOT_MAJOR_VERSION libreboot-20230625
      |                                ^~~~~~~~~
src/lib/version.c:35:46: note: in expansion of macro 'COREBOOT_MAJOR_VERSION'
   35 | const unsigned int coreboot_major_revision = COREBOOT_MAJOR_VERSION;
      |                                              ^~~~~~~~~~~~~~~~~~~~~~

This happened on the 20230625 *release archive*, when a user tried to
build for W541 MRC on an Arch Linux container.

This change fixes the error. I never got the error on my end when
build testing the release archives, but this will prevent the error.
Fix it by only inserting libreboot version string YYYYMMDD representing
the Libreboot version. (libreboot uses ISO dates as version numbers)

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-07-08 00:27:53 +01:00
Leah Rowe 4efa545a46 build/release/src: clean spkmodem/e6400 utils
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-25 13:33:20 +01:00
Leah Rowe 2e85a63a0a build/roms_helper: reset d521fca7, backport fixes
I keep getting random linker issues when running:

./build boot roms all

I think the issue lies somewhere in here, from when
I did that massive audit. So I'm undoing the audit
which mostly re-factored the code style here.

These changes are being backported:
f338697b build/boot/roms: Support removing microcode
941fbcb run coreboot utils from own directory
f256ce98 build/boot/roms: say board name on stderr

I removed this change:
6d6bd5ee (the script now uses dedicated utils directory)

additionally:

cbutils is built much earlier on in the script, first
thing after initialising variables

the other changes not backported are all code style
changes, and I believe these are responsible.

if no other fixes occur to this fire before the next
libreboot release, then my hunch was right.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-25 12:21:48 +01:00
Leah Rowe f256ce9870 build/boot/roms: say board name on stderr
That way, I can more easily debug build issues with
specific boards, e.g.

./build boot roms all 2>lbmk.err.log

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-25 03:06:13 +01:00
Leah Rowe 1deb5843eb build/roms: distclean coreboot before each build
don't clean it, distclean it

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-24 23:28:41 +01:00
Leah Rowe 941fbcbf1b run coreboot utils from own directory
this means coreboot can now be distcleaned safely,
before and after each build of a rom image

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-24 23:23:16 +01:00
Leah Rowe 4a49ea3599 build/cbutils: distclean before building
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-24 22:54:53 +01:00
Leah Rowe 55fc8fe0b0 build/cbutils: exit if utils dir doesn't exist
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-24 22:50:09 +01:00
Leah Rowe dd16a575e7 build/cbutils: tab indentation, not spaces
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-24 22:33:29 +01:00
Leah Rowe 494c4d8dfe build/cbutils: rename variable for clarity
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-24 22:32:53 +01:00
Leah Rowe 1762d114d3 build/boot/roms_helper nicer indent on switch loop
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-20 02:06:51 +01:00
Leah Rowe 97c9f06c91 blobs/download: exit if no board configs found
fixes ./build boot roms all

in detect_firmware(), "set" is used to get values from
configs, to know if things like ME/MRC are needed

on some "board" configs under resources/coreboot/, no
actual coreboot configs are provided, because they are
used as a reference (coreboot revision, tree name etc)
for actual boards, with actual coreboot configs

when attempting to build for such a board, running "set"
on such non-existent files would cause a non-zero exit,
when we want zero. the non-zero exit then caused the
build/boot/roms command to fail, when running "all" if
it found, for example, resources/coreboot/cros/ which
has the above problem, in this context

work around it by verifying that coreboot configs exist
for the given target name, in the blobutil download script.
if no such configs exist, then exit zero (success)

doing so is correct, because the script is intended to
do just that, erroring only if it is detected that blobs
are needed for a given board, but other errors occur; if
no coreboot configs exist, then no roms will be built and,
therefore, no blobs are needed

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-20 01:53:12 +01:00
Leah Rowe 652f3ba379 build/boot/roms: remove wrong parentheses
will pass all args as a single arg, which is wrong

fix that

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-20 01:15:28 +01:00
Leah Rowe 794def924c build/boot/roms: nicer indent style on switch loop
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-20 01:09:11 +01:00
Leah Rowe a08b6ac8e2 build/boot/roms: only set firstoption if argc>0
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-20 00:56:44 +01:00
Leah Rowe 347f0899b7 update release files
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-20 00:51:41 +01:00
Leah Rowe 051f928fd2 Merge pull request 'Cache downloads based on checksum' (#81) from Riku_V/lbmk:dl_cache into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/81
2023-06-19 22:17:19 +00:00
Leah Rowe f338697b96 build/boot/roms: Support removing microcode
From now on, the following rules are available for all
mainboards, in resources/coreboot/boardname/board.cfg:

* blobs_required="n" or "y"
* microcode_required="n" or "y"

The blobs setting, if set to "n", simply renames filename.rom to
filename_noblobs.rom.

The microcode setting, if set to "n", copies the ROM (with or
without _noblobs) to filename_nomicrocode.rom (if blobs="n",
it would be filename_noblobs_nomicrocode.rom).

Where "nomicrocode" is set, ROMs with microcode will still be
provided by lbmk and in relesase, but ROMs will also be provided
alongside it that lacks any microcode updates.

If the *original* ROM already lacks microcode updates, then the
original ROM will be *renamed* to include "nomicrocode" in the name.
This is done on images for ARM platforms, for instance, where
microcode is never used whatsoever.

Example filenames now generated:
seabios_e6400_4mb_libgfxinit_corebootfb_noblobs_nomicrocode.rom
seabios_e6400_4mb_libgfxinit_corebootfb_noblobs.rom
seabios_withgrub_hp8300usdt_16mb_libgfxinit_corebootfb_colemak_nomicrocode.rom
seabios_withgrub_hp8300usdt_16mb_libgfxinit_corebootfb_colemak.rom
uboot_payload_gru_kevin_libgfxinit_corebootfb_noblobs_nomicrocode.rom

A vocal minority of people were not happy with some of the changes
made in Libreboot last year, including on existing supported
hardware from before those changes were made. I did this before the
last release, out of respect:
https://libreboot.org/news/gm45microcode.html
(re-add mitigations for no-microcode setup on GM45)

This new change is done as an further, extended courtesy. Tested
and works fine. (testing using cbfstool-print)

Actual Libreboot policy about binary blobs is nuanced. See:
https://libreboot.org/news/policy.html (reduction policy) and:
https://libreboot.org/freedom-status.html (implementation)

Well, the status page talks about descriptor vs non-descriptor
on Intel platforms, and where me_cleaner is used (on platforms
that need Intel ME firmware), it regards the descriptored setups
to be blob-free if coreboot does not require binary blobs.

In this paradigm, microcode updates are not considered to be
binary blobs, because they aren't technically software, they're
more like config files that just turn certain features on or off
within the CPU.

However, for lbmk purposes, "noblobs" means that, after the ROM
is fully ready to flash on the chip, there will be no blobs in
it (except microcode). So for example, an X200 that does not
require ME firmware is considered blob-free under this paradigm,
even though Libreboot policy regards X230 as equally libre when
me_cleaner is used; in this setup, ROMs will not contain "blobfree"
in the filename, for X230 (as one example).

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-06-19 10:44:02 +01:00
Riku Viitanen 0f4f32cfc2 Cache downloads based on checksum
Since many boards use the same ME firmware, we could save
everyone's bandwidth and time by caching the update files.

Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-06-17 18:15:55 +03:00
Leah Rowe 2e38ddaa9b Revert "Remove most of Ferass's lbmk contributions"
This reverts commit a4ea286731.

The licensing audit has been abandoned. I will not be re-licensing
in bulk to MIT.

I can still use MIT license on new works, e.g. utilities, but there's
really no pressing need to re-license lbmk. It's just shell scripts,
and most of what it interacts with (coreboot, grub, seabios) is GPL
anyway.

So who cares?

Ferass's patch was removed due to refusal to re-license, but the
decision to re-license has been canceled.

I'm now aiming for a quick stable release.
2023-06-13 12:09:01 +01:00
Leah Rowe 06c92d4a4a blobutil: merge with main script
make blobutil a symlink. Example of command changes:

./blobutil download x220_8mb
is now:
./update blobs download x220_8mb

The old command still works, for compatibility.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-27 12:00:04 +01:00
Leah Rowe ff954c5b73 unify download/build scripts
move resources/scripts/download/ to:
resources/scripts/update/module/

This: ./download coreboot
Is now: ./update module coreboot

However, running "./download coreboot"
still works, via backwards compatibility.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-27 11:44:54 +01:00
Leah Rowe 6344b19600 build/payload/seabios: reduced indentation
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-27 09:43:05 +01:00
Leah Rowe a4ea286731 Remove most of Ferass's lbmk contributions
The primary purpose of my intense auditing has
been to improve lbmk's coding style and fix bugs
but there is a secondary purpose: know precisely
who owns what, because I want to re-license as
much as possible of lbmk under *MIT*, instead of
the current GNU licensing. MIT is vastly superior,
because it grants *actual* freedom to the user,
permits *sublicensing* and it is vastly more
compatible with other GPL combinations; for
example, MIT license is compatible with GPL2-only
whereas lbmk's current mix of GPLv3-or-later and
GPLv3-only is legally incompatible with GPLv2-only.

Re-licensing under MIT will most likely result in
more contributions to Libreboot's build system in
the future, especially as it will attract a lot
more commercial interest. Contrary to the popular
arguments, copyleft is a liability to the free
software movement and results in less code being
written; in practise, permissively licensed code
gets more public contributions, including from
commercial entities, even if companies can
theoretically make something proprietary out of
it (in practise, anyone inclined can just use the
upstream and proprietary forks almost always die).

Copyleft propaganda is fundamentally flawed. See:
<https://unixsheikh.com/articles/the-problems-with-the-gpl.html>

Anyway, I've been doing a combination of:

* Seeking permission from other copyright holders,
  for re-licensing
* Deleting, or moving, other contributions; for
  example, splitting certain contributions into
  separate files so that originally modified files
  become unencumbered. This latter solution is a
  result of *code cleanup* arising from the audit.

For Ferass's contributions, I opted to seek
*permission*, and permission was denied. In full compliance
with this legal imperative, I'm acting accordingly; this
commit removes all of Ferass's changes that converted lbmk
to posix shell scripts, thus removing his copyright on the
affected files, bypassing his authority entirely. Therefore,
lbmk is largely now bash-dependent. In practise, nobody is
going to use anything other than a GNU system to build
Libreboot, because many projects that Libreboot makes use
of rely heavily on GNU; for example, coreboot's build
system makes heavy use of GNU-specific extensions in *GNU
Make*, and likely contains many bashisms. Of course,
Libreboot also compiles GNU GRUB.

I would much rather have MIT-licensed Bash scripts
than GPL-licensed posix SCL scripts.

This reverts the changes from Ferass El Hafidi,
for the following commits, with some exceptions:

* 7f5dfebf7d
* f787044642

Exception:

download/mrc not reverted, because that was
already a fork of an existing script under
coreboot's build system, and their script was
GPLv2. i cannot/will not re-license this file
(ergo,
7f5dfebf7d
change remains intact, on this file)

resources/scripts/build/boot/roms_helper, these changes
have been kept:
* 7e6691e9 - Add ARMv7 and AArch64 support
* dec2d720 - add myself in the build/roms_helper script
	(added 2021 copyright for the change below)
* b7405656 - Workaround for grub's slow boot
^ these changes will be re-factored, splitting them
  out of the file into a new file. This will be done in
  a future lbmk revision. (in some cases, it makes sense
  to keep a change but split it, allowing the main file to
  be re-licensed without the change in it)

This is part of a much larger series of
licensing audits. It's likely that lbmk will
be posix-compliant (in its shell scripts)
again some day, because I'm planning to rewrite
most of these scripts (the ones modified in this
patch), and many of them (e.g. individual download
scripts) are subject to future deletion in a planned
overhaul of the download logic for third party
projects.

In addition: these changes are being kept (no attempt
to re-license them will be made):

* cff081c6 - Fix grub's slow boot (1 year, 5 months ago) <Vitali64>
* 4c851889 - Add macbook*1 16mb configs (1 year, 6 months ago) <Vitali64>

Ferass's work that remains will be split into dedicated
files containing them, where feasible.

In the case of grub.cfg (for GNU GRUB), I don't care
because it's a script for an engine (GRUB shell) that's
under GPL anyway, so who really cares about MIT license.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-27 08:10:50 +01:00
Leah Rowe 2be1a8ea76 download/coreboot: fix error handling in subshell
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-24 07:45:07 +01:00
Leah Rowe d0171eeff3 download/coreboot: don't needlessly re-download 2023-05-24 07:16:51 +01:00
Leah Rowe c616930b71 download/coreboot: remove unnecessary bloat
it is not necessary to have help output

similarly, listing all boards in this script is
pointless. why not just run ls -1 on the directory?
2023-05-21 03:24:29 +01:00
Leah Rowe d1935c0590 build/clean/u-boot: remove unnecesssary check
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-20 21:48:12 +01:00
Leah Rowe 676efbb0df build/clean/u-boot: improved coding style
tabs for indentation

simplify some checks
2023-05-20 21:47:10 +01:00
Leah Rowe 06a92f61a8 build/clean/ich9utils: don't use subshell
this also fixes error handling

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-20 21:38:54 +01:00
Leah Rowe 43e2dfe2bf build/u-boot: top-down, split-function code style
main() on top

top-down order of logic

logic split into separate functions

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-20 21:33:37 +01:00
Leah Rowe a8f0721a6f build/payload/u-boot: 79 chars or less per line
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-20 20:48:19 +01:00
Leah Rowe 89ac1ea5a9 build/payload/u-boot: fix wrong attributions
only alper and ferass have ownership of this file,
but ferass only submitted to it in 2022, not 2021

fix this

i've removed myself from the file, for now

i never touched this file before, so it's
not right that my name be here

put alper's name at the top, because alper
was the person who created this file first

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-20 20:32:40 +01:00
Leah Rowe c973b95909 build/payload/grub: rename functions for clarity
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-20 20:16:10 +01:00
Leah Rowe 51e0e40123 build/payload/grub: remove unnecessary check
sed does the same job as cp, in this situation

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-20 20:08:40 +01:00
Leah Rowe 8e206be7c8 build/payload/grub: split logic into functions
main() on top

top-down logic

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-20 20:07:22 +01:00
Leah Rowe db7e81612a build/payload/grub: 79 chars or less per line
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-20 19:55:40 +01:00
Leah Rowe 92bd18c45a build/release/roms: minor cleanup
split actual purging of blobs to a function

rename functions for clarity
2023-05-20 19:45:08 +01:00
Leah Rowe ec3d1006b3 build/release/roms: handle argument properly
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-20 19:40:31 +01:00
Leah Rowe e0b9766087 build/release/roms: remove superfluous comments
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-20 19:36:51 +01:00
Leah Rowe 681538a20c build/release/roms: handle errors inside subshell
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-20 19:35:36 +01:00
Leah Rowe a9bd54423c build/release/roms: split logic into functions
main() on top

top-down logic

79 chars or less, per line

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-20 19:33:29 +01:00
Leah Rowe 2983309006 build/release/roms: use tabs for indentation
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-20 19:15:50 +01:00
Leah Rowe fff5fa53ff build/release/src: 79 chars or less per code line
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-20 19:03:04 +01:00
Leah Rowe 1cdf1c7cf0 build/release/src: handle errors in subshells
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-20 18:59:59 +01:00
Leah Rowe 16f878e882 build/release/src: split logic into functions
main() on top

top-down logic

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-20 18:52:33 +01:00