mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-17 15:34:18 +08:00
Fix and port more apps for uutils-procps
This commit is contained in:
parent
5676d5f763
commit
0c7353bfad
@ -1,22 +1,41 @@
|
||||
#TODO: common libc functions such as getsid
|
||||
#TODO: only watch is working
|
||||
#TODO: common libc functions such as getsid and utmpx in rustix
|
||||
[source]
|
||||
git = "https://github.com/uutils/procps"
|
||||
rev = "ee98c0a78fe2abe72589f80eb05b455fa228e757"
|
||||
patches = [ "redox.patch" ]
|
||||
shallow_clone = true
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
# TODO: more features support?
|
||||
CARGO_PROFILE_RELEASE_LTO=thin cookbook_cargo --no-default-features --features pmap,slabtop,sysctl,tload,vmstat,watch
|
||||
|
||||
BINS=(
|
||||
#free
|
||||
hugetop
|
||||
pgrep
|
||||
pidof
|
||||
pidwait
|
||||
pkill
|
||||
pmap
|
||||
ps
|
||||
pwdx
|
||||
skill
|
||||
snice
|
||||
sysctl
|
||||
tload
|
||||
#top
|
||||
vmstat
|
||||
#w
|
||||
watch
|
||||
)
|
||||
|
||||
(IFS=,; CARGO_PROFILE_RELEASE_LTO=thin cookbook_cargo --no-default-features --features "${BINS[*]}")
|
||||
|
||||
for bin in "${BINS[@]}"
|
||||
do
|
||||
ln -sv procps "${COOKBOOK_STAGE}/usr/bin/$bin"
|
||||
done
|
||||
"""
|
||||
|
||||
# conflict with coreutils
|
||||
rm "${COOKBOOK_STAGE}/usr/bin/ps"
|
||||
"""
|
||||
|
||||
37
recipes/wip/rs/uutils-procps/redox.patch
Normal file
37
recipes/wip/rs/uutils-procps/redox.patch
Normal file
@ -0,0 +1,37 @@
|
||||
diff --git a/src/uu/pgrep/src/process_matcher.rs b/src/uu/pgrep/src/process_matcher.rs
|
||||
index c991092..33adcff 100644
|
||||
--- a/src/uu/pgrep/src/process_matcher.rs
|
||||
+++ b/src/uu/pgrep/src/process_matcher.rs
|
||||
@@ -452,14 +452,14 @@ pub fn getpgrp() -> u64 {
|
||||
|
||||
/// Dummy implementation for unsupported platforms.
|
||||
pub fn getsid(_pid: u32) -> u64 {
|
||||
- #[cfg(unix)]
|
||||
+ #[cfg(all(unix, not(target_os = "redox")))]
|
||||
{
|
||||
rustix::process::getsid(None)
|
||||
.ok()
|
||||
.map(|pid: rustix::process::Pid| pid.as_raw_nonzero().get() as u64)
|
||||
.unwrap_or(0)
|
||||
}
|
||||
- #[cfg(not(unix))]
|
||||
+ #[cfg(not(all(unix, not(target_os = "redox"))))]
|
||||
{
|
||||
0
|
||||
}
|
||||
diff --git a/src/uu/ps/src/process_selection.rs b/src/uu/ps/src/process_selection.rs
|
||||
index c2a0a5a..65c33a2 100644
|
||||
--- a/src/uu/ps/src/process_selection.rs
|
||||
+++ b/src/uu/ps/src/process_selection.rs
|
||||
@@ -20,6 +20,11 @@ fn getsid(pid: i32) -> Option<i32> {
|
||||
}
|
||||
}
|
||||
|
||||
+#[cfg(target_os = "redox")]
|
||||
+fn getsid(_pid: i32) -> Option<i32> {
|
||||
+ None
|
||||
+}
|
||||
+
|
||||
// TODO: Temporary add to this file, this function will add to uucore.
|
||||
#[cfg(target_family = "windows")]
|
||||
fn getsid(_pid: i32) -> Option<i32> {
|
||||
Loading…
Reference in New Issue
Block a user