Crates.io | uefisettings |
lib.rs | uefisettings |
version | 0.1.4 |
source | src |
created_at | 2023-07-19 13:22:37.083418 |
updated_at | 2024-01-10 16:26:00.089173 |
description | The tool to read/get/extract and write/change/modify BIOS/UEFI settings from Linux terminal. |
homepage | https://github.com/linuxboot/uefisettings |
repository | |
max_upload_size | |
id | 920318 |
size | 1,081,391 |
uefisettings
uefisettings
is a tool to read and write BIOS settings on a local host. It currently supports two interfaces:
cargo install uefisettings
cd /tmp
git clone https://github.com/linuxboot/uefisettings
cd uefisettings
cargo install --path .
~/.cargo/bin/uefisettings --help
uefisettings hii set 'Pending operation' 'TPM Clear'
if [[ "$(uefisettings hii get --json 'Enable Intel(R) TXT' | jq -r '.responses | .[].question.answer')" = "Enable" ]]; then
# Do something if TXT is enabled
fi
SUBCOMMANDS:
get Auto-identify backend and get the current value of a question
help Print this message or the help of the given subcommand(s)
hii Commands which work on machines exposing the UEFI HiiDB
identify Auto-identify backend and display hardware/bios-information
ilo Commands which work on machines having HPE's Ilo BMC
set Auto-identify backend and set/change the value of a question
hii
:
SUBCOMMANDS:
extract-db Dump HiiDB into a file
get Get the current value of a question
help Print this message or the help of the given subcommand(s)
list-strings List all strings-id, string pairs in HiiDB
set Set/change the value of a question
show-ifr Show a human readable representation of the Hii Forms
ilo
:
SUBCOMMANDS:
get Get the current value of a question
help Print this message or the help of the given subcommand(s)
set Set/change the value of a question
show-attributes List bios attributes and their current values
To change BIOS settings from Linux terminal there are usually next ways available:
/sys
file system to change settings. This approach may also work on some non-OCP consumer hardware like your laptops.But this tool is an unified opensource approach to manipulate UEFI settings on any platform.
/dev/mem
after getting offsets from efivarfs
.hii
) in Rust partially implements the UEFI Hii specification.efivarfs
.efivarfs
./dev/hpilo
directly. This doesn't require authentication credentials. HPE doesn't provide any documentation for this approach but they provide an opensource ilorest CLI tool which calls a closed-source dynamically loaded shared object library called ilorest_chif.so
which does the magic. The transport method used here instead of TCP is called Blobstore2.ilorest_chif.so
are implemented in the ilorest
library. Feel free to use opensource implementation instead of ilorest_chif.so
to avoid license problems.The opensource ilorest study results are published in doc/ilorest.md
.
If one needs to update a file inside thrift
directory then:
cargo install fbthrift_compiler && (sudo dnf install -y fbthrift || sudo apt install -y fbthrift)
.thrift
file.~/.cargo/bin/compiler path/to/updated/file.thrift
.mv lib.rs path/to/generated/rust/file.rs
.For example:
# Install fbthrift compiler
cargo install fbthrift_compiler
sudo dnf install -y fbthrift
# Update file
vi thrift/uefisettings_spellings_db.thrift
# Re-generate the rust file from the thrift file.
cargo install fbthrift_compiler
~/.cargo/bin/compiler thrift/uefisettings_spellings_db.thrift
mv lib.rs thrift/rust/uefisettings_spellings_db_thrift/uefisettings_spellings_db.rs