Commit Graph

40 Commits (d521fca7efa633698b75c81af9e0e15b4427376f)

Author SHA1 Message Date
Leah Rowe d521fca7ef build/roms: fix faulty keymap list expansion 2023-05-10 04:40:48 +01:00
Leah Rowe 67a607b88c build/boot/roms*: RFC 2646 compliance
No more than 80 characters per line.
2023-05-10 02:48:34 +01:00
Leah Rowe 3f1ee01507 seabios: do normal config, disable oprom in vgarom
previously, "normal" initmode relied on the vgarom-based
seabios config, which enables option roms, but then lbmk
would insert pci-optionrom-exec 0 for vgarom, and 2 for normal

in libreboot, coreboot roms with "vgarom" in the filename do
pci option rom execution from coreboot, and "normal" roms
do execution from seabios(where seabios is the only payload
provided on normal setups)

this is because payloads like grub can also be used, on vgarom
setups, where coreboot must handle oprom execution
2023-05-09 20:40:12 +01:00
Leah Rowe dac9ea86d3 build/boot/roms: fail when build cbutils fails 2023-02-19 23:16:01 +00:00
Ferass 'Vitali64' EL HAFIDI f787044642 Do not rely on bashisms and behaviour undefined by the POSIX specification.
By making lbmk fully POSIX-compliant, it will be easier to port lbmk to
other systems implementing POSIX such as Alpine Linux and FreeBSD.

Signed-off-by: Ferass 'Vitali64' EL HAFIDI <vitali64pmemail@protonmail.com>
2022-12-27 15:50:41 +00:00
Leah Rowe 31111c645f build/boot roms: add exits for failing commands 2022-12-11 06:25:09 +00:00
Alper Nebi Yasak 1c62b003ad build/roms: Support using "u-boot" ELF file as U-Boot payload
U-Boot runtime configuration is done with a device-tree file, which is
built alongside the executable in the upstream build system, and must be
available to U-Boot at runtime.

This device-tree is normally not linked into the default "u-boot" ELF
file. So far we have been handling it by re-creating a "u-boot.elf" from
the raw binary parts by setting REMAKE_ELF, and using that as the
coreboot payload. Unfortunately, that fails to build for x86 boards,
more specificly the "coreboot" boards upstream.

It's also possible (but discouraged) to set OF_EMBED to embed the
device-tree file into the U-Boot itself, in which case we could use the
"u-boot" file as the payload on the "coreboot" boards. Add support for
using the "u-boot" file as the payload if "u-boot.elf" doesn't exist.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-12-10 14:19:00 +03:00
Alper Nebi Yasak 5b6bf2a826 build/roms: Don't rebuild crossgcc if it was already built
The roms_helper script skips building crossgcc-i386 if its target
directory exists. Skip it for other architectures as well.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-12-10 14:19:00 +03:00
Alper Nebi Yasak bee5054077 build/roms: Make coreboot crossgcc usable for payloads and modules
Add the coreboot-built cross-architecture toolchains to the PATH so that
modules and payloads can use them. When building for a foreign-arch
board, also export CROSS_COMPILE pointing to the appropriate prefix.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-12-10 14:19:00 +03:00
Alper Nebi Yasak a586356164 build/roms: Build 32-bit crossgcc for AArch64 as well
This re-applies commit a69855f7e4 ("Build 32-bit crossgcc for AArch64
as well") which was inexplicably reverted along with unrelated changes.
Mention in a comment that building crossgcc-arm is necessary for
AArch64.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-12-10 14:19:00 +03:00
Alper Nebi Yasak 9fb4ecec62 build/roms: Don't build Memtest86+ when not specified by cmdline
When overriding which payloads will be built with the -p command line
argument, the roms_helper script builds the Memtest86+ payload before
checking if it should be disabled. Move the build command after the
command line override.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-12-10 14:19:00 +03:00
Alper Nebi Yasak 4e3097b5e7 build/roms: Disable U-Boot when not in payloads specified by cmdline
When overriding which payloads will be built with the -p command line
argument, the roms_helper script doesn't disable the U-Boot payload.
Disable it in this case.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-12-10 14:19:00 +03: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
Leah Rowe e1bbdadc95 build/roms: remove seabios_grubfirst logic
the intended use-case scenario was one in which vga rom initialisation
would be used, on desktop configurations, but without coreboot itself
handling vga rom initialisation, instead leaving that task to seabios

it was assumed that grub, when running on the bare metal with
build option "--with-platform=coreboot" would be able to display
like this, but it is not so when tested

in such setups (add-on gpu with grub payload), it is necessary to
extract the video bios and insert it into the coreboot rom, having
coreboot handle such execution. this is beyond the scope of lbmk,
in context of automated building, because we cannot reliably predict
things such as PCI IDs

do away with this build option entirely, for it does not serve the
intended purpose. it will be necessary to run PC GRUB instead (build
option --with-platform=i386-pc). PC GRUB can still read from CBFS,
and you could provide it as a floppy image file inside CBFS for
SeaBIOS to execute. in this setup, GRUB would function as originally
intended by the seabios_withgrub option; such a configuration is
referred to as "SeaGRUB" by the libreboot project, and experimentation
was done with it in the past, to no avail

it's better to keep things simple, in the libreboot project. simpler
for users, that is
2022-11-22 22:45:18 +00:00
Leah Rowe 24a866baea remove kfsn4-dre, kcma-d8 and kgpe-d16
buggy, buggy, buggy, buggy, buggy, buggy, buggy

full of bugs, these boards never worked properly. i got ripped
off with these.

now i'm ripping off the band aid

use dasharo if you want d16 stuff. i'm done with it.
2022-11-19 03:51:59 +00: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 6d6bd5eee0 build/roms: Rebuild cbutils module before starting coreboot build
In recent coreboot versions, running distclean started to erase the
cbfstool binary we built earlier in the util/cbfstool dir via the
cbutils build script call. The coreboot build puts it in a different
directory, and the roms build script can't find it when trying to add
payloads to the roms. This doesn't make the script fail (because set -e
is stupid like that), and the build appears to succeed if you don't look
close enough to see the "cbfsutil not found" error.

