00b799d512
Per local/docs/PATCH-PRESERVATION-AUDIT-2026-07-12.md the base fork was carrying only 38 of 100 patches in local/patches/base/. The other 62 patches' content was silently missing from the fork working tree, even though their .patch files were preserved. This commit re-applies 41 patches that genuinely still apply cleanly + 17 hunks that partially applied. Recovery covers: - D-Bus initfs service wiring (P4-initfs-dbus-services) - USB service wiring (P4-initfs-usb-drm-services) - netcfg/dhcp/dhcpv6 driver fixes - acpid shutdown/PM/quirk fixes - inputd/ps2d hard-fail logging - pcid driver interface refinements (server cmd channel) - virtio-core for VirtualBox support - ixgbed/rtl8139/rtl8168 net drivers - ahcid NCQ + per-function interrupt coalescing - logd persistent logging - bootstrap procmgr race-condition fixes - cargo version pin to +rb0.3.0 (synchronized release branch) 58 files changed, +1444/-318 lines. Untracked mnt/ tree and *.orig / *.rej files cleaned up after patch application (leftover from absolute-path patch headers).
57 lines
1.5 KiB
Rust
57 lines
1.5 KiB
Rust
use std::process;
|
|
|
|
mod backend;
|
|
use self::backend::{AcpiBackend, Backend, DeviceTreeBackend, LegacyBackend};
|
|
|
|
fn daemon(daemon: daemon::Daemon) -> ! {
|
|
common::setup_logging(
|
|
"misc",
|
|
"hwd",
|
|
"hwd",
|
|
common::output_level(),
|
|
common::file_level(),
|
|
);
|
|
|
|
// Prefer DTB if available (matches kernel preference)
|
|
let mut backend: Box<dyn Backend> = match DeviceTreeBackend::new() {
|
|
Ok(ok) => {
|
|
log::info!("using devicetree backend");
|
|
Box::new(ok)
|
|
}
|
|
Err(err) => {
|
|
log::debug!("cannot use devicetree backend: {}", err);
|
|
match AcpiBackend::new() {
|
|
Ok(ok) => {
|
|
log::info!("using ACPI backend");
|
|
Box::new(ok)
|
|
}
|
|
Err(err) => {
|
|
log::debug!("cannot use ACPI backend: {}", err);
|
|
|
|
log::info!("using legacy backend");
|
|
Box::new(LegacyBackend)
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
//TODO: launch pcid based on backend information?
|
|
// Must launch after acpid but before probe calls /scheme/acpi/symbols
|
|
daemon.ready();
|
|
|
|
//TODO: HWD is meant to locate PCI/XHCI/etc devices in ACPI and DeviceTree definitions and start their drivers
|
|
match backend.probe() {
|
|
Ok(()) => {
|
|
process::exit(0);
|
|
}
|
|
Err(err) => {
|
|
log::error!("failed to probe with error {}", err);
|
|
process::exit(1);
|
|
}
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
daemon::Daemon::new(daemon);
|
|
}
|