Commit Graph

1265 Commits (btrfsvols)

Author SHA1 Message Date
Leah Rowe 8583a05dde Merge pull request 'Update U-Boot to v2023.10 and use default coreboot tree for gru chromebooks' (#136) from alpernebbi/lbmk:uboot-v2023.10 into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/136
2023-10-14 19:42:54 +00:00
Alper Nebi Yasak 4d9567a756 coreboot: gru: Use default coreboot tree
We don't really need a custom coreboot tree for Chromebooks. I had added
one, because at a cursory glance to the available config/coreboot/board
subdirectories I had the impression that I should. But upstreams have
one tree for every board and I think we should move towards that too.

Move the one important BL31 makefile patch into the default coreboot
patches, update the gru boards' configs by running savedefconfig in the
cros tree and then running olddefconfig in the default tree.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 17:34:42 +03:00
Alper Nebi Yasak 6e65595da5 u-boot: gru: Do not persist EFI variables
By default U-Boot stores EFI variables in a ubootefi.var file in
whatever EFI System Partition it finds, which would be a FAT filesystem.
I'm occasionally finding out while testing that my ESPs somehow end up
with a corrupted filesystem, and I'm suspecting it's this.

For now, disable storing EFI environment variables on disk so that
U-Boot doesn't try to manipulate the filesystem.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak 4e7e476191 u-boot: gru: Enable more EFI commands
Enable U-Boot commands to manipulate EFI environment storage, to
self-test EFI implementation, and to run a basic EFI test application.
These are so that we can test and debug EFI functionality easier.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak f08102a227 u-boot: gru: Enable more bootstd features
U-Boot upstream is switching to a new code framework for discovering and
booting OSes ("Standard Boot", or "bootstd"). Enable more features for
it, including commands we can use for introspection and debugging.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak fea0cec24a u-boot: gru: Do not reset on panic
Normally U-Boot immediately resets the board on a panic. I had run into
"Synchronous Abort"s from shim and rEFInd, and having a traceback in
those cases can be useful. Hang instead of resetting, so the panic
reason stays on the screen.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak f9bad4449a u-boot: gru: Enable poweroff command
We should be able to power the board off from U-Boot command line.
Enable the "poweroff" command for gru boards so we can.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak f7db91c848 u-boot: gru: Disable VIDEO_COPY
U-Boot can keep a "copy" framebuffer to read from, for devices where
reading from hardware framebuffer is expensive. This needs the video
driver to support it. The Rockchip video driver doesn't need or support
it, so this option does nothing on gru boards. Disable it.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak 7afe2f3918 u-boot: Set EFI variable buffer size to upstream value
U-Boot upstream used to have 16KB for EFI variables, and this was
causing problems with shim. Commit f0236acbc6 ("u-boot: Increase EFI
variable buffer size") fixed this by raising it to 32KB in our builds.
It has now been raised to 64K upstream, so raise it here as well.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak 46e01c0e1d u-boot: Avoid building U-Boot-only binman images
For Rockchip boards U-Boot tries to build SPI and MMC images that
require an externally built BL31 file to be provided, and the build
fails otherwise. This is not really as configurable as it should be.

In Libreboot, we only care about the build outputs for U-Boot proper.
There is a BL31 built during our coreboot builds, but using that in
U-Boot builds is a chicken-and-egg problem. Building BL31 outside the
coreboot build and passing it to both projects is possible, but needs
work.

For now, stop trying to build these U-Boot-only images as a workaround,
by removing the binman image descriptions from the device-tree sources.
Additionally, disable in our configs the BINMAN_FDT functionality that
allows using these at runtime as it requires them to be present.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak 5b4ced3329 u-boot: Add patch to avoid regulator errors
U-Boot upstream has added a reference counting for regulator enable
actions which somehow makes gru-kevin unbootable. Add a workaround
that makes it work again.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak f459e05ecd u-boot: Update to v2023.10
Set default U-Boot revision to v2023.01 and rebase patches on top of
that. Another series about 16x32 fonts was merged upstream, so drop some
now-unnecessary patches we had for that. For the video damage tracking
series, switch to the version I'm trying to upstream.

Upstream kconfig status is a bit unstable, so updating configs with
`make oldconfig` would miss important upstream changes, since they rely
on carrying defaults via upstream defconfigs. Update the configs as
such:

- Turn old configs into defconfigs (./update project trees -s u-boot)
- Save the diff from old upstream defconfig (diffconfig $theirs $ours)
- Update U-Boot revision, rebase patches, and clean old trees
- Prepare new U-Boot tree (./update project trees -f u-boot)
- Review the diffconfigs to see if any options were renamed upstream
- Copy over the new upstream defconfigs and apply earlier diff
- Turn new defconfigs into configs (./update project trees -l u-boot)

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak b2d84213da update/project/trees: Add flags for more kconfig actions
Add an "-s" flag for "make savedefconfig", "-l" for "make olddefconfig"
and "-n" for "make nconfig" to the update script. The first two are
mainly useful for U-Boot, to compare our configs to the upstream
defconfigs and stay in sync with any upstream changes. The latter is
because the ncurses one has a nice "Symbol Search" that can point out
the menu entry for a config symbol we know.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak 8b411963b7 u-boot: qemu_arm64_12mb: Remove misleading rev field
The U-Boot build for qemu_arm64_12mb board refers to a code revision
whereas it uses the common "default" tree, remove the bad reference.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak eb267733fa build/fw/coreboot: Fix misuse of raw u-boot.bin as payload
The "u-boot.bin" file generated by U-Boot builds is a raw binary. When
adding payloads to a CBFS, we need to use ELF files with add-payload
or manually pass the entry point and load address of the payload binary
with add-flat-binary.

We primarily use the "u-boot.elf" which gets build with the REMAKE_ELF
option, as it also has the necessary device-tree binary that U-Boot
usually needs to work. When the option is not set (e.g. for QEMU), we
need to use the "u-boot" file which is an ELF.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Leah Rowe 65af756fc3 x/xx: slightly more verbose error messages
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-14 09:01:58 +01:00
Leah Rowe 19f1e0083d vendor/inject: only build nvmutil if required
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-14 08:57:11 +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 7b741dd062 update/release: remove unused variables
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-14 05:30:54 +01:00
Leah Rowe e0feda639b update/release: fix/simplify mtime handling
i wasn't getting the very first line of tar --version,
so it wasn't doing the check properly.

further sort the files by name within the tar archive.
for reliability, don't bother using versiondate anymore:
set a *fixed* date, and fixed timezone, to ensure
that it works reliably for reproducible tarball creation.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-14 05:04:28 +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 2ebadb7ffd build/release: don't include tmp/ in src tarball
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-10-14 02:34:29 +01:00
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