Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 628692 - sys-fs/eudev: mishandled /dev/disk symlinks
Summary: sys-fs/eudev: mishandled /dev/disk symlinks
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: eudev team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-23 08:34 UTC by Alexander Sergeyev
Modified: 2017-09-05 23:23 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Sergeyev 2017-08-23 08:34:46 UTC
Currently I have the latest sys-fs/eudev-3.2.2-r1 installed and it seems that storage udev rules (which add symlinks to /dev/disk/ and such) are not handling spaces very well.

The effect of this as follows:

$ ls -al /dev                                                                                        
<...>                                                                                                
lrwxrwxrwx  1 root     root         7 Aug 18 11:11 1TB_SERIAL-IS-REDACTED -> nvme0n1                 
lrwxrwxrwx  1 root     root         9 Aug 18 08:11 1TB_SERIAL-IS-REDACTED-part1 -> nvme0n1p1         
lrwxrwxrwx  1 root     root         9 Aug 18 08:11 1TB_SERIAL-IS-REDACTED-part2 -> nvme0n1p2         
lrwxrwxrwx  1 root     root         9 Aug 18 08:11 960 -> nvme0n1p1                                  
lrwxrwxrwx  1 root     root         9 Aug 18 08:11 PRO -> nvme0n1p1                                                                                                                            
lrwxrwxrwx  1 root     root         9 Aug 18 08:11 SSD -> nvme0n1p1                                  
<...>

$ ls -al /dev/disk/by-id
<...>
lrwxrwxrwx 1 root root 15 Aug 18 08:11 nvme-Samsung -> ../../nvme0n1p1
<...>

$ udevadm info -a -p $(udevadm info -q path /dev/nvme0n1)
<...>
ATTRS{model}=="Samsung SSD 960 PRO 1TB                 "                                             
ATTRS{serial}=="SERIAL-IS-REDACTED     "
<...>

The relavant part of udev rules seem to be here:
$ cat /lib64/udev/rules.d/60-persistent-storage.rules
<...>
# NVMe
KERNEL=="nvme*[0-9]n*[0-9]", ATTR{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}"                  
KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}-part%n"
                                                                                                       
KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{serial}=="?*", ENV{ID_SERIAL_SHORT}="$attr{serial}"
KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{model}=="?*", ENV{ID_SERIAL_SHORT}=="?*", ENV{ID_SERIAL}="$attr{model}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}"                                                                                                                                                                                            
                                                                                                     
KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{serial}=="?*", ENV{ID_SERIAL_SHORT}="$attr{serial}"
KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{model}=="?*", ENV{ID_SERIAL_SHORT}=="?*", ENV{ID_SERIAL}="$attr{model}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}-part%n"
<...>

Overall, it seems that the model attribute made its way to /dev/disk/by-id, but spaces were not handled and the rest of the model name escaped directly into /dev/, while the serial number got itself combined with the last part of the model name.
Comment 1 Alexander Sergeyev 2017-08-23 08:55:26 UTC
Well, apparently there is already an issue created in the upstream project.

