Commit Graph

26 Commits (a4ea2867319471d9fe7d4ee540881e0286b4d3cf)

Author SHA1 Message Date
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 4ac0bc8d3e blobutil/download: minor code cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-18 11:41:56 +01:00
Leah Rowe b74e407806 blobutil/download: cleaner coding style
consistent indentation, and 80-line character limit
(RFC 2646)

top-down order, a main() is introduced, split into
more functions

non-zero-status exit (with message) now, when a non-
defined target is provided, e.g. nonexistentboard_4mb

puffy!
2023-05-14 20:36:06 +01:00
Leah Rowe 5a197b4ff1 blobutil: support downloading E6400 VGA ROM
For Nvidia GPU models of Dell Latitude E6400
2023-05-06 22:23:27 +01:00
Riku Viitanen 6ff0284a51 Add HP EliteBook Folio 9470m 2023-04-22 04:04:37 +03:00
Leah Rowe 560642c585 chmod +x on blobutil/download script
i downloaded this file from git manually at some point,
when rebasing changes (i think it was the ec ones)

the logic in the file is correct but i forgot to mark
it executable

without this commit, lbmk fails utterly, on all the newer
intel boards
2023-04-20 22:24:11 +01:00
Leah Rowe b9ee4e79c3 blobutil: support fetching KBC1126 EC (HP laptops)
This is useful for e.g. HP EliteBook 2560p.

In coreboot config, enable e.g. (for lbmk blobutil):

CONFIG_KBC1126_FW1="../../ec/hp2560p/ec.bin.fw1"
CONFIG_KBC1126_FW2="../../ec/hp2560p/ec.bin.fw2"

In resources/blobs/sources you would have these entries:

EC_url
EC_url_bkup
EC_hash
2023-04-15 00:11:23 +01:00
Leah Rowe 668de6d81f blobutil: support extracting ME from full ROMs
In cases where the vendor update file contains a full
ROM image encompassing IFD+GbE+ME+BIOS, blobutil was
saving the *entire* ROM containing those, as me.bin.
For example, if it's an 8MB ROM, blobutil would create
a me.bin file that is actually the whole ROM containing:

* Vendor IFD region
* Vendor GbE(if it has one)
* Vendor ME region
* Vendor BIOS region

This fix tries with -M and -O first. In this combination,
me_cleaner shall extract me.bin (neutered) and save it.

If that fails, then the normal method with just -O is
tried, which by this logic would always be a lone ME
image if it succeeds.

I tested downloading ME images on existing boards with
this, and it didn't break them, and this fixes the bug.

This is done for HP 8200 SFF which Riku_V is adding to
lbmk. I'm on IRC with Riku_V as I write this commit
message! Super hot hotfix patch.
2023-04-14 01:41:07 +01:00
Leah Rowe 65d7e7c1dd blob/download: don't use bad character in printf
This fixes errors when running that script.
2023-04-10 06:50:33 +01:00
Leah Rowe df534acd24 blobutil: replace fake tabs with tabs
always use tabs
2023-04-01 17:59:09 +01:00
Leah Rowe a2686bf4f4 blobutil: don't hardcode paths 2023-04-01 17:12:19 +01:00
Leah Rowe 688e508175 blobutil/download: don't hardcode me.bin paths
Bruteforce it. Some executables are just using inno
archival but some are simple LZMA. This patch handles
both of them, and also the event where you have LZMA
compressed files (even LZMA compressed files within
LZMA compressed archives) within any inno/lzma compressed
executable.

It recursively scans inside a vendor update, to find
a me.bin files for neutering with me_cleaner.

This is in preparation for two new ports in Libreboot:

* HP EliteBook 8560w
* Apple MacBook Air 4,2 (2011)

This script can literally be used with multiple vendors now.
It is no longer specific just to Lenovo. I originally did
this and other recent commits to the file, as one big
commit, but I decided to split it all up into small commits.
2023-04-01 13:47:01 +01:00
Leah Rowe ed47c91453 blobutil/download: split into small functions
This patch makes it easier to determine which part does what.
2023-04-01 13:06:35 +01:00
Leah Rowe b10bfacf67 blobutil/download: make more logic top-down
Basically, I really like OpenBSD coding style, and I want to
replicate this, somewhat, in shell scripts.
2023-04-01 11:27:56 +01:00
Leah Rowe 1c2f9b54c6 blobutil/download: move main logic to the top
Top-down order is easier to read, for greater understanding.

What's moved is initialisation. The glue that calls Build_deps
and Download_needed still need to be at the bottom.
2023-04-01 11:20:12 +01:00
Leah Rowe 14b5947ed9 blobutil/download: move Build_deps to the top
It's called first, so declare it first!
2023-04-01 11:13:04 +01:00
Leah Rowe 7f3c0ca81e improved a comment 2023-04-01 11:11:31 +01:00
Leah Rowe af29f112ab blobutil: rename variables to make more sense
for example, files being downloaded have nothing to do
with the ME; they are merely compressed, and contain many
files in addition to it
2023-04-01 03:36:41 +01:00
Leah Rowe be3d7b7e69 haswell: re-add mrc.bin in separate board configs
libre mrc on haswell is quite buggy for now, but works in
a limited fashion

this patch re-adds the old configs, but as _mrc for example
t440p_12mb_mrc instead of t440p_12mb

and t440p_12mb (without _mrc) still uses the libre mrc code
2023-03-18 15:20:03 +00:00
Leah Rowe 548872ce8e haswell boards: use libre mrc.bin replacement
courtesy of Angel Pons from the coreboot project

this uses the following patch set from gerrit, as yet
unmerged (in coreboot master) on this date:

    https://review.coreboot.org/c/coreboot/+/64198/5

logic for downloading mrc blobs has been deleted from
lbmk, as this is now completely obsolete (for haswell
boards)

if other platforms are added later that need mrc.bin,
then logic will be re-added again for that
2023-03-18 00:55:10 +00:00
Ferass 'Vitali64' EL HAFIDI 7f5dfebf7d Do not rely on bashisms and behaviour undefined by the POSIX specification. Part 2
Signed-off-by: Ferass 'Vitali64' EL HAFIDI <vitali64pmemail@protonmail.com>
2022-12-28 18:43:49 +00:00
Leah Rowe 137b5434d7 remove logic for avoiding nonredistributable blobs
the --nuke option in ifdtool will be used instead, to nuke
the ME regions in specific rom sets (and cbfstool will be
used to delete mrc.bin files from rom sets)

the new method being implemented is heavier on disk io, but
simplifies lbmk, and disk io could still be optimised in
the following ways:

* when copying roms from boards with ME in them, use
  ifdtool --nuke to get filename.rom.new, and *move* (not copy)
  filename.rom.new to the new destination (for use with tar)

* possibly modify ifdtool to make efficient use of mmap for
  disk i/o; it currently loads entire roms into an allocated
  buffer in memory
2022-12-05 00:10:07 +00:00
Alexei Sorokin ec082429ab scripts: avoid relying on spaces from sha1sum output 2022-11-29 20:26:35 +00:00
shmalebx9 175b48a4e0 added more checks and optimised extraction script 2022-11-26 12:56:31 -07:00
shmalebx9 1246c3adb9 add smort failures to blob download script 2022-11-20 14:32:25 -07:00
Leah Rowe 7af9953463 pragmatic system distribution guideline compliance
osboot is now part of libreboot, and will soon shut down.
libreboot now conforms to osboot policy.
2022-11-14 00:51:12 +00:00