The generated Cargo.toml was stale (still 0.1.17 with
optional = true on redox_syscall) after the .orig bump.
Force-regenerate by manually editing both fields so the
generated file matches .orig. The previous build failure
(unresolved import redox_syscall) was due to this drift.
Discovered by running redbear-mini build after the
nice-mapping, affinity-mask, deadlock, and proc-path
fixes landed.
Three fixes for cross-recipe build:
1. O_CLOEXEC was already imported from libc at line 114, but
the 0.1.18 backport added a duplicate 'pub const O_CLOEXEC'
at line 173. E0255 ("name defined multiple times") error.
Keep only the new F_DUPFD_CLOEXEC constant; O_CLOEXEC comes
from libc.
2. pub mod acpi that re-exports AcPiVerb from redox_syscall
is now correctly gated on '#[cfg(feature = "redox_syscall")]'.
The 'redox_syscall' dep is currently optional in libredox's
Cargo.toml, so recipes that don't enable the feature
(e.g. base-initfs which uses default-features libredox)
get an unresolved-import error. Move to making the dep
non-optional so it's always available.
3. Make redox_syscall dep non-optional in Cargo.toml. This
is safe because (a) the path override always points at the
local fork which is always present, and (b) all downstream
consumers of libredox already depend on redox_syscall
transitively (or are the syscall consumers themselves, like
the kernel).
After these three changes, the libredox fork builds cleanly
and the 'pub mod acpi { pub use redox_syscall::AcPiVerb; }'
re-export is available to all consumers without feature flags.
Three changes in one commit, all interrelated:
1. Bump version 0.1.17 -> 0.1.18 to match upstream. Reason:
recipes/core/redoxfs/source requires libredox = "0.1.18",
and the kernel's [patch.crates-io] override forces this local
fork to be used in the kernel compilation. If the local fork
stays at 0.1.17, the linker fails with undefined references
to symbols added in 0.1.18 (redox_fcntl_v0 in particular).
2. Backport the 0.1.18 additions to src/lib.rs:
- fn redox_fcntl_v0 extern declaration
- pub fn fcntl() on Fd and as a free function
- O_CLOEXEC and F_DUPFD_CLOEXEC constants
All backports are purely additive; the existing Phase J
path override (path = "../syscall") is preserved.
3. Re-apply the actual Phase J work to libredox that was
missing from commit d01da35 ("Phase J fork"):
- pub mod acpi re-exporting AcPiVerb from redox_syscall
The commit message of d01da35 implied it added AcPiVerb
re-exports but in fact only added the path override and
version bump. This re-export is what gives acpid / kstop /
redbear-power / redbear-acmd access to the symbolic
EnterS2Idle / ExitS2Idle / SetS3WakingVector / EnterS3
names instead of hardcoded integer discriminants.
After this commit, redoxfs links cleanly against the local
libredox 0.1.18 and the kernel's per-cpu run queues / futex
sharding work remains intact.
Phase J: hardware-agnostic s2idle / Modern Standby support
in libredox. The libredox 0.1.17 dep on redox_syscall is
redirected to the local fork at ../syscall (the fork at
local/sources/syscall/ which adds EnterS2Idle/ExitS2Idle
AcPiVerb variants to upstream's 0.8.1).
This breaks the libredox::error::Error <-> syscall::Error
type-identity barrier that previously caused E0277 errors
in scheme-utils and daemon when the local syscall fork
was used. Now that libredox also uses the local fork,
both types are the same compile-time type.
The version field stays at upstream 0.1.17 per the
AGENTS.md 'GOLDEN RULE — Red Bear adapts to upstream,
never the reverse'. Periodic rebase via 'git fetch
upstream' is the workflow when upstream changes.
Hardware-agnostic: works for any platform with Modern
Standby firmware (Dell, HP, Lenovo, LG Gram, etc.).