Skip to content

Commit ac5c352

Browse files
committed
doc: help with feature selection
1 parent de58824 commit ac5c352

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

uefi-test-runner/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2024"
77

88
[dependencies]
99
uefi-raw = { path = "../uefi-raw" }
10-
uefi = { path = "../uefi", features = ["alloc", "global_allocator", "panic_handler", "logger", "qemu"] }
10+
uefi = { path = "../uefi", features = ["alloc", "global_allocator", "panic_handler", "logger", "qemu", "log-debugcon"] }
1111

1212
log.workspace = true
1313

uefi/Cargo.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ license.workspace = true
1515
repository.workspace = true
1616
rust-version.workspace = true
1717

18+
# Feature documentation in uefi/lib.rs.
1819
[features]
19-
# KEEP this feature list in sync with doc in lib.rs!
20-
default = [ "log-debugcon" ]
20+
# KEEP this feature list in sync with doc in uefi/lib.rs!
21+
default = [ ]
2122
alloc = []
2223

23-
# Generic gate to code that uses unstable features of Rust. You usually need a nightly toolchain.
24+
# Generic gate to code that uses unstable features of Rust, needing a nightly
25+
# toolchain.
2426
unstable = []
2527

2628
# Helper features:
@@ -31,9 +33,6 @@ panic_handler = []
3133
# - dependency log-debugcon: logical, not technical
3234
# - dependency panic_handler: logical, not technical
3335
qemu = ["dep:qemu-exit", "panic_handler", "log-debugcon"]
34-
# Whether the internal logger from the helpers module should also log to
35-
# the debugcon device (QEMU) and debug-console (cloud-hypervisor). Only works
36-
# on x86.
3736
log-debugcon = []
3837

3938
[dependencies]

uefi/src/lib.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@
119119
//! protocols can be defined with the [`unsafe_protocol`] macro.
120120
//!
121121
//! ## Optional Cargo crate features
122-
//!
122+
//!
123+
//! ### Feature List
124+
//!
123125
//! - `alloc`: Enable functionality requiring the [`alloc`] crate from
124126
//! the Rust standard library. For example, methods that return a
125127
//! `Vec` rather than filling a statically-sized array. This requires
@@ -134,6 +136,8 @@
134136
//! - `logger`: Logging implementation for the standard [`log`] crate
135137
//! that prints output to the UEFI console. No buffering is done; this
136138
//! is not a high-performance logger.
139+
//! - `log-debugcon`: Whether the logger set up by `logger` should also log
140+
//! to the debugcon device (available in QEMU or Cloud Hypervisor on x86).
137141
//! - `panic_handler`: Add a default panic handler that logs to `stdout`.
138142
//! - `unstable`: Enable functionality that depends on [unstable
139143
//! features] in the nightly compiler.
@@ -147,6 +151,16 @@
147151
//! only unfold their potential when you invoke `uefi::helpers::init` as soon
148152
//! as possible in your application.
149153
//!
154+
//! ### TL;DR: Recommended Default Features
155+
//!
156+
//! In typical use-cases, the following features are useful for you:
157+
//! - Building a UEFI image:
158+
//! - Recommend `alloc`, `global_allocator`, `logger`, `panic_handler`
159+
//! - Optional `log-debugcon`, `unstable`, `qemu`
160+
//! - Building another application/library:
161+
//! - Recommend `alloc`,
162+
//! - Optional `unstable`
163+
//!
150164
//! # Discuss and Contribute
151165
//!
152166
//! For general discussions, feel free to join us in our [Zulip] and ask

0 commit comments

Comments
 (0)