Skip to content

dbus: rauc: replace tacd-based update polling with native update polling #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ac2e0c4
tacd: dbus: rauc: re-introspect services
hnez Mar 27, 2025
77aafa2
dbus: systemd: also monitor rauc.service
hnez Apr 2, 2025
a164327
dbus: rauc: add Channels type to use instead of Vec<Channel>
hnez Apr 2, 2025
0833495
dbus: rauc: use a UpdateRequest object instead of a simple URL for in…
hnez Apr 2, 2025
b1d8baa
dbus: rauc: allow restricting installation to a specific manifest_hash
hnez Apr 2, 2025
46cb875
dbus: rauc: remove tacd-based update polling
hnez Apr 2, 2025
6a43333
dbus: rauc: update_channels: add a concept of a single primary channel
hnez Apr 2, 2025
42b959f
dbus: rauc: only install bundles from the primary channel
hnez Apr 2, 2025
2b84818
dbus: rauc: system_conf: write runtime RAUC config with poll section
hnez Apr 2, 2025
008b883
dbus: rauc: reload rauc daemon when required
hnez Apr 2, 2025
632685f
dbus: rauc: trigger a single poll for updates after reloading the daemon
hnez Apr 3, 2025
0ab21a3
dbus: rauc: forward poller status to broker
hnez Apr 2, 2025
911e489
dbus: rauc: add manifest_hash und effective_url to UpstreamBundle
hnez Apr 2, 2025
f6d6b46
dbus: rauc: add support for enabling the auto install feature
hnez Apr 2, 2025
79f970f
dbus: rauc: implement forced polling via update channel files
hnez Mar 31, 2025
e5c3a3c
dbus: rauc: allow configuring the *_criteria in channel files
hnez Mar 31, 2025
31dd189
dbus: rauc: prevent auto updates while in setup mode
hnez Apr 2, 2025
cb89591
web: setup: inform the user about additional headers that are sent now
hnez Apr 2, 2025
9f5d256
web: indicate to the user when a channel is enabled but not primary
hnez Apr 2, 2025
84c6b9e
web: add toggle switches to enable automatic installation of updates
hnez Apr 2, 2025
4e711b3
web: use manifest_hash and effective_url when triggering an install
hnez Apr 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 44 additions & 3 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,7 @@ paths:
- network-manager
- labgrid-exporter
- lxa-iobus
- rauc
put:
summary: Perform an action on a systemd service
tags: [System]
Expand All @@ -722,6 +723,7 @@ paths:
- network-manager
- labgrid-exporter
- lxa-iobus
- rauc
get:
summary: Get the status of a systemd service
tags: [System]
Expand Down Expand Up @@ -773,6 +775,21 @@ paths:
'400':
description: The value could not be parsed as boolean

/v1/tac/update/enable_auto_install:
put:
summary: Enable automatic installation of operating system updates
tags: [Updating]
requestBody:
content:
application/json:
schema:
type: boolean
responses:
'204':
description: Automatic installation of updates was enabled/disabled
'400':
description: The value could not be parsed as boolean

/v1/tac/update/operation:
get:
summary: Get the currently running system update operation
Expand Down Expand Up @@ -825,12 +842,12 @@ paths:
content:
application/json:
schema:
type: string
$ref: '#/components/schemas/UpdateRequest'
responses:
'204':
description: The value was parsed as string and will be tried
description: The value was parsed successfully and will be tried
'400':
description: The value could not be parsed as string
description: The value could not be parsed

/v1/tac/update/channels:
get:
Expand Down Expand Up @@ -1100,6 +1117,14 @@ components:
nesting_depth:
type: number

UpdateRequest:
type: object
properties:
url:
type: string
manifest_hash:
type: string

UpdateChannels:
type: array
items:
Expand All @@ -1122,15 +1147,31 @@ components:
type: integer
enabled:
type: boolean
primary:
type: boolean
bundle:
type: object
properties:
compatible:
type: string
version:
type: string,
manifest_hash:
type: string,
effective_url:
type: string,
newer_than_installed:
type: boolean
force_polling:
type: boolean
force_auto_install:
type: boolean
candidate_criteria:
type: string
install_criteria:
type: string
reboot_criteria:
type: string

ServiceStatus:
type: object
Expand Down
12 changes: 0 additions & 12 deletions src/broker/topic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,18 +336,6 @@ impl<E: Serialize + DeserializeOwned + Clone + PartialEq> Topic<E> {

self.modify(|prev| if prev != msg { msg } else { None });
}

/// Wait until the topic is set to the specified value
pub async fn wait_for(self: &Arc<Self>, val: E) {
let (mut stream, sub) = self.clone().subscribe_unbounded();

// Unwrap here to keep the interface simple. The stream could only yield
// None if the sender side is dropped, which will not happen as we hold
// an Arc to self which contains the senders vec.
while stream.next().await.unwrap() != val {}

sub.unsubscribe()
}
}

impl<E: Serialize + DeserializeOwned + Clone + Not + Not<Output = E>> Topic<E> {
Expand Down
7 changes: 5 additions & 2 deletions src/dbus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,21 @@ impl DbusSession {
wtb: &mut WatchedTasksBuilder,
led_dut: Arc<Topic<BlinkPattern>>,
led_uplink: Arc<Topic<BlinkPattern>>,
setup_mode: Arc<Topic<bool>>,
) -> anyhow::Result<Self> {
let tacd = Tacd::new();

let conn_builder = ConnectionBuilder::system()?.name("de.pengutronix.tacd")?;

let conn = Arc::new(tacd.serve(conn_builder).build().await?);

let systemd = Systemd::new(bb, wtb, &conn).await?;

Ok(Self {
hostname: Hostname::new(bb, wtb, &conn)?,
network: Network::new(bb, wtb, &conn, led_dut, led_uplink)?,
rauc: Rauc::new(bb, wtb, &conn)?,
systemd: Systemd::new(bb, wtb, &conn).await?,
rauc: Rauc::new(bb, wtb, &conn, systemd.rauc.clone(), setup_mode)?,
systemd,
})
}
}
Loading