# genkernel /dev/ram0 brd.ko not in initramfs

## tangram

Since I updated genkernel to version 3.4.12.1 and higher I can not build correct initramfs.

During boot I get error:

 *Quote:*   

> 
> 
> VFS: Cannot open root device “ram0” or unknown block(0,0)
> 
> Kernel panic – not syncing: VFS: Unable to mount root fs on unknown-block (0,0)
> ...

 

My grub config( part).

```

title Gentoo Linux 2.6.37-gentoo CONSOLE

root (hd0,4)

kernel /kernel-genkernel-x86-2.6.37-gentoo root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda7 \

video=neofb:internal,external splash=silent,theme:natural_gentoo console=tty1 quiet udev

initrd /initramfs-genkernel-x86-2.6.37-gentoo

```

Kernel config ( part for DEV_RAM)

```

CONFIG_BLK_DEV_RAM=m

CONFIG_BLK_DEV_RAM_COUNT=1

CONFIG_BLK_DEV_RAM_SIZE=8192

```

Module for ram device is created.

```

find /lib/modules/`uname -r` -type f -name '*rd.ko'

/lib/modules/2.6.37-gentoo/kernel/drivers/block/brd.ko

```

I unpacked iniramfs file, and … indeed there is no module for ram device !

```

./lib/modules/2.6.37-gentoo/kernel/drivers/usb/host/ehci-hcd.ko

./lib/modules/2.6.37-gentoo/kernel/drivers/usb/host/uhci-hcd.ko

./lib/modules/2.6.37-gentoo/kernel/drivers/usb/storage/usb-storage.ko

./lib/modules/2.6.37-gentoo/kernel/drivers/scsi/sg.ko

./lib/modules/2.6.37-gentoo/kernel/drivers/scsi/scsi_wait_scan.ko

./lib/modules/2.6.37-gentoo/kernel/drivers/scsi/scsi_mod.ko

./lib/modules/2.6.37-gentoo/kernel/drivers/scsi/sd_mod.ko

./lib/modules/2.6.37-gentoo/kernel/drivers/pcmcia/pcmcia.ko

./lib/modules/2.6.37-gentoo/kernel/drivers/pcmcia/pcmcia_core.ko

./lib/modules/2.6.37-gentoo/kernel/drivers/pcmcia/pcmcia_rsrc.ko

./lib/modules/2.6.37-gentoo/kernel/drivers/pcmcia/yenta_socket.ko

```

When is no module, no device is created – right ?

Maybe I have some bad settings in genkernel.conf ?

Any advices, please ?.

My "fdisk -l"

```

Device Boot      Start         End      Blocks   Id  System

/dev/hda1   *          63      831599      415768+   6  FAT16

/dev/hda2          831600    78140159    38654280    5  Extended

/dev/hda5          831663      892079       30208+  83  Linux

/dev/hda6          892143     1905119      506488+  82  Linux swap / Solaris

/dev/hda7         1905183    78140159    38117488+  83  Linux

```

My genkernel config.

