Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Howto get rid of early_ucode.cpio safely?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
EasterParade
l33t
l33t


Joined: 26 Jul 2003
Posts: 938

PostPosted: Mon Dec 03, 2018 12:41 pm    Post subject: Howto get rid of early_ucode.cpio safely? Reply with quote

In January I decided to install intel microcode using this guide
https://wiki.gentoo.org/wiki/Intel_microcode
Recently I have had boot hang-ups on loading ramdisc forcing me to shutdown
and boot up again with the help of power button. Booting works on second try.
Now that I have made "new" recommended kernel linux-4.14.83 I decided to clean up,
remove "old" stale kernel images and their accompanying files from boot and at the same
time the ucode.
Instead I might consider flashing UEFI with the latest BIOS file from Asus that addresses the
processor vulnerability known as Spectre & Meltdown.

How do I go about removing early_ucode.cpio without rendering the system unbootable?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54234
Location: 56N 3W

PostPosted: Mon Dec 03, 2018 1:08 pm    Post subject: Reply with quote

transsib,

If early_ucode.cpio isn't there, it won't be loaded.
Flashing the BIOS is risky. I would stick with early_ucode.cpio rather than do that.

BIOS update failures can 'brick' your device.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
EasterParade
l33t
l33t


Joined: 26 Jul 2003
Posts: 938

PostPosted: Mon Dec 03, 2018 1:29 pm    Post subject: Reply with quote

early_ucode.cpio is there and gets listed by grub-mkconfig -o /boot/grub/grub.cfg command every time
I call it.

Why do I get boot hangs while loading the initrd? According to the wiki I do not have to have an entry in
/etc/default/grub. It gets loaded automatically.

The wiki offers another method, a new one at the bottom of the page: it involves changes in kernel, in Processor types and features
and in Device Drivers, Generic driver options.

What do you think about that?

And if I switch to the aformentioned method with kernel firmware blob how do I remove the initramfs then; they could collide?


Last edited by EasterParade on Tue Dec 04, 2018 4:41 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54234
Location: 56N 3W

PostPosted: Mon Dec 03, 2018 1:41 pm    Post subject: Reply with quote

transsib,

Grub tells you
Code:
Loading kernel ...
Loading initrd ...

After that, it jumps to the kernel entry point.

If the boot process is really hanging while the initrd is loading, its a problem with grub.

If the last message you see is Loading initrd ... the boot process has gone wrong later but you don't know where.
It might even be booting properly but without a console. Can you ssh in later?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
EasterParade
l33t
l33t


Joined: 26 Jul 2003
Posts: 938

PostPosted: Mon Dec 03, 2018 1:45 pm    Post subject: Reply with quote

Quote:
It might even be booting properly but without a console. Can you ssh in later?

Since everything stops there and then with a non flashing bar underneath I have to assume
that the boot process does not complete whether I can see it or not.
If I wanted to ssh into it let´s say a minute later I would have to call another console but
no input signals from keyboard do anything when the hang happens.
And it only happens once or twice at the most. Next time I boot booting completes just fine
and of course visible until it reaches login.
My grub.cfg:
Code:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ba4f28a1-af32-48cc-8664-bdebc6fdad34
else
  search --no-floppy --fs-uuid --set=root ba4f28a1-af32-48cc-8664-bdebc6fdad34
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=1920x1080x32
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=de_DE
  insmod gettext
