Classic confinement for ubports installer

Hi,

UBports installer is the official installer for UBports, it installs Ubuntu touch on supported devices using adb and fastboot. github: https://github.com/ubports/ubports-installer

This needs access to both adb and fastboot in order to work. this does not seems to work with devmode. Adb also needs to spawn a server that does not behave in strict or devmode.

Thanks

@evan - can you or someone from your team work with the requester on Process for reviewing classic confinement snaps?

I can confirm that Marius is upstream for ubports. @mariogrip, can you elaborate on why the server in question does not behave in strict confinement? Can you also share the errors encountered if you bundle adb and fastboot into the snap?

Thanks!

The server is the adb daemon (https://developer.android.com/studio/command-line/adb.html)

The problem with this is that it need direct usb access, and so does fastboot. And they does not seem to get that at all, even in dev mode. There is no real log that i can find, other then both adb and fastboot does not find any devices. nothing in dmesg.

I have to note, this has been working before, but after an update to snapd (or whatever causes this) it does not seem to work anymore. Thats why we want classic mode to not need to worry about any snapd updates that breaks our app.

Classic isn’t meant to help you not “worry about any snapd updates that breaks [your] app”. The raw-usb interface may be sufficient for your needs. Does this work with snapd from candidate (in devmode and strict)? If it works in devmode (there were fixes in 2.29 for that) but not strict, then I wonder if Mir snap not detecting new input devices is affecting you (there seems to be a change in udev that is causing that).

Also fastboot require sudo due to all the different fastboot idVendor’'s, so strict will probably never work for us.

This is what happens on strict mode (with raw-usb)

[ 1164.386007] audit: type=1400 audit(1510261553.727:1762): apparmor="DENIED" operation="open" profile="snap.android-tool.adb" name="/dev/bus/usb/003/005" pid=8221 comm="adb" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

@jdstrand is there a way i can include udev rules with a snap?

Btw here is the snap in question: http://ci.ubports.com/job/ubports/job/ubports-installer/job/mariogrip-dev/lastSuccessfulBuild/artifact/dist/ubports-installer_0.1.8-beta_amd64.snap does not work in devmode, but works just fine in classic

If you need udev rules, then I would suggest we create an interface for your snap. This would include the udev rules you need, the usb access you need, etc.

As for not working in devmode-- is this because your snap isn’t staging everything it needs, is expecting things in different places than what is in the snap, something else?

This denial would be covered by the raw-usb interface. Plugs that and use ‘snap connect’ after installing and that denial should go away.

I can try snapping just the adb/fastboot tools see if that works

is snap connect something the user will need to do also?

You might join #snappy on Freenode or join rocketchat for realtime help on getting your snap to work in devmode. Once that is working, I can help with strict mode.

Yes, but you can request an auto-connection by following: Process for aliases, auto-connections and tracks

Eventually we’ll also have a graphical tool for users to use to help with this sort of thing.

@mariogrip have you tested using the raw-usb interface (which you for now will need to snap connect ubports-installer:raw-usb core:raw-usb post-install) to see if that overcomes your issue with adb etc? How did it go?

1 Like