```

# Configuration file for genkernel

# $Id: 3f52a322add852187660497dcea7f9ef35403821 $

# This file is sourced by genkernel at startup and determines which options

# we will be using to compile our kernel.  The order of precidence is simple,

# with the internal settings being least important, configuration file

# settings next, and command line options being most important.

# =========Common Command Line Option Defaults=========

# Run 'make oldconfig' before compiling this kernel?

#dartst OLDCONFIG="yes"

OLDCONFIG="no"

# Run 'make menuconfig' before compiling this kernel?

MENUCONFIG="no"

# 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.

#dartst CLEAN="yes"

CLEAN="no"

# Run 'make mrproper' before configuration/compilation?

#dartst MRPROPER="yes"

MRPROPER="no"

# Override the arch detection?

# ARCH_OVERRIDE="x86"

# Mount BOOTDIR automatically if it isn't mounted?

MOUNTBOOT="yes"

# Make symlinks in BOOTDIR automatically?

# SYMLINK="no"

# Save the new configuration in /etc/kernels upon

# successfull compilation

SAVE_CONFIG="yes"

# Use Color output in Genkernel?

USECOLOR="yes"

# Clear build cache dir

CLEAR_CACHE_DIR="yes"

# Genkernel uses an independent configuration for MAKEOPTS, and does not source

# /etc/make.conf . You can override the default setting by uncommenting and

# tweaking the following line. Default setting is set up by

# ${GK_SHARE}/${ARCH_OVERRIDE}/config.sh . The recommended value for -j

# argument is: <number of processors>*<number of cores per processor>+1

# MAKEOPTS="-j2"

# Add in LVM support from static binaries if they exist on the system, or

# compile static LVM binaries if static ones do not exist.

LVM="no"

# Add in Luks support. Needs sys-fs/cryptsetup with -dynamic installed.

LUKS="no"

# Add in GnuPG support

GPG="no"

# Add in EVMS support from static binaries if they exist on the system: you

# should run "emerge evms" first.

EVMS="no"

# Add DMRAID support.

DMRAID="no"

# Include (or suppresses the inclusion of) busybox in the initrd or initramfs.

# If included, busybox is rebuilt if the cached copy is out of date.

# BUSYBOX="yes"

# dartst

BUSYBOX="no"

# Copy /etc/mdadm.conf, mdadm/mdmon binaries to initramfs.

# Without sys-fs/mdadm[static] installed, this will build a static mdadm.

MDADM="no"

# Add Multipath support.

MULTIPATH="no"

# Add iSCSI support.

# ISCSI="no"

# Enable copying of firmware into initramfs

# FIRMWARE="no"

# Specify directory to pull from

# FIRMWARE_DIR="/lib/firmware"

# Specify specific firmware files to include. This overrides FIRMWARE_DIR

# FIRMWARE_FILES=""

# Enable disklabel support (copies blkid to initrd)

DISKLABEL="yes"

# Add new kernel to grub?

# BOOTLOADER="grub"

# =========Low Level Compile Settings=========

#

# GNU Make to use for kernel.  See also the --kernel-make command line option.

# KERNEL_MAKE="make"

# Compiler to use for the kernel (e.g. distcc).  See also the --kernel-cc

# command line option.

# KERNEL_CC="gcc"

# Assembler to use for the kernel.  See also the --kernel-as command line

# option.

# KERNEL_AS="as"

# Linker to use for the kernel.  See also the --kernel-ld command line option.

# KERNEL_LD="ld"

# GNU Make to use for the utilities.  See also the --utils-make command line

# option.

# UTILS_MAKE="make"

# Compiler to use for the utilities (e.g. distcc).  See also the --utils-cc

# command line option.

# UTILS_CC="gcc"

# Assembler to use for the utilities.  See also the --utils-as command line

# option.

# UTILS_AS="as"

# Linker to use for the utilities.  See also the --utils-ld command line

# option.

# UTILS_LD="ld"

# =========GENKERNEL LOCATION CONFIGURATION============

# Variables:

#   %%ARCH%%  - Final determined architecture

#   %%CACHE%% - Final determined cache location

# Set genkernel's temporary work directory.  Default is /var/tmp/genkernel

# TMPDIR="/var/tmp/genkernel"

# Set the boot directory, default is /boot

#BOOTDIR="/boot"

# Default share directory location

GK_SHARE="${GK_SHARE:-/usr/share/genkernel}"

# Location of the default cache

CACHE_DIR="/var/cache/genkernel"

# Location of DISTDIR, where our source tarballs are stored

DISTDIR="${CACHE_DIR}/src"

# Log output file

LOGFILE="/var/log/genkernel.log"

# Debug Level

LOGLEVEL=1

# Default location of kernel source

DEFAULT_KERNEL_SOURCE="/usr/src/linux"

# Default kernel config (only use to override using

# arch/%%ARCH%%/kernel-config-${VER}.${PAT} !)

# DEFAULT_KERNEL_CONFIG="${GK_SHARE}/arch/%%ARCH%%/kernel-config"

BUSYBOX_VER="1.18.1"

BUSYBOX_SRCTAR="${DISTDIR}/busybox-${BUSYBOX_VER}.tar.bz2"

BUSYBOX_DIR="busybox-${BUSYBOX_VER}"

BUSYBOX_BINCACHE="%%CACHE%%/busybox-${BUSYBOX_VER}-%%ARCH%%.tar.bz2"

# BUSYBOX_APPLETS="[ ash sh mount uname echo cut cat"

DEVICE_MAPPER_VER="1.02.22"

DEVICE_MAPPER_DIR="device-mapper.${DEVICE_MAPPER_VER}"

DEVICE_MAPPER_SRCTAR="${DISTDIR}/device-mapper.${DEVICE_MAPPER_VER}.tgz"

DEVICE_MAPPER_BINCACHE="%%CACHE%%/device-mapper-${DEVICE_MAPPER_VER}-%%ARCH%%.tar.bz2"

LVM_VER="2.02.74"

LVM_DIR="LVM2.${LVM_VER}"

LVM_SRCTAR="${DISTDIR}/LVM2.${LVM_VER}.tgz"

LVM_BINCACHE="%%CACHE%%/LVM2.${LVM_VER}-%%ARCH%%.tar.bz2"

MDADM_VER="3.1.4"

MDADM_DIR="mdadm-${MDADM_VER}"

MDADM_SRCTAR="${DISTDIR}/mdadm-${MDADM_VER}.tar.bz2"

MDADM_BINCACHE="%%CACHE%%/mdadm-${MDADM_VER}-%%ARCH%%.tar.bz2"

DMRAID_VER="1.0.0.rc14"

DMRAID_DIR="dmraid/${DMRAID_VER}"

DMRAID_SRCTAR="${DISTDIR}/dmraid-${DMRAID_VER}.tar.bz2"

DMRAID_BINCACHE="%%CACHE%%/dmraid-${DMRAID_VER}-%%ARCH%%.tar.bz2"

ISCSI_VER="2.0-871"

ISCSI_DIR="open-iscsi-${ISCSI_VER}"

ISCSI_SRCTAR="${DISTDIR}/open-iscsi-${ISCSI_VER}.tar.gz"

ISCSI_BINCACHE="%%CACHE%%/iscsi-${ISCSI_VER}-%%ARCH%%.bz2"

E2FSPROGS_VER="1.41.14"

E2FSPROGS_DIR="e2fsprogs-${E2FSPROGS_VER}"

E2FSPROGS_SRCTAR="${DISTDIR}/e2fsprogs-${E2FSPROGS_VER}.tar.gz"

BLKID_BINCACHE="%%CACHE%%/blkid-${E2FSPROGS_VER}-%%ARCH%%.bz2"

FUSE_VER="2.7.4"

FUSE_DIR="fuse-${FUSE_VER}"

FUSE_SRCTAR="${DISTDIR}/fuse-${FUSE_VER}.tar.gz"

FUSE_BINCACHE="%%CACHE%%/fuse-${FUSE_VER}-%%ARCH%%.tar.bz2"

UNIONFS_FUSE_VER="0.22"

UNIONFS_FUSE_DIR="unionfs-fuse-${UNIONFS_FUSE_VER}"

UNIONFS_FUSE_SRCTAR="${DISTDIR}/unionfs-fuse-${UNIONFS_FUSE_VER}.tar.bz2"

UNIONFS_FUSE_BINCACHE="%%CACHE%%/unionfs-fuse-${UNIONFS_FUSE_VER}-%%ARCH%%.bz2"

GPG_VER="1.4.11"

GPG_DIR="gnupg-${GPG_VER}"

GPG_SRCTAR="${DISTDIR}/gnupg-${GPG_VER}.tar.bz2"

GPG_BINCACHE="%%CACHE%%/gnupg-${GPG_VER}-%%ARCH%%.bz2"

```

