Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 101599 - genkernel udev upgrade requires code changes
Summary: genkernel udev upgrade requires code changes
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Gentoo Genkernel Maintainers
URL: http://forums.gentoo.org/viewtopic-p-...
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2005-08-06 18:28 UTC by Chris Smith
Modified: 2005-09-08 11:02 UTC (History)
1 user (show)

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


Attachments
Genkernel log (genkernel.log.tar.bz2,44.15 KB, application/x-bzip)
2005-08-07 05:06 UTC, Chris Smith
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Smith 2005-08-06 18:28:34 UTC
udevstart is a symlink to /sbin/udev.
udev requires input arguments.
real_root is not found, due to a bare /dev.
system cannot boot.

Reproducible: Always
Steps to Reproduce:
1. run genkernel
2. verify /boot/grub/grub.conf
3. reboot

Actual Results:  
mounting filesystems
determining root device
block device /dev/hda6 is not a valid root device...
the root block device is unspecified or not detected
please specify a device to boot, or "shell for a shell...
boot() :: 

Expected Results:  
boot to a login prompt

http://forums.gentoo.org/viewtopic-p-2630180.html#2630180 demonstrates a partial
fix, implemented by thugging udev test.block and implanting it in (more or less)
genkernel/generic/initrd.scripts.
I hasten to add that I'm still a n00b, and I don't think this is the final form
of the fix by any means.
Props to the genkernel developers.  Quite an educational chase.




Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.3.5, glibc-2.3.5-r1,
2.6.12-gentoo-r6 i686)
=================================================================
System uname: 2.6.12-gentoo-r6 i686 Intel(R) Pentium(R) M processor 2.00GHz
Gentoo Base System version 1.6.13
dev-lang/python:     2.3.5, 2.4.1-r1
sys-apps/sandbox:    1.2.11
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env
/usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/texmf/web2c
/etc/env.d"
CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X alsa apm arts avi berkdb bitmap-fonts cdr crypt cups curl eds emboss
encode esd fam flac foomaticdb fortran gd gdbm gif gnome gpm gstreamer gtk gtk2
guile imlib ipv6 jpeg kde libg++ libwww mad mikmod motif mozilla mp3 mpeg
ncurses nls ogg oggvorbis opengl oss pam pdflib perl png python qt quicktime
readline sdl spell sqlite ssl svga tcpd tetex tiff truetype truetype-fonts
type1-fonts vorbis xine xml2 xmms xv zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY


# Genkernel Configuration File

# ===========GENKERNEL BASIC CONFIGURATION=============

# Run 'make menuconfig' before compiling this kernel?
MENUCONFIG="yes"

# Run 'make clean' before compilation?
# If set to NO, implies MRPROPER WILL NOT be run
# Also, if clean is NO, it won't copy over any configuration
# file, it will use what's there.
CLEAN="yes"

# Run 'make mrproper' before configuration/compilation?
MRPROPER="yes"

# Copy bootsplash into the initrd image?
BOOTSPLASH="yes"

# Override the arch detection?
# ARCH_OVERRIDE="x86"

# Mount /boot automatically if it isn't mounted?
MOUNTBOOT="yes"

# Save the new configuration in /etc/kernels upon
# successfull compilation
SAVE_CONFIG="yes"

# Use Color output in Genkernel?
USECOLOR="yes"

# Add new kernel to grub?
BOOTLOADER="grub"

# Clear initramfs cpio cache dir
CLEAR_CPIO_CACHE="yes"

# Clear build cache dir
CLEAR_CACHE_DIR="yes"


# =========GENKERNEL LOCATION CONFIGURATION============
# Variables:
#   %%ARCH%%  - Final determined architecture
#   %%CACHE%% - Final determined cache location

# Default share directory location
GK_SHARE="/usr/share/genkernel"

# Location of helper-scripts
#GK_BIN="${GK_SHARE}/bin"
GK_BIN="${GK_SHARE}"
# Location of the default cache
CACHE_DIR="${GK_SHARE}/pkg/%%ARCH%%"
# Log output file
DEBUGFILE="/var/log/genkernel.log"
# Debug Level
DEBUGLEVEL=10

