I’m trying to get Automatic Ripping Machine in its docker form to work in a container via a profile and container instance created with that profile.
I cannot solve is how to add the CD-ROM device to the profile.
I have tried acting like it is a disk, to no avail:
sudo incus profile device add Ripz cdrom disk source=/dev/sr0 path=/dev/sr0
This fails with Failed to start device "cdrom": Failed detecting source path "/dev/sr0" block device filesystem: Failed to run: blkid -s TYPE -o value /dev/sr0: exit status 2
Based on these old links reddit post and blog post, I cooked up these calls after finding how to call lxc calls directly (theoretically):
sudo incus profile set Ripz raw.lxc.cgroup.devices.allow='b 11:0 rwm'
sudo incus profile set Ripz raw.lxc.autodev=1
sudo incus profile set Ripz raw.lxc.hook.autodev='sh -c "mknod -m 666 /dev/sr0 b 11 0; ln -s /dev/sr0 /dev/cdrom"'
These fail with Error: Unknown configuration key:
and the key following, indicating that this is not the way to set lxc settings - yet the description sounds like it should be. I could also be lost in time such that these are no longer relevant lxc settings, since the links are between 6 and 9 years old. It’s not clear to me how to find relevant ones, if the names changed.
I also have attached to the profile
sudo incus profile set Ripz security.nesting=true
sudo incus profile set Ripz security.syscalls.intercept.mknod=true
sudo incus profile set Ripz security.syscalls.intercept.setxattr=true
The first lets docker work, the second would let a mknod
command work I assume, and the third honestly idk I found it with an add-a-GPU guide and seemed like an idea here.
The autoripper docker will call udevadm info --query=env /dev/sr0
to check /dev/sr0
on startup, so that call in the Ripz instance is my baseline to see if the cdrom access works. Some relevant output is here just in case it’s needed:
❯ udevadm info --query=env /dev/sr0
DEVPATH=/devices/pci0000:00/0000:00:01.0/0000:01:00.0/ata6/host5/target5:0:0/5:0:0:0/block/sr0
DEVNAME=/dev/sr0
DEVTYPE=disk
DISKSEQ=9
MAJOR=11
MINOR=0
SUBSYSTEM=block
USEC_INITIALIZED=3515651
ID_CDROM=1
Love using Incus btw, thanks for forkin and keeping it truckin!
Edit: full command in case someone finds this is
sudo incus profile device add Ripz cdrom unix-block source=/dev/sr0