140 Commits

Author SHA1 Message Date
Tim Crawford
968a612824 scripts: Address shellcheck issues
Report issues by shell files with:

    git ls-files '*.sh' | xargs shellcheck --exclude=SC2162

Address the following:

- SC1087: Use braces when expanding arrays
- SC1091: Not following
- SC2004: `$`/`${}` is unnecessary on arithmetic variables
- SC2024: `sudo` doesn't affect redirects
- SC2034: foo appears unused. Verify it or export it
- SC2086: Double quote to prevent globbing and word splitting
- SC2087: Quote `EOF`
- SC2115: Use `"${var:?}"` to ensure this never expands to `/*`
- SC2148: Add a shebang

Addresses (at least partially) some POSIX/dash issues:

- SC2113: `function` keyword is non-standard
- SC3010: In POSIX sh, `[[` `]]` is undefined
- SC3014: In POSIX sh, `==` in place of `=` is undefined
- SC3020: In POSIX sh, `&>` is undefined
- SC3046: In POSIX sh, `source` in place of `.` is undefined

Does not address:

- SC2162: `read` without `-r` will mangle backslashes
- Any other POSIX/dash-specific issues

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-19 14:45:22 -06:00
Tim Crawford
b379c94b76 Split building coreboot toolchains to a separate file
Specify dependencies specifically for building coreboot toolchains in
the file, so they are not conflated with the dependencies required for
building firmware-open.

Remove building the toolchain when building firmware, so that the new
script is the single source for building coreboot toolchains.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-19 08:08:02 -06:00
Tim Crawford
5fb1624187 Set and use XGCCPATH
Allow overriding the coreboot toolchain location with `XGCCPATH` so
that xgcc can be installed to a separate location, such as `/opt`.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-19 08:07:39 -06:00
Tim Crawford
c1dafbbfad scripts: Always set EC build dir
Building EC was broken as the build output from the previous board was
not being cleaned. `BUILD` is now always set, defaulting to "build",
instead of only when `BOARD` is specified. For good measure, add it
to the clean command in case a custom path is used.

Fixes: 569321f9ac79 ("scripts: Set EC build dir")
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-12 13:27:55 -06:00
Tim Crawford
569321f9ac scripts: Set EC build dir
Specify the EC build directory so that it does not require the model or
version to be determined in the script.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-11 19:05:16 -06:00
Tim Crawford
b22e8dee41 scripts: Split installing Rust to its own script
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-03 14:04:54 -06:00
Tim Crawford
616b2bfe7b scripts: Don't run git-lfs commands on CI
The `deps.sh` script needs to be run to set up a new Jenkins workspace.
The git-lfs commands fail with:

    mkdir /dev/null: not a directory
    To resolve this, either:
      1: run `git lfs update --manual` for instructions on how to merge hooks.
      2: run `git lfs update --force` to overwrite your hook.

Just don't run them, since Jenkins is configured to perform the LFS pull
when fetching the repo.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-08-15 07:09:09 -06:00
Tim Crawford
0e01b365ae Remove libs/
These are at best a convenience for working on them. They are not used
directly by firmware-open, only as dependencies in other projects.

- coreboot-table: Dependency of apps/firmware-setup
- coreboot-fs: Dependency of apps/firmware-update and libs/intel-spi
- intel-spi: Dependency of apps/firmware-update
- intelfash: Dependency of apps/firmware-update and scripts/modeltool
- uefi: Dependency of a lot of stuff

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-08-04 12:04:42 -06:00
Tim Crawford
fcd8132165 Remove MinPlatform support
MinPlatform was only ever used for the KBL boards, and they no longer
build from this repo.

