5 Commits

Author SHA1 Message Date
vasilito 8a4014fb3c libredox: remove redox_syscall from default features list
The default features list still had 'redox_syscall' as a
feature entry, but the redox_syscall dep is now non-optional
(made non-optional in commit 80d0eae so the acpi module
could unconditionally re-export AcPiVerb). Cargo rejects
this as a manifest error: 'feature default includes
redox_syscall, but redox_syscall is not an optional
dependency'.

The fix is to remove 'redox_syscall' from the default list.
Since the dep is non-optional now, the feature is redundant
anyway (always on by default). The .orig and the
auto-generated Cargo.toml are updated in sync.

The previous build failure (after Cargo.toml regen) was
uncovered by the next build attempt and fixed here.
2026-07-02 11:09:42 +03:00
vasilito fc1ece67b3 libredox: regenerate Cargo.toml from .orig (version 0.1.18, non-optional redox_syscall)
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.
2026-07-02 10:59:45 +03:00
vasilito 80d0eaeb21 libredox: make redox_syscall non-optional, fix O_CLOEXEC dup
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.
2026-07-02 08:25:51 +03:00
vasilito d87746b279 libredox: bump to 0.1.18 + backport redox_fcntl_v0 + add Phase J acpi module
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.
2026-07-02 07:55:04 +03:00
vasilito d01da350c1 libredox: Red Bear OS Phase J fork (use local syscall with EnterS2Idle/ExitS2Idle)
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.).
2026-07-01 13:12:39 +03:00
8 changed files with 1282 additions and 16 deletions
+1
View File
@@ -0,0 +1 @@
{"v":1}
+6
View File
@@ -0,0 +1,6 @@
{
"git": {
"sha1": "7040cf71b3a5d15d91802810d0a50aa197970c43"
},
"path_in_vcs": ""
}
+2
View File
@@ -0,0 +1,2 @@
/target
/Cargo.lock
+73
View File
@@ -0,0 +1,73 @@
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.
[package]
edition = "2021"
name = "libredox"
version = "0.1.18"
authors = ["4lDO2 <4lDO2@protonmail.com>"]
build = false
exclude = ["target"]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Redox stable ABI"
readme = false
license = "MIT"
repository = "https://gitlab.redox-os.org/redox-os/libredox.git"
[features]
base = ["libc"]
call = ["base"]
default = [
"base",
"call",
"std",
"protocol",
]
mkns = ["ioslice"]
protocol = [
"plain",
"bitflags",
]
std = ["base"]
[lib]
name = "libredox"
path = "src/lib.rs"
[dependencies.bitflags]
version = "2"
optional = true
[dependencies.ioslice]
version = "0.6"
optional = true
[dependencies.libc]
version = "0.2"
optional = true
[dependencies.plain]
version = "0.2"
optional = true
# Red Bear OS Phase J: path override to the local syscall
# fork. The local fork at ../syscall/ adds the
# EnterS2Idle/ExitS2Idle AcPiVerb variants. This breaks
# the libredox::error::Error <-> syscall::Error type-
# identity barrier that previously caused E0277 errors in
# scheme-utils and daemon.
[dependencies.redox_syscall]
path = "../syscall"
version = "0.8"
+44
View File
@@ -0,0 +1,44 @@
[package]
name = "libredox"
authors = ["4lDO2 <4lDO2@protonmail.com>"]
# Red Bear OS Phase J: version is 0.1.18 upstream. The
# redox_syscall dep is now required (not optional) because
# the local fork's acpi module (added in this commit) re-
# exports AcPiVerb from redox_syscall, and downstream recipes
# that don't enable the redox_syscall feature get an
# "unresolved import" error. Making the dep non-optional
# also matches the upstream 0.1.18 Cargo.toml pattern where
# the redox_syscall dep is unconditional.
version = "0.1.18"
edition = "2021"
license = "MIT"
description = "Redox stable ABI"
# Red Bear OS fork lives at the canonical outer repo
# (gitea.redbearos.org/vasilito/RedBear-OS).
repository = "https://gitea.redbearos.org/vasilito/RedBear-OS"
exclude = ["target"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
default = ["base", "call", "std", "protocol"]
base = ["libc"]
call = ["base"]
std = ["base"]
protocol = ["plain", "bitflags", "redox_syscall"]
mkns = ["ioslice"]
[dependencies]
bitflags = { version = "2", optional = true }
libc = { version = "0.2", optional = true }
# Phase J: path override to the local fork (../syscall
# relative to the libredox fork's local/sources/libredox/
# path). This gives libredox access to the EnterS2Idle /
# ExitS2Idle AcpiVerb variants. Cargo's [patch.crates-io]
# in the workspace's outer Cargo.toml (in base/ and kernel/)
# is what wires this path through to the actual
# redox_syscall crate; this path entry is the libredox-
# side patch override for the same crate.
redox_syscall = { path = "../syscall", version = "0.8" }
ioslice = { version = "0.6", optional = true }
plain = { version = "0.2", optional = true }
+16 -13
View File
@@ -1,18 +1,21 @@
MIT License
Copyright (c) 2026 vasilito
Copyright (c) 2023 4lDO2
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-3
View File
@@ -1,3 +0,0 @@
# RedBear-OS
RedBear Operating System, based on RedoxOS. Licenced under MIT license.
+1140
View File
File diff suppressed because it is too large Load Diff