----------

## billydv

Have the same problem I believe

Trying libraries: crypt m

Failed: -Wl,--start-group -lcrypt -lm -Wl,--end-group

Output of:

gcc -Wall -Wshadow -Wwrite-strings -Wundef -Wstrict-prototypes -Wunused -Wunused-parameter -Wunused-function -Wunused-value -Wmissing-prototypes -Wmissing-declarations -Wdeclaration-after-statement -Wold-style-definition -fno-builtin-strlen -finline-limit=0 -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-guess-branch-probability -funsigned-char -static-libgcc -falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1 -Os -static -o busybox_unstripped -Wl,--sort-common -Wl,--sort-section,alignment -Wl,--start-group applets/built-in.o archival/lib.a archival/libarchive/lib.a console-tools/lib.a coreutils/lib.a coreutils/libcoreutils/lib.a debianutils/lib.a e2fsprogs/lib.a editors/lib.a findutils/lib.a init/lib.a libbb/lib.a libpwdgrp/lib.a loginutils/lib.a mailutils/lib.a miscutils/lib.a mdadm/lib.a modutils/lib.a networking/lib.a networking/libiproute/lib.a networking/udhcp/lib.a printutils/lib.a procps/lib.a runit/lib.a selinux/lib.a shell/lib.a sysklogd/lib.a util-linux/lib.a util-linux/volume_id/lib.a archival/built-in.o archival/libarchive/built-in.o console-tools/built-in.o coreutils/built-in.o coreutils/libcoreutils/built-in.o debianutils/built-in.o e2fsprogs/built-in.o editors/built-in.o findutils/built-in.o init/built-in.o libbb/built-in.o libpwdgrp/built-in.o loginutils/built-in.o mailutils/built-in.o miscutils/built-in.o mdadm/built-in.o modutils/built-in.o networking/built-in.o networking/libiproute/built-in.o networking/udhcp/built-in.o printutils/built-in.o procps/built-in.o runit/built-in.o selinux/built-in.o shell/built-in.o sysklogd/built-in.o util-linux/built-in.o util-linux/volume_id/built-in.o -Wl,--end-group -Wl,--start-group -lcrypt -lm -Wl,--end-group

==========

coreutils/lib.a(id.o): In function `get_groups':

id.c :Sad: .text.get_groups+0xa): warning: Using 'getgrouplist' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

libbb/lib.a(bb_pwd.o): In function `xgetgrgid':

bb_pwd.c :Sad: .text.xgetgrgid+0x4): warning: Using 'getgrgid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

mdadm/lib.a(config.o): In function `load_conffile':

config.c :Sad: .text.load_conffile+0x272): warning: Using 'getgrnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

config.c :Sad: .text.load_conffile+0x1f0): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

libbb/lib.a(bb_pwd.o): In function `xgetpwuid':

bb_pwd.c :Sad: .text.xgetpwuid+0x4): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

libbb/lib.a(xconnect.o): In function `str2sockaddr':

xconnect.c :Sad: .text.str2sockaddr+0x100): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

libbb/lib.a(inet_common.o): In function `INET_rresolve':

inet_common.c :Sad: .text.INET_rresolve+0xbd): warning: Using 'gethostbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

util-linux/lib.a(mount.o): In function `nfsmount':

mount.c :Sad: .text.nfsmount+0xd8): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

libbb/lib.a(xconnect.o): In function `bb_lookup_port':

xconnect.c :Sad: .text.bb_lookup_port+0x41): warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.2/../../../../lib64/libc.a(memmove_chk.o): In function `__memmove_chk':

(.text+0x1b4): undefined reference to `__memmove_chk_ssse3_back'

/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.2/../../../../lib64/libc.a(memmove_chk.o): In function `__memmove_chk':

(.text+0x1b9): undefined reference to `__memmove_chk_ssse3'

collect2: ld returned 1 exit status

make: *** [busybox_unstripped] Error 1

* Gentoo Linux Genkernel; Version 3.4.11.1

* Running with options: --install --splash=natural_gentoo initramfs

* ERROR: Failed to compile the "all" target...

* -- End log... --

* Please consult /var/log/genkernel.log for more information and any

