LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Gentoo (https://www.linuxquestions.org/questions/gentoo-87/)
-   -   initramfs genkernel vs custom kernel (https://www.linuxquestions.org/questions/gentoo-87/initramfs-genkernel-vs-custom-kernel-925486/)

steve_pa 01-24-2012 12:17 PM

initramfs genkernel vs custom kernel
 
Hi to everyone!

Question:
When I do the genkernel all route, a initrd file gets copied to /boot, but I notice that when I compile a custom kernel, I don't see that same file to copy. The genkernel boots fine, the custom kernel fails as "VFS: can not open root device". I suspect it is because there is no initrd file??

1. Should there be a initrd file for custom compile?
2. If so, what config is required to generate it?

I do know that the modules to mount the root fs do need to be installed built in vs modules.

My config:
MBP
VirtualBox
Host OS: os x
guest os: gentoo x86_64

any info appreciated
steve.

TobiSGD 01-24-2012 02:47 PM

You do not only need the drivers for the file system built into the kernel, but also the drivers for the storage controllers. In Virtualbox you need AHCI drivers for the virtual SATA controller, IIRC, and Intel PATA drivers for the IDE controller (you can choose the type of controller here, it can be PIIX3, PIIX4 and ICH6).
If you have all those drivers built in you shouldn't need an initrd.

Ion Silverbolt 01-24-2012 02:54 PM

You shouldn't need anything extra to boot a custom kernel. The more likely cause is maybe you forgot to add support for the SATA controller for your hard drive in your kernel config. It can be easy to overlook something. Another thing you might want to double-check for is ext4 support. It's not enabled by default when you do the custom config route.

It also could be your grub.conf file needs altered. Genkernel uses a different setup than a custom kernel does. A quick look at the manual here might help you out:

http://www.gentoo.org/doc/en/handboo...part=1&chap=10

steve_pa 01-24-2012 10:26 PM

Thanks to each responder.

I have built-in about everything related to SATA, PATA, SCSI and my two filesystems (ext2,3) available, and I still get the exact same VFS error.

Can someone clarify if I need to configure any modules as per the Handbook? Seems like if my hardware interfaces and file system configuration is built-in, then this would not seem like a cause of my problems.



Thanks
Steve.

Ion Silverbolt 01-24-2012 11:16 PM

What is the output of your grub.conf file? A difference between compiling your own and genkernel is the root appendage. Example:

Genkernel: kernel /boot/kernel-genkernel-x86-2.6.34-gentoo-r1 real_root=/dev/sda3

Self compiled: kernel /boot/kernel-2.6.34-gentoo-r1 root=/dev/sda3

If you have the real_root setting for the self compiled kernel, it will not boot. Use root=

steve_pa 01-25-2012 08:24 AM

[Solved] initramfs genkernel vs custom kernel
 
Quote:

Originally Posted by Ion Silverbolt (Post 4583733)
What is the output of your grub.conf file? A difference between compiling your own and genkernel is the root appendage. Example:

Genkernel: kernel /boot/kernel-genkernel-x86-2.6.34-gentoo-r1 real_root=/dev/sda3

Self compiled: kernel /boot/kernel-2.6.34-gentoo-r1 root=/dev/sda3

If you have the real_root setting for the self compiled kernel, it will not boot. Use root=

Ion, you were spot on! After changing it and re-installing grub, it booted. (I had used both "root=" forms, since I was not sure why it was not booting.)

At this point, I am not really sure which "exact" kernel stuff needs to be built in and which can be modularized. That is for another day.

Thanks to all.

steve_pa 01-25-2012 01:38 PM

To clarify the environment:
Macbook Pro late 2011.
Host OS X 10.7.2
virtual environment: VirtualBox 4.1.8
Guest OS: gentoo x86_64 linux-3.1.6

this post will be updated after more confirmation.

Ion Silverbolt 01-25-2012 07:17 PM

Compiling your own kernel is very rewarding once you get past all the failures. :)

As for compiling in vs. modules..Things that are critical at boot such as a SATA controller, or file system support, I find it more benificial to compile in. Otherwise, audio, video, and network drivers I think are better compiled as modules. For one, you can pass on modifications to drivers if they are built as modules.

As for the SATA example, if it's compiled as a module, you may have to add delays in booting. Otherwise you will get the error you got above because the kernel is trying to load before the module is loaded.

steve_pa 01-25-2012 07:58 PM

Quote:

Originally Posted by Ion Silverbolt (Post 4584572)
Compiling your own kernel is very rewarding once you get past all the failures. :)

As for compiling in vs. modules..Things that are critical at boot such as a SATA controller, or file system support, I find it more benificial to compile in. Otherwise, audio, video, and network drivers I think are better compiled as modules. For one, you can pass on modifications to drivers if they are built as modules.

As for the SATA example, if it's compiled as a module, you may have to add delays in booting. Otherwise you will get the error you got above because the kernel is trying to load before the module is loaded.

Ion, appreciate your great help.

AFAIK, all SATA is built-in for me.

It was not til I returned to Gentoo that I realized how much I had forgotten about Linux.

Its pretty obvious how effective the exercise of reading the doc, then editing config files, untiring, emerge-ing, to get a working Linux install, really helps in the education process!

Thanks again.
Steve.


All times are GMT -5. The time now is 11:10 AM.