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
2023-10-19 08:08:11 -06:00
2023-10-12 13:27:55 -06:00
2023-09-07 10:34:31 -06:00
2023-04-03 13:23:12 -06:00
2019-10-04 17:28:41 -06:00
2023-08-04 12:04:42 -06:00
2023-07-20 10:43:17 -06:00

System76 Open Firmware

An open source distribution of firmware utilizing coreboot, EDK2, and System76 firmware applications.

Supported models and features

To view models that are supported and will receive updates through the firmware manager, as well as available features for those models, please see the feature matrix.

Other models may be in development or available without support, and can be seen in the models/ directory.

If the device becomes bricked it will require restoring the current firmware using an external programmer. See flashing for details.

Schematics

System76 customers may request board schematics for their system by sending an email to firmware@system76.com with the subject line "Schematics for model", where model is one of the supported models listed above. Please include the serial number of your system for verification.

You may not share these without explicit permission from System76.

Changelog

For a list of important changes please see the changelog.

Building

Dependencies can be installed with the provided script.

./scripts/install-deps.sh

If rustup was installed for the first time, it will be required to source the environment file it installed to use the correct Rust toolchain.

source ~/.cargo/env

A script is provided to build the firmware. The available targets for building are the model folders in models/. For example, to build for QEMU:

./scripts/build.sh qemu

Once built, the firmware must be flashed to use. Several scripts are available to flash the new firmware, depending on how it is going to be written.

  • scripts/qemu.sh: Run the firmware in QEMU (specific to the QEMU model)
  • scripts/flash.sh: Flash using the internal flasher
  • scripts/ch341a-flash.sh: Flash using a CH341A programmer
  • scripts/spipi-flash.sh: Flash using a Raspberry Pi

See Flashing firmware for more details.

Description
Languages
C 93.5%
Shell 5.7%
Rust 0.5%
Dockerfile 0.3%