# eMMC support in initramfs

## 352310

Hello there, I just joined the forum, and this question is why.

I was just wondering if there was a way to add drivers/kernel modules to genkernel-next, because when I use the generated image, when I boot it asks me for the location of my device(because it can't find it), and if i drop to a shell, I can see that there are no mmc devices(using 'ls /dev').

This is a Chromebook (Thinkpad 11e aka. GLIMMER), so installing to eMMC or an SD card are my only choices. Also, when I use dracut, and specify the drivers(mmc_block, sdhci, mmc_core, etc) with --drivers="a b c", after a few minutes it gives me the message repeatedly "dracut-initqueue[204]: Warning: dracut-initqueue timeout - starting timeout scripts" about every .5 secs. After, it drops me to a shell.

If I type 'ls /dev' it blanks the screen and I have no idea what is going on. So I either need a way to fix dracut to work or a way to include kernel drivers/modules into my initramfs.

Also it kernel panics within ~.5s if I specify no initramfs.

~Thanks in Advance~  :Smile: 

----------

## NeddySeagoon

352310,

Welcome to Gentoo.

Can't you build Gentoo on a USB drive?

SD cards will be very slow.

genkernel builds a fully modular kernel.  With no initrd., it has no way to mount the root filesystem.

If you run genkernel with the menuconfig option, you can fine tune the kernel options before its built.

You can also save the .config and use it as genkernels default .config for next time.

----------

## 352310

 *Quote:*   

> Can't you build Gentoo on a USB drive?
> 
> SD cards will be very slow.

 

Yes, but I would much prefer to leave one of my two ports open for devices and the similar(also its not very convenient to have to do that, since this is a laptop), and I have an SD card slot, witch I would be using for storage/games, and a 16GB eMMC(Soldered to Motherboard of laptop) that would be for OS only. Right now I am only worried about the eMMC drive.

 *Quote:*   

> genkernel builds a fully modular kernel. With no initrd., it has no way to mount the root filesystem.

 

I don't have a seperate /boot partition, but I doubt that is an issue, because Grub2 is able to find the initrd and kernel just fine, but can't mount /dev/mmcblkp2, probably due to the initrd missing a driver(mmc_block, mmc_core). With dracut, I can include these using --drivers="mmc_block mmc_core", and they are included. Is there a way to do this with genkernel. Just to be clear, I am using genkernel-next. It IS loading the initramfs, but is missing the kernel drivers needed to find the root partition, and prompts me to mount it.

 *Quote:*   

> If you run genkernel with the menuconfig option, you can fine tune the kernel options before its built. 

 

Again, I doubt it is a kernel issue, and an issue with the initramfs missing a driver. I'll keep trying, and let you know if I come up with anything

~Thanks in Advance~  :Smile: 

----------

## szatox

You say you included the necessary modules with a Dracut's command line option, but it doesn't work, do I get it right?

So... First thing is, when you get to the shell, make sure those modules really are there and they get loaded.

Kernel modules are typically stored under /lib/modules/$(uname -r)

You can list loaded modules with lsmod.

And you can load and unload modules with modprobe <module> and rmmod <module> commands.

Regarding genkernel, it has an option --all-ramdisk-modules, this may be handy (if it works - I had some problems with it).

You can also launch genkernel with --oldconfig --menconfig to load already present .config and then modify it with a convenient text-mode GUI-like app. Good stuff, you can use it to build drivers needed at boot into the kernel so you wouldn't need initrd anymore.

----------

## NeddySeagoon

352310,

I wasn't clear.  You build Gentoo on the USB device and do a binary install from USB to some internal media, so you don't need the USB device to run Gentoo. It saves a lot of space.  My 2009 Netbook with an 8G SSD is operated this way. A desktop install fits into 6.5Gb.

If you want to you can use cross distcc to help with the building, so say, your desktop does all the hard work. Anyway, that's bye the by.

You appear to misunderstand the boot process.  At the outset, some very simple loader built into firmware loads the first part of grub.

The first part of grub loads the rest of grub, which shows you your boot menu.

When you make your choice, grub loads the kernel and optionally, the initrd.  Grub makes its own arrangements to read these files. It can't use the kernel as its whole purpose is to load the kernel.

Once the kernel and initrd are loaded, grub jumps to the kernel start address.  What happens next is up to the kernel.

Grub is gone, its done its stuff. Its just the kernel and initrd in RAM and the kernel has control.  If those two things between them cannot mount root, its game over.

None of the initrd builders will add kernel modules into the initrd that you did not choose in the kernel.

Its your problem to choose the right kernel modules to mount root.  That grub can read your filesystem but the kernel cannot, confirms that grub has all the (grub) modules it needs but the kernel is missing (kernel) modules.

The words in brackets just emphasise that these modules are not related.

----------

## steveL

ISTM the OP just wants to add some built-in modules to the kernel config for genkernel.

How does one do that?

----------

## NeddySeagoon

steveL,

Pass genkernel the -menuconfig option.

----------

## steveL

Thanks Neddy.

Ah, I see it now (ed):  *szatox wrote:*   

> You can also launch genkernel with --oldconfig --menuconfig to load an already present .config and then modify it with a convenient text-mode GUI-like app.

 

Presumably that's running make nconfig?

----------

## NeddySeagoon

steveL,

I've never used genkernel.

----------

