[packagekit] Doing something useful with ServicePack
Richard Hughes
hughsient at gmail.com
Thu Mar 13 14:44:23 PDT 2008
Now, for some of the use cases for offline update and install we need a
way to be able to insert media and do something with it in a sane way.
We also need to do this carefully to use Lock() on hal or gvfs so the
user can't remove optical media (the common use case). The lock will
need to be system-wide, not per-session or per-user.
We also need to integrate this with the per-session UI and permissions
model we have in packagekit. What I'm suggesting here is basically a
brain dump after sitting on a train for a couple of hours.
First, the split has to be in the right place.
The client tools are responsible for watching volumes and then doing the
right thing, where this might be starting the update viewer, or
installing a pack of infomation, and of course using policykit to
authenticate and warning the user of repercussions. The client tool will
have to integrate with the desktop, so for gnome add a launch handler
for gnome-volume-manager or even use gvfs. The client tool also has to
inform the user if they inserted a forsight 2.0 update CD into a fedora
9 system.
The daemon is responsible for telling the backend about the media
presence (so it can add a local repo or something) and also telling the
backend when the media is no longer available. This can also do a Lock()
on HAL (using gvfs or libhal) as this will be system wide.
On daemon startup we check for volumes:
- if the file servicepack.txt is present then add to whitelist and do ServicePack(location, TRUE)
- if not, add to blacklist
watch for volume removal
- if in whitelist do ServicePack(location, FALSE) and remove from whitelist
- else remove from blacklist
watch for volume insertion - insert into correct list like we do at startup
When we are about to do a method call (for example UpdateSystem)
- Lock() volumes in whitelist
- do method
- Unlock() volumes in whitelist
When we want to unload the daemon we can just do
- Remove from blacklist
- ServicePack(location, FALSE) from whitelist, then remove
When the backend gets ServicePack(location, enable) it does:
- Reads servicepack.txt if extra information is required
- Adds or removes a repository for local install with location
- NOTE: there can be multiply inserted update media, e.g. a pendrive and a DVDROM
This way we only lock media that we might be using, rather than any
random DVD in the drive. By locking the media, the backend knows it can
use the ServicePack installed repository without the user removing the
disk. Well, unless they just disconnect the USB, or use a paperclip, or
even just power down - but we can't control those without using mind
control.
I guess this looks fairly complicated, but I think with this interaction
we can solve a lot of the offline use cases in an abstract way, and do
some super cool new stuff that just works. I've not yet thought of how
to /generate/ the servicepack media yet, but I think that will be better
done as a GSoC idea or something.
Richard.
More information about the PackageKit
mailing list