# New initramfs after every kernel config change?

## greanie

Sorry for the total n00bie question but do I have to generate a new initramfs after every change in the kernel (I use menuconfig / make && make modules_install)?

Thanks!

----------

## khayyam

greanie ...

generally, no. It somewhat depends on what the initramfs is doing ... or rather how it was created, but mostly the initramfs is generic enough to provide all thats need to do whats necessary to have the system in a ready enough state to boot.

The bootloader will obviously need to point to this initramfs.gz, and some bootloader configurations are designed to look for a initramfs.gz that is named to match the kernel version (I'm fairly sketchy on this, but I know of one that does this by default).

best ... khay

----------

## frostschutz

If your initramfs contains modules, it may have to be updated for modules (depends on your config change, if you changed something previously builtin to module). If it's generated automatically anyway, it's safer to just run the thing just in case.

A module-free initramfs works with any kernel that has the necessary drivers builtin. You might not ever have to change it provided old versions of lvm/cryptsetup/... are what you want to use to get things going.

----------

## greanie

Ok, another dump question, how do I know if my initramfs has modules?  My kernel has a few packages installed as modules.  Does that mean my initramfs will also have packages installed as modules?  Is my initramfs just a copy of the kernel but configured to run in RAM?

----------

## khayyam

greanie ...

You haven't said how this initramfs was created, only that you 'make && make modules_install' (so I assume your not using genkernel). As I said above it depends on what the initramfs is doing, and what you have, or don't have, enabled in the kernel. If something is required to boot then you could build this into the kernel rather than as a module, this way the initramfs will have whatever is needed.

For an example of an initramfs that can be used with various kernels without having to rebuild the initramfs see better-initramfs.

HTH & best ... khay

----------

