Subject: Re: bug#35584: CDs and DVDs aren't auto-mounted

From: Maxim Cournoyer <[email-masked]>
Date: Wed, 30 Apr 2025 14:56:10 +0900

Hi,

It looks like it's a udev configuration thing, as we have CDROM support
builtin the kernel (sr_mod), and the eudev of Void Linux, which is at
the same version as ours, report this when attaching a media to a
virtual CDROM in virt-manager:

--8<---------------cut here---------------start------------->8---
$ udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[2401.365251] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sr0 (block)
KERNEL[2401.450065] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sr0 (block)
UDEV  [2401.527639] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sr0 (block)
UDEV  [2401.567290] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sr0 (block)
KERNEL[2401.786096] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sr0 (block)
UDEV  [2401.824286] change   /devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sr0 (block)
--8<---------------cut here---------------end--------------->8---

While on Guix System the same is quiet:

--8<---------------cut here---------------start------------->8---
$ udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
--8<---------------cut here---------------end--------------->8---

Fedora has these udev rules:

--8<---------------cut here---------------start------------->8---
$ sudo grep -irl -E '(cdrom|optic|dvd)' /usr/lib/udev/rules.d | sort
[sudo] password for user: 
/usr/lib/udev/rules.d/50-udev-default.rules
/usr/lib/udev/rules.d/60-cdrom_id.rules
/usr/lib/udev/rules.d/60-persistent-storage.rules
/usr/lib/udev/rules.d/70-uaccess.rules
/usr/lib/udev/rules.d/80-pktsetup.rules
/usr/lib/udev/rules.d/80-udisks2.rules
--8<---------------cut here---------------end--------------->8---

While Void Linux (where it works) has the sames except for
80-pktsetup.rules, which is missing.  On Guix System we have these:

--8<---------------cut here---------------start------------->8---
$ grep -iRl -E '(cdrom|optic|dvd)' /etc/udev/rules.d/ | sort
/etc/udev/rules.d/50-udev-default.rules
/etc/udev/rules.d/60-cdrom_id.rules
/etc/udev/rules.d/60-libsane.rules
/etc/udev/rules.d/60-persistent-storage.rules
/etc/udev/rules.d/70-uaccess.rules
/etc/udev/rules.d/80-udisks2.rules
--8<---------------cut here---------------end--------------->8---

60-libsane sticks out as something only we have; perhaps it 'eats' the
kernel event for itself and means udisks2.rules doesn't get to see it.

To be continued.

-- 
Thanks,
Maxim