Allow optical drive write support for MakeMKV

MakeMKV, the DVD and BluRay ripping utility has a feature where it can upload a small firmware application into volatile drive memory to assist with ripping discs. This is claimed to be non-invasive and completely non-persistent beyond a power cycle. To achieve this upload, the MakeMKV snap requires the ability to write to the optical drive device node(s) to upload the application to the drive.

This post is therefore requesting a store assertion to allow the use of optical-drive with the write: true designation. Ideally we should allow both read-only and writable as separate connections so the the user may use the app out of the box unless they require the libredrive feature in which case they can manually connect the writable interface. My test install correctly lists optical-drive and my customised optical-write interfaces with the former connected automatically and the latter manually-connectable but disconnected by default. This is my preferred way for the feature to be presented to the user - two separate interfaces - but I’m not sure if this will be the same once in the store.

Do I need to specify optical-drive in addition to optical-write for snapd to present two interfaces separating readonly and writable? Currently my yaml looks like:

plugs:
  optical-write:
    interface: optical-drive
    write: true

apps:
  makemkv:
    ...
    plugs:
    - desktop
    - desktop-legacy
    - gsettings
    - hardware-observe
    - home
    - network
    - opengl
    - optical-write
    - process-control
    - removable-media
    - unity7
    - wayland
    - x11

Yes, the docker snap works a similar way, having both the privileged version of the interface and the unprivileged declared. Though for docker both are auto-connected, and there is only one rule in the declaration, so I’m not sure if the store supports such a declaration. I want to say it does, but I don’t know for sure.

Yes, snap declarations support this. We just say:

deny-auto-connection:
  plug-attributes:
    write: true

I went ahead and adjusted the snap declaration for this and also allowed use of ‘write: true’ since this snap is what precipitated the interface attribute. Thanks for splitting this out like this. Please report back if there are any problems with the snap declaration.

UPDATED: s/slot-attributes/plug-attributes/

2 Likes

@lucyllewy - with the updated snap declaration, to achieve your objective, you should be able to adjust your snap to have:

plugs:
  optical-write:
    interface: optical-drive
    write: true
apps:
  makemkv:
    plugs:
    - optical-drive
    - optical-write

which should auto-connect the read-only ‘optical-drive’ but leave the ‘optical-write’ as manually connected.

You may want to look at https://launchpad.net/bugs/1849564 if using ‘snap connections’ to verify things since ‘snap connections’ will not tell the truth (you can always examine the policy in /var/lib/snapd/apparmor/profiles/snap.makemkv.* though; it should be right).

1 Like

Oh, ok, thanks for highlighting the issue :slight_smile: I’ve added the optical-drive plug in addition to optical-write now and it is currently building on the build service. We’ll see how it fares once it’s uploaded…