Files
RedBear-OS/local/patches/base/P6-rtcd-no-ocreat.patch
T
vasilito cee25393d8 fix: boot process improvements — dependency cycle, INIT_NOTIFY, probing loop, and log spam fixes
- Fix P15-8-init-cycle-detection.patch: replace visiting+error with seen+silent-skip
  to eliminate 11 false-positive 'dependency cycle detected' errors on shared deps
- Fix P0-daemon-fix-init-notify-unwrap.patch: remove eprintln! for missing
  INIT_NOTIFY (expected for oneshot_async services, ~7 daemons affected)
- Fix driver-manager hotplug loop: add PERMANENTLY_SKIPPED static set shared
  between hotplug handler and DriverConfig::probe() to stop infinite re-probing
  of Fatal/NotSupported/deferred-exhausted device+driver pairs (e.g. ided)
- Fix driver-manager log_timeline: suppress repeated EPIPE/ENOENT errors with
  AtomicI32 dedup and AtomicBool one-shot guards for boot timeline JSON
- Add driver-manager SIGTERM handler, ACPI bus registration, --status mode,
  driver reap loop, graceful shutdown, and reduced deferred retries (30→3)
2026-05-17 12:34:02 +03:00

27 lines
1.2 KiB
Diff

diff --git a/drivers/rtcd/src/main.rs b/drivers/rtcd/src/main.rs
index 3e913780..41383ca3 100644
--- a/drivers/rtcd/src/main.rs
+++ b/drivers/rtcd/src/main.rs
@@ -1,4 +1,5 @@
use anyhow::{Context, Result};
+use std::io::Write;
// TODO: Do not use target architecture to distinguish these.
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
@@ -17,7 +18,14 @@ fn main() -> Result<()> {
let time_s = self::x86::get_time();
let time_ns = u128::from(time_s) * 1_000_000_000;
- std::fs::write("/scheme/sys/update_time_offset", &time_ns.to_ne_bytes())
+ // Open the sys scheme resource directly without O_CREAT, since update_time_offset
+ // is a pre-existing kernel resource. Using std::fs::write (which sets O_CREAT) can
+ // trigger EEXIST from the kernel's named pipe subsystem.
+ let mut file = std::fs::OpenOptions::new()
+ .write(true)
+ .open("/scheme/sys/update_time_offset")
+ .context("failed to open time offset")?;
+ file.write_all(&time_ns.to_ne_bytes())
.context("failed to write to time offset")?;
}
// TODO: aarch64 is currently handled in the kernel