# [udev] upgrading... (SOLVED)

## Tanisete

Hi to all!!

I have updated my system with new baselayout, and after spending some hours reconfiguring everything, i got to a point where i don't know what is failing. Now, my system boots well, no problem at all with anything, expect udev. I have some rules for the usb devices to be mounted with determinate names. But after the upgrading to the new baselayout, there's no case. The rules are completely ignored... I post my conf.d/rc:

```
RC_TTY_NUMBER=11

# Set to "yes" if you want the rc system to try and start services

# in parallel for a slight speed improvement.

RC_PARALLEL_STARTUP="no"

RC_NET_STRICT_CHECKING="no"

# RC_VOLUME_ORDER allows you to specify, or even remove the volume setup

# for various volume managers (MD, EVMS2, LVM, DM, etc).  Note that the are

# stopped in reverse order.

RC_VOLUME_ORDER="raid evms lvm dm"

# RC_USE_FSTAB allows you to override the default mount options for the

# standard /proc, /sys, /dev, and /dev/pts mount points.  Note that this

# is the new way for selecting ramfs/tmpfs/etc... for udev mounting.

RC_USE_FSTAB="yes"

RC_FORCE_AUTO="no"

# Use this variable to control the /dev management behavior.

#  auto   - let the scripts figure out what's best at boot

#  devfs  - use devfs (requires sys-fs/devfsd)

#  udev   - use udev (requires sys-fs/udev)

#  static - let the user manage /dev

RC_DEVICES="udev"

# UDEV OPTION:

# Set to "yes" if you want to save /dev to a tarball on shutdown

# and restore it on startup.  This is useful if you have a lot of

# custom device nodes that udev does not handle/know about.

RC_DEVICE_TARBALL="no"

```

I've tried changing values in RC_USE_FSTAB, without success... I use udev-045 (the stable one).

In fact, if i try to use udevinfo to get some info from my device, i don't get any info of product... something I shoudl get because my rules are based on that. Output from udevinfo -a -p /sys/block/sdb:

```
looking at class device '/sys/block/sdb':

    SYSFS{dev}="8:16"

    SYSFS{range}="16"

    SYSFS{removable}="0"

    SYSFS{size}="312581808"

    SYSFS{stat}="      62      186      599      233        1        0        8        2        0      202      235"

follow the class device's "device"

  looking at the device chain at '/sys/devices/pci0000:00/0000:00:02.1/usb2/2-5/2-5:1.0/host4/target4:0:0/4:0:0:0':

    BUS="scsi"

    ID="4:0:0:0"

    SYSFS{device_blocked}="0"

    SYSFS{iocounterbits}="32"

    SYSFS{iodone_cnt}="0x44"

    SYSFS{ioerr_cnt}="0x0"

    SYSFS{iorequest_cnt}="0x44"

    SYSFS{max_sectors}="240"

    SYSFS{model}="WD1600BB-00FTA0 "

    SYSFS{queue_depth}="1"

    SYSFS{queue_type}="none"

    SYSFS{rev}="15.0"

    SYSFS{scsi_level}="3"

    SYSFS{state}="running"

    SYSFS{timeout}="30"

    SYSFS{type}="0"

    SYSFS{vendor}="WDC     "

```

Does anyone have the same problem? Can anyone help me with this?

Thanks a lot!Last edited by Tanisete on Mon Jun 13, 2005 9:50 pm; edited 2 times in total

----------

## Yogi-CH

What profile are you running?  I have found that this is very_important for the udev to work.  I installed 2004.3 and attempted upgrading using the migration guide and had nothing but trouble.  I did an emerge --sync some weeks later (that is, last month) and then an emerge --update system and was informed I should change the symlink for make.profile to 2005.0, which I did.

Just yesterday, I decided to give udev another shot and, with a little cornballing around, I got it working.  The cornballing was with the boot parameters, actually.

My /etc/conf.d/rc file looks like this:

