Skip to content

Add coreboot firmware settings UI - #2197

Draft
Sean-StarLabs wants to merge 1 commit into
linuxboot:masterfrom
StarLabsLtd:sean/heads-cfr-qemu-20260827
Draft

Add coreboot firmware settings UI#2197
Sean-StarLabs wants to merge 1 commit into
linuxboot:masterfrom
StarLabsLtd:sean/heads-cfr-qemu-20260827

Conversation

@Sean-StarLabs

@Sean-StarLabs Sean-StarLabs commented Aug 27, 2026

Copy link
Copy Markdown

Summary

  • add a Heads firmware-settings menu backed by the Linux firmware-attributes ABI
  • support enum and stepped integer settings with confirmation and error handling
  • hide unavailable, suppressed, inactive, malformed, and non-writable settings as appropriate
  • report reboot-required changes
  • add a root-run host fixture for the production UI entry point

Functional validation

The production UI entry point passes the host sysfs fixture while running as root, including writable-mode changes, malformed data, disappearing settings, cancelled confirmation, write failures, and fbwhiptail cursor-control output.

On a Star Labs StarBook Horizon with the matching coreboot atomic CFR service and Linux driver, Heads enumerated the writable Bluetooth setting and changed it from Enabled to Disabled through the confirmation flow. The refreshed menu immediately read back and displayed Disabled.

Reboot persistence was not exercised on physical hardware. The QEMU integration fixture has been dropped from this branch.

@Sean-StarLabs
Sean-StarLabs force-pushed the sean/heads-cfr-qemu-20260827 branch from d5714d0 to 5532cdc Compare August 27, 2026 12:33
@Sean-StarLabs Sean-StarLabs changed the title WIP: Add coreboot firmware settings UI Add coreboot firmware settings UI Aug 27, 2026
@Sean-StarLabs
Sean-StarLabs marked this pull request as ready for review August 27, 2026 12:33
@Sean-StarLabs
Sean-StarLabs force-pushed the sean/heads-cfr-qemu-20260827 branch from 5532cdc to e0e5127 Compare August 27, 2026 12:37
@Sean-StarLabs
Sean-StarLabs marked this pull request as draft August 27, 2026 12:47
@Sean-StarLabs
Sean-StarLabs force-pushed the sean/heads-cfr-qemu-20260827 branch from e0e5127 to 173735a Compare August 27, 2026 13:24
@Sean-StarLabs
Sean-StarLabs marked this pull request as ready for review August 27, 2026 13:24
@Sean-StarLabs
Sean-StarLabs force-pushed the sean/heads-cfr-qemu-20260827 branch from 173735a to 138bc8e Compare August 27, 2026 14:08
Heads has no setup browser for settings described by coreboot CFR.
Without a payload UI, users must boot another operating system or carry
product-specific policy outside firmware to change an otherwise supported
setting.

Expose firmware settings through the Linux firmware-attributes ABI when a
board explicitly enables CFR support. Validate firmware-provided metadata,
confirm every write, and report reboot-required updates.

Allow boards to pin exact Linux and coreboot revisions so CFR support can
be integrated without changing existing release-based builds. Add a host UI
fixture for malformed, read-only, disappearing, and cancelled settings.

Link: https://patchew.org/linux/cover.1787003659.git.sean@starlabs.systems/

Link: https://review.coreboot.org/q/topic:heads-cfr-settings

TEST=On a Star Labs StarBook Horizon, Heads enumerated the writable
     Bluetooth setting, changed it from Enabled to Disabled through the
     confirmation flow, and immediately read back Disabled. Reboot
     persistence was not tested.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
@Sean-StarLabs
Sean-StarLabs force-pushed the sean/heads-cfr-qemu-20260827 branch from 138bc8e to dbf0213 Compare August 27, 2026 14:34
Sean-StarLabs added a commit to StarLabsLtd/coreboot that referenced this pull request Aug 27, 2026
CFR describes firmware settings, but non-UEFI payloads such as Heads do
not have a firmware setup browser or an EFI runtime service that can
safely coordinate persistence and immediate hardware application. The
Linux CFR firmware-attributes backend therefore needs a bounded
firmware transaction rather than direct variable writes plus a second,
non-atomic apply request.

Allocate one firmware-owned CBMEM mailbox and expose typed GET and
compare-and-set transactions through SMM. Persist and read back the
value, verify optional runtime application, roll back both states on
failure, and fault later writes if recovery becomes indeterminate. Exact
request retries return the cached result without applying twice.

Qubes already carries product-specific dom0 policy where platform
behavior is otherwise unavailable to the OS. The linked display patch
does not consume CFR, but is a concrete example of the board-specific
workarounds this generic settings path is intended to avoid for options
that coreboot does describe.

Link: https://patchew.org/linux/cover.1787003659.git.sean@starlabs.systems/

Link: linuxboot/heads#2197

Link: QubesOS/qubes-core-admin-linux#222

TEST=On a Star Labs StarBook Horizon, Heads enumerated the writable
     Bluetooth setting, changed it from Enabled to Disabled, and
     immediately read back Disabled. Reboot persistence was not tested.

Change-Id: I8d5ff6d4c7b7df548bdb0288a51bdde627dec7ac
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Sean-StarLabs added a commit to StarLabsLtd/coreboot that referenced this pull request Aug 27, 2026
CFR describes firmware settings, but non-UEFI payloads such as Heads do
not have a firmware setup browser or an EFI runtime service that can
safely coordinate persistence and immediate hardware application. The
Linux CFR firmware-attributes backend therefore needs a bounded
firmware transaction rather than direct variable writes plus a second,
non-atomic apply request.

Allocate one firmware-owned CBMEM mailbox and expose typed GET and
compare-and-set transactions through SMM. Persist and read back the
value, verify optional runtime application, roll back both states on
failure, and fault later writes if recovery becomes indeterminate. Exact
request retries return the cached result without applying twice.

Qubes already carries product-specific dom0 policy where platform
behavior is otherwise unavailable to the OS. The linked display patch
does not consume CFR, but is a concrete example of the board-specific
workarounds this generic settings path is intended to avoid for options
that coreboot does describe.

Link: https://patchew.org/linux/cover.1787003659.git.sean@starlabs.systems/

Link: linuxboot/heads#2197

Link: QubesOS/qubes-core-admin-linux#222

TEST=On a Star Labs StarBook Horizon, Heads enumerated the writable
     Bluetooth setting, changed it from Enabled to Disabled, and
     immediately read back Disabled. Reboot persistence was not tested.

Change-Id: I8d5ff6d4c7b7df548bdb0288a51bdde627dec7ac
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
@Sean-StarLabs
Sean-StarLabs marked this pull request as draft August 27, 2026 15:29
Comment thread Makefile
$(if $(COREBOOT_UTIL_CFLAGS),CFLAGS="$(COREBOOT_UTIL_CFLAGS)") \
)

$(COREBOOT_UTIL_DIR)/cbmem/cbmem: COREBOOT_UTIL_CFLAGS := \

@tlaurion tlaurion Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was wrong with the current way cbmem was built from Makefile into tools.cpio?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also ideally, everything built for Heads tools.cpio should be Oz not O2

@tlaurion tlaurion left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just glanced through, will try to make time to review thoroughly in the next days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants