Commit Graph

1343 Commits (cea88fa827c00ef13c51c81b0e60c74019591ba3)

Author SHA1 Message Date
Leah Rowe 27aaae5992 update/release: also set timestamp on srcdir
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-14 02:22:48 +01:00
Leah Rowe ca78fc6762 update/release: be more thorough updating times
use find and touch, to force all files, directories and
links to the desired timestamp (versiondate file)

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-14 01:40:23 +01:00
Leah Rowe 7cd84aec28 update/release: use getops OPTARG correctly
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-14 00:35:02 +01:00
Leah Rowe b5db048089 update/release: delete multi-tree upstream repos
e.g. src/coreboot/coreboot must not appear in a release,
because we instead have directories like
src/coreboot/default or src/coreboot/cros

lbmk resets src/coreboot/coreboot to HEAD, but then resets
revisions properly in copies of it

therefore, for reproducibility, we must not include
src/coreboot/coreboot, src/u-boot/u-boot or
src/seabios/seabios into libreboot releases

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-13 23:53:24 +01:00
Leah Rowe 6846c9f735 update/release: if *GNU* tar, use --mtime
with --mtime, files added to the archive can be set
to a static date (in this case, the unix epoch)

the one used here is derived from git commit dates,
and it is static; if not being handled in lbmk.git,
the versiondate file never changes

this is the first patch in a series of patches designed
to bring about reproducible builds in libreboot

a solution will need to be found, for non-GNU tar
implementations, because they did not have an
equivalent option according to their manpages.
for example, BSD tar implementations.

perhaps i could systematically go around changing
file dates, on each file, as a fallback behaviour?

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-13 23:29:22 +01:00
Leah Rowe c401efdd03 build/release: support skipping rom builds
pass this argument: -m src

by doing this, only the src tarball will be made

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-13 23:16:19 +01:00
Leah Rowe 268fd6ce71 update/release: make src tarball first, then roms
this way, the src tarball is guaranteed to be clean.

the downside is that lbmk itself does not currently
handle crossgcc downloads, and there may be some
stragglers such as third party modules automatically
downloaded by certain codebases that libreboot uses.

this will have to be audited later (and it will be).

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-13 23:11:40 +01:00
Leah Rowe 653a8571f4 put space in the warning message about elf/
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-13 03:50:56 +01:00
Leah Rowe c44a38aefc only build cbutils if required
it's sometimes done unconditionally. this change
ensures that it is not repeated needlessly.

i observed otherwise that cbfstool would be
re-built from time to time, even if it was built.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-13 03:22:37 +01:00
Nicholas Chin 5d6946c42c
util/e6400-flash-unlock: Rename to dell-flash-unlock
This more accurately describes the scope of the utility.

Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
2023-10-12 17:57:06 -06:00
Leah Rowe 42068f7ce1 coreboot/default bump: rev d862695f5f, 12 Oct 2023
Riku's mSATA patch for HP8300USDT was merged upstream, so the
patch has been dropped from lbmk because it is contained within
this new coreboot revision.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-12 23:31:06 +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 1f3316422d nvmutil: simplify endianness handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-12 15:55:51 +01:00
Leah Rowe 3162d60d52 nvmutil: don't reset errno before write
under the current logic, errno would be ECANCELED
if neither checksum is valid, or I/O related if
pwrite fails; alternatively, the for loop exits
and the file has been written, where it is quite
correctly reset already.