fi
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-ba4f28a1-af32-48cc-8664-bdebc6fdad34' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ba4f28a1-af32-48cc-8664-bdebc6fdad34
        else
          search --no-floppy --fs-uuid --set=root ba4f28a1-af32-48cc-8664-bdebc6fdad34
        fi
        echo    'Linux 4.16.11-gentoo wird geladen …'
        linux   /boot/vmlinuz-4.16.11-gentoo root=/dev/sda2 ro root=/dev/sda2
        echo    'Initiale Ramdisk wird geladen …'
        initrd  /boot/early_ucode.cpio
}
submenu 'Erweiterte Optionen für Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-ba4f28a1-af32-48cc-8664-bdebc6fdad34' {
        menuentry 'Gentoo GNU/Linux, mit Linux 4.16.11-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.16.11-gentoo-advanced-ba4f28a1-af32-48cc-8664-bdebc6fdad34' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                set root='hd0,gpt2'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ba4f28a1-af32-48cc-8664-bdebc6fdad34
                else
                  search --no-floppy --fs-uuid --set=root ba4f28a1-af32-48cc-8664-bdebc6fdad34
                fi
                echo    'Linux 4.16.11-gentoo wird geladen …'
                linux   /boot/vmlinuz-4.16.11-gentoo root=/dev/sda2 ro root=/dev/sda2
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/early_ucode.cpio
        }
        menuentry 'Gentoo GNU/Linux, mit Linux 4.16.11-gentoo (Wiederherstellungsmodus)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.16.11-gentoo-recovery-ba4f28a1-af32-48cc-8664-bdebc6fdad34' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                set root='hd0,gpt2'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ba4f28a1-af32-48cc-8664-bdebc6fdad34
                else
                  search --no-floppy --fs-uuid --set=root ba4f28a1-af32-48cc-8664-bdebc6fdad34
                fi
                echo    'Linux 4.16.11-gentoo wird geladen …'
                linux   /boot/vmlinuz-4.16.11-gentoo root=/dev/sda2 ro single root=/dev/sda2
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/early_ucode.cpio
        }
        menuentry 'Gentoo GNU/Linux, mit Linux 4.16.11-gentoo.old' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.16.11-gentoo.old-advanced-ba4f28a1-af32-48cc-8664-bdebc6fdad34' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                set root='hd0,gpt2'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ba4f28a1-af32-48cc-8664-bdebc6fdad34
                else
                  search --no-floppy --fs-uuid --set=root ba4f28a1-af32-48cc-8664-bdebc6fdad34
                fi
                echo    'Linux 4.16.11-gentoo.old wird geladen …'
                linux   /boot/vmlinuz-4.16.11-gentoo.old root=/dev/sda2 ro root=/dev/sda2
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/early_ucode.cpio
        }
        menuentry 'Gentoo GNU/Linux, mit Linux 4.16.11-gentoo.old (Wiederherstellungsmodus)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.16.11-gentoo.old-recovery-ba4f28a1-af32-48cc-8664-bdebc6fdad34' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                set root='hd0,gpt2'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ba4f28a1-af32-48cc-8664-bdebc6fdad34
                else
                  search --no-floppy --fs-uuid --set=root ba4f28a1-af32-48cc-8664-bdebc6fdad34
                fi
                echo    'Linux 4.16.11-gentoo.old wird geladen …'
                linux   /boot/vmlinuz-4.16.11-gentoo.old root=/dev/sda2 ro single root=/dev/sda2
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/early_ucode.cpio
        }
        menuentry 'Gentoo GNU/Linux, mit Linux 4.14.83-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.14.83-gentoo-advanced-ba4f28a1-af32-48cc-8664-bdebc6fdad34' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                set root='hd0,gpt2'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ba4f28a1-af32-48cc-8664-bdebc6fdad34
                else
                  search --no-floppy --fs-uuid --set=root ba4f28a1-af32-48cc-8664-bdebc6fdad34
                fi
                echo    'Linux 4.14.83-gentoo wird geladen …'
                linux   /boot/vmlinuz-4.14.83-gentoo root=/dev/sda2 ro root=/dev/sda2
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/early_ucode.cpio
        }
        menuentry 'Gentoo GNU/Linux, mit Linux 4.14.83-gentoo (Wiederherstellungsmodus)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.14.83-gentoo-recovery-ba4f28a1-af32-48cc-8664-bdebc6fdad34' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                set root='hd0,gpt2'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ba4f28a1-af32-48cc-8664-bdebc6fdad34
                else
                  search --no-floppy --fs-uuid --set=root ba4f28a1-af32-48cc-8664-bdebc6fdad34
                fi
                echo    'Linux 4.14.83-gentoo wird geladen …'
                linux   /boot/vmlinuz-4.14.83-gentoo root=/dev/sda2 ro single root=/dev/sda2
                echo    'Initiale Ramdisk wird geladen …'
                initrd  /boot/early_ucode.cpio
        }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (auf /dev/sdb3)' --class windows --class os $menuentry_id_option 'osprober-efi-250A-E7D2' {
        insmod part_gpt
        insmod fat
        set root='hd1,gpt3'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3  250A-E7D2
        else
          search --no-floppy --fs-uuid --set=root 250A-E7D2
        fi
        chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###


Looks like it should never fail.
Back to top
View user's profile Send private message
EasterParade
l33t
l33t


Joined: 26 Jul 2003
Posts: 938

PostPosted: Mon Dec 03, 2018 4:56 pm    Post subject: Reply with quote

I am dense: you meant ssh from another system in the network.
No I haven´t.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54234
Location: 56N 3W

