Red Bear OS — microkernel OS in Rust, based on Redox
Derivative of Redox OS (https://www.redox-os.org) adding: - AMD GPU driver (amdgpu) via LinuxKPI compat layer - ext4 filesystem support (ext4d scheme daemon) - ACPI fixes for AMD bare metal (x2APIC, DMAR, IVRS, MCFG) - Custom branding (hostname, os-release, boot identity) Build system is full upstream Redox with RBOS overlay in local/. Patches for kernel, base, and relibc are symlinked from local/patches/ and protected from make clean/distclean. Custom recipes live in local/recipes/ with symlinks into the recipes/ search path. Build: make all CONFIG_NAME=redbear-full Sync: ./local/scripts/sync-upstream.sh
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
# TODO Fix coreutils i18n/l10n behavior on Redox
|
||||
# TODO Fix locale init bug on aarch64 before removing patches
|
||||
# TODO https://github.com/uutils/coreutils/commit/e6f7ad06 broke locales on x86_64
|
||||
[source]
|
||||
git = "https://github.com/uutils/coreutils"
|
||||
rev = "1f7c81f5d2d3e56c518349c0392158871a1ea9ec"
|
||||
patches = [
|
||||
"redox.patch"
|
||||
]
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
# TODO: upstream changes, consider using feat_require_unix_core if relibc is ready?
|
||||
CARGO_PROFILE_RELEASE_LTO=thin cookbook_cargo --no-default-features --features feat_os_unix_redox,kill --bin coreutils
|
||||
|
||||
BINS=(
|
||||
'['
|
||||
b2sum
|
||||
b3sum
|
||||
base32
|
||||
base64
|
||||
basename
|
||||
basenc
|
||||
cat
|
||||
chmod
|
||||
cksum
|
||||
comm
|
||||
cp
|
||||
csplit
|
||||
cut
|
||||
date
|
||||
dd
|
||||
#df not working, use redox coreutils
|
||||
dir
|
||||
dircolors
|
||||
dirname
|
||||
du
|
||||
echo
|
||||
env
|
||||
expand
|
||||
expr
|
||||
factor
|
||||
false
|
||||
fmt
|
||||
fold
|
||||
hashsum
|
||||
head
|
||||
join
|
||||
install
|
||||
kill
|
||||
link
|
||||
ln
|
||||
ls
|
||||
md5sum
|
||||
mkdir
|
||||
mktemp
|
||||
more
|
||||
mv
|
||||
nl
|
||||
nproc
|
||||
numfmt
|
||||
od
|
||||
paste
|
||||
pr
|
||||
printenv
|
||||
printf
|
||||
ptx
|
||||
pwd
|
||||
readlink
|
||||
realpath
|
||||
rm
|
||||
rmdir
|
||||
seq
|
||||
sha1sum
|
||||
sha224sum
|
||||
sha256sum
|
||||
sha3-224sum
|
||||
sha3-256sum
|
||||
sha3-384sum
|
||||
sha3-512sum
|
||||
sha384sum
|
||||
sha3sum
|
||||
sha512sum
|
||||
shake128sum
|
||||
shake256sum
|
||||
shred
|
||||
shuf
|
||||
sleep
|
||||
sort
|
||||
split
|
||||
stat
|
||||
sum
|
||||
tac
|
||||
tail
|
||||
tee
|
||||
test
|
||||
touch
|
||||
tr
|
||||
true
|
||||
truncate
|
||||
tsort
|
||||
unexpand
|
||||
uname
|
||||
uniq
|
||||
unlink
|
||||
vdir
|
||||
wc
|
||||
yes
|
||||
)
|
||||
|
||||
for bin in "${BINS[@]}"
|
||||
do
|
||||
ln -sv coreutils "${COOKBOOK_STAGE}/usr/bin/$bin"
|
||||
done
|
||||
"""
|
||||
@@ -0,0 +1,83 @@
|
||||
diff --git a/Cargo.toml b/Cargo.toml
|
||||
index 5f417bd42..b7b895a9c 100644
|
||||
--- a/Cargo.toml
|
||||
+++ b/Cargo.toml
|
||||
@@ -326,6 +326,7 @@ feat_os_unix_redox = [
|
||||
"feat_common_core",
|
||||
#
|
||||
"chmod",
|
||||
+ "nproc",
|
||||
"stat",
|
||||
"uname",
|
||||
]
|
||||
diff --git a/src/uucore/src/lib/features/fs.rs b/src/uucore/src/lib/features/fs.rs
|
||||
index fd1f30303..c508f6b9b 100644
|
||||
--- a/src/uucore/src/lib/features/fs.rs
|
||||
+++ b/src/uucore/src/lib/features/fs.rs
|
||||
@@ -13,7 +13,7 @@ use libc::{
|
||||
S_IRUSR, S_ISGID, S_ISUID, S_ISVTX, S_IWGRP, S_IWOTH, S_IWUSR, S_IXGRP, S_IXOTH, S_IXUSR,
|
||||
mkfifo, mode_t,
|
||||
};
|
||||
-#[cfg(all(unix, not(target_os = "redox")))]
|
||||
+#[cfg(unix)]
|
||||
pub use libc::{major, makedev, minor};
|
||||
use std::collections::HashSet;
|
||||
use std::collections::VecDeque;
|
||||
@@ -849,24 +849,6 @@ pub fn make_fifo(path: &Path) -> std::io::Result<()> {
|
||||
}
|
||||
}
|
||||
|
||||
-// Redox's libc appears not to include the following utilities
|
||||
-
|
||||
-#[cfg(target_os = "redox")]
|
||||
-pub fn major(dev: libc::dev_t) -> libc::c_uint {
|
||||
- (((dev >> 8) & 0xFFF) | ((dev >> 32) & 0xFFFFF000)) as _
|
||||
-}
|
||||
-
|
||||
-#[cfg(target_os = "redox")]
|
||||
-pub fn minor(dev: libc::dev_t) -> libc::c_uint {
|
||||
- ((dev & 0xFF) | ((dev >> 12) & 0xFFFFF00)) as _
|
||||
-}
|
||||
-
|
||||
-#[cfg(target_os = "redox")]
|
||||
-pub fn makedev(maj: libc::c_uint, min: libc::c_uint) -> libc::dev_t {
|
||||
- let [maj, min] = [maj as libc::dev_t, min as libc::dev_t];
|
||||
- (min & 0xff) | ((maj & 0xfff) << 8) | ((min & !0xff) << 12) | ((maj & !0xfff) << 32)
|
||||
-}
|
||||
-
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
// Note this useful idiom: importing names from outer (for mod tests) scope.
|
||||
diff --git a/src/uucore/src/lib/mods/locale.rs b/src/uucore/src/lib/mods/locale.rs
|
||||
index b670f8976..a4ff9f983 100644
|
||||
--- a/src/uucore/src/lib/mods/locale.rs
|
||||
+++ b/src/uucore/src/lib/mods/locale.rs
|
||||
@@ -211,10 +211,11 @@ fn init_localization(
|
||||
}
|
||||
};
|
||||
|
||||
- LOCALIZER.with(|lock| {
|
||||
+ // TODO: In aarch64 redox OS, this lock (once cell) is already initialized out of nothing
|
||||
+ let _ = LOCALIZER.with(|lock| {
|
||||
lock.set(loc)
|
||||
.map_err(|_| LocalizationError::Bundle("Localizer already initialized".into()))
|
||||
- })?;
|
||||
+ });
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -422,10 +423,12 @@ pub fn setup_localization(p: &str) -> Result<(), LocalizationError> {
|
||||
let english_bundle = create_english_bundle_from_embedded(&default_locale, p)?;
|
||||
let localizer = Localizer::new(english_bundle);
|
||||
|
||||
- LOCALIZER.with(|lock| {
|
||||
+ // TODO: In aarch64 redox OS, this lock (once cell) is already initialized out of nothing
|
||||
+ // TODO: When this code is used? Patching for keep sake
|
||||
+ let _ = LOCALIZER.with(|lock| {
|
||||
lock.set(localizer)
|
||||
.map_err(|_| LocalizationError::Bundle("Localizer already initialized".into()))
|
||||
- })?;
|
||||
+ });
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user