Repository navigation
Add sysupdate backend - #247
leolost2605 wants to merge 10 commits into
Conversation
db81255 to
e9e468f
Compare
|
This PR now allows checking for new updates, updating, cancelling the update and also says that a restart is required. Progress report is left to a follow up. It's also missing any automatic updates stuff and last refresh time etc. since I wanted to focus on the actual functional parts. The rest is pretty independent from sysupdate and can always be added later without changing any architecture. I think we should keep the system update in the settings daemon. A few reasons for that:
Now a few answers to things from the discussion in elementary/settings-system#422
Yeah we probably want to adjust the API at some point. But for now just sending the new version as a "package" works fine IMO.
This ofc needs adjusted API but apart from that I don't think we need to parse it in both. I think we should just parse it in the system settings to get the release notes. The main reason why we would want to parse it in the daemon would be too handle security updates but I don't think it makes a lot of sense anymore to differentiate between security fixes and other updates. The main reason for this is that given that we only have one monolithic image chances are that every update contains at least one security fix in one package.
Like I said above unfortunately it turns out that this would be a bit more complex than expected but ofc still doable though I'm not sure it's worth the effort. All in all IMO having it in the settings daemon is the better option but I'm not entirely against moving it to system settings as well. My main point was that I wanted to make sure we have some abstraction around the actual sysupdate logic and a rough plan for what we all need to support everything we want (e.g. I struggled a bit to find a proper way of handling jobs without races and still provide a good API while also making sure that it scales and is flexible because even the dbus interface API has been broken in the latest release (update will be two jobs: download + install instead of a single update job)) which is here now provided by |
518fa52 to
d1a8b43
Compare
3b3ab7e to
fd1cc06
Compare
|
Should be ready for an initial review :) |
f68833e to
dc0b8bb
Compare
danirabbit
left a comment
There was a problem hiding this comment.
Can we add an interface that the backends implement so we can make sure to keep them in sync?
| */ | ||
|
|
||
| [DBus (name="io.elementary.settings_daemon.SystemUpdate")] | ||
| public class SettingsDaemon.Backends.SystemDSystemUpdate : Object { |
There was a problem hiding this comment.
Is there a reason to not just call this Sysupdate?
There was a problem hiding this comment.
Not really. I thought in the beginning it might be to similar to SystemUpdate but I think it's fine. However now the problem is that we also have the namespace Sysupdate which will clash if we try to use something from there in this class (notably Sysupdate.Target.HOST_PATH). We could change the namespace to DBus.Sysupdate but idk. Open to any suggestions :)
Unfortunately this is a bigger refactor than I thought in the beginning. We then can't export the backend directly because the dbus generation doesn't recognize the interface async methods somehow. So we would need an intermediate class that just passes through the calls to the backend. I have a branch for that but I wasn't sure how much we want to make this exchangeable. I'll propose a separate PR for this :) Edit: #251 |
|
I also added progress report now since with the infrastructure in place that is only minimal changes :) |
3e1d05e to
ad4462d
Compare
This now introduces SysupdateTarget (and some utility classes use by it) which has a convenient (and stateless) API to communicate with sysupdate. It can be used by the system update and also for selecting features in the future. If we want to move it completely to the settings this class can be moved one to one there. It then uses that in the SystemDSystemUpdate which mirrors the exact interface that the packagekit system update has.
Testing
This is what I came up with since it's the first time i've really worked with an image based os. If anybody has a better way to do this or a great workflow you want to share I'd be happy. But what I did didn't take too long as well and should be pretty robust.
I used sysext which has a great introduction in this blog: https://blogs.gnome.org/alatiera/2023/08/04/developing-gnome-os-systemd-sysext/ together with distrobox because not all dependencies are yet in the sdk.
distrobox create --image ubuntu:26.04 -n my-containerdistrobox enter my-containeror via the ptyxis profiles and containers drop downmeson setup build --prefix=/usrsudo DESTDIR=~/sys-exts/settings-daemon meson install. This will create a file hierarchy under ~/sys-exts/settings-daemon that contains your normal /usr that only contains your settings daemonsudo systemd-sysext refresh --forceNote that this will cause some problems if you have changes to the gschemas etc. because they have to be compiled via a custom script and custom scripts are skipped when running meson install with a custom DESTDIR so you would have to compile them manually. GNOMEs sysext-utils would take care of that but for now this should work.