f6c2eb2a8e
- P19-init-startup-hardening: Replace panic-grade expect/unwrap in init startup paths (getns, register_scheme_to_ns, setrens, filename parsing) with graceful error handling and logging - P19-acpid-startup-hardening: Replace panic-grade calls in acpid with graceful degradation (rxsdt read failure → warn + exit 0, SDT parse → error + exit 1, I/O privilege → fatal, scheme registration → fatal, setrens → warn + continue, event loop errors → log + continue) - P18-9-msi-allocation-resilience: Regenerate with git diff -U0 -w format for maximum context resilience - fetch.rs: Change --fuzz=0 to --fuzz=3 for resilient patch application - AGENTS.md: Document robust patch generation technique as mandatory - Add P4/P5/P6/P7 patches (estale, dmi, i2c, ps2d hardening) - Add P21 kernel x2apic SMP fix patch - Multiple local recipe source improvements (redox-drm, driver-manager, driver-acpi, thermald) - Config updates for redbear-mini and redbear-device-services - Subsystem assessment document
25 lines
1.2 KiB
Diff
25 lines
1.2 KiB
Diff
--- a/drivers/hwd/src/backend/acpi.rs
|
|
+++ b/drivers/hwd/src/backend/acpi.rs
|
|
@@ -16,7 +16,20 @@
|
|
|
|
fn probe(&mut self) -> Result<(), Box<dyn Error>> {
|
|
// Read symbols from acpi scheme
|
|
- let entries = fs::read_dir("/scheme/acpi/symbols")?;
|
|
+ let entries = match fs::read_dir("/scheme/acpi/symbols") {
|
|
+ Ok(entries) => entries,
|
|
+ Err(err) if err.kind() == std::io::ErrorKind::WouldBlock || err.raw_os_error() == Some(11) => {
|
|
+ log::debug!("hwd: ACPI symbols are not ready yet");
|
|
+ return Ok(());
|
|
+ }
|
|
+ // ESTALE (116): filesystem handle stale during initfs-to-rootfs transition
|
|
+ // ENOENT (2): /scheme/acpi not mounted yet (e.g., acpid not started)
|
|
+ Err(err) if err.raw_os_error() == Some(116) || err.kind() == std::io::ErrorKind::NotFound => {
|
|
+ log::info!("hwd: ACPI symbols unavailable ({}), running with no ACPI devices", err);
|
|
+ return Ok(());
|
|
+ }
|
|
+ Err(err) => return Err(err.into()),
|
|
+ };
|
|
// TODO: Reimplement with getdents?
|
|
let symbols_fd = libredox::Fd::open(
|
|
"/scheme/acpi/symbols",
|