```
# /etc/conf.d/rc:

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/rc,v 1.13 2004/02/26 18:01:29 azarah Exp $

#

# Global config file for the Gentoo RC System

#

# NOTE: most of these are not in use yet!!

#

# This is the amount of tty's used in most of the rc-scripts (like

# consolefont, numlock, etc

RC_TTY_NUMBER=11

# Set to "yes" if you want the rc system to try and start services

# in parallel for slight speed improvement.

RC_PARALLEL_STARTUP="no"

# Set to "yes" if the default behaviour of at least one net.*

# service starting beside net.lo is NOT enouth to consider

# the 'net' dependency up and running.

RC_NET_STRICT_CHECKING="no"

# Set to "yes" if you want to save /dev to a tarball on shutdown

# and restore it on startup.  This is useful if you have a lot of

# custom device nodes that udev do not handle/know about.

# (ONLY used by UDEV enabled systems!)

RC_DEVICE_TARBALL="no"

# Set to "yes" if you want devfsd to start upon bootup.  This is

# the default for Gentoo.

# Set to "no" only if you understand the full implications.  A

# number of files may need to be altered (i.e. /etc/inittab,

# /etc/fstab, etc.).

# Also note that it does _NOT_ start for UDEV enabled systems,

# even if RC_DEVFSD_STARTUP="yes" ...

RC_DEVFSD_STARTUP="yes"

# Set to "yes" if stop-daemon() should always retry killing the

# service if it fails the first time.

RC_RETRY_KILL="yes"

# Set the amount of seconds stop-daemon() should wait between

# retries.  $RC_RETRY_KILL should be set to "yes".

RC_RETRY_TIMEOUT=1

# Set the amount of times stop-daemon() should try to kill

# a service before giving up.  $RC_RETRY_KILL should be set to "yes".

RC_RETRY_COUNT=5

# Set to "yes" if stop-daemon() should fail if the service

# is marked as started, but not actually running on stop.

RC_FAIL_ON_ZOMBIE="no"

#

# Internal configuration variables

#

# NB:  These are for advanced users, and you should really

#      know what you are doing before changing them!

#

 

# rc-scripts dep-cache directory

#

# NOTE:  Do not remove the next line, as its needed by the baselayout ebuild!

#

#  svcdir="/var/lib/init.d"

svcdir="/var/lib/init.d"

# Should we mount $svcdir as a tmpfs or ramfs for some speed

# increase for slower machines, or for the more extreme setups ?

svcmount="no"

# FS type that should be used for $svcdir.  Note that you need

# $svcmount above set to "yes" for this to work ...  Currently

# "tmpfs" and "ramfs" are supported, with "tmpfs" the default.

svcfstype="tmpfs"

# Size of $svcdir in KB

svcsize=2048

```

....and my grub.conf looks like this:

```

title=GUI (2.6.11.7-udev)

root (hd0,2)

   kernel (hd0,2)/boot/kernel-2.6.11.7 gentoo=nodevfs root=/dev/ram0 init=/boot/linuxrc ramdisk=8192 real_root=/dev/hda3 video=vesafb:ywrap,mtrr vga=0x317 hdc=ide-cd splash=verbose

   initrd (hd0,2)/boot/initrd-2.6.11.7

```

As long as I put the gentoo=nodevfs as the 1st parameter, udev took over and I lost no devices upon subsequent boot.

Everything seems to be working as promised with the exception of the udev-guide's format for the rules.  I found I actually had to omit the BUS="xxx" for the rules to work endlessly when plugging/unplugging USB stuff, et. al.  I have no clue as to why, it just worked better.  I also turned on the debugging in /etc/udev/udev.conf which helped quite a bit more than udevinfo on any device.  I was more curious to see if it would_work than actually needing it.  I do like the fact that I can name my /dev/<devices> & /mnt/<devices> to names I like.  :Cool: 

HTH, since it did for me...

----------

## Tanisete