# Default location of kernel source
DEFAULT_KERNEL_SOURCE="/usr/src/linux"
# Default kernel config (only use to override using
%%ARCH%%/kernel-config-${VER}.${PAT} !)
# DEFAULT_KERNEL_CONFIG="${GK_SHARE}/%%ARCH%%/kernel-config"

# Configuration file for busybox
BUSYBOX_CONFIG="${GK_SHARE}/%%ARCH%%/busy-config"
# BusyBox Version
BUSYBOX_VER="1.00-rt-mdstart.plasmaroo"
# Busybox bin-cache location, to store pre-compiled busybox
# binary is just a bzip2 busybox executable
BUSYBOX_BINCACHE="%%CACHE%%/busybox-${BUSYBOX_VER}-%%ARCH%%.bz2"
# Location of BusyBox source tarball
BUSYBOX_SRCTAR="${GK_SHARE}/pkg/busybox-${BUSYBOX_VER}.tar.bz2"
# Directory created after busybox tarball is extracted
BUSYBOX_DIR="busybox-${BUSYBOX_VER}"

MODULE_INIT_TOOLS_VER="3.2-pre7"
MODULE_INIT_TOOLS_SRCTAR="${GK_SHARE}/pkg/module-init-tools-${MODULE_INIT_TOOLS_VER}.tar.bz2"
MODULE_INIT_TOOLS_DIR="module-init-tools-${MODULE_INIT_TOOLS_VER}"
MODULE_INIT_TOOLS_BINCACHE="%%CACHE%%/insmod-%%ARCH%%-static-2.6.bz2"

MODUTILS_VER="2.4.26"
MODUTILS_SRCTAR="${GK_SHARE}/pkg/modutils-${MODUTILS_VER}.tar.bz2"
MODUTILS_DIR="modutils-${MODUTILS_VER}"
MODUTILS_BINCACHE="%%CACHE%%/insmod-%%ARCH%%-static-2.4.bz2"

DIETLIBC_VER="0.27"
DIETLIBC_SRCTAR="${GK_SHARE}/pkg/dietlibc-${DIETLIBC_VER}.tar.bz2"
DIETLIBC_DIR="dietlibc-${DIETLIBC_VER}"
DIETLIBC_BINCACHE="%%CACHE%%/dietlibc-${DIETLIBC_VER}-%%ARCH%%.tar.bz2"
DIETLIBC_BINCACHE_TEMP="%%CACHE%%/dietlibc-${DIETLIBC_VER}-%%ARCH%%-tempdir"

DEVFSD_VER="1.3.25-dietlibc-kernel25"
DEVFSD_SRCTAR="${GK_SHARE}/pkg/devfsd-${DEVFSD_VER}.tar.bz2"
DEVFSD_DIR="devfsd"
DEVFSD_BINCACHE="%%CACHE%%/devfsd-${DEVFSD_VER}-%%ARCH%%.bz2"
DEVFSD_CONF_BINCACHE="%%CACHE%%/devfsd-conf-${DIETLIBC_VER}-%%ARCH%%.bz2"

UDEV_VER="065"
UDEV_DIR="udev-${UDEV_VER}"
UDEV_SRCTAR="${GK_SHARE}/pkg/udev-${UDEV_VER}.tar.bz2"
UDEV_BINCACHE="%%CACHE%%/udev-${UDEV_VER}-%%ARCH%%.tar.bz2"

DEVICE_MAPPER_VER="1.00.17"
DEVICE_MAPPER_DIR="device-mapper.${DEVICE_MAPPER_VER}"
DEVICE_MAPPER_SRCTAR="${GK_SHARE}/pkg/device-mapper.${DEVICE_MAPPER_VER}.tgz"
DEVICE_MAPPER_BINCACHE="%%CACHE%%/device-mapper-${DEVICE_MAPPER_VER}-%%ARCH%%.tar.bz2"

LVM2_VER="2.00.25"
LVM2_DIR="LVM2.${LVM2_VER}"
LVM2_SRCTAR="${GK_SHARE}/pkg/LVM2.${LVM2_VER}.tgz"
LVM2_BINCACHE="%%CACHE%%/LVM2.${LVM2_VER}-%%ARCH%%.tar.bz2"