Build the coreboot utils we want at the places we want them after
calling distclean, so that we can actually use cbfsutil and avoid
silently-broken roms with newer coreboot versions.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-08-28 13:09:52 +03:00
Alper Nebi Yasak 61ede99832 build/roms: Support using U-Boot as a coreboot payload
This enables embedding U-Boot into the coreboot roms as the payload. For
now, the ELF file generated by enabling CONFIG_REMAKE_ELF is used, which
includes the U-Boot binary and the board-specific device-tree file. It
might be better to use the FIT payload support for U-Boot, but that was
reportedly broken and is not tested yet.

Coreboot boards can specify payload_uboot="y" in their board.cfg to
enable building a rom with U-Boot as the payload, which is built from
the U-Boot board with the same name. Boards can further specify a
uboot_config option, to choose which board-specific config file U-Boot
should be built with.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-08-28 13:09:52 +03:00
Alper Nebi Yasak a69855f7e4 build/roms: Build 32-bit crossgcc for AArch64 as well
The 32-bit ARM cross compiler toolchain is used to build parts of
arm-trusted-firmware needed by AArch64 boards, compile the toolchain for
those boards as well.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-08-28 13:09:52 +03:00
Alper Nebi Yasak 769f18f2f6 build/roms: Fix building for ARMv7 and AArch64 boards
The code that compiles coreboot crossgcc changes the working directory
to the coreboot directory, and the following code cannot find the lbmk
scripts that it needs to run. Compile ARMv7 and AArch64 cross compilers
in a subshell like in the x86 case so the rest of the script can work.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-08-28 13:09:52 +03:00
Leah Rowe 2701555582 build/boot/roms: fix wrong variable name 2021-12-29 07:37:11 +00:00
Leah Rowe 6b4b49cf8f build/boot/roms: substitute grub_scan_disk according to board.cfg 2021-12-29 07:10:56 +00:00
Vitali64 7e6691e999 Add ARMv7 and AArch64 support 2021-12-11 13:38:43 +00:00
Vitali64 dec2d7206e add myself in the build/roms_helper script 2021-12-09 06:46:18 +00:00
Leah Rowe 4b64e34fc2 build/roms: warn if grub_scan_disk is not set at all 2021-11-30 18:44:08 +00:00
Leah Rowe c7944c0e01 build/roms: warn when grub_scan_disk is set incorrectly 2021-11-30 18:40:27 +00:00
Leah Rowe c87b6f6369 build/boot/roms: don't error out if grub_scan_disk is invalid
just set it to the default, instead
2021-11-30 18:35:52 +00:00
Leah Rowe 9a0677eafd fix incorrect logic on recent grub optimization patch
or was used, instead of and
2021-11-30 18:31:19 +00:00
Vitali64 b74056563f Workaround for grub's slow boot 2021-11-28 17:16:18 +00:00
Leah Rowe eed25bd220 update coreboot and nuke tianocore
tianocore is a liability for the libreboot project. it's a bloated mess, and
unreliable, broken on many boards, and basically impossible to audit.

i don't trust tianocore, so i'm removing it.
2021-11-22 10:03:50 +00:00
Leah Rowe bc7243f1e1 build/boot/roms: fix wrong filename for pike2008 option roms 2021-11-18 17:02:36 +00:00
Leah Rowe 68d3c9372a Revert "nuke memtest86+"
This reverts commit 84a1bc502b.
2021-11-01 02:51:10 +00:00
Leah Rowe 84a1bc502b nuke memtest86+ 2021-10-31 20:52:01 +00:00
Leah Rowe 62fa042a17 re-add grub backgrounds and update grub. mitigate missing characters
mitigate missing characters in unifont for border/arrow characters. this saves
space because now it is no longer necessary to add a custom font

the background added has the libreboot logo on it, and it's 10kb in size unlike
the old gnulove background that was hundreds of KB
2021-10-31 07:13:46 +00:00
Leah Rowe 49198fe3d1 Disable PIKE2008 option ROM loading on KGPE-D16/KCMA-D8
These option ROMs are known to cause a system hang. If you insert an empty
option ROM into CBFS, it disables any option ROM loading for those devices
when using SeaBIOS.
2021-10-30 21:22:27 +01:00
Ron Nazarov 0fadeed493 replace #!/bin/bash with #!/usr/bin/env bash 2021-06-03 12:47:08 +01:00
Leah Rowe 15e4b8a00c build/crossgcc: insert .coreboot-version 2021-05-22 20:28:41 +01:00
Leah Rowe 52d8fccaae don't include memtest by default. make it a board.cfg option 2021-05-22 19:21:24 +01:00
Leah Rowe 89517ed6b9 libreboot!
this is forked from the "libre" branch in osboot, which is itself a libre,
deblobbed fork of osboot, a blobbed up fork of libreboot

libreboot needed to be purged clean. this is the new libreboot development
repository. the old one has been abandoned
2021-05-18 13:56:12 +01:00