Link: https://github.com/gentoo/eudev/issues/148
Comment 2 Anthony Basile gentoo-dev 2017-08-30 15:12:19 UTC
yep, its on my radar for testing this afternoon.
Comment 3 Anthony Basile gentoo-dev 2017-09-03 18:20:38 UTC
(In reply to Anthony Basile from comment #2)
> yep, its on my radar for testing this afternoon.

this should be fixed in eudev-3.2.3 which I'm just about to add to the tree.  can someone test and get back to me.
Comment 4 Scott Short 2017-09-03 20:33:46 UTC
(In reply to Anthony Basile from comment #3)
> (In reply to Anthony Basile from comment #2)
> > yep, its on my radar for testing this afternoon.
> 
> this should be fixed in eudev-3.2.3 which I'm just about to add to the tree.
> can someone test and get back to me.

Please put a hold on eudev-3.2.3. It is causing major breakage and resulting in a non-bootable system, had to chroot to correct issues.
Comment 5 Anthony Basile gentoo-dev 2017-09-03 20:55:42 UTC
(In reply to Scott Short from comment #4)
> (In reply to Anthony Basile from comment #3)
> > (In reply to Anthony Basile from comment #2)
> > > yep, its on my radar for testing this afternoon.
> > 
> > this should be fixed in eudev-3.2.3 which I'm just about to add to the tree.
> > can someone test and get back to me.
> 
> Please put a hold on eudev-3.2.3. It is causing major breakage and resulting
> in a non-bootable system, had to chroot to correct issues.

i can mask it, please give me details
Comment 6 Anthony Basile gentoo-dev 2017-09-03 21:50:20 UTC
(In reply to Anthony Basile from comment #5)
> (In reply to Scott Short from comment #4)
> > (In reply to Anthony Basile from comment #3)
> > > (In reply to Anthony Basile from comment #2)
> > > > yep, its on my radar for testing this afternoon.
> > > 
> > > this should be fixed in eudev-3.2.3 which I'm just about to add to the tree.
> > > can someone test and get back to me.
> > 
> > Please put a hold on eudev-3.2.3. It is causing major breakage and resulting
> > in a non-bootable system, had to chroot to correct issues.
> 
> i can mask it, please give me details

its currently masked but i need a report here on what's going on so i can fix it.
Comment 7 Scott Short 2017-09-03 22:17:15 UTC
(In reply to Anthony Basile from comment #6)
> (In reply to Anthony Basile from comment #5)
> > (In reply to Scott Short from comment #4)
> > > (In reply to Anthony Basile from comment #3)
> > > > (In reply to Anthony Basile from comment #2)
> > > > > yep, its on my radar for testing this afternoon.
> > > > 
> > > > this should be fixed in eudev-3.2.3 which I'm just about to add to the tree.
> > > > can someone test and get back to me.
> > > 
> > > Please put a hold on eudev-3.2.3. It is causing major breakage and resulting
> > > in a non-bootable system, had to chroot to correct issues.
> > 
> > i can mask it, please give me details
> 
> its currently masked but i need a report here on what's going on so i can
> fix it.

This seems to only be a issue with X11. Xorg has no mouse or keyboard function. Networking is correct. I cannot find any useful log or debug issues w/ X11. I have tried rebuilding all X11 modules - even with no evdev support. I was hoping someone else could confirm this.
Comment 8 Anthony Basile gentoo-dev 2017-09-03 22:19:27 UTC
(In reply to Scott Short from comment #7)
> (In reply to Anthony Basile from comment #6)
> > (In reply to Anthony Basile from comment #5)
> > > (In reply to Scott Short from comment #4)
> > > > (In reply to Anthony Basile from comment #3)
> > > > > (In reply to Anthony Basile from comment #2)
> > > > > > yep, its on my radar for testing this afternoon.
> > > > > 
> > > > > this should be fixed in eudev-3.2.3 which I'm just about to add to the tree.
> > > > > can someone test and get back to me.
> > > > 
> > > > Please put a hold on eudev-3.2.3. It is causing major breakage and resulting
> > > > in a non-bootable system, had to chroot to correct issues.
> > > 
> > > i can mask it, please give me details
> > 
> > its currently masked but i need a report here on what's going on so i can
> > fix it.
> 
> This seems to only be a issue with X11. Xorg has no mouse or keyboard
> function. Networking is correct. I cannot find any useful log or debug
> issues w/ X11. I have tried rebuilding all X11 modules - even with no evdev
> support. I was hoping someone else could confirm this.

when you get some useful info, open up another bug.  if its just X11, then using ctlr-alt-F1 you can switch to a monitor and shouldn't have to chroot to fix it.
Comment 9 Anthony Basile gentoo-dev 2017-09-05 00:43:48 UTC
(In reply to Scott Short from comment #7)
> 
> This seems to only be a issue with X11. Xorg has no mouse or keyboard
> function. Networking is correct. I cannot find any useful log or debug
> issues w/ X11. I have tried rebuilding all X11 modules - even with no evdev
> support. I was hoping someone else could confirm this.

Okay I got it.  Can you add this one line to rules/50-udev-default.rules:

https://github.com/gentoo/eudev/commit/99e12e394fed83453ff738563e9606ed7789abd2

You don't need to even recompile.  I was able to reproduce the problem and this fixed it for me.  Let me know and I'll push out another release.
Comment 10 Scott Short 2017-09-05 22:40:06 UTC
(In reply to Anthony Basile from comment #9)
> (In reply to Scott Short from comment #7)
> > 
> > This seems to only be a issue with X11. Xorg has no mouse or keyboard
> > function. Networking is correct. I cannot find any useful log or debug
> > issues w/ X11. I have tried rebuilding all X11 modules - even with no evdev
> > support. I was hoping someone else could confirm this.
> 
> Okay I got it.  Can you add this one line to rules/50-udev-default.rules:
> 
> https://github.com/gentoo/eudev/commit/
> 99e12e394fed83453ff738563e9606ed7789abd2
> 
> You don't need to even recompile.  I was able to reproduce the problem and
> this fixed it for me.  Let me know and I'll push out another release.

Confirmed. Above problem is corrected. 50-udev-default.rules patch fixed the issue. Thanks! :)
Comment 11 Anthony Basile gentoo-dev 2017-09-05 23:23:30 UTC
(In reply to Scott Short from comment #10)
> (In reply to Anthony Basile from comment #9)
> > (In reply to Scott Short from comment #7)
> > > 
> > > This seems to only be a issue with X11. Xorg has no mouse or keyboard
> > > function. Networking is correct. I cannot find any useful log or debug
> > > issues w/ X11. I have tried rebuilding all X11 modules - even with no evdev
> > > support. I was hoping someone else could confirm this.
> > 
> > Okay I got it.  Can you add this one line to rules/50-udev-default.rules:
> > 
> > https://github.com/gentoo/eudev/commit/
> > 99e12e394fed83453ff738563e9606ed7789abd2
> > 
> > You don't need to even recompile.  I was able to reproduce the problem and
> > this fixed it for me.  Let me know and I'll push out another release.
> 
> Confirmed. Above problem is corrected. 50-udev-default.rules patch fixed the
> issue. Thanks! :)

use eudev-3.2.4 which I just pushed out.