* errors that were reported above.

* Report any genkernel bugs to bugs.gentoo.org and

* assign your bug to genkernel@gentoo.org. Please include

* as much information as you can in your bug report; attaching

* /var/log/genkernel.log so that your issue can be dealt with effectively.

* 

* Please do *not* report compilation failures as genkernel bugs!

----------

## sfireman

Maybe /usr/share/genkernel/arch/x86_64/modules_load will help?(fix x86_64 to your arch)

This is the list of modules initramfs try to load during boot process.

----------

## tangram

Hello Billy I write just now because last week I have had lot of work.

We have two different problems although with same tool.

I can compile my initramfs , but can not use it.

I am full time employee and I do not have much time to analyse source code why ram0 device is not created. 

I am little bit surprised why none of the gurus did not answered me, as next I will try to ask direct the package maintainer. 

If I knew anything more I will write.

All the best

tangram

----------

## jburns

The driver to read the ramfile must be build into the kernel.  Change the kernel configuration.

```
CONFIG_BLK_DEV_RAM=y
```

----------

## billydv

Jburns, 

      Thanks but it is built in. I havent changed the kernel config for at least a kernel version or two and now the initramfs won't compile. I'm quite sure this error is related to busybox and the new glibc.

----------

## tangram

jburns

I have allready tried this solution( CONFIG_BLK_DEV_RAM=y), /dev/ram0 is still not created

----------

## billydv

Problem is glibc 2.13.

----------

## tangram

billydv

Could you write a little bit more ...

----------

## billydv

Tangram, I'm sorry I didn't answer you sooner.  When I said that the problem is glibc, I meant that was my problem. After downgrading glibc to the previous version, I was able to compile kernels just fine.

Now as for your problem, there are a number of things I would suggest. For starters, your kernel config. My guess would be that you may have something screwy there. A first step would probably be using a kernel seed. Pappy's kernel configs seem to be a good starting point.

Second, I would check your make.conf and your selected profile. eselect profile list and the eselect profile set *, to make sure you arent missing some use flag or package. Here is my make.conf

# These settings were set by the catalyst build script that automatically built this stage

# Please consult /usr/share/portage/config/make.conf.example for a more detailed example

#

### Use this to change to different Motherboard

#CFLAGS="-mtune=generic -O2 -pipe"

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

CHOST="x86_64-pc-linux-gnu"

CXXFLAGS="${CFLAGS}"

USE="3dnow S3TC X a52 aac aalib accessibility acpi aften akonadi alsa altivec amarok amrnb aqua archive ares arts artworkextra audio audiofile automount avahi bash-completion berkdb bidi binary-drivers -bindist bittorrent bookmarks branding bzip2 cairo calendar cdda cddb cdio cdparanoia cdr chm clamav clamd cleartype cli clucene consolekit corefonts cpudetection css cups curl dbus deprecated designer-plugin device-mapper devil dga directfb discouraged distribution divx dns doc dri dts dv dvb dvd dvdnav dvdr dvdread ebook eds elisp emacs emboss emerald encode esd eselect etc-proposals evo examples exif expat extraicons extras extra-tools fam fat fax fbcon fbcondecor fbsplash ffmpeg firefox flac flash fltk foomaticdb fortran ftp fts3 fuse gcj gd gdbm gdu gedit ggi gif gimp glep glib glitz gmedia gnome gnutls google google-gadgets gphoto2 gpm gstreamer gtk gtkhtml handbook hddtemp hfs hpcups hpijs html htmlhandbook httpd hyperestraier idn ieee1394 imagemagick imlib inkjar inotify ipv6 isdnlog jack jadetex java java6 jfs joystick jpeg jpeg2k kde kdehiddenvisibility kdrive kerberos konqueror kpathsea lame lcms ldap libcaca libsamplerate -lilo lirc live lm_sensors logrotate mad mail matroska md5sum mdnsresponder-compat mikmod mime mjpeg mmx mmxext mng mono mozilla mp2 mp3 mpeg mplayer multilib musepack musicbrainz mysql nas nautilus ncurses networking new-login nforce2 nls npp nptl nptlonly nsplugin ntfs nvidia objc odbc offensive ogg ole openal openexr opengl osdmenu pam parport pcre pdf perl pipechan plasma pmu png policykit postgres ppds pppd pulseaudio python qt3support qt4 quicktime raptor rar rdesktop readline real realmedia reflection regex reiser4 reiserfs reports samba sametime scanner sdl secure-delete semantic-desktop servletapi session sip skins slang slp smbclient smp sndfile snmp sound sounds speex spell spl sql sqlite sse sse2 ssl startup-notification static-ppds stream subversion svg svga swat sysfs syslog tcpd templates theora thesaurus threads thumbnail thunderbird tidy tiff timidity tk tools truetype type1 udev unicode unsupported usb userlocales utempter utils v4l vcd vdpau vdr video vlm voice vorbis vram wav wavpack weather webkit win32codecs wmf wmp wordperfect wxwindows x264 xattr xcb xcomposite xforms xfs xine xml xorg xpm xprint xscreensaver xv xvid xvmc zeroconf zip zlib"

ACCEPT_KEYWORDS="~amd64"

ACCEPT_LICENSE ="*"

DISTDIR="/usr/portage/distfiles"

EMERGE_DEFAULT_OPTS="--keep-going"

FEATURES="buildpkg preserve-libs"

INPUT_DEVICES="evdev joystick keyboard mouse" 

MAKEOPTS="-j9"

PKGDIR="/usr/portage/packages"

PORTAGE_ECLASS_WARNING_ENABLE="0"

PORTAGE_ELOG_CLASSES="warn error log info qa"

PORTAGE_ELOG_SYSTEM="save"

#PORTAGE_NICENESS="18"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/portage/local/miscellaneous"

USE_PYTHON="2.7 3.1"

VIDEO_CARDS="fbdev nvidia nv vesa"

Next, there is a possibility that your grub conf is wrong. Here is mine

# Generated by grubconf

default=0

timeout=5

#splashimage=(hd2,1)/boot/grub/splash.xpm.gz

#gfxmenu (hd0,1)/boot/gfx-themes/message.livecd-2007.0-silent

gfxmenu (hd0,1)/boot/gfx-themes/message.natural-gentoo

#gfxmenu (hd0,1)/boot/gfx-themes/message.gentoo-black

#gfxmenu (hd0,1)/boot/gfx-themes/message.livecd-2006-silent

title Gentoo AMD64 2.6.37-gentoo

        root (hd0,1)

        kernel /boot/kernel-2.6.37-gentoo root=/dev/ram0 init=/linuxrc ramdisk_size=8192 real_root=/dev/sda2 udev quiet splash=silent,fadein,fadeout,theme:natural_gentoo video=uvesafb:1024x768-32,mtrr:3,ywrap console=tty1

        initrd /boot/initramfs-2.6.37-gentoo

title Gentoo AMD64 2.6.36-gentoo-r7

        root (hd0,1)

        kernel /boot/kernel-2.6.36-gentoo-r7 root=/dev/ram0 init=/linuxrc ramdisk_size=8192 real_root=/dev/sda2 udev quiet splash=silent,fadein,fadeout,theme:natural_gentoo video=uvesafb:1024x768-32,mtrr:3,ywrap console=tty1

        initrd /boot/initramfs-2.6.36-gentoo-r7

title Windows 7 Ultimate 

        map (hd0) (hd2)

        map (hd2) (hd0)

        unhide (hd2,0)

	rootnoverify (hd2,0)

        chainloader +1

	makeactive

	boot

And then finally, your genkernel command, Here is what I use

genkernel --menuconfig --install --splash=natural_gentoo all

Finally, One last suggestion. In my opinion, every gentoo system should be rebuilt from time to time. I usually rebuild everything each time there is a gcc update or a linux headers update. Depending on the speed of your machine this can take a day or a week. If none of the other suggestions work, maybe rebuilding your system may solve the problem.

----------

