PackageKit and device rebinding

A few people mentioned on my last blog post that instead of nagging the user to unplug or restart, we should just rebind the device. I didn’t do this yesterday as it was quite hard to do the layering correctly as the session is running as a normal user.

But of course, doing things correctly is often harder than doing things quickly. I’ve merged an optional helper into PackageKit that just pokes the hardware in the right place to make it rebind and re-request firmware. This is all done using the pkexec functionality in PolicyKit1, and a custom policy rule.

Device has been virtually unplugged and plugged in
Device has been virtually unplugged and plugged in

If you want this new functionality you need to build contrib/device-rebind in the PackageKit project, and also have GUdev and PolicyKit1 installed. If you don’t have these things, the session will fall back to just asking the user to reboot.

Ohh, and if the rebind fails in any way, we just fall back to asking the user to re-plug or restart like we did before. Device rebind functionality is currently Linux specific, but patches for other operating systems welcome.

Published by

hughsie

Richard has over 10 years of experience developing open source software. He is the maintainer of GNOME Software, PackageKit, GNOME Packagekit, GNOME Power Manager, GNOME Color Manager, colord, and UPower and also contributes to many other projects and opensource standards. Richard has three main areas of interest on the free desktop, color management, package management, and power management. Richard graduated a few years ago from the University of Surrey with a Masters in Electronics Engineering. He now works for Red Hat in the desktop group, and also manages a company selling open source calibration equipment. Richard's outside interests include taking photos and eating good food.

14 thoughts on “PackageKit and device rebinding”

  1. Sorry for nitpicking – it’s great that we can install the needed software so hardware just works. But a computer should rarely notify you – especially when something actually works. Shouldn’t we expect it to work?

    Notifications just suck ;) And it’s only tech ppl who wants to know that the computer does. The rest want’s to know what other ppl do ;)

  2. I like it! So, free firmware now just works, while non-free firmware requires a confirmation?

  3. I kind of agree wrt notifications, I like Linux/GNOME quiet style just to start using, e.g., USB stick compared to my WinXP which gives several notifications how things are configured – Linux/GNOME style gives feeling that things Just Work(tm) without additional configuration compared to silly messages from WinXP.

    Anyway, definitely great progress here, sorry for my nit-picking :)

  4. A lot better already, Hugsie. This is why open source sometimes rules… Trying to make such change with some bigmoney.com would have taken weeks, months, or even years.

  5. My understanding is that you get this notification only when you were prompted to install something you didn’t have installed. So:

    – plug hardware that has drivers & firmware already installed, no notification

    – plug hardware that needs a firmware package
    – get notification telling the user about something they could install to make it work
    – user accepts
    – user waits until installation is done
    – this notification tells the user installation is done and hardware is functional

    Am I right?

  6. How about the following bike shed:

    Your computer must install software onto USB WLAN in order for it to function.

    Software Source: Foo Vendor
    Licence: Non-Free, [read]
    Version: 3.404, 2/4/2009

    Install

    IMO, this should not be done through a notification bubble, especially because they are going to likely end up with a modal box asking for authorization credentials anyway.

  7. does the question mark makes any sense?? this isn’t anymore a notification to ask something to the user…

  8. Why do you need to present this notification? It seems to me that the computer is just saying “all is fine”. I only want to be presented with UI stuff when I actually have to do something.

    1. I think it is interesting to know if new software are installed. Perhaps that is the case for many Fedora users who might be extra technically interested. In Fedora at least with so many testers and developers it is good to get notifications like this. In other distros it might be less interesting.

  9. Seems several people have beat me to it. But here goes anyways, I don’t care much for a positive notification either.

Comments are closed.