PostPosted: Mon Dec 03, 2018 6:28 pm    Post subject: Reply with quote

transsib,

I'll guess the last message you see is
Code:
'Initiale Ramdisk wird geladen …'

If you comment out the
Code:
initrd  /boot/early_ucode.cpio
then the microcode updater won't find any microcode to work with and will do nothing except report the current version.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
EasterParade
l33t
l33t


Joined: 26 Jul 2003
Posts: 938

PostPosted: Mon Dec 03, 2018 7:22 pm    Post subject: Reply with quote

NeddySeagoon wrote:

Quote:
If you comment out the
Code:
initrd /boot/early_ucode.cpio
then the microcode updater won't find any microcode to work with and will do nothing except report the current version.


Ok, but I cannot comment it out because this is the grub.cfg that gets written by
grub-mkconfig -o /boot/grub/grub.cfg command.
Or is is possible to just manually edit it ?

I will have to shut down the box soon. May be I am lucky with the new kernel.
I might read up on the subject in the wiki again.
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1791

PostPosted: Mon Dec 03, 2018 7:39 pm    Post subject: Reply with quote

For a stop-gap test, yes commenting out the line in the grub.cfg would work (as that is what grub loads). Once you verify it works and doesn't break anything, then you can see about where the initrd line is coming from in your /etc/grub.d and comment it out there. Once you remove it from being a thing in your grub.d directory, the grub-mkconf won't be an issue. In the mean time, just making the change in the grub.cfg makes it a easy test with little to no harm (you can easily enough just do grub-mkconf to undo any changes).
Back to top
View user's profile Send private message
EasterParade
l33t
l33t


Joined: 26 Jul 2003
Posts: 938

PostPosted: Tue Dec 04, 2018 10:12 am    Post subject: Reply with quote

Apparently no action is required any more.
This only happens with linux-14.16.11 that I ran until yesterday.
Kernel 4.14.83 helped get audio via displayport working but obvioulsy
eliminated the boot stop on loading initial ramdisc for microcode as well.
If this message shows that microcode version is up to date
Code:
dmesg | grep microcode
[    0.000000] microcode: microcode updated early to revision 0x22, date = 2017-01-27
[    0.538655] microcode: sig=0x306c3, pf=0x2, revision=0x22
[    0.539415] microcode: Microcode Update Driver: v2.2.

then I will leave it where it is.
If not I must have forgotten to update it.
In case the boot failure appears again I now know what to do.
Thank you all
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54234
Location: 56N 3W

PostPosted: Tue Dec 04, 2018 10:51 am    Post subject: Reply with quote

transsib,

Depending on your CPU, there may be newer versions of the microcode than revision 0x22.
From the date, 2017-01-27, that's well before the Spectre/Meltdown hooha.

You should check for microcode updates as a part of your routine update cycle, just like any other package.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
EasterParade
l33t
l33t


Joined: 26 Jul 2003
Posts: 938

PostPosted: Tue Dec 04, 2018 1:24 pm    Post subject: Reply with quote

There have been a few updates. I must have failed to update early_ucode.cpio in /boot (?)

Last edited by EasterParade on Thu Dec 06, 2018 10:08 am; edited 1 time in total
Back to top
View user's profile Send private message
EasterParade
l33t
l33t


Joined: 26 Jul 2003
Posts: 938

PostPosted: Wed Dec 05, 2018 5:23 pm    Post subject: Reply with quote

cat /proc/cpuinfo
Code:
Intel(R) Xeon(R) CPU E3-1240 v3 @ 3.40GHz
microcode       : 0x22

Does anyone know which microcode version it should have by now?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54234
Location: 56N 3W

PostPosted: Wed Dec 05, 2018 7:30 pm    Post subject: Reply with quote

transsib,

The Intel Microcode Revision Guidance (August 8, 2018) tells you.
Your CPU is on Page 9 of that PDF. 0x25?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
EasterParade
l33t
l33t


Joined: 26 Jul 2003
Posts: 938

PostPosted: Thu Dec 06, 2018 9:09 am    Post subject: Reply with quote

Ok, thank you.
Code:
grep microcode /proc/cpuinfo
microcode       : 0x25
microcode       : 0x25
microcode       : 0x25
microcode       : 0x25
microcode       : 0x25
microcode       : 0x25
microcode       : 0x25
microcode       : 0x25

Looks like it worked.
Weird, I did issue update command only recently while boot was mounted.
Also with linux-4.14.83 I do not have any boot "freezes" anymore.
Gonna leave initial ramdisc where it is for now.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum