mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-15 18:56:49 -04:00
Merge branch 'endrift/workspace' into 'master'
Split into workspaces, move proxy module into its own crate See merge request holo/steamos-manager!20
This commit is contained in:
commit
074b1031a8
56 changed files with 127 additions and 106 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
@ -1196,6 +1196,7 @@ dependencies = [
|
|||
"serde",
|
||||
"serde_json",
|
||||
"speech-dispatcher",
|
||||
"steamos-manager-proxy",
|
||||
"strum",
|
||||
"sysinfo",
|
||||
"tempfile",
|
||||
|
@ -1211,6 +1212,13 @@ dependencies = [
|
|||
"zbus_xml",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "steamos-manager-proxy"
|
||||
version = "25.6.1"
|
||||
dependencies = [
|
||||
"zbus",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "strum"
|
||||
version = "0.27.1"
|
||||
|
|
39
Cargo.toml
39
Cargo.toml
|
@ -1,39 +1,6 @@
|
|||
[package]
|
||||
name = "steamos-manager"
|
||||
version = "25.6.1"
|
||||
edition = "2021"
|
||||
repository = "https://gitlab.steamos.cloud/holo/steamos-manager/"
|
||||
[workspace]
|
||||
resolver = "2"
|
||||
members = ["steamos-manager", "steamos-manager-proxy"]
|
||||
|
||||
[profile.release]
|
||||
strip="symbols"
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
async-trait = "0.1"
|
||||
clap = { version = "4.5", default-features = false, features = ["derive", "help", "std", "usage"] }
|
||||
config = { version = "0.15", default-features = false, features = ["async", "ini", "toml"] }
|
||||
gio = "0.20"
|
||||
inotify = { version = "0.11", default-features = false, features = ["stream"] }
|
||||
input-linux = "0.7"
|
||||
itertools = "0.14"
|
||||
lazy_static = "1"
|
||||
libc = "0.2"
|
||||
nix = { version = "0.30", default-features = false, features = ["fs", "poll", "signal", "time", "user"] }
|
||||
num_enum = "0.7"
|
||||
regex = "1"
|
||||
serde = { version = "1.0", default-features = false, features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
speech-dispatcher = "0.16"
|
||||
strum = { version = "0.27", features = ["derive"] }
|
||||
sysinfo = "0.35"
|
||||
tempfile = "3"
|
||||
tokio = { version = "1", default-features = false, features = ["fs", "io-std", "io-util", "macros", "process", "rt-multi-thread", "signal", "sync"] }
|
||||
tokio-stream = { version = "0.1", default-features = false }
|
||||
tokio-util = { version = "0.7", default-features = false }
|
||||
toml = "0.8"
|
||||
tracing = { version = "0.1", default-features = false }
|
||||
tracing-subscriber = { version = "0.3", default-features = false, features = ["env-filter", "fmt"] }
|
||||
udev = { version = "^0.9.3", features = ["send", "sync"] }
|
||||
xdg = "3.0"
|
||||
zbus = { version = "5", default-features = false, features = ["tokio"] }
|
||||
zbus_xml = "5"
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2023 Collabora Ltd.
|
||||
* Copyright © 2024 Valve Software
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#![allow(clippy::module_name_repetitions)]
|
||||
|
||||
// Re-export relevant proxies
|
||||
|
||||
// Deprecated interface
|
||||
mod manager;
|
||||
pub use crate::proxy::manager::ManagerProxy;
|
||||
|
||||
// Optional interfaces
|
||||
mod ambient_light_sensor1;
|
||||
mod battery_charge_limit1;
|
||||
mod cpu_scaling1;
|
||||
mod factory_reset1;
|
||||
mod fan_control1;
|
||||
mod gpu_performance_level1;
|
||||
mod gpu_power_profile1;
|
||||
mod hdmi_cec1;
|
||||
mod low_power_mode1;
|
||||
mod manager2;
|
||||
mod performance_profile1;
|
||||
mod screenreader0;
|
||||
mod storage1;
|
||||
mod tdp_limit1;
|
||||
mod update_bios1;
|
||||
mod update_dock1;
|
||||
mod wifi_debug1;
|
||||
mod wifi_debug_dump1;
|
||||
mod wifi_power_management1;
|
||||
pub use crate::proxy::ambient_light_sensor1::AmbientLightSensor1Proxy;
|
||||
pub use crate::proxy::battery_charge_limit1::BatteryChargeLimit1Proxy;
|
||||
pub use crate::proxy::cpu_scaling1::CpuScaling1Proxy;
|
||||
pub use crate::proxy::factory_reset1::FactoryReset1Proxy;
|
||||
pub use crate::proxy::fan_control1::FanControl1Proxy;
|
||||
pub use crate::proxy::gpu_performance_level1::GpuPerformanceLevel1Proxy;
|
||||
pub use crate::proxy::gpu_power_profile1::GpuPowerProfile1Proxy;
|
||||
pub use crate::proxy::hdmi_cec1::HdmiCec1Proxy;
|
||||
pub use crate::proxy::low_power_mode1::LowPowerMode1Proxy;
|
||||
pub use crate::proxy::manager2::Manager2Proxy;
|
||||
pub use crate::proxy::performance_profile1::PerformanceProfile1Proxy;
|
||||
pub use crate::proxy::screenreader0::ScreenReader0Proxy;
|
||||
pub use crate::proxy::storage1::Storage1Proxy;
|
||||
pub use crate::proxy::tdp_limit1::TdpLimit1Proxy;
|
||||
pub use crate::proxy::update_bios1::UpdateBios1Proxy;
|
||||
pub use crate::proxy::update_dock1::UpdateDock1Proxy;
|
||||
pub use crate::proxy::wifi_debug1::WifiDebug1Proxy;
|
||||
pub use crate::proxy::wifi_debug_dump1::WifiDebugDump1Proxy;
|
||||
pub use crate::proxy::wifi_power_management1::WifiPowerManagement1Proxy;
|
||||
|
||||
// Sub-interfaces
|
||||
mod job1;
|
||||
mod job_manager1;
|
||||
mod udev_events1;
|
||||
pub use crate::proxy::job1::Job1Proxy;
|
||||
pub use crate::proxy::job_manager1::JobManager1Proxy;
|
||||
pub use crate::proxy::udev_events1::UdevEvents1Proxy;
|
8
steamos-manager-proxy/Cargo.toml
Normal file
8
steamos-manager-proxy/Cargo.toml
Normal file
|
@ -0,0 +1,8 @@
|
|||
[package]
|
||||
name = "steamos-manager-proxy"
|
||||
version = "25.6.1"
|
||||
edition = "2021"
|
||||
repository = "https://gitlab.steamos.cloud/holo/steamos-manager/"
|
||||
|
||||
[dependencies]
|
||||
zbus = { version = "5", default-features = false, features = ["tokio"] }
|
62
steamos-manager-proxy/src/lib.rs
Normal file
62
steamos-manager-proxy/src/lib.rs
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* Copyright © 2023 Collabora Ltd.
|
||||
* Copyright © 2024 Valve Software
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#![allow(clippy::module_name_repetitions)]
|
||||
|
||||
// Re-export relevant proxies
|
||||
|
||||
// Deprecated interface
|
||||
mod manager;
|
||||
pub use crate::manager::ManagerProxy;
|
||||
|
||||
// Optional interfaces
|
||||
mod ambient_light_sensor1;
|
||||
mod battery_charge_limit1;
|
||||
mod cpu_scaling1;
|
||||
mod factory_reset1;
|
||||
mod fan_control1;
|
||||
mod gpu_performance_level1;
|
||||
mod gpu_power_profile1;
|
||||
mod hdmi_cec1;
|
||||
mod low_power_mode1;
|
||||
mod manager2;
|
||||
mod performance_profile1;
|
||||
mod screenreader0;
|
||||
mod storage1;
|
||||
mod tdp_limit1;
|
||||
mod update_bios1;
|
||||
mod update_dock1;
|
||||
mod wifi_debug1;
|
||||
mod wifi_debug_dump1;
|
||||
mod wifi_power_management1;
|
||||
pub use crate::ambient_light_sensor1::AmbientLightSensor1Proxy;
|
||||
pub use crate::battery_charge_limit1::BatteryChargeLimit1Proxy;
|
||||
pub use crate::cpu_scaling1::CpuScaling1Proxy;
|
||||
pub use crate::factory_reset1::FactoryReset1Proxy;
|
||||
pub use crate::fan_control1::FanControl1Proxy;
|
||||
pub use crate::gpu_performance_level1::GpuPerformanceLevel1Proxy;
|
||||
pub use crate::gpu_power_profile1::GpuPowerProfile1Proxy;
|
||||
pub use crate::hdmi_cec1::HdmiCec1Proxy;
|
||||
pub use crate::low_power_mode1::LowPowerMode1Proxy;
|
||||
pub use crate::manager2::Manager2Proxy;
|
||||
pub use crate::performance_profile1::PerformanceProfile1Proxy;
|
||||
pub use crate::screenreader0::ScreenReader0Proxy;
|
||||
pub use crate::storage1::Storage1Proxy;
|
||||
pub use crate::tdp_limit1::TdpLimit1Proxy;
|
||||
pub use crate::update_bios1::UpdateBios1Proxy;
|
||||
pub use crate::update_dock1::UpdateDock1Proxy;
|
||||
pub use crate::wifi_debug1::WifiDebug1Proxy;
|
||||
pub use crate::wifi_debug_dump1::WifiDebugDump1Proxy;
|
||||
pub use crate::wifi_power_management1::WifiPowerManagement1Proxy;
|
||||
|
||||
// Sub-interfaces
|
||||
mod job1;
|
||||
mod job_manager1;
|
||||
mod udev_events1;
|
||||
pub use crate::job1::Job1Proxy;
|
||||
pub use crate::job_manager1::JobManager1Proxy;
|
||||
pub use crate::udev_events1::UdevEvents1Proxy;
|
37
steamos-manager/Cargo.toml
Normal file
37
steamos-manager/Cargo.toml
Normal file
|
@ -0,0 +1,37 @@
|
|||
[package]
|
||||
name = "steamos-manager"
|
||||
version = "25.6.1"
|
||||
edition = "2021"
|
||||
repository = "https://gitlab.steamos.cloud/holo/steamos-manager/"
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
async-trait = "0.1"
|
||||
clap = { version = "4.5", default-features = false, features = ["derive", "help", "std", "usage"] }
|
||||
config = { version = "0.15", default-features = false, features = ["async", "ini", "toml"] }
|
||||
gio = "0.20"
|
||||
inotify = { version = "0.11", default-features = false, features = ["stream"] }
|
||||
input-linux = "0.7"
|
||||
itertools = "0.14"
|
||||
lazy_static = "1"
|
||||
libc = "0.2"
|
||||
nix = { version = "0.30", default-features = false, features = ["fs", "poll", "signal", "time", "user"] }
|
||||
num_enum = "0.7"
|
||||
regex = "1"
|
||||
serde = { version = "1.0", default-features = false, features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
speech-dispatcher = "0.16"
|
||||
steamos-manager-proxy = { path = "../steamos-manager-proxy" }
|
||||
strum = { version = "0.27", features = ["derive"] }
|
||||
sysinfo = "0.35"
|
||||
tempfile = "3"
|
||||
tokio = { version = "1", default-features = false, features = ["fs", "io-std", "io-util", "macros", "process", "rt-multi-thread", "signal", "sync"] }
|
||||
tokio-stream = { version = "0.1", default-features = false }
|
||||
tokio-util = { version = "0.7", default-features = false }
|
||||
toml = "0.8"
|
||||
tracing = { version = "0.1", default-features = false }
|
||||
tracing-subscriber = { version = "0.3", default-features = false, features = ["env-filter", "fmt"] }
|
||||
udev = { version = "^0.9.3", features = ["send", "sync"] }
|
||||
xdg = "3.0"
|
||||
zbus = { version = "5", default-features = false, features = ["tokio"] }
|
||||
zbus_xml = "5"
|
|
@ -33,7 +33,7 @@ const PRODUCT_NAME_PATH: &str = "/sys/class/dmi/id/product_name";
|
|||
#[cfg(not(test))]
|
||||
const DEVICE_CONFIG_PATH: &str = "/usr/share/steamos-manager/devices";
|
||||
#[cfg(test)]
|
||||
const DEVICE_CONFIG_PATH: &str = "data/devices";
|
||||
const DEVICE_CONFIG_PATH: &str = "../data/devices";
|
||||
|
||||
#[derive(Display, EnumString, PartialEq, Debug, Default, Copy, Clone)]
|
||||
#[strum(serialize_all = "snake_case", ascii_case_insensitive)]
|
|
@ -18,6 +18,8 @@ use tokio::io::AsyncWriteExt;
|
|||
use tokio_util::sync::CancellationToken;
|
||||
use tracing::{debug, error, info, warn};
|
||||
|
||||
pub use steamos_manager_proxy as proxy;
|
||||
|
||||
mod ds_inhibit;
|
||||
mod error;
|
||||
mod inputplumber;
|
||||
|
@ -34,7 +36,6 @@ pub mod cec;
|
|||
pub mod daemon;
|
||||
pub mod hardware;
|
||||
pub mod power;
|
||||
pub mod proxy;
|
||||
pub mod screenreader;
|
||||
pub mod wifi;
|
||||
|
|
@ -1345,7 +1345,7 @@ mod test {
|
|||
.await
|
||||
.expect("remote");
|
||||
let local = testing::InterfaceIntrospection::from_local(
|
||||
"com.steampowered.SteamOSManager1.Manager.xml",
|
||||
"../com.steampowered.SteamOSManager1.Manager.xml",
|
||||
"com.steampowered.SteamOSManager1.Manager",
|
||||
)
|
||||
.await
|
||||
|
@ -1357,7 +1357,7 @@ mod test {
|
|||
let remote =
|
||||
testing::InterfaceIntrospection::from_remote::<I, _>(connection, MANAGER_PATH).await?;
|
||||
let local = testing::InterfaceIntrospection::from_local(
|
||||
"com.steampowered.SteamOSManager1.xml",
|
||||
"../com.steampowered.SteamOSManager1.xml",
|
||||
I::name().to_string(),
|
||||
)
|
||||
.await?;
|
|
@ -341,7 +341,7 @@ mod test {
|
|||
|
||||
#[tokio::test]
|
||||
async fn jupiter_valid() {
|
||||
let config = read_to_string("data/devices/jupiter.toml")
|
||||
let config = read_to_string("../data/devices/jupiter.toml")
|
||||
.await
|
||||
.expect("read_to_string");
|
||||
let res = toml::from_str::<PlatformConfig>(config.as_ref());
|
|
@ -36,7 +36,7 @@ use crate::systemd::SystemdUnit;
|
|||
use crate::uinput::UInputDevice;
|
||||
|
||||
#[cfg(test)]
|
||||
const TEST_ORCA_SETTINGS: &str = "data/test-orca-settings.conf";
|
||||
const TEST_ORCA_SETTINGS: &str = "../data/test-orca-settings.conf";
|
||||
#[cfg(test)]
|
||||
const ORCA_SETTINGS: &str = "orca-settings.conf";
|
||||
#[cfg(test)]
|
|
@ -118,7 +118,7 @@ impl MockDBus {
|
|||
.args([
|
||||
"--nofork",
|
||||
"--print-address",
|
||||
"--config-file=data/test-dbus.conf",
|
||||
"--config-file=../data/test-dbus.conf",
|
||||
])
|
||||
.stdout(Stdio::piped())
|
||||
.spawn()?;
|
|
@ -213,7 +213,7 @@ mod test {
|
|||
.await
|
||||
.expect("remove");
|
||||
let local = testing::InterfaceIntrospection::from_local(
|
||||
"com.steampowered.SteamOSManager1.xml",
|
||||
"../com.steampowered.SteamOSManager1.xml",
|
||||
UdevDbusObject::name().to_string(),
|
||||
)
|
||||
.await
|
Loading…
Add table
Add a link
Reference in a new issue