Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 253396 - sys-apps/openrc: After update sometimes /etc/runlevels/sysinit/udev don't exist - causes boot failure
Summary: sys-apps/openrc: After update sometimes /etc/runlevels/sysinit/udev don't exi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://www.gentoo.org/doc/en/openrc-m...
Whiteboard:
Keywords:
: 253979 255286 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-01-02 00:23 UTC by Robin Johnson
Modified: 2009-02-12 01:00 UTC (History)
4 users (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 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-01-02 00:23:47 UTC
Ok, so I'm not sure how this happened, but it was stumping me as to what I'd broken on the box.

Ultimately, it turned out that in /etc/runlevels/sysinit/ there was devfs and dmesg, but not sysfs and udev. I got a partial boot with /usr and a few other criticals passing fsck, failures in localmount, and a soft hang when it when to start urandom.

I don't know how it happened, but we should probably have some sort of check to help folks that might end up in a bad state like this.

My fix was using the debug mode in my initramfs, chroot into my / space, and creating the missing symlinks. I was given the clue by the fact that LVM was complaining it couldn't find the sysfs mountpoint.
Comment 1 Roy Marples 2009-01-02 08:22:08 UTC
sysfs is not added by OpenRC because there's no guarantee it will work due to old kernels.
However, udev DOES need it so it will get started if udev is correctly installed.
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-01-02 10:29:34 UTC
Can we test for a new enough kernel?
Comment 3 Roy Marples 2009-01-02 10:36:00 UTC
(In reply to comment #2)
> Can we test for a new enough kernel?

It already tests for existance of sysfs in /proc/filesystems.
But simply adding it to the sysinit runlevel won't fix the failure of udev not being added either.

This should be fixed in OpenRC for 0.5.0 when it gets it's own basic udev init script so it's entirely self sufficient for booting. Gentoo of course can choose to use this or continue using the existing udev script.
Comment 4 Matthias Schwarzott gentoo-dev 2009-01-02 17:04:00 UTC
The code to add udev to sysinit runlevel is contained now in openrc-ebuild. This code tries to detect if udev was enabled before, and adds it in this case.

Robin, maybe can have a look at the ebuild and check why it failed to add udev at your place.

        enable_udev=0
        if [[ ! -e "${ROOT}"/etc/runlevels/sysinit/udev ]] && \
                [[ -e "${ROOT}"/etc/init.d/udev ]] && \
                ! has_version ">=sys-apps/openrc-0.4.0"
        then
                # make sure udev is in sysinit if it was enabled before
                local rc_devices=$(
                        [[ -f /etc/rc.conf ]] && source /etc/rc.conf
                        [[ -f /etc/conf.d/rc ]] && source /etc/conf.d/rc
                        echo "${rc_devices:-${RC_DEVICES:-auto}}"
                )
                case ${rc_devices} in
                        udev|auto)
                                enable_udev=1
                                ;;
                esac
        fi
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-01-03 00:40:43 UTC
I tested a bunch of other machines of mine, and the udev symlink does get created there, but the sysfs one is still missing on them.
Comment 6 Roy Marples 2009-01-03 07:54:49 UTC
As I said earlier, sysfs is pulled in by udev and not added by OpenRC.
Comment 7 Matthias Schwarzott gentoo-dev 2009-01-08 09:48:48 UTC
*** Bug 253979 has been marked as a duplicate of this bug. ***
Comment 8 Xavier Neys (RETIRED) gentoo-dev 2009-01-17 18:05:08 UTC
*** Bug 255286 has been marked as a duplicate of this bug. ***
Comment 9 Matthias Schwarzott gentoo-dev 2009-01-28 18:47:26 UTC
So I think someone should add a sentence/small chapter about checking udev is in sysfs runlevel to the openrc-upgrade guide.
Comment 10 nm (RETIRED) gentoo-dev 2009-01-28 19:40:51 UTC
(In reply to comment #9)
> So I think someone should add a sentence/small chapter about checking udev is
> in sysfs runlevel to the openrc-upgrade guide.
> 

Like what?
Comment 11 Matthias Schwarzott gentoo-dev 2009-01-29 11:16:14 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > So I think someone should add a sentence/small chapter about checking udev is
> > in sysfs runlevel to the openrc-upgrade guide.
> > 
> 
> Like what?

Like this, but maybe some native speaker should check it:

Around the place where the chapter "Boot runlevel" is, adding a chapter udev containing:

openrc no longer starts udev by default, but it now need to be present in the sysfs runlevel to be started. The openrc ebuild should detect if udev was enabled before and add it to sysfs runlevel, but it seems to fail in some cases. So, to be safe, please check if udev is present before rebooting.

Code Listing 1:
  # ls -l ls -l /etc/runlevels/sysfs
  lrwxrwxrwx 1 root root 14 2009-01-29 08:00 /etc/runlevels/sysfs/udev -> /etc/init.d/udev

If udev is not listed, add it to sysfs runlevel.

Code Listing 2:
  rc-update add udev sysfs
Comment 12 nm (RETIRED) gentoo-dev 2009-02-11 09:10:22 UTC
(In reply to comment #11)

Done.
Comment 13 Doug Goldstein (RETIRED) gentoo-dev 2009-02-11 15:11:16 UTC
Looks like the guide's been updated. Thanks Josh.
Comment 14 nm (RETIRED) gentoo-dev 2009-02-12 00:45:28 UTC
(In reply to comment #11)
> sysfs stuff

Please double-check this: you said the "sysfs" runlevel, so that's what I put in the guide, but today I got an email from a user who believes it to be a typo; that it should be the "sysinit" runlevel.

Which is it?
Comment 15 nm (RETIRED) gentoo-dev 2009-02-12 01:00:32 UTC
(In reply to comment #14)
> (In reply to comment #11)
> > sysfs stuff
> 
> Please double-check this: you said the "sysfs" runlevel, so that's what I put
> in the guide, but today I got an email from a user who believes it to be a
> typo; that it should be the "sysinit" runlevel.
> 
> Which is it?

I checked the ebuilds and upstream subversion: it is sysinit, not sysfs. Dunno what zzam was smokin', but it's all fixed now. :D