daemon: make tdp_service optional

There seems to have been recent addition of requiring a valid
TDPManagerService in the user daemon, which in turn breaks the service
for people who use steamos-manager on devices such as HTPCs or other
non-supported hardware.

Fix this by making the TDP configuration optional in the user daemon.
This commit is contained in:
Kalle Ahlström 2025-06-02 23:25:52 +03:00 committed by Matthew Schwartz
parent 5fecc6bbb4
commit 5778a636f3

View file

@ -109,7 +109,12 @@ pub(crate) type Command = DaemonCommand<()>;
async fn create_connections( async fn create_connections(
channel: Sender<Command>, channel: Sender<Command>,
) -> Result<(Connection, Connection, JobManagerService, TdpManagerService)> { ) -> Result<(
Connection,
Connection,
JobManagerService,
Result<TdpManagerService>,
)> {
let system = Connection::system().await?; let system = Connection::system().await?;
let connection = Builder::session()? let connection = Builder::session()?
.name("com.steampowered.SteamOSManager1")? .name("com.steampowered.SteamOSManager1")?
@ -121,7 +126,7 @@ async fn create_connections(
let jm_service = JobManagerService::new(job_manager, rx, system.clone()); let jm_service = JobManagerService::new(job_manager, rx, system.clone());
let (tdp_tx, rx) = unbounded_channel(); let (tdp_tx, rx) = unbounded_channel();
let tdp_service = TdpManagerService::new(rx, &system, &connection).await?; let tdp_service = TdpManagerService::new(rx, &system, &connection).await;
create_interfaces(connection.clone(), system.clone(), channel, jm_tx, tdp_tx).await?; create_interfaces(connection.clone(), system.clone(), channel, jm_tx, tdp_tx).await?;
@ -151,7 +156,9 @@ pub async fn daemon() -> Result<()> {
let mut daemon = Daemon::new(subscriber, system, rx).await?; let mut daemon = Daemon::new(subscriber, system, rx).await?;
daemon.add_service(mirror_service); daemon.add_service(mirror_service);
daemon.add_service(tdp_service); if let Ok(tdp_service) = tdp_service {
daemon.add_service(tdp_service);
}
session.object_server().at("/", ObjectManager {}).await?; session.object_server().at("/", ObjectManager {}).await?;