Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,19 @@ commands:

jobs:

cfr_settings_tests:
docker:
# cimg/base:2026.08 provides Bash and ShellCheck for this host-only job.
- image: cimg/base@sha256:e8f07526f593ac5dee29362b7f98c6fec94c412722d6bbece731e4cc885abccb
steps:
- checkout
- run:
name: CFR settings host fixture
command: ./tests/cfr/test_cfr_settings.sh
- run:
name: CFR settings shellcheck
command: shellcheck initrd/bin/cfr-settings.sh tests/cfr/test_cfr_settings.sh

# ═══════════════════════════════════════════════════════════════════════════
# Glossary (see doc/circleci.md for full cache model)
# ═══════════════════════════════════════════════════════════════════════════
Expand Down Expand Up @@ -415,6 +428,7 @@ workflows:
build_and_test:
max_auto_reruns: 3
jobs:
- cfr_settings_tests
- create_hashes:
name: create_hashes [cache keys]

Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -877,10 +877,19 @@ endif
# --- TOOLS.CPIO ---

# tools.cpio is built from all binaries, libraries, and config staged in initrd_tools_dir
initrd_feature_markers :=
ifeq ($(CONFIG_HEADS_CFR),y)
initrd_feature_markers += $(initrd_tools_dir)/etc/heads-cfr-enabled
$(initrd_tools_dir)/etc/heads-cfr-enabled: $(CONFIG)
@mkdir -p "$(dir $@)"
@printf 'enabled\n' > "$@"
endif

$(build)/$(initrd_dir)/tools.cpio: \
$(initrd_bins) \
$(initrd_libs) \
$(initrd_tools_dir)/etc/config \
$(initrd_feature_markers) \
FORCE
$(call do-cpio,$@,$(initrd_tools_dir))
@$(RM) -rf "$(initrd_tools_dir)"
Expand Down
37 changes: 37 additions & 0 deletions doc/cfr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Coreboot Firmware Settings

Heads can optionally show the standard Linux firmware-attributes interface
published by the coreboot CFR driver. The feature is disabled unless a board
sets `CONFIG_HEADS_CFR=y` in its board configuration. Its build-generated
`/etc/heads-cfr-enabled` marker is immutable at runtime, so `config.user`
cannot enable or disable the feature.

The UI reads only:

```text
/sys/class/firmware-attributes/coreboot-cfr/attributes
```

It does not parse the coreboot table, access EFI variables or SMMSTORE, or
invoke an SMI. A board must therefore provide a kernel and firmware stack that
implements this standard interface before enabling the feature.

The board configuration must select kernel and coreboot revisions that provide
the required CFR firmware-attributes ABI. Source selection and board enablement
are intentionally outside this generic UI change.

The settings menu is available under Options only when both the immutable
feature marker and the firmware-attributes class/device exist. Missing,
malformed, disappearing, or unwritable attributes are handled as unavailable
or read-only. Every selected write requires an explicit confirmation showing
the display name, current value, requested value, and pending-reboot status;
cancelling that confirmation does not write.

The Linux driver currently exposes writability through the `current_value` mode
and does not publish a `flags` attribute. The UI works with no `flags` files.
It tolerates an optional flags file for forward compatibility, hiding
`inactive`/`suppressed` entries and treating `readonly` or `volatile` as
non-writable, but that file is not part of the required ABI. Enumeration values
use the standard semicolon delimiter; labels containing spaces are preserved. A literal
semicolon cannot be represented unambiguously by that sysfs ABI and is rejected
rather than guessed.
1 change: 1 addition & 0 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Quick reference: read the relevant doc when working on a topic.
| `build-artifacts.md` | ROM filenames, update-package zip layout, LVFS conventions |
| `build-freshness.md` | Why rebuilds produce stale artifacts and how to force a full rebuild |
| `circleci.md` | CI pipeline: job dependency graph, cache layers, workspace persistence |
| `cfr.md` | Optional coreboot firmware-settings UI |
| `docker.md` | Docker-based build environment with pinned, reproducible images |
| `modules.md` | Module system: toolchain and bin modules, inclusion rules, sentinel chain |
| `patches.md` | Creating and maintaining source patches for upstream packages |
Expand Down
Loading