[systemd-devel] [PATCH 1/2] Don't use ALSA card id in ID_ID

Lennart Poettering lennart at poettering.net
Mon Apr 20 11:39:33 PDT 2015


On Mon, 20.04.15 20:00, Lennart Poettering (lennart at poettering.net) wrote:

> On Fri, 10.04.15 22:27, Adam Goode (agoode at google.com) wrote:
> 
> > The ALSA id sysattr is generated by the sound subsystem and is not
> > a stable identifier. It is generated though some string manipulation
> > then made unique if there is a conflict. This means that it is
> > enumeration-dependent and shouldn't be used for ID_ID.
> > 
> > If ID_ID is supposed to be system-unique, it is not already since
> > for firewire it is generated from the guid and there are broken
> > firewire devices that have duplicate guids across devices.
> 
> Hmm, this patch pretty much reverts
> ed1b2d9fc7d5c5bfe2a67b0b8ff9e5ea8694268e. Now I am not sure if that
> commit from 6 years ago was a good idea, but we should have some
> clarity about this.
> 
> What is ID_ID actually supposed to be? Should it really be system
> unique?
> 
> I do have the suspicion this is something that better should be fixed in
> PA rather then in these udev rules, so I figure your patch might be a
> good idea?
> 
> Opinions?
> 
> If we apply the patch somebody should at least post a bug report
> against PA to be aware of this change.

OK, after talking to some folks I think we should merge your
patch. Any chance you can post a bug to PA though, reference this
discussion, and then include the bug report in the commit message and
resend the patch?

Thanks,

Lennart
> 
> > ---
> >  rules/78-sound-card.rules | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/rules/78-sound-card.rules b/rules/78-sound-card.rules
> > index 295f490..bd7a994 100644
> > --- a/rules/78-sound-card.rules
> > +++ b/rules/78-sound-card.rules
> > @@ -49,8 +49,8 @@ SUBSYSTEMS=="firewire", GOTO="skip_pci"
> >  SUBSYSTEMS=="pci", ENV{ID_BUS}="pci", ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}"
> >  LABEL="skip_pci"
> >  
> > -ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="?*", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_USB_INTERFACE_NUM}-$attr{id}"
> > -ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}-$attr{id}"
> > +ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="?*", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_USB_INTERFACE_NUM}"
> > +ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}"
> >  
> >  IMPORT{builtin}="path_id"
> >  
> > -- 
> > 2.2.0.rc0.207.ga3a616c
> > 
> > _______________________________________________
> > systemd-devel mailing list
> > systemd-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> 
> 
> Lennart
> 
> -- 
> Lennart Poettering, Red Hat


Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list