Skip to content

Commit 7fee5fd

Browse files
committed
WIP: meta-lxatac-software: tacd{,-webinterface}: add rauc-polling support
RAUC has recently learned to perform update polling on its own. This means we can remove the update polling support from tacd and use the one provided by RAUC instead. Signed-off-by: Leonard Göhrs <[email protected]>
1 parent ee84e91 commit 7fee5fd

23 files changed

+3077
-5
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
From ac2e0c416223552d9a604bab7e33e514e1d518bd Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Leonard=20G=C3=B6hrs?= <[email protected]>
3+
Date: Thu, 27 Mar 2025 08:59:42 +0100
4+
Subject: [PATCH 01/17] tacd: dbus: rauc: re-introspect services
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=UTF-8
7+
Content-Transfer-Encoding: 8bit
8+
9+
RAUC is in the process of adding native update polling support.
10+
Re-introspect the dbus service to add the new APIs.
11+
12+
Signed-off-by: Leonard Göhrs <[email protected]>
13+
---
14+
src/dbus/rauc.rs | 3 +++
15+
src/dbus/rauc/installer.rs | 5 +++++
16+
src/dbus/rauc/poller.rs | 24 ++++++++++++++++++++++++
17+
3 files changed, 32 insertions(+)
18+
create mode 100644 src/dbus/rauc/poller.rs
19+
20+
diff --git a/src/dbus/rauc.rs b/src/dbus/rauc.rs
21+
index 415f771..6d69084 100644
22+
--- a/src/dbus/rauc.rs
23+
+++ b/src/dbus/rauc.rs
24+
@@ -43,6 +43,9 @@ mod installer;
25+
#[cfg(not(feature = "demo_mode"))]
26+
use installer::InstallerProxy;
27+
28+
+#[cfg(not(feature = "demo_mode"))]
29+
+mod poller;
30+
+
31+
#[cfg(feature = "demo_mode")]
32+
mod imports {
33+
use std::collections::HashMap;
34+
diff --git a/src/dbus/rauc/installer.rs b/src/dbus/rauc/installer.rs
35+
index d8c1836..f030161 100644
36+
--- a/src/dbus/rauc/installer.rs
37+
+++ b/src/dbus/rauc/installer.rs
38+
@@ -10,6 +10,11 @@ use zbus::proxy;
39+
default_path = "/"
40+
)]
41+
trait Installer {
42+
+ /// GetArtifactStatus method
43+
+ fn get_artifact_status(
44+
+ &self,
45+
+ ) -> zbus::Result<Vec<std::collections::HashMap<String, zbus::zvariant::OwnedValue>>>;
46+
+
47+
/// GetPrimary method
48+
fn get_primary(&self) -> zbus::Result<String>;
49+
50+
diff --git a/src/dbus/rauc/poller.rs b/src/dbus/rauc/poller.rs
51+
new file mode 100644
52+
index 0000000..70fdb3b
53+
--- /dev/null
54+
+++ b/src/dbus/rauc/poller.rs
55+
@@ -0,0 +1,24 @@
56+
+//! This code was generated by `zbus-xmlgen` `4.1.0` from DBus introspection data.
57+
+//!
58+
+//! By running `zbus-xmlgen system de.pengutronix.rauc /` on the LXA TAC.
59+
+
60+
+use zbus::proxy;
61+
+
62+
+#[proxy(
63+
+ interface = "de.pengutronix.rauc.Poller",
64+
+ default_service = "de.pengutronix.rauc",
65+
+ default_path = "/"
66+
+)]
67+
+trait Poller {
68+
+ /// Poll method
69+
+ fn poll(&self) -> zbus::Result<()>;
70+
+
71+
+ /// NextPoll property
72+
+ #[zbus(property)]
73+
+ fn next_poll(&self) -> zbus::Result<i64>;
74+
+
75+
+ /// Status property
76+
+ #[zbus(property)]
77+
+ fn status(&self)
78+
+ -> zbus::Result<std::collections::HashMap<String, zbus::zvariant::OwnedValue>>;
79+
+}
80+
--
81+
2.39.5
82+
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
From 77aafa2af22bb812df0effec2d3a37f808af21ac Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Leonard=20G=C3=B6hrs?= <[email protected]>
3+
Date: Wed, 2 Apr 2025 14:45:10 +0200
4+
Subject: [PATCH 02/17] dbus: systemd: also monitor rauc.service
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=UTF-8
7+
Content-Transfer-Encoding: 8bit
8+
9+
This exposes the status of the RAUC daemon to users inside and outside of
10+
the tacd. As of now neither of them exist, but in the next few commits
11+
support for re-starting the RAUC deamon to reload its configuration will
12+
be added.
13+
14+
Signed-off-by: Leonard Göhrs <[email protected]>
15+
---
16+
openapi.yaml | 2 ++
17+
src/dbus/systemd.rs | 5 +++++
18+
2 files changed, 7 insertions(+)
19+
20+
diff --git a/openapi.yaml b/openapi.yaml
21+
index 7451efc..46589cc 100644
22+
--- a/openapi.yaml
23+
+++ b/openapi.yaml
24+
@@ -697,6 +697,7 @@ paths:
25+
- network-manager
26+
- labgrid-exporter
27+
- lxa-iobus
28+
+ - rauc
29+
put:
30+
summary: Perform an action on a systemd service
31+
tags: [System]
32+
@@ -722,6 +723,7 @@ paths:
33+
- network-manager
34+
- labgrid-exporter
35+
- lxa-iobus
36+
+ - rauc
37+
get:
38+
summary: Get the status of a systemd service
39+
tags: [System]
40+
diff --git a/src/dbus/systemd.rs b/src/dbus/systemd.rs
41+
index e06f2dd..ff78eb3 100644
42+
--- a/src/dbus/systemd.rs
43+
+++ b/src/dbus/systemd.rs
44+
@@ -66,6 +66,8 @@ pub struct Systemd {
45+
pub labgrid: Service,
46+
#[allow(dead_code)]
47+
pub iobus: Service,
48+
+ #[allow(dead_code)]
49+
+ pub rauc: Service,
50+
}
51+
52+
impl ServiceStatus {
53+
@@ -238,6 +240,7 @@ impl Systemd {
54+
let networkmanager = Service::new(bb, "network-manager");
55+
let labgrid = Service::new(bb, "labgrid-exporter");
56+
let iobus = Service::new(bb, "lxa-iobus");
57+
+ let rauc = Service::new(bb, "rauc");
58+
59+
networkmanager
60+
.connect(wtb, conn.clone(), "NetworkManager.service")
61+
@@ -248,12 +251,14 @@ impl Systemd {
62+
iobus
63+
.connect(wtb, conn.clone(), "lxa-iobus.service")
64+
.await?;
65+
+ rauc.connect(wtb, conn.clone(), "rauc.service").await?;
66+
67+
Ok(Self {
68+
reboot,
69+
networkmanager,
70+
labgrid,
71+
iobus,
72+
+ rauc,
73+
})
74+
}
75+
}
76+
--
77+
2.39.5
78+

0 commit comments

Comments
 (0)