Maciej Pijanowski 2c502f407d bump to v0.2.1
Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
2023-11-15 10:21:05 +01:00
2023-11-10 15:39:37 +01:00
2023-11-15 10:21:05 +01:00
2023-11-14 10:11:25 +01:00
2023-11-10 15:39:37 +01:00
2023-11-10 15:39:37 +01:00
2023-11-10 15:39:37 +01:00
2023-11-14 10:11:25 +01:00
2023-11-10 15:39:37 +01:00
2023-11-14 10:07:19 +01:00
2023-11-10 15:39:37 +01:00
2023-11-15 10:21:05 +01:00
2023-11-14 10:11:30 +01:00
2023-11-07 21:16:07 +01:00
2023-11-15 09:52:54 +01:00

DCU - Dasharo Configuration Utility

Introduction

The Dasharo Configuration Utility is a tool designed to configure Dasharo firmware binary images. It includes task such as customizing the boot logo, and setting unique UUIDs or Serial Numbers in SMBIOS tables.

DCU can be run in two modes - standalone, or as a container. The container setup contains all of the prerequisites, so it should be easier to use.

Prerequisites

Dasharo Configuration Utility Container

Standalone DCU

Following packages must be installed:

The script will exit with an error if any of above are not present.

Compiling cbfstool

The cbfstool can be compiled from source if needed.

git clone https://review.coreboot.org/coreboot.git
cd coreboot
TOOLLDFLAGS=-static make -C util/cbfstool
strip --strip-unneeded util/cbfstool/cbfstool
TOOLLDFLAGS=-static sudo make -C util/cbfstool install

Usage

dcu can be used as a standalone script, and is also available in the Dasharo Tools Suite.

To use dcu as a standalone script (or using a container), you should clone the repository first:

git clone https://github.com/Dasharo/dcu.git

Dasharo Configuration Container

Simply use dcuc instead od dcu, and follow the section below.

Standalone

The script will save the UUID and Serial Number to the COREBOOT region and the logo to BOOTSPLASH region.

NOTE: Not all Dasharo platform support such customizations.

NOTE: if you update the firmware by rewriting whole BIOS region, the data will be lost. To avoid data loss during the COREBOOT region update, Dasharo firmware will keep the copies of Serial Number and UUID in the UEFI variables on normal boot, so that in the potential firmware update in the future, the data will be kept (as long as UEFI variables are not erased).

Simply run the script with -h or --help flags to get documentation and examples of the available commands.

Common actions:

  • Change boot logo:
./dcu logo coreboot.rom -l bootsplash.bmp

Error codes

  • 0 - no error
  • 1 - unknown argument/option
  • 2 - uuidparse not found
  • 3 - convert not found
  • 4 - coreboot image not found or invalid path
  • 5 - cbfstool not found
  • 6 - failed to extract coreboot configuration file from coreboot image
  • 7 - configurable UUID not supported by given coreboot image
  • 8 - invalid UUID format
  • 9 - failed to set the UUID (more detailed error information in the script output)
  • 10 - configurable Serial Number not supported by given coreboot image
  • 11 - failed to set the Serial Number (more detailed error information in the script output)
  • 12 - logo file not found or invalid path
  • 13 - unsupported logo file format
  • 14 - customizable logo not supported by given coreboot image
  • 15 - logo file too big to fit in given coreboot image
  • 16 - failed to set the logo (more detailed error information in the script output)

Development

Please note that after every code modification in src you have to run bashly generate. Typical developer workflow would looks as follows:

  1. Set alias for bashly:
alias bashly='docker run --rm -it --user $(id -u):$(id -g) --volume "$PWD:/app" dannyben/bashly'
  1. Perform code modification in src directory.
  2. Apply changes by bashly generate
  3. Test your changes.
  4. If your changes work as expected create pull request.

Testing

We are using approvals.bash here.

How to run test and/or refresh the expected outputs:

  1. Edit the ./test/approve to create desired test cases.
  2. Get the test data:
./test/get-test-data.sh
  1. Run tests (or refresh expected outputs)
./test/approve
Description
No description provided
Readme Apache-2.0 6.8 MiB
Languages
Shell 100%