# Forcing re-compile of initramfs?

## PeeJay

How do I force a recompile of everything that goes into the initramfs (using genkernel-next)? Have have changed my system from an intel to amd cpu.

I recompiled @world and the kernel in advance, but forgot about the initramfs, so I'm getting a kernel panic. I managed to work around the issue by using another machine with less aggressive compiler flags to build the same kernel, but I'd like to fix it.

I've looked everywhere but I can't find where the files are cached. 

Would it be considered a bug with genkernel that there is no command option to totally recreate the initramfs?

Thanks.

----------

## DONAHUE

think this should do it:

genkernel --mrproper all 

reference:  https://wiki.gentoo.org/wiki/Genkernel#Options

----------

## Zucca

There are man pages and --help too.

```
Gentoo Linux Genkernel 64

Usage: 

  genkernel [options] action

Available Actions: 

  all               Build all steps

  bzImage           Build only the kernel

  initramfs         Build only the ramdisk/initramfs

  kernel            Build only the kernel and modules
```

----------

## John R. Graham

Well it depends on whether you mean to rebuild the initramfs or recompile everything in it. Rebuilding it is a simple genkernel built-in command:

```
genkernel initramfs
```

but this doesn't rebuild the executables in the initramfs. Genkernel builds those but caches the binaries in /var/cache/genkernel. Erasing the contents of that directory (no need to erase its subdirectories) will force Genkernel to recompile them:

```
rm /var/cache/genekernel/*

genkernel initramfs
```

@DONAHUE,  --mrproper will not erase this cache and also causes the recompile of the whole kernel, something the OP didn't ask for.

- John

----------

## DONAHUE

Thanks.

----------

## PeeJay

 *John R. Graham wrote:*   

> 
> 
> ```
> rm /var/cache/genekernel/*
> ```
> ...

 

That was what I needed. Thanks!

----------

