Commit Graph

20 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
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
Alper Nebi Yasak 584210bd1f download/u-boot: Change to download target before running extra.sh
The U-Boot download script does its work from the repository root
instead going into the newly created dirs, unlike the coreboot
counterpart. It should run the board-specific extra.sh files with the
downloaded paths as their working directory. Do so by a subshell.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-12-09 16:50:29 +03:00
Alper Nebi Yasak 2b761f2f8a download/u-boot: Re-add usage text for no-argument form
The no-argument form of the U-Boot download script prepare trees for all
boards when run with no arguments, like the corresponding script for
coreboot. The usage text for this case was removed without any changes
to the corresponding code, assume it was by mistake and add it back.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-12-09 16:50:29 +03:00
Alper Nebi Yasak 71cf7f9db1 download/u-boot: Remove support for deleting git folders
Removing the git dirs was part of deblobbing, which Libreboot no longer
cares about. The variable that triggers it is no more. Remove the dead
code.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-12-09 16:50:29 +03: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
Alper Nebi Yasak cf29574165 download: Use shallow clones for big projects
Downloading coreboot and U-Boot takes quite the disk space and bandwith.
We don't need to download entire repos, only the revisions that we are
interested in.

Use the --depth=1 option to only download the files we need. Since the
initial clones may not have our target revision, always try to fetch it.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-08-27 17:35:55 +03:00
Alper Nebi Yasak ef39e05bb5 download: Allow keeping .git dirs with NODELETE=git
Keeping the git repositories is useful while development, e.g. to avoid
git cloning repositories over and over again while debugging download
scripts. Setting the NODELETE environment variable keeps the blobs and
the git repositories. Allow a slightly finer-tuned version of this where
we can keep only the git-related files by setting the variable to "git".

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-08-27 17:35:55 +03:00
Alper Nebi Yasak 270272eb61 download/u-boot: Remove .git folders as well
The coreboot download removes .git folders as they still contain the
removed blobs, remove those in the U-Boot version as well.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-08-27 17:35:55 +03:00
Alper Nebi Yasak 820b8e706e download/u-boot: Support running extra commands from board dirs
Although it's unlikely, boards might want to run extra commands after
the board-specific U-Boot directories are prepared. Copy the existing
mechanism for that from the coreboot download script to the U-Boot one.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-08-27 17:35:55 +03:00
Alper Nebi Yasak eae6b35dab download/u-boot: Support applying patches from board dirs
Boards may need different sets of patches to be applied to their U-Boot
builds, copy the existing mechanism from the coreboot download script to
the U-Boot download script.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-08-27 17:35:55 +03:00
Alper Nebi Yasak 454364ccb8 download/u-boot: Try to update submodules as in coreboot script
The coreboot download script tries to update submodules, since coreboot
does use git submodules to retrieve and compile the projects it depends
on. Although U-Boot doesn't use submodules, try to update them anyway to
match the coreboot download script.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-08-27 17:35:55 +03:00
Alper Nebi Yasak 0aeb69b5ad download/u-boot: Use GitHub mirror as fallback
The coreboot download script uses GitHub as a fallback if the upstream
coreboot is unavailable, use a similar fallback for U-Boot as well.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-08-27 17:35:55 +03:00
Alper Nebi Yasak 7b552bd299 download/u-boot: Support reading tree and revision from board.cfg
Boards may want to specify a board-specific U-Boot revision. At the very
least, pseudo-boards for u-boot-libre releases will need to specify their
U-Boot versions somehow.

Copy the existing mechanism from download/coreboot for specifying
build info with board.cfg files. Specify the commit hash for the
'v2021.07' pseudo-board, and 'master' as the default.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-08-27 17:35:55 +03:00
Alper Nebi Yasak 8dd1a24504 download/u-boot: Prepare files per board instead of per revision
The U-Boot download script is designed to help with releasing
u-boot-libre and it can only prepare a generic U-Boot v2021.07 tree.
However, we will need to build board-specific versions of U-Boot to be
able to use it as a coreboot payload effectively.

As a first step toward that, make the download script prepare per-board
copies of U-Boot v2021.07. Then, add a 'v2021.07' pseudo-board for the
u-boot-libre release script to work on.

The u-boot-libre deblob script hash ends up chaning due to copying my
author attribution from the download script, update its hash.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-08-27 17:35:55 +03:00
Denis 'GNUtoo' Carikli 8833be159b
scripts: download: u-boot: fix u-boot repository URL
Without that fix we have the following warning during the download:
    Cloning into 'u-boot/u-boot'...
    warning: redirecting to https://source.denx.de/u-boot/u-boot.git/

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
2022-02-16 19:33:53 +01:00
Denis 'GNUtoo' Carikli 425162db93
boot-libre: add --gen-blob-script to generate a deblob script
This should enable various distributions and build system to reuse
the generated script to deblob u-boot releases themselves.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
2022-02-16 19:11:14 +01:00
Denis 'GNUtoo' Carikli ee2731af44
boot-libre: ship the blob list too
This should enable various distributions and build system to reuse
that blob to deblob u-boot releases themselves.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
2022-02-16 19:11:12 +01:00
Denis 'GNUtoo' Carikli 4b2d426a20
scripts: download: u-boot: Add help and support for multiple revisions
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
2022-02-16 18:00:30 +01:00
Denis 'GNUtoo' Carikli 7422411b24
Add support for releasing deblobbed u-boot 2020.07 source tarballs
Once the tarball are released, it will enable distributions to use
these tarballs to produce deblobbed u-boot packages.

Note that the produced tarball is not reproducible yet. Because of
that it has to be trusted.

During a release, it's a good idea to sign the uncompressed tarball as
the various compression formats and associated tools make different
tradeoffs.

For instance with xz, xz -9e tends to compress really well with the
the most used xz[1] implementation, and most GNU/Linux users probably
already have it installed, but and the drawbacks is that the format is
very fragile[2].

The lzip format is more suited for long term archiving but its most
packaged implementation[3] is less likely to be already installed by
users than more well known formats like xz, bzip2 or gzip.

Being able to add more compression formats after the release is also
useful, for instance to accommodate different build systems or use
cases (like being able to build u-boot with less dependencies in
distributions like Guix, or building u-boot directly on devices which
don't have enough RAM for xz for instance).

[1]https://tukaani.org/xz/
[2]https://www.nongnu.org/lzip/xz_inadequate.html
[3]https://www.nongnu.org/lzip/

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
2022-02-10 10:55:03 +01:00