DMRAID_VER="1.0.0.rc8"
DMRAID_DIR="dmraid/${DMRAID_VER}"
DMRAID_SRCTAR="${GK_SHARE}/pkg/dmraid-${DMRAID_VER}.tar.bz2"
DMRAID_BINCACHE="%%CACHE%%/dmraid-${DMRAID_VER}-%%ARCH%%.tar.bz2"

UNIONFS_VER="1.0.12a"
UNIONFS_DIR="unionfs-${UNIONFS_VER}"
UNIONFS_SRCTAR="${GK_SHARE}/pkg/unionfs-${UNIONFS_VER}.tar.gz"
UNIONFS_BINCACHE="%%CACHE%%/unionfs-${UNIONFS_VER}-tools-%%ARCH%%.tar.bz2"
UNIONFS_MODULES_BINCACHE="%%CACHE%%/unionfs-${UNIONFS_VER}-modules-%%KV%%-%%ARCH%%.tar.bz2"

E2FSPROGS_VER="1.38"
E2FSPROGS_DIR="e2fsprogs-${E2FSPROGS_VER}"
E2FSPROGS_SRCTAR="${GK_SHARE}/pkg/e2fsprogs-${E2FSPROGS_VER}.tar.gz"
BLKID_BINCACHE="%%CACHE%%/blkid-${E2FSPROGS_VER}-%%ARCH%%.bz2"
Comment 1 Eric Edgar (RETIRED) gentoo-dev 2005-08-07 03:21:20 UTC
what options did you give when you compiled the kernel/initramfs with 
genkernel? 
 
please post the contents of your grub.conf 
 
also post the contents of /var/log/genkernel.log 
 
The fix you mentioned runs udevstart always and isnt really a fix.  Most likely 
its a boot parameter out of whack on your system. 
 
 
Comment 2 Chris Smith 2005-08-07 05:06:22 UTC
Created attachment 65303 [details]
Genkernel log

