Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to build a custom linux kernel that does not use the initrd during boot. I still want the loadable modules option due to a couple of third-party modules I build (which are NOT needed for boot).
The problem *may* lie in my grub.conf but I can't seem to track it down.
The hardware is standard IDE hard drive (not SATA) and I have pretty much most of the modules I know I use built into the kernel. If I build the kernel with the initrd image and do a 'lsmod' there are no modules listed so I am confident that any required modules for booting are definitely built into the kernel.
There is only one partition (i.e. no /boot partition) and the partition is formatted ext3. The partition is /dev/hda1 and my grub.conf configuration is as follows:
title Linux (2.6.23.1-2)
root (hd0,0)
kernel /boot/vmlinuz-2.6.23.1-2 ro root=LABEL=/ quiet vga=794
initrd /boot/initrd-2.6.23.1-2.img
So I am thinking the problem might be in the "root=LABEL=" option but no matter what values I put there I can't get a boot of the kernel. I have gotten various boot errors depending on what I put here (e.g. Kernel panic can't find device (0,0)).
Is there a particular kernel option I need to enable/disable to make this happen? I really want to get rid of the initrd dependency.
I am trying to build a custom linux kernel that does not use the initrd during boot. I still want the loadable modules option due to a couple of third-party modules I build (which are NOT needed for boot).
The problem *may* lie in my grub.conf but I can't seem to track it down.
The hardware is standard IDE hard drive (not SATA) and I have pretty much most of the modules I know I use built into the kernel. If I build the kernel with the initrd image and do a 'lsmod' there are no modules listed so I am confident that any required modules for booting are definitely built into the kernel.
There is only one partition (i.e. no /boot partition) and the partition is formatted ext3. The partition is /dev/hda1 and my grub.conf configuration is as follows:
title Linux (2.6.23.1-2)
root (hd0,0)
kernel /boot/vmlinuz-2.6.23.1-2 ro root=LABEL=/ quiet vga=794
initrd /boot/initrd-2.6.23.1-2.img
So I am thinking the problem might be in the "root=LABEL=" option but no matter what values I put there I can't get a boot of the kernel. I have gotten various boot errors depending on what I put here (e.g. Kernel panic can't find device (0,0)).
Is there a particular kernel option I need to enable/disable to make this happen? I really want to get rid of the initrd dependency.
Thanks.
Grub starts counting at 0, not 1. Change the default to:
default=0
That was a casualty of cut-n-paste. There actually is another kernel in my config. The default is irrelevant because when you boot, you get the option of which kernel you want to boot (if other than the default).
I'm not sure I quite understand the problem you are having? Is it a kernel config problem or a grub problem?
I have been able to boot into a 2.6.x kernel using the following for my grub entry:
Code:
title ClfsLinux
root (hd0,0)
kernel /boot/clfskernel-2.6.17.13 quiet rw root=/dev/hda1
The "Block devices" portion of my kernel configuration looks like:
Code:
#
# Block devices
#
CONFIG_BLK_DEV_FD=m
# CONFIG_BLK_DEV_XD is not set
# CONFIG_PARIDE is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=m
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
CONFIG_BLK_DEV_NBD=m
# CONFIG_BLK_DEV_SX8 is not set
# CONFIG_BLK_DEV_UB is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=8
CONFIG_BLK_DEV_RAM_SIZE=20480
CONFIG_BLK_DEV_INITRD=y
CONFIG_CDROM_PKTCDVD=m
CONFIG_CDROM_PKTCDVD_BUFFERS=8
# CONFIG_CDROM_PKTCDVD_WCACHE is not set
# CONFIG_ATA_OVER_ETH is not set
If I have missed the point of your query, please restate your question and perhaps I may be able to help.
> "Is it a kernel config problem or a grub problem?"
Well, that's my original question. As I stated in my original question, I am trying to remove the dependency of the initrd image when I boot (i.e. remove the line "initrd /boot/initrd-<version>" from my grub.conf file) when I build a custom kernel.
The kernel I am trying to boot (custom built 2.6.21.7) contains all required modules (that I know of) built into the kernel. It looks like it's going through the boot sequence but the latest error I am getting during boot is:
Warning: Unable to open an initial console
Then it automatically reboots.
If I add the initrd line back into grub for this kernel, boot then do a lsmod, no modules are listed which tells me that all required modules are built it, right?
You might be just missing something, but I can't tell for sure. What disto are you running? Can you verify that you have a /dev/console? If not, it can be created using this command:
Code:
mknod -m 600 /dev/console c 5 1
It is indeed a myth that one requires an initrd to run. The system I run is CLFS (cross-compiled linux from scratch); I do not use an initrd, although I do run udev to setup my device nodes, with the exception of the one shown above and /dev/null.
/dev/null is setup using:
Code:
mknod -m 666 /dev/null c 1 3
Aside from the devices above, look at your /etc/inittab, your startup scripts, directory permissions (i.e. /tmp, /var), /bin/sh or /bin/bash, etc..
You should at least be able to boot to the black/white console that displays the login prompt.
P.S. In case this matters, here's the "File systems" section of my kernel config file:
Code:
#
# File systems
#
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
CONFIG_EXT2_FS_SECURITY=y
# CONFIG_EXT2_FS_XIP is not set
CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
CONFIG_FS_MBCACHE=y
CONFIG_REISERFS_FS=y
# CONFIG_REISERFS_CHECK is not set
# CONFIG_REISERFS_PROC_INFO is not set
# CONFIG_REISERFS_FS_XATTR is not set
# CONFIG_JFS_FS is not set
CONFIG_FS_POSIX_ACL=y
# CONFIG_XFS_FS is not set
# CONFIG_OCFS2_FS is not set
# CONFIG_MINIX_FS is not set
CONFIG_ROMFS_FS=m
CONFIG_INOTIFY=y
# CONFIG_QUOTA is not set
CONFIG_DNOTIFY=y
CONFIG_AUTOFS_FS=m
CONFIG_AUTOFS4_FS=m
CONFIG_FUSE_FS=m
Last edited by dwhitney67; 12-04-2007 at 11:17 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.