LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 12-02-2007, 06:38 PM   #1
phytoman
LQ Newbie
 
Registered: Mar 2004
Posts: 8

Rep: Reputation: 0
Problem booting non-initrd kernel


Hi group,

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:

#boot=/dev/hda
default=1
timeout=5
#splashimage=(hd0,0)/boot/grub/splash.xpm.gz
#hiddenmenu

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.
 
Old 12-02-2007, 07:10 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,340

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by phytoman View Post
Hi group,

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:

#boot=/dev/hda
default=1
timeout=5
#splashimage=(hd0,0)/boot/grub/splash.xpm.gz
#hiddenmenu

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

-------------------
Steve Stites
 
Old 12-02-2007, 07:48 PM   #3
phytoman
LQ Newbie
 
Registered: Mar 2004
Posts: 8

Original Poster
Rep: Reputation: 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).

So my original question remains.
 
Old 12-02-2007, 08:17 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Quote:
Originally Posted by phytoman View Post
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.
You can't - read this thread.
 
Old 12-03-2007, 08:31 AM   #5
phytoman
LQ Newbie
 
Registered: Mar 2004
Posts: 8

Original Poster
Rep: Reputation: 0
I can't? That does not compute. I have another system with a 2.4 kernel that I built that boots with no initrd.

Why would you say that the linux 2.6 kernel can't boot without it?
 
Old 12-04-2007, 12:12 AM   #6
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,541

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
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.
 
Old 12-04-2007, 10:01 AM   #7
phytoman
LQ Newbie
 
Registered: Mar 2004
Posts: 8

Original Poster
Rep: Reputation: 0
> "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?

Am I missing something?
 
Old 12-04-2007, 11:15 AM   #8
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,541

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware 12: trouble booting 2.6.21.5-smp kernel. initrd problem? ErV Slackware 8 07-07-2007 09:23 AM
initrd 'echo > /proc/suspend2/do_resume gets write error:2 when booting elie.zedeck Linux - Hardware 3 05-22-2007 09:45 PM
Booting problem, initrd Drassk Linux - Software 3 03-06-2005 01:56 PM
problems booting new initrd levicc00123 Slackware 1 10-28-2004 11:57 PM
booting vmlinuz/initrd from a bootloader bob_man_uk Linux - General 4 04-07-2004 09:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 05:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration