# [solved] Early microcode + initamfs issues

## BlueFusion

Hey folks,

I discovered early microcode loading last night and I want to get this working on my systems.  Unfortunately I require an initramfs to load filesystem modules and run cryptsetup to decrypt multiple disks to mount rootfs.  How can this be accomplished in tandem with early_ucode.cpio ?

At this point, everything I have tried leads to a kernel panic that says it can not mount root without the initramfs.

Here is my working Grub entry:

 *Quote:*   

> title Gentoo Linux 64-bit (4.8.12)
> 
>         root (hd0,0)
> 
>         kernel /kernel-genkernel-x86_64-4.8.12-gentoo root=/dev/ram0 init=/linuxrc crypt_root=/dev/sda2 real_rootflags=ssd,acl,compress=lzo,noatime,subvol=@rootfs video=vesafb:ywrap,mtrr:3 vga=794
> ...

 

Also, I use this kernel/initramfs on multiple hosts with various CPUs, including VMs.  I see there's an option to include firmware blobs in the kernel.  Is it possible to use that method and include multiple blobs, and it will select the appropriate one?

----------

## Logicien

Have-you try to add the full path of your early_ucode.cpio file with a space at the end of 

```
initrd /initramfs-genkernel-x86_64-4.8.12-gentoo /early_ucode.cpio
```

or maybe better

```
initrd /early_ucode.cpio /initramfs-genkernel-x86_64-4.8.12-gentoo
```

You use Grub1. With Grub2 you can have several initramfs files in the same entry and the same line. All the initramfs contain that the kernel use must not conflicts with each others, no cpio files and directories lists conflicts.

----------

## BlueFusion

I did already try using multiple entries in the initrd line to no avail.  It made no difference, unfortunately.

I did discover at the bottom on this Wiki entry that the microcode blobs can be added to the kernel.  I did that, built the kernel, and booted it, however it did not update the microcode on boot.

```
CONFIG_PREVENT_FIRMWARE_BUILD=y

CONFIG_PREVENT_FIRMWARE_BUILD=y

CONFIG_FIRMWARE_IN_KERNEL=y

CONFIG_EXTRA_FIRMWARE="intel-ucode/06-0f-06 intel-ucode/06-5e-03"

CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"

# Altera FPGA firmware download module

# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set

CONFIG_FIRMWARE_EDID=y

# Firmware Drivers

CONFIG_FIRMWARE_MEMMAP=y

# CONFIG_GOOGLE_FIRMWARE is not set

# CONFIG_TEST_FIRMWARE is not set

CONFIG_MICROCODE=y

CONFIG_MICROCODE_INTEL=y

# CONFIG_MICROCODE_AMD is not set

CONFIG_MICROCODE_OLD_INTERFACE=y

```

----------

## Logicien

What output dmesg give to you about microcode? This is what I have with Gentoo-sources-4.4.26 and an Intel processor:

```
dmesg|grep -i microcode

[    0.000000] microcode: CPU0 microcode updated early to revision 0xa0b, date = 2010-09-28

[    0.002000] microcode: CPU1 microcode updated early to revision 0xa0b, date = 2010-09-28

[    1.756180] microcode: CPU0 sig=0x1067a, pf=0x1, revision=0xa0b

[    1.756188] microcode: CPU1 sig=0x1067a, pf=0x1, revision=0xa0b

[    1.756233] microcode: Microcode Update Driver: v2.01 <tigran@aivazian.fsnet.co.uk>, Peter Oruba
```

----------

## BlueFusion

I finally got a chance to play with this further today on my laptop this time.  It seems to work!

 *Quote:*   

> rich@zenith ~ $ dmesg
> 
> [    0.000000] microcode: microcode updated early to revision 0x1f, date = 2016-04-01
> 
> [    0.000000] Linux version 4.8.12-gentoo (root@zenith) (gcc version 4.9.3 (Gentoo 4.9.3 p1.5, pie-0.6.4) ) #1 SMP Wed Dec 7 20:32:15 EST 2016
> ...

 

This was performed with simply including the microcode into the kernel as extra firmware.  I included 3 separate microcode files, one for each of the 3 different CPUs I have in use among my computers that share the same kernel.

 *Quote:*   

> rich@zenith /etc/kernels $ grep -i firmware kernel-config-x86_64-4.8.12-gentoo 
> 
> CONFIG_PREVENT_FIRMWARE_BUILD=y
> 
> CONFIG_FIRMWARE_IN_KERNEL=y
> ...

 

And FWIW, the Wikipedia article I mentioned above says this seems to be a fairly new feature, likely starting with 4.8 kernel.

I'll report back when I get home again and test this kernel on my two desktops.

----------