ergo, the errno reset at the start of
writeGbeFile is superfluous. remove this bloat.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-12 15:22:13 +01:00
Leah Rowe f989360e88 nvmutil: reset errno on successful write
previously, a bad checksum would have caused a non-zero
exit, even if the other checksum was correct (observed
when using the swap command)

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-12 15:17:47 +01:00
Leah Rowe 3ad171fd3d nvmutil: simplify prototype declarations
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-12 15:10:50 +01:00
Leah Rowe 96fd88c5b3 build: fix bad command in help text
lbmk was massively re-written, very recently.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-10 23:52:42 +01:00
Leah Rowe 5b8b55f2ae build/fw/coreboot: fix bad commands in help text
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-10 23:48:03 +01:00
Leah Rowe 067a358d4d fix warning about coreboot elf/ vs bin/
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-10 06:31:26 +01:00
Leah Rowe 13c58200a4 Merge pull request 'util/e6400-flash-unlock: Update to upstream version' (#134) from nic3-14159/lbmk:e6400-flash-unlock-updates into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/134
2023-10-10 05:25:22 +00:00
Leah Rowe 67ffb5134c build/fw/coreboot: warning about bin/ versus elf/
also rename elf/coreboot to something scary

some users were flashing roms built under elf/, which
lack payloads. lbmk builds no-payload roms (and payloads)
under elf/ then inserts them, creating full (flashable)
images under bin/

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-10 06:21:34 +01:00
Nicholas Chin 724cb39f86
util/e6400-flash-unlock: Update to upstream version
This updates lbmk's copy of e6400-flash-unlock to commit c5567fece479
(README.md: Update with info about broader device support) in my
upstream repo.

Changes:
- Theoretical support for any Dell system that implements that flash
  descriptor override command. This is done by reading base address
  registers at runtime instead of hard coding them for specific devices.
  Tested on the Latitude E6400 and Latitude E6430.
- Support for OpenBSD. It compiles, runs, and behaves as expected,
  though I have not actually tested internally flashing with flashrom
  yet. It should work though, as the program checks if the descriptor
  override is set and the BIOS Write Enable is able to be set to 1, which
  is all that is needed to internal flash.
- Integrated changes made in the lbmk copy
- Moved operating system accessor implementations to their own file

It should be fully functional, though minor formatting and cleanup
changes are still planned.

Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
2023-10-09 23:16:18 -06:00
Leah Rowe 634aac0b69 config/dependencies: fix unifont on arch/parabola
it's unarchiver in repos. not unar.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-10 01:43:01 +01:00
Leah Rowe 7e3a031a1d include/err.sh: don't run check_git
it's already executed in "build"

running it in err.sh makes the user have to set
git name/email as root, when running dependencies
scripts. this is a regression, that this patch
fixes. git isn't needed to install dependencies.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-09 20:53:49 +01:00
Leah Rowe b61e3feb6b config/dependencies/ubuntu: symlink to debian
this is for the latest ubuntu release.

the ubuntu2004 config (for ubuntu 20.04) still exists,
and will remain in place.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-09 06:51:38 +01:00
Leah Rowe 4ea9b9fb2f config/dependencies: add popos config
symlinked to the debian config

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-09 06:48:24 +01:00
Leah Rowe f8528d129a config/dependencies/debian: add autopoint
a user installed these dependencies in popos, but autopoint
was missing during the grub build.

add autopoint to the debian dependencies config.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-09 06:46:48 +01:00
Leah Rowe 21db72b695 disable 32-bit memtest86plus, only build 64-bit
some users reported build errors. technically, there's
nothing wrong with lbmk but it relies on hostcc, and
hostcc is hit or miss when it comes to cross compiling
32-bit, depending on the build system of whatever project.

lbmk needs to handle cross compilation. for now, i'm just
disabling memtest86plus on non-64-bit hosts.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-09 06:06:20 +01:00
Leah Rowe d1ba94ea08 update/release/*: merge to update/project/release
The logic has been re-written, where source archives are
concerned. This clones the current repository, and starts
a new build from scratch. A custom release directory is
possible, by passing -d

This eliminates a step during build-testing, saving hours
of time, because it builds the release archive *inside* the
release archive, with git files removed, thus replicating
the same setup that the user would have.

This also makes everything a bit more consistent, because
it's guaranteed that a release archive will always have
the same files; previously, the release build script would
only copy what was already built, without building anything.

Now, this script builds everything itself.
The script also builds serprog images, not just coreboot.

Usage:

./update project release

If -d is not passed, release/ is used inside lbmk.

Otherwise, you could do:

./update project release -d /path/to/directory

If the directory exists, this script will exit (error).

Other minor fixes: build/fw/coreboot: make version in
coreboot-version (file) not contain hyphens, to work
around a quirk in coreboot's build system when not building
on regular libreboot releases. this quirk only appears
when lbmk is not being compiled under git.

The other main benefit of this change is that the new
script will probably require a lot less maintenance.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-08 08:08:39 +01:00
Leah Rowe e7a77b50e8 build/fw/coreboot: reset grub background each time
the script used to be called once per target, now it
handles every target. the grub background image wasn't
being set, so if it changed at build time, it would
stay changed.

keep the default in place for each run, while still
allowing target.cfg files to change it per target.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 21:04:45 +01:00
Leah Rowe 92abbb25fe update/release/roms: copy license files to archive
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 11:10:39 +01:00
Leah Rowe 85bee1f8bd bump grub revision
most of the changes since last revision aren't very
useful to us; most of them pertain to fs/ntfs, but
there is one that is interesting:

48f569c78a496d3e11a4605b0999bc34fa5bc977
kern/acpi: Skip NULL entries in RSDT and XSDT

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 10:48:04 +01:00
Leah Rowe d58bc5ff0d bump seabios revision
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 10:36:50 +01:00
Leah Rowe 1e89264ce3 update/project/*: merge to update/project/trees
Just one script.

Just one!

Well, two, but the 2nd one already existed:
logic in update/project/trees and
update/project/repo was merged into
include/git.sh and update/project/build
was renamed to update/project/trees; an -f
option was added, which calls the functions
under git.sh

so git clones are now handled by the main build
script (for handling makefiles and defconfigs)
but the logic there is a stub, where git.sh
does all the actual heavy lifting

this cuts the file count down by two, and reduces
sloccount a reasonable amount because much of
the logic already exists in the build script, when
it comes to handling targets. git.sh was adjusted
to integrate with this, rather than act standalone

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 10:26:11 +01:00
Leah Rowe a413c01a3e update/project/trees: handle seen in fetch_config
I'm planning to re-use this function later, in other
files, to unify handling of target.cfg files.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 06:23:22 +01:00
Leah Rowe c8bace0d84 build/fw/grub: re-add end confirmation message
otherwise, if src/grub/ was already compiled, this
would not print anything on the screen. however, the
files will have been created under elf/grub

this message just makes lbmk a bit more user friendly

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 06:08:03 +01:00
Leah Rowe ba324d8c07 build/coreboot/grub: move to build/fw/grub
This eliminates an additional subdirectory.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 06:04:45 +01:00
Leah Rowe 4708da2ca9 use quotes when checking empty strings in scripts
this is far less error-prone

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 05:37:11 +01:00
Leah Rowe 0fad3497b8 build/fw/coreboot: fix error "unexpected operator"
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 05:30:17 +01:00
Leah Rowe ea27c92842 update/project/build: move helpers to option.sh
certain functions are better placed there, rather than
in the main script

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 05:16:46 +01:00
Leah Rowe 0ed2ec294b build/coreboot/util: merge to update/project/build
The benefit now is that it can be cleaned. E.g.

./update project build -b coreboot utils
./update project build -b coreboot utils default
./update project build -c coreboot utils
./update project build -c coreboot utils default

the update/project/build script checks when arguments
are provided after the project name. if the first one
is "utils", then it acts in the same way as the old
build/coreboot/util script

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 05:04:55 +01:00
Leah Rowe b6d9e6c18d build/fw/coreboot: don't support no-all all arg
it's buggy. "./build fw coreboot" was made to work,
but it caused lots of unknown issues when mixing other
args

the old way wasn't broken. now, once again, you must
pass the "all" argument. e.g.:

./build fw coreboot all

Also, the confirmation messages at the end are a bit
clearer, when listing which ROM images were compiled.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 03:06:20 +01:00
Leah Rowe 0962600c84 build/fw/coreboot: correctly check built targets
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 02:55:17 +01:00
Leah Rowe fa8e204f14 unified projectname/version/versiondate handling
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 02:46:47 +01:00
Leah Rowe 24584296a8 put include/export.sh in build script
remove include/export.sh

it's not a lot of code, and build is the only
file that uses it

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 02:10:14 +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
Leah Rowe 3c7e37b15d update/blobs: correct utils paths check
some utils were being needlessly re-downloaded.
fix that!

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 00:47:42 +01:00
Leah Rowe 5e81024e97 update/blobs: don't hardcode kbc1126 util check
use the variable that is set up in blobutil.sh

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 00:46:38 +01:00
Leah Rowe 9f8f230b61 update/blobs: don't needlessly re-build uefitool
during the switch to src/ for all downloads, i
overlooked that the path check was hardcoded.

now the check for this binary is corrected.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-07 00:45:34 +01:00
Leah Rowe fe502da944 Rename blobs/ to blob/
We don't have a directory names "srces", just "src".

Ditto ecs, mrcs <-- it's just ec and mrc

When referring to a file, e.g. blob/t1650/me.bin, that
makes much more sense, because it's a single blob, not
multiple blobs.

Don't pluralise what isn't plural

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