It is still possible to build coreboot-based firmware for KBL boards.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-08-04 11:41:26 -06:00
Tim Crawford
c90cf2f0f1 Remove firmware-smmstore
firmware-smmstore is a Rust-based application for compacting SMMSTOREv1,
which we no longer use. After commit af955613e09d ("models: Enable
SMMSTOREv2 in coreboot") it is no longer needed.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-08-03 12:04:47 -06:00
Tim Crawford
64aa0e3160 Remove script for reading SMMSTOREv1
commit af955613e09d ("models: Enable SMMSTOREv2 in coreboot") switched
us from SMMSTOREv1 to SMMSTOREv2. This script is no longer useful.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-08-03 12:04:47 -06:00
Tim Crawford
f903877cfb scripts: Disable showing signature when getting date
Fixes building when `log.showSignature` is enabled.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-06-08 11:06:44 -06:00
Tim Crawford
f527a7a273 scripts: Allow additional EC configs
Modify the build script to allow setting additional EC configs, similar
to how edk2 is done.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-05-24 08:58:28 -06:00
Tim Crawford
39af7165e4 scripts: Force submodule checkout
Some coreboot submodules have their update strategy set to "none". They
will not be cloned/updated unless `--checkout` is specified.

Fixes building after cloning firmware-open and running `deps.sh`.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-05-23 09:59:04 -06:00
marco
ff95dd03ab fixed flag for pacman --noconfirm 2023-04-24 13:01:07 -04:00
Jeremy Soller
b212d78343 Firmware security support 2023-04-03 13:23:12 -06:00
Tim Crawford
a308d84632 modeltool: Update edition, deps
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-04-03 13:23:12 -06:00
Tim Crawford
6562cf213d coreboot: Rebase on 4.19
Rebase on coreboot/coreboot@decbf7b4d9.

The following boards have been upstreamed:

- darp8
- galp6

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-02-10 15:45:26 -07:00
Tim Crawford
87b0a4903c scripts: Build crossgcc with multiple cores
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-09-01 16:23:31 -06:00
Tim Crawford
161895da77 scripts: Install deps without confirmation
This makes `dep.sh` usable from CI. Also update the package lists before
installing on debian/ubuntu.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-08-29 12:55:07 -06:00
Tim Crawford
7160b01929 scripts: Install Rust with stable toolchain
The trick of using `show` to install components requires a default
toolchain be set. Assume users with Rust installed already have one set,
and use stable for new installs.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-08-29 10:10:34 -06:00
Tim Crawford
9754d7d8a9 scripts: Drop some unneeded deps
- coreboot no longer requires Python 2 for the FSP
- nasm is provided by the coreboot toolchain

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-08-29 10:10:34 -06:00
Tim Crawford
f311c8b10f scripts: Build coreboot toolchain as part of deps
Front load building the toolchain binaries when installing deps instead
of during the first board build.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-08-29 10:10:34 -06:00
Tim Crawford
42814e6e5c scripts: Build edk2 using coreboot toolchain
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-08-29 10:10:34 -06:00
John Wiggins
584bc40189 Set spipi to new name instead of IP address
Improved config script so the spipi config file doesn't have
to be updated with the IP address of the raspberry pi.
2022-07-27 12:20:29 -06:00
Tim Crawford
4aa8a81be1 deps: Call EC deps script
Remove EC-specific dependencies and call the EC script to install them
instead.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-05-25 13:10:29 -06:00
Jeremy Soller
ef56bc8925 scripts/generate: Fix use of wrong Rust toolchain 2022-05-16 12:40:59 -07:00
Tim Crawford
05577baab2 qemu: Enable KVM
Fixes performance issues when running a QEMU VM.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-03-10 10:14:09 -07:00
Tim Crawford
cf7fc2c540 scripts: Update rustup or inform user of env vars
Ensure rustup is up-to-date to avoid users having a version that is too
old to support the TOML format.

If rustup was just installed, tell the user to source the new env vars
to use the correct version of the toolchain.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-02-28 16:00:54 -07:00
Tim Crawford
9e09461c65 scripts: Change QEMU binary name
`kvm` is a symlink to the `qemu-system-x86_64`. Use this name instead so
the script can be used on other distros without modification.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-02-28 16:00:54 -07:00
Tim Crawford
239e2cbaed build.sh: Set git-describe length
Specify `abbrev` to ensure the length of the commit hash is always the
same, in case `core.abbrev` is set or the default changes.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-01-18 11:57:12 -07:00
Tim Crawford
dbe7213ecf Remove top-level README.md.in
- The generated "Contents" section isn't useful
- Non-standard, causing confusion on how to update README.md
- It's already out of sync

Remove galp3-c and darp5, as we never released the firmware due to
issues with the touchpad and keyboard. Add gaze16-3060-b variant.

Make "Schematics" a subsection of "Supported models".

Remove directory from list of paths to update in `scripts/readmes.sh`.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-12-21 13:11:09 -07:00
Tim Crawford
3e4688fcbc Remove libs/smmstore
Replace the stand-alone smmstore app in favor of the read example in
firmware-smmstore.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-12-21 13:11:09 -07:00
Tim Crawford
ffdceb5f0b Update Rust toolchain to 2021-06-15
Update the toolchain to the version used by Redox.

Update a lot of the submodules, which have been updated to build on the
new toolchain.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-12-21 13:11:09 -07:00
Tim Crawford
fa98ecae1f edk2: Rebase on edk2-stable202108
Set options in edk2.config for each board.

PCIE_BASE is no longer an edk2 option. The value is expected to be in
AcpiBoardInfo HOB, generated from the bootloader's ACPI table.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-12-21 13:11:09 -07:00
Tim Crawford
de3b0a65fa scripts: Add Python2 to deps
coreboot requires python2 explicitly when using the FSP submodule as the
source for FSP binaries.

    python2 3rdparty/fsp/Tools/SplitFspBin.py ...

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-10-04 08:13:40 -06:00
Tim Crawford
06576f7fc1 scripts: Update pkg for python symlink
Install `python-is-python3` to provide the `/usr/bin/python` symlink.
Fixes installing dependencies on Pop!_OS 21.10.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-09-17 14:46:49 -06:00
Jeremy Soller
93c2809b7d Add realtek-coeffs script 2021-07-20 16:32:32 -06:00
Tim Crawford
d7813dae8e Add missing ccache/xxd deps 2021-05-14 12:48:48 -06:00
Tim Crawford
2f1069d381 Clean up Arch deps
- Sort deps
- Remove duplicates
- Replace libgudev with systemd-libs for `libudev.so`
2021-05-14 12:48:48 -06:00
Tim Crawford
bc684170d0 Drop qt5 as a dep
It is only needed for building UEFITool/UEFIExtract, but cmake can just
be used by itself for that.
2021-05-14 12:48:48 -06:00
Jeremy Soller
4328777136 Fixes for python 3.9 2021-05-12 11:11:25 -06:00
Tim Crawford
971416091d scripts: Use PAD_CFG_GPO if there is no pull 2021-04-15 11:56:23 -06:00
Tim Crawford
adce54fe9a scripts: Remove extra indent when generating coreboot GPIO data 2021-04-05 13:06:00 -06:00
Aram Hamo
dd78a6ce5c
Update deps.sh to support Arch 2021-03-27 10:38:42 -06:00
Tim Crawford
c6ea487b77 Add Python script to produce the dt values 2021-03-18 08:01:52 -06:00
Tim Crawford
0a98ce8c93 scripts: Check coreboot config is correct
If a board in models/ does not exist in coreboot, coreboot will emit a
warning and select the first available board for the vendor instead.

This may result in building and being able to flash coreboot with an
addw1 configuration on another board.
2021-03-15 10:12:23 -06:00
Tim Crawford
7d6a15e63c Convert toolchain file to TOML syntax
rustup 1.23.0 (2020-11-27) introduced support for TOML syntax for the
toolchain file. Use this and specify required compoenents.

To ensure you are using a new enough rustup, run:

    rustup self update
2021-03-15 10:10:03 -06:00
Tim Crawford
99e0b46092 Fix building on Debian
Debian does not export /usr/bin in PATH for users like every other
distro so builds fail to find mkfs and parted.
2021-03-05 11:29:53 -07:00
Jeremy Soller
83b35f6870
Revert "scripts: Check coreboot config is correct"
This reverts commit af5041f90befc28d8d99efa052d5823b2b1833c6.
2021-02-26 15:28:05 -07:00