# devfs: waiting for udev...

## Aquous

Hi guys   :Cool: 

This has been bothering me for a while now.

Whenever I boot Gentoo I hit a 50 second delay while devfs is waiting for udev. If I, at this point, quickly plug in (or plug out if it's already plugged in) a USB device, my boot continues normally.

So it seems devfs is waiting for a notification of some sort from udev, which it never gets because nothing hardware-related is happening.

It may be important to mention that I downgraded this system from ~amd64 to amd64, and as a consequence I've had to keyword some packages which were simply undowngradeable. One of those is baselayout-2. If it matters, I am using the parallel job function it offers (meaning my init.d services start parallelly where possible instead of sequentially). I'm also using kernel 2.6.37 (I didn't want to downgrade, so I removed gentoo-sources from package.keywords but masked every version prior to 2.6.37 so I will be using the stable kernel once the next post-2.6.37 version hits arch).

System is AMD64 Intel i5 (Clarkdale) processor with a Gigabyte H55M-USB3 mobo running gentoo stable (NOT ~amd64).

```
$ emerge -pv udev

These are the packages that would be merged, in order:

Calculating dependencies                  ... done!

[ebuild   R   ] sys-fs/udev-151-r4  USE="extras -devfs-compat -old-hd-rules (-selinux) -test" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB
```

(the extras useflag is not explicitly set but appears to be selected by default)

Any thoughts?

----------

## DONAHUE

http://www.kernel.org/doc/Documentation/ABI/removed/devfs says *Quote:*   

> What:		devfs
> 
> Date:		July 2005 (scheduled), finally removed in kernel v2.6.18
> 
> Contact:	Greg Kroah-Hartman <gregkh@suse.de>
> ...

  you have emerged?  *Quote:*   

> ~ # emerge -s devfs
> 
> Searching...    
> 
> [ Results for search key : devfs ]
> ...

 

----------

## Aquous

I don't think devfsd (which I do not have installed btw) has anything to do with /etc/init.d/devfs. The only contents of the latter are:

```
#!/sbin/runscript

# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>

# All rights reserved. Released under the 2-clause BSD license.

description="Mount system critical filesystems in /dev."

depend() {

   use dev

   keyword -prefix -vserver

}

start() {

   # Mount required stuff as user may not have then in /etc/fstab

   for x in \

      "devpts /dev/pts 0755 ,gid=5,mode=0620 devpts" \

      "tmpfs /dev/shm 1777 ,nodev shm" \

   ; do

      set -- $x

      grep -Eq "[[:space:]]+$1$" /proc/filesystems || continue

      mountinfo -q $2 && continue

      if [ ! -d $2 ]; then

         mkdir -m $3 -p $2 >/dev/null 2>&1 || \

            ewarn "Could not create $2!"

      fi

      if [ -d $2 ]; then

         ebegin "Mounting $2"

         if ! fstabinfo --mount $2; then

            mount -n -t $1 -o noexec,nosuid$4 $5 $2

         fi

         eend $?

      fi

   done

   return 0

}
```

Also:

```
$ equery b /etc/init.d/devfs

[ Searching for file(s) /etc/init.d/devfs in *... ]

sys-apps/openrc-0.7.0 (/etc/init.d/devfs)
```

This service has been added to the boot runlevel ever since I installed Gentoo.

----------

## VoidMage

No, that was not the point.

The real problem was downgrade from baselayout2 to 1.

The upgrade was not trivial, the downgrade would be much harder.

On upgrade, ebuild did quite a few things, on downgrade, you're on your own.

Frankly, i.e. glibc explicitly disallows downgrade. While baselayout doesn't, in case of 1 -> 2 move, if you want to downgrade, you're just asking for trouble.

----------

## Aquous

I didn't downgrade baselayout. I'm on baselayout-2.

Steps I followed to downgrade glibc:

1. download binary version of desired glibc from tinderbox

2. use LDFLAGS and such to recompile @system against that glibc

3. add desired glibc to local overlay and remove downgrade check

4. downgrade glibc

5. emerge -e system && emerge -e world

Worked just fine and recompiled both @system and @world once more after that to be sure.

package.keywords contains:

```
app-emulation/wine

app-emulation/vmware-workstation

app-emulation/vmware-tools

app-emulation/vmware-modules

x11-libs/libview

app-office/libreoffice

sys-apps/baselayout

x11-libs/libdrm

media-libs/mesa

x11-wm/compiz

x11-plugins/compiz-plugins-extra

gnome-extra/avant-window-navigator

gnome-extra/avant-window-navigator-extras

x11-plugins/screenlets

x11-apps/ccsm

app-editors/gedit-plugins

dev-python/compizconfig-python

x11-themes/oxygen-gtk
```

Baselayout is there because I neither could nor wanted to downgrade it, the other packages are there for reasons not related to the downgrade process.

----------

## DONAHUE

sorry, I was looking for devfs in all the wrong places.

Takes a second here from mounting /sys to mounting /dev/shm on a fully ~amd64 system

 *Quote:*   

> emerge -pv udev
> 
> These are the packages that would be merged, in order:
> 
> Calculating dependencies... done!
> ...

  no *Quote:*   

>  -devfs-compat -old-hd-rules

 

----------

## Aquous

 *DONAHUE wrote:*   

> no *Quote:*    -devfs-compat -old-hd-rules 

 That's because your udev, being from ~arch, is newer than mine, which is from arch.

Hmm... I may try keywording udev to see whether that makes a difference. (it may be that I'm hitting a bug which is fixed in your version of udev)

----------

## Aquous

Keywording udev appears to have done the trick. Thanks for giving me that idea!  :Very Happy: 

----------

## DONAHUE

Well done. Wahoo!

----------

## seenxu

I am having the same problem, but still, no solution found yet, everytime I boot the system, have to wait 60s at "starting udevd" until the devfs timed out.

```

sys-kernel/gentoo-sources-2.6.38

sys-fs/udev-164-r2

sys-apps/openrc-0.8.0

$ rc-update show sysinit

                dmesg | sysinit

                udev | sysinit

                devfs | sysinit

$ rc-update show boot

               procfs | boot

               swap | boot

               mtab | boot

               modules | boot

               localmount | boot

               fsck | boot

               bootmisc | boot

               urandom | boot

               consolefont | boot

               hostname | boot

               root | boot

               keymaps | boot

               sysctl | boot

               net.lo | boot

               termencoding | boot

               hwclock | boot

               alsasound | boot

```

----------

## optiluca

 *seenxu wrote:*   

> I am having the same problem, but still, no solution found yet, everytime I boot the system, have to wait 60s at "starting udevd" until the devfs timed out.
> 
> 

 

Same issue over here, udev takes over 30 seconds to start, sometimes times out.  In my case, plugging/unplugging devices makes no difference.

```
rc-update show

            alsasound | boot default                                  

            bluetooth |      default                                  

             bootmisc | boot                                          

          consolefont | boot                                          

           consolekit |      default                                  

                cupsd |      default                                  

                 dbus |      default                                  

                devfs |                                        sysinit

                dmesg |                                        sysinit

                 fsck | boot                                          

                 gpsd |      default                                  

               hdapsd |      default                                  

               hdparm |      default                                  

             hostname | boot                                          

              hwclock | boot                                          

              keymaps | boot                                          

            killprocs |                        shutdown               

                local |              nonetwork                        

           localmount | boot                                          

        microcode_ctl |      default                                  

              modules | boot                                          

             mount-ro |                        shutdown               

                 mtab | boot                                          

                mysql |      default                                  

               net.lo | boot                                                                                                                                                                                                                       

             netmount |      default                                  

                 ntpd |      default                                  

               procfs | boot                                          

                 root | boot                                          

            savecache |                        shutdown               

            shorewall |      default                                  

                 swap | boot                                          

               sysctl | boot                                          

            syslog-ng |      default                                  

         termencoding | boot                                          

                 udev |                                        sysinit

       udev-postmount |      default                                  

              urandom | boot                                          

           vixie-cron |      default                                  

              vnstatd |      default                                  

                 wicd |      default                                  

                  xdm |      default   
```

```
emerge --info

Portage 2.2.0_alpha51 (default/linux/amd64/10.0/desktop/kde, gcc-4.5.3, glibc-2.13-r4, 3.0.2-pf x86_64)

=================================================================

System uname: Linux-3.0.2-pf-x86_64-Intel-R-_Core-TM-_i7_CPU_Q_820_@_1.73GHz-with-gentoo-2.0.3

Timestamp of tree: Fri, 19 Aug 2011 08:00:01 +0000

app-shells/bash:          4.2_p10

dev-java/java-config:     2.1.11-r3

dev-lang/python:          2.7.2-r2

dev-util/cmake:           2.8.5-r2

dev-util/pkgconfig:       0.26

sys-apps/baselayout:      2.0.3

sys-apps/openrc:          0.8.3-r1

sys-apps/sandbox:         2.5

sys-devel/autoconf:       2.13, 2.68

sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.1-r1

sys-devel/binutils:       2.21.1

sys-devel/gcc:            4.5.3-r1

sys-devel/gcc-config:     1.4.1-r1

sys-devel/libtool:        2.4-r1

sys-devel/make:           3.82-r1

sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)

sys-libs/glibc:           2.13-r4

Repositories: gentoo sunrise ikelos lcd-filtering benf bitcoin LOCAL

Installed sets: 

ACCEPT_KEYWORDS="amd64 ~amd64"

ACCEPT_LICENSE="*"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-march=native -O2 -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.2/ext-active/ /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.2/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.2/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"

CXXFLAGS="-march=native -O2 -pipe"

DISTDIR="/etc/portage/distfiles"

FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"

FFLAGS=""

GENTOO_MIRRORS="http://mirror.qubenet.net/mirror/gentoo/ ftp://mirror.qubenet.net/mirror/gentoo/ http://mirror.bytemark.co.uk/gentoo/"

LANG="en_GB.UTF-8"

LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-O1"

LINGUAS="en_GB it"

MAKEOPTS="-j8"

PKGDIR="/etc/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/var/lib/layman/sunrise /var/lib/layman/ikelos /var/lib/layman/lcd-filtering /var/lib/layman/benf /var/lib/layman/bitcoin /usr/local/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="X a52 aac acl acpi alsa amd64 amr apm avi bash-completion berkdb bluetooth branding bzip2 cairo caps cdaudio cdda cddb cdr chm cleartype cli consolekit cracklib crypt css cuda cups cxx dbus declarative dhcp dri dts dv dvb dvd dvdr dvdread editor emboss emovix encode exif faac faad fam fame fbcondecor fbsplash ffmpeg firefox flac foomaticdb fortran gcj gd gdbm gdu gif git glitz glx gphoto2 gpm gps gstreamer hdaps iconv id3tag ieee1394 imagemagick inotify ipod ipv6 it jack java java6 joystick jpeg kde kickoff kipi ladspa lastfm lcms ldap libnotify libsamplerate lm_sensors mad mbrola mikmod mmx mng modules mp2 mp3 mp4 mpeg mplayer msn mudflap multilib musicbrainz ncurses nls nptl nptlonly nsplugin nvidia ogg opengl openmp pam pango pcre pdf perl phonon plasma pmu png policykit ppds pppd python qt qt3support qt4 quicktime readline rtc samba scanner sdl semantic-desktop session skype slp smp snmp spell sse sse2 sse3 ssl ssse3 startup-notification subtitles subversion svg sysfs tcpd theora threads tiff truetype twolame udev unicode usb v4l v4l2 vdpau vorbis wicd wifi x264 xcomposite xine xinerama xml xorg xscreensaver xulrunner xv xvid zeroconf zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev joystick synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB it" PHP_TARGETS="php5-3 php5-2" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

```

```
sys-fs/udev

     Available versions:  114 115-r1 119 124-r1 124-r2 141 (~)141-r1 146-r1!t 149 151-r4 164-r2 (~)171-r1 **9999 {acl action_modeswitch build debug (+)devfs-compat edd (-)extras floppy gudev hwdb introspection keymap old-hd-rules +rule_generator selinux test}                                                                                                                                                                                                                                   

     Installed versions:  171-r1(11:46:48 23/06/11)(acl extras gudev hwdb keymap rule_generator -action_modeswitch -build -debug -edd -floppy -introspection -selinux -test)

     Homepage:            http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html

     Description:         Linux dynamic and persistent device naming support (aka userspace devfs)

```

Bootchart output:

http://imagebin.org/168685

Does anyone have any ideas?    :Confused: 

----------

