# custom initramfs for dmraid

## neybis

so i used 'genkernel --dmraid all' to build my kernel and get it to boot and then edited the config file to my liking. however, because I have to use genkernels initramfs to boot my raid0 it has been loading what appears to be every driver it can in search for my raid setup.

what I am looking to do is build a custom initramfs that will use dmraid to mount my root partition using only what is necessary (i don't believe it needs to do anything more). i have gone over gentoo's guide for making your own initramfs and not gotten very far (dmraid can't find libdevmapper) and I'm not sure im evening going in the right direction. i have had no issues yet but I am booting genkernels initramfs but also built in a initramfs into the kernel for loading my framebuffer. Maybe this could all be combined into one? advice??

----------

## neybis

so I am using raidautorun and mdev but am getting an error from raidautorun saying /dev/mapper/isw_bajdhehehh_RAID0 device cannot be found even tho I copied it with the -a argument into the initramfs's dev. I had no md0 so I thought this is what I was supposed to use. any help from the gentoo community?

----------

## neybis

bump

...no one here knows anything about initramfs??

----------

## NeddySeagoon

neybis,

First, a little advice.  Don't respond to your own first post in a thread. That takes the thread out of the search for unanswered posts search so you lose a lot of potential helpers.  If you have more to add, edit the post instead.

You are stuck with an initrd as you are using fake raid and you can't build the fake raid driver into the kernel.

When you use 

```
genkernel --dmraid all
```

you use the generic genkernel config file, which includes almost every kernel module known to Linus. There is no hardware detecion science involved.  You can use your own .config by using genkernels --oldconfig option (check that option name, I've never used genkernel. 

Your /dev/mapper/isw_bajdhehehh_RAID0 /dev/ node must exist in two places. In the initrd and in your real /dev as it will be after the piviot_root.

How did you determine you have an initrd problem?

----------

## neybis

For starters, thank you. I was unaware of being able to search for unanswered posts and will take your advice.

On the record, the option is --kernel-config=<file> and it worked beautifully. Used the config file I wanted and made an initramfs that will mount root with nearly nothing to do so.

I determined that I had an initrd problem because of the fact that my system boots fine whenever I use genkernels initramfs but when i use my own raidautorun errored when runnin the init script.

Again, thank you as you have helped me greatly. You have left me wondering however, what disadvantages am I at using genkernel. If I specify the .config file all I am really using genkernel for is the initramfs, right? I imagine if it was any different I could always make && make modules_install a new kernel from the .config file and move the kernel image to boot but is any of this even necessary?

----------

## NeddySeagoon

neybis,

When you give genkernel a config file, all you are using it for is to build and install the kernel and the initrd.

Tha hard part in all of this is getting the config file the way you like it.

genkernel, without the --kernel-config=<file> producues a very bloated run everywhere kernel. Its not the kernel file itself thats bloaed, its all the modules.

They take up disk space and use compile time. Its also made for the lowest common denominater CPU.  That i486 if you have a x86 install.

----------

