Fwupd-snap deb package

Since making a fwupd classic snap, I wanted to give a good transition path for people on the fwupd deb.

It doesn’t make sense to completely replace the fwupd deb with a snap, but rather I want to give people a path to switch to the snap and to handle the cleanup of stuff that is placed into the snap install hook.

So ideally I want a deb package that will conflicts with fwupd so that installation of fwupd-snap will cause the conflicting files to get removed and then fwupd-snap can use the snap’s install hook to put them in place.
If the fwupd-snap is removed (or fwupd deb installed) then remove those files.

Has this been done yet? Any samples?

CC @wimpress

1 Like

Since I got no replies to this, I took a stab at trying to make a package how I thought it should work here.
I would appreciate some review and comments on this.

Although it works locally, it seems that the buildds don’t have access to fastly.cdn.snapcraft.io to download the file at that time. Is there a local mirror that buildds can use to access this?

@stgraber please can you share some insight with Mario about how the deb to snap migration works for LXD?

LXD is a strictly confined snap which can be co-installed with the traditional lxd deb so it’s a bit different.

In our case, we have lxd.migrate command which grabs the data from outside the snap, rewrites files and databases, … and then offers the user to cleanup their system from the deb.

We also have a deb (in 18.10) which moves people over to the snap.

Code for both can be found in:

1 Like

Thanks for sharing @stgraber. Yes of course a different case. Since I want the snap to completely take the place of the system installed daemon and they provide the same dbus interfaces I can’t have them both installed simultaneously.

So it looks like you opt to install the snap during preinst rather than saving it into the deb at build time or anything. I’ll adjust to adopt similar principles.

I’ve adjusted this to use some of the same principles as lxd does (but of course different purposes).
Same repo:

@stgraber would you mind to review to see if anything stands out to you on that? Otherwise I guess I’ll try to get this into cosmic repos and then backported to all the LTS releases.

@superm1 looks good to me