bzip2'd due to high output setting.
Comment 3 Chris Smith 2005-08-07 05:15:24 UTC
(In reply to comment #1)
> what options did you give when you compiled the kernel/initramfs with 
> genkernel? 

genkernel all, based on genkernel --help.
in particular, I didn't say --no-devfs.

> please post the contents of your grub.conf 
>  

localhost smitty # cat /boot/grub/grub.conf
default 0
timeout 30
slashimage=(hd0,2)/grub/splash.xpm.gz

title=Gentoo Linux (2.6.12-gentoo-r7)
root=(hd0,2)
kernel /kernel-genkernel-x86-2.6.12-gentoo-r7 novdevfs udev devfs=nomount vga=6
splash=verbose root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda6
initrd /initramfs-genkernel-x86-2.6.12-gentoo-r7 boot

title=Gentoo Linux (2.6.12-gentoo-r6)
root=(hd0,2)
kernel /kernel-genkernel-x86-2.6.12-gentoo-r6 novdevfs udev devfs=nomount vga=6
splash=verbose root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda6
initrd /initrd-2.6.12-gentoo
boot

title=Gentoo Linux 2.6.12-r4
root=(hd0,2)
kernel /kernel-genkernel-x86-2.6.12-gentoo-r4 novdevfs udev devfs=nomount vga=6
splash=verbose root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda6
initrd /initrd-2.6.12-gentoo
boot

title=MicroSchrott LoseXP
rootnoverify (hd0,0)
makeactive
chainloader +1


> also post the contents of /var/log/genkernel.log 
>
bzipped and attached, due to size.
  
> The fix you mentioned runs udevstart always and isnt really a fix.  Most likely 
> its a boot parameter out of whack on your system. 
> 
Very possible.  However, in the absence of explicitely invoking udevstart
against /sys, I don't see how I'm getting a /dev entry to support real_root.
The udev/sysfs code in genkernel is a little baroque.  Is there a plan to purge
the devfs stuff at kernel 2.6.13?
Comment 4 Eric Edgar (RETIRED) gentoo-dev 2005-08-07 08:25:55 UTC
This is wrong. 

title=Gentoo Linux (2.6.12-gentoo-r7)
root=(hd0,2)
kernel /kernel-genkernel-x86-2.6.12-gentoo-r7 novdevfs udev devfs=nomount vga=6
splash=verbose root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda6
initrd /initramfs-genkernel-x86-2.6.12-gentoo-r7 boot

it should look more like this 

title=Gentoo Linux (2.6.12-gentoo-r7)
root=(hd0,2)
kernel /kernel-genkernel-x86-2.6.12-gentoo-r7 nodevfs udev
root=/dev/ram0 init=/linuxrc real_root=/dev/hda6
initrd /initramfs-genkernel-x86-2.6.12-gentoo-r7



Note I have removed the graphics lines from your grub entry as they are wrong 
for an initramfs.  That is for bootsplash support,  for a 2.6 kernel you want 
gensplash instead.  refer to the documentation on how to set that up after we 
get this solved.  The main issue you had in this is that you had typoed nodevfs 
and had it as novdevfs.  For this reason it was trying to use devfs on your 
system even though its not compiled in to the initramfs.  You also do not need 
the extra boot work at the end of the initrd line.
Comment 5 Chris Smith 2005-08-07 11:11:09 UTC
(In reply to comment #4)

OK.
I cut out the -r7 section of /boot/grub/grub.conf
I did:

emerge --sync
emerge -C genkernel
rm -rf /usr/share/genkernel
emerge genkernel

following

ls /usr/share/genkernel/pkg

I did

cp /usr/portage/distfiles/module-init-tools-3.2-pre7.tar.bz2
/usr/share/genkernel/pkg
cp /usr/portage/distfiles/udev-065.tar.bz2                  
/usr/share/genkernel/pkg

having noted /usr/share/genkernel/pkg/udev-054.tar.bz2 (?)
I then opened /etc/genkernel.conf

After running, here is my /boot/grub/grub.conf:

...header elided...

title=Gentoo Linux (2.6.12-gentoo-r7)
root=(hd0,2)
kernel /kernel-genkernel-x86-2.6.12-gentoo-r7 novdevfs udev devfs=nomount vga=6
splash=verbose root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda6
initrd /initramfs-genkernel-x86-2.6.12-gentoo-r7boot

...rest elided...


So, there is the novdevfs typo, and a need for \n before boot in the last line.
 Mini-bugs in genkernel, both of these.
I'm not worried about the gensplash issue at the moment.
After amending these grub.conf issues, I reboot:

mounting filesystems
determining root device
block device /dev/hda6 is not a valid root device...
the root block device is unspecified or not detected
please specify a device to boot, or "shell for a shell...
boot() :: 

Now, let me explain why this is no shocker.
--------
/usr/share/genkernel/generic/linuxrc  has:

# Set up symlinks
if [ "$0" = '/init' ]
then
    /bin/busybox --install -s

    [ -e /linuxrc ] && rm /linuxrc
    [ -e /sbin/udev ] && ln -s /sbin/udev /sbin/udevstart

    if [ -e /bin/lvm ]
    then
        ln -s /bin/lvm /bin/vgscan
        ln -s /bin/lvm /bin/vgchange
    fi
fi

# Mount sysfs
mount_sysfs

# Start udev/devfs
start_dev_mgr



Let's trace that.
--------
/usr/share/genkernel/generic/initrd.scripts 

mount_sysfs(){
    if [ "${KV_2_6_OR_GREATER}" ]
    then
        # Udev is semi-broken on non /sys sysfs mount points.
        mount -t sysfs /sys /sys >/dev/null 2>&1
        ret=$?

        # sysfs mount failed .. udev wont work fall back to devfs if available
        [ "$ret" -eq '0' ] || USE_UDEV_NORMAL=0
    fi
}


start_dev_mgr(){
    # Check udev is available...
    if [ "${KV_2_6_OR_GREATER}" -a ! "${USE_UDEV_NORMAL}" -eq '0' -a -x /sbin/udev ]
    then
                USE_UDEV_NORMAL=1
    else
                USE_UDEV_NORMAL=0
    fi

    if [ "${USE_UDEV_NORMAL}" -eq '1' ]
    then
                cd /sys
                [ "${DO_bladecenter}" ] && sleep 10
                kill_devfsd
                good_msg 'Activating udev'
                runUdev
                [ "${DO_bladecenter}" ] && sleep 20
                cd /
    else
                if [ ! -e /dev/.devfsd ]
                then
                    good_msg 'Activating devfs'
                        mount -t devfs devfs /dev
                        devfsd /dev -np
                fi
    fi
}



runUdev() {
        mount -t tmpfs -o size=100k udev /dev
        mkdir /dev/pts
        mkdir /dev/shm
        /sbin/udevstart
        ln -snf /proc/self/fd /dev/fd
        ln -snf /proc/self/fd/0 /dev/stdin
        ln -snf /proc/self/fd/1 /dev/stdout
        ln -snf /proc/self/fd/2 /dev/stderr
        ln -snf /proc/kcore /dev/core
}


As we saw in linuxrc, /sbin/udevstart is just an alias for udev.
What is a 0-argument call going to effect in udev.c? (I've added whitespace for
personal clarity):


        /* trigger timeout to prevent hanging processes */
        alarm(      UDEV_ALARM_TIMEOUT  );
        action    = getenv( "ACTION"    );
        devpath   = getenv( "DEVPATH"   );
        subsystem = getenv( "SUBSYSTEM" );

        /* older kernels passed the SUBSYSTEM only as argument */
        if (!subsystem && argc == 2)
                subsystem = argv[1];

        if (!action || !subsystem || !devpath) {
                err("action, subsystem or devpath missing");
                goto exit;
        }

Thus, if we don't do something along the lines of splicing in
udev-065/test/test.all, to put a few device paddles in /dev for us, we will
find ourselves empty handed, and up the scatalogical waterway.
Unless I've missed something.
Best,
Chris
Comment 6 Tim Yamin (RETIRED) gentoo-dev 2005-08-07 19:41:55 UTC
Not a bug as such; note that genkernel uses *054* which treats argv[0]
differently. The reason the forums guy is getting the issue is that he probably
needs to empty out /usr/share/genkernel/pkg/x86 and then rebuild. However, we do
need to fix this since an upgrade to a newer udev is required for HPPA.
Comment 7 Chris Smith 2005-08-08 07:04:28 UTC
(In reply to comment #6)
> Not a bug as such; note that genkernel uses *054* which treats argv[0]
> differently. The reason the forums guy is getting the issue is that he 
probably
> needs to empty out /usr/share/genkernel/pkg/x86 and then rebuild. However, we 
do
> need to fix this since an upgrade to a newer udev is required for HPPA.

Fair enough.
While I have about two weeks of madness facing me at work, I'd like to think 
out loud about the possibility of contributing a patch to genkernel.
Thoughts include:
- fixing the two grub.conf buglets noted in post #4
- purging devfs entirely (as it's scheduled for extinction in linux-2.6.13)

I don't pretend to know everything necessary to get it right immediately, but I 
feel I'm making progress.  Eventual goal is to become a respectable kernel 
hacker.  Contributing to genkernel seems a splendid learning opportunity.  
Getting a n00b up to speed is non-trivial; I understand in advance if the 
answer is "thanks, but..."
Best,
Chris
Comment 8 Eric Edgar (RETIRED) gentoo-dev 2005-08-08 07:52:11 UTC
Any code that removes devfs will not be accepted at this time.  We still need 
to support 2.4 kernels and devfs is required for those.

We also have a patch that needs to be tested for newer udev support.  udevstart 
was split off from udev in future versions so we needed to take that change 
into account.  
Comment 9 Chris Smith 2005-08-08 08:26:33 UTC
(In reply to comment #8)
> Any code that removes devfs will not be accepted at this time.  We still need 
> to support 2.4 kernels and devfs is required for those.
> We also have a patch that needs to be tested for newer udev support.  
udevstart 
> was split off from udev in future versions so we needed to take that change 
> into account.  

Fair enough.
What about a linuxrc command line interface replacing:

nodevfs udev devfs=nomount 

with dev=x
where x = devfs or udev?
Argument being that 1 is better than 3 for command line parameters.
Best,
Chris
Comment 10 Eric Edgar (RETIRED) gentoo-dev 2005-08-11 06:11:06 UTC
Newer udev support is in cvs.  
Comment 11 Chris Gianelloni (RETIRED) gentoo-dev 2005-09-08 09:03:35 UTC
genkernel 3.3.6 is now in CVS
Comment 12 Chris Gianelloni (RETIRED) gentoo-dev 2005-09-08 11:02:03 UTC
...forgot to resolve the bug... heh