When I start to generate an initrd with genkernel, it stop with this error : * Linux Kernel 2.6.12-suspend2-r5acpi-2.1.9.9 for x86... * The build-host kernel does not appear to have loop device support. * Please load loop support before running genkernel! * ERROR: Load loop support! But loop support is ok, module is loaded and /dev/loop/0 exist. The problem is in /usr/share/genkernel/gen_funcs.sh in function has_loop(), because it want that the line "^loop:" must exist. But in a computer with a lot of kernel message, this line don't exist after some time, because dmesg use a limited FIFO buffer (and it a good choice). Reproducible: Always Steps to Reproduce: 1. genkernel --debuglevel=5 --postclear initrd Actual Results: root@efflam:~ # genkernel --debuglevel=5 --postclear initrd * CMD_DEBUGLEVEL: 5 * CMD_POSTCLEAR: 1 * Gentoo Linux Genkernel; Version 3.3.5 * Running with options: --debuglevel=5 --postclear initrd * Linux Kernel 2.6.12-suspend2-r5acpi-2.1.9.9 for x86... * The build-host kernel does not appear to have loop device support. * Please load loop support before running genkernel! * ERROR: Load loop support! * -- Grepping log... -- * CMD_DEBUGLEVEL: 5 * CMD_POSTCLEAR: 1 * Gentoo Linux Genkernel; Version 3.3.5 * Running with options: --debuglevel=5 --postclear initrd * ERROR: Load loop support! * -- End log... -- ... Expected Results: A good detection of loop support. root@efflam:~ # emerge info Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.4.4-vanilla, glibc-2.3.5-r1, 2.6.12-suspend2-r5acpi-2.1.9.9 i686) ================================================================= System uname: 2.6.12-suspend2-r5acpi-2.1.9.9 i686 Intel(R) Pentium(R) M processor 1.60GHz Gentoo Base System version 1.12.0_pre6 distcc[5014] (dcc_mkdir) ERROR: mkdir /root/.distcc/state failed: No such file or directory [disabled] ccache version 2.4 [enabled] dev-lang/python: 2.4.1-r1 sys-apps/sandbox: 1.2.12 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="-Os -march=pentium-m -fomit-frame-pointer -pipe" 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/share/config /var/bind /var/qmail/control /var/www/localhost/htdocs/cacti/include/" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-Os -march=pentium-m -fomit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig candy ccache collision-protect distlocks noauto notitles sandbox sfperms strict userpriv usersandbox" GENTOO_MIRRORS="ftp://ftp.uoi.gr/mirror/OS/gentoo/ http://mirror.pudas.net/gentoo http://194.117.143.71 ftp://gentoo.mirrors.scphost.com/pub/mirrors/gentoo/ ftp://mirror.pudas.net/gentoo ftp://ftp.isu.edu.tw/pub/Linux/Gentoo ftp://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://gentoo.scphost.com http://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://mir.zyrianes.net/gentoo/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://hsc.hsc.fr/gentoo-portage" USE="x86 7zip X X509 aalib accounting acpi alsa apache2 arts async avi bash-completion berkdb bindist bitmap-fonts bluetooth bzip2 cdr chroot crypt css cups curl dba devfs26 devmap dhcp divx4linux dvd eds emboss emoticon encode escreen esd ethereal fam fat ffmpeg firefox flac font-server foomaticdb fortran freetds ftp gd gdbm gif gimpprint gkrellm gmail gmp gnome gphoto2 gpm gps graphviz gs gsm gstreamer gtk gtk2 h323 hardened hardenedphp iconv icq imagemagick imap imlib ipv6 irda jabber java john jp2 jpeg lcms ldap libg++ libwww lzo lzw mad mailbox matroska mbox md5sum mikmod mmx mng motif mozcalendar mp3 mpeg msn mssql mysql ncurses network new-login nls nntp nptl ntfs ntlm ogg oggvorbis old-crypt opengl openssh openssl oscar oss pam pcmcia pdflib perl php pic png pnp procmail python qt quicktime readline real reiserfs rtc ruby samba sdl slang smartcard smime snmp softmmu spell sqlite sse sse2 ssl svga tcltk tcpd tidy tiff truetype truetype-fonts type1-fonts usb vhosts vnc vorbis wifi win32codecs wmf wxwindows x11vnc xine xml xml2 xmms xosd xscreensaver xv xvid yahoo zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS ---- A solution is to use /var/log/dmesg instead of the dmesg command.
Except that /var/log/dmesg doesn't exist on every machine. Also, checking it for loop support on my machine fails, as it doesn't list everything from the boot, but rather a whole ton of filesystem stuff (yeah, unclean reboot). Anyway, if you have a patch for a better solution, I'm all for it.
Alright, I simply added code to check /var/log/dmesg if it is there and to use dmesg if it isn't into CVS... The patch looks like this: Index: gen_funcs.sh =================================================================== RCS file: /var/cvsroot/gentoo/src/genkernel_bradmssw/gen_funcs.sh,v retrieving revision 1.16 diff -u -b -B -r1.16 gen_funcs.sh --- gen_funcs.sh 19 Jul 2005 14:33:17 -0000 1.16 +++ gen_funcs.sh 28 Oct 2005 18:43:16 -0000 @@ -234,7 +234,12 @@ } has_loop() { + if [ -e /var/log/dmesg ] + then + cat /var/log/dmesg | egrep -q '^loop:' + else dmesg | egrep -q '^loop:' + fi if [ -e '/dev/loop0' -o -e '/dev/loop/0' -a ${PIPESTATUS[1]} ] then # We found devfs or standard dev loop device, assume I haven't actually tested it, as I don't have /var/log/dmesg on my boxes, but it shoudl work just fine. This is now in CVS and will go into the next genkernel release.
fixed in 3.3.7