I have both, the symlinks for 2005.0 profile and the line in the grub.conf. for a only udev enabled system. The thing that gives me a strange feeling is that the output of udevinfo is so short. Usually, i've seen in many posts outputs bigger than mine. That's why I posted the output for me. It's like it's unifinished for the device, like it haven't class info...

And my rc is different since i upgraded yesterday to baselayout-1.11.12 (it hit stable arch). I think this upgrading must be the problem, but i can't figure it out why...

Thanks a lot for answering!!

----------

## Yogi-CH

 *Tanisete wrote:*   

> I have both, the symlinks for 2005.0 profile and the line in the grub.conf. for a only udev enabled system. The thing that gives me a strange feeling is that the output of udevinfo is so short. Usually, i've seen in many posts outputs bigger than mine. That's why I posted the output for me. It's like it's unifinished for the device, like it haven't class info...
> 
> And my rc is different since i upgraded yesterday to baselayout-1.11.12 (it hit stable arch). I think this upgrading must be the problem, but i can't figure it out why...
> 
> Thanks a lot for answering!!

 

Perhaps that version of baselayout isn't quite ready for prime time --on your box, anyhow.  Have you tried reverting to your earlier version?  I am running v1.9.4-r6, myself (and I guess I'll give it awhile before I sync, again).  You might also try backing up the existing rc file & using mine.  That'd be interesting and might tell you something.

I, too, have experienced very short output from udevinfo ...but not always.  It depends upon the hdwe, I guess.  For that reason, I now plug in the device and go to tty12 to see what the kernel has to say about it, write my udev rule, try plugging it in again and seeing what udev has to say about it --with debugging on, of course.

I did perform a couple 2005.0 installs from scratch and found that the udev worked appreciably well but the grub line puzzled me in the fact that they had...

```
real_root=/dev/hdaX udev
```

 and on my 2004.3 --> 2005.0 I need to put... 

```
kernel hd(0,x)/boot/kernel-2.6.11.7 gentoo=nodevfs
```

 for it to work properly.  That is a major difference.

Regarding the kernel, the 2005.0 handbook has a misprint which has been reported and they promise to put it right in 2005.1.  When using... 

```
genkernel --menuconfig --udev all
```

  ...I took a peek at the Pseudo Filesystems and found that devfs was enabled, but not set for mount at boot;  The example later in the docs for rolling your own kernel shows devfs not checked.  Since I had rolled my own and followed their example, I had some problems.  I later discovered the discrepancy and used genkernel (as in the example), and had to fool around w/adding udev to the boot parameters so root would be found.

FWIW...

----------

## dsd

 *Tanisete wrote:*   

> I use udev-045 (the stable one).

 

udev 058 is the latest version which is marked stable...

----------

## Tanisete

It was 056, sorry... Ive tried both 056 and 058 without a trace of how to solve this... I've seen in 058 that now the first rule is applied, so i put 

```
OPTIONS="last_rule"
```

 in order to get the latter behaviour with usb rules in disk rules.

