# EFI Stub and initrd

## JumboAg

I'm booting Gentoo in an EFI environment using the EFI Stub option in my kernel.

It works great, but there's one thing I have never been able to figure out how to make work.   I'd like to load an initrd image to fire off my fbcondecor decorations earlier in the boot process.  (I know I can just enable the decorations by putting fbcondecor in runlevel default, but I'm a bit OCD.  I REALLY want to figure this one out.)

My normal built-in kernel command line entry is very basic:  "ro root/dev/sda3"

Works great, lasts long time.

I want to call an initrd on the same line and just cant get the syntax right so it launches the console decorations.

I know for a start its going to be the same as before, so:

ro root=/dev/sda3

Add in "splash=verbose,theme=Linux console=tty1"  (The generic entry for the decoration I want to use)

I called my initramfs file that contains the image initrd.img and put it in /boot/efi/EFI/gentoo.

I've tried backslashes,  no absolute directories, forward slashes,  basically every combo I can think of, but none execute the initrd file.

Any suggestions would be greatly appreciated.

BTW, my EFi boot manager is "refind" [a fantastic refit fork that another poster on these boards maintains.  Its creator is the person that more than anyone got EFI boot working for me originally.] so its not a limitation of my EFI mgr.

----------

## s4e8

from kernel Documentation/x86/efi-stub.txt *Quote:*   

> 
> 
>       fs0:\Kernels> bzImage.efi initrd=\Kernels\initrd-large.img
> 
> 

 

----------

## stevenylai

According to the refind.conf on my computer, a sample linux entry with initramfs should look like:

menuentry Linux {

        icon EFI/refind/icons/os_linux.icns

        volume KERNELS

        loader bzImage-3.3.0-rc7

        initrd initrd-3.3.0.img

        options "ro root=UUID=5f96cafa-e0a7-4057-b18f-fa709db5b837"

}

So I suppose you can try adding the line below?

initrd initrd.img

----------

## Hu

Why not just embed the initramfs into the kernel?  That would make it available without any tinkering with the bootloader.

----------

## WorBlux

https://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob_plain;f=Documentation/x86/efi-stub.txt;hb=HEAD

use backslashes, and the path should be the absolute path from the root of the efi partition.

----------

## srs5694

As others have said, you need to use backslashes and an absolute path relative to the root of whatever filesystem holds the kernel (it looks like the ESP in your case).

That said, if you're using rEFInd, and if you're using its auto-detection to find your kernel, this shouldn't be necessary. Place the initrd file in the same directory as the kernel, be sure it has a name that begins with "init", and be sure its filename contains the same version string as the kernel, and rEFInd should auto-detect the initrd file and pass it as an option. In my own use, this fails only if I make a mistake, such as using the wrong version string on one file or the other. (Note that rEFInd defines the "version string" as the part of the filename from the first digit to the last digit, so if your kernel is called "bzImage-x86_64-3.7.4", the version string is "86_64-3.7.4", and the initrd filename must contain that string and no other digits.)

----------