I need baselayout-1.11.12 since i have a new wireless device (and it's stable now).

I turned log on on udev (with udev-056) and i get this:

```
Jun 13 21:05:49 krynn udev[16884]: configured rule in '/etc/udev/rules.d/50-udev.rules[28]'

 applied, 'sdb' becomes '%k'

Jun 13 21:05:49 krynn udev[16884]: creating device node '/dev/sdb'

Jun 13 21:05:49 krynn udev[16885]: creating device node '/dev/sg1'

Jun 13 21:05:49 krynn udev[16907]: configured rule in '/etc/udev/rules.d/50-udev.rules[28]'

 applied, 'sdb1' becomes '%k'

Jun 13 21:05:49 krynn udev[16907]: creating device node '/dev/sdb1'

```

So, it's applying only the first rule, and not the last one, because it does not see the attribute "SYSFS{product}", that has now disappeared from the device chain..

What can be happening here?

Thanks a lot!

----------

## Tanisete

Ok, i restarted with an old 2.6.11 kernel (i was using 2.6.12-rc6), and udevinfo gives me a lot more of output. But... stilll no luck with the rules. Shouldn't it apply the last one if i'm using 056?

Thanks a lot!!

----------

## Yogi-CH

 *Tanisete wrote:*   

> Ok, i restarted with an old 2.6.11 kernel (i was using 2.6.12-rc6), and udevinfo gives me a lot more of output. But... stilll no luck with the rules. Shouldn't it apply the last one if i'm using 056?
> 
> Thanks a lot!!

 

Since the default rules are contained in '50-udev.rules' you need to make all your custom rules numerically  preceed it.  My custom rules are '20-udev.rules' so they get read first, no matter what.  The udev-guide flatly states that this is necessary.

There's more, though.  The 'BUS=' parameter does not always get recognized.  I had a rule set up and it worked only once.  That was when I turned on the debugging and discovered that the first parameter, for whatever reason, was not being read properly so I stopped adding it.  The result was that no matter how many times I plug/unplug that specific device, it gets recognized and set up as I require as per the custom rule.

Also, if you discover that your /dev/dsp is not working (in KDE, anyhow) you have to go to the control center and reset the sound system to, in my case, 'autodetect' and sound for XMMS, et. al., will again work.

----------

## Yogi-CH

 *Tanisete wrote:*   

> Ok, i restarted with an old 2.6.11 kernel (i was using 2.6.12-rc6), and udevinfo gives me a lot more of output. But... stilll no luck with the rules. Shouldn't it apply the last one if i'm using 056?
> 
> Thanks a lot!!

 

Since the default rules are contained in '50-udev.rules' you need to make all your custom rules numerically  preceed it.  My custom rules are '20-udev.rules' so they get read first, no matter what.  The udev-guide flatly states that this is necessary.

There's more, though.  The 'BUS=' parameter does not always get recognized.  I had a rule set up and it worked only once.  That was when I turned on the debugging and discovered that the first parameter, for whatever reason, was not being read properly so I stopped adding it.  The result was that no matter how many times I plug/unplug that specific device, it gets recognized and set up as I require as per the custom rule.

Also, if you discover that your /dev/dsp is not working (in KDE, anyhow) you have to go to the control center and reset the sound system to, in my case, 'autodetect' and sound for XMMS, et. al., will again work.  This is no guarantee... but it did work on my box.

----------

## Tanisete

I tried with 20-udev.rules... without success... No matter what, it ignores my rules. Now they are:

```
KERNEL="sd*", SYSFS{product}="LaCie Hard Drive USB",  NAME="usbhd%n"

KERNEL="sd*", SYSFS{product}="<USB PRODUCT>   ",  NAME="usbmp3%n"

KERNEL="sd*", SYSFS{product}="CASIO QV DIGITAL", NAME="camara%n"

KERNEL="sd*", SYSFS{product}="FHD-xs",  NAME="usbrober%n"

```

Any more ideas?

And thanks a lot!!!!

----------

## dsd

if you are using newer than 2.6.12-rc4 then you need to use udev 058

----------

## Tanisete

Ok, i trid again with 2.6.12-rc6 and udev-058 and now it works!! I also had to change this in the rules:

```
BUS="usb", KERNEL="sd*", SYSFS{product}="LaCie Hard Drive USB",  NAME="%k", SYMLINK="usbhd%n"

BUS="usb", KERNEL="sd*", SYSFS{product}="<USB PRODUCT>   ",  NAME="%k", SYMLINK="usbmp3%n"

BUS="usb", KERNEL="sd*", SYSFS{product}="CASIO QV DIGITAL", NAME="%k", SYMLINK="camara%n"

BUS="usb", KERNEL="sd*", SYSFS{product}="FHD-xs",  NAME="%k", SYMLINK="usbrober%n"

```

It seems some of the updates made the symlinks the only possibility for udev...

Thanks a lot to dsd ans Yogi for all the help!

----------

## jmpnz

Simply running etc-update fixed this for me.

----------

