[Bug 2052382] [NEW] [os-prober] microcode still in grub.cfg after first update-grub

Alban Ponche 2052382 at bugs.launchpad.net
Sun Feb 4 14:30:45 UTC 2024


Public bug reported:

If you install microcode-initrd and then remove it, after the FIRST
update-grub, reference to microcode.cpio. but /boot/microcode.cpio don't
exists anymore, causing boot failure.

This problem only occure when using os-prober AND having SUBMENU enabled
in grub.

This is due to use of /usr/lib/linux-boot-probes/mounted/40grub2, in os-
prober, wich use grub.cfg, but when update-grub run, it's grub.cfg.new
which is the new reference.

I propose managing grub.cfg.new in 40grub2 :

<code>
96c96,101
< if [ -e "$mpoint/boot/grub/grub.cfg" ] && \
---
> # If fresh grub.cfg.new exists, we where in update-grub/grub-mkconfig generation cycle
> GRUB_NEW=$(find ${mpoint}/boot/grub/ -maxdepth 1 -type f -name grub.cfg.new -mmin -5 || true)
> if [ -n "${GRUB_NEW}" ];then
> 	debug "parsing grub.cfg.new"
>         parse_grub_menu "$mpoint" "$partition" "$bootpart" < "$mpoint/boot/grub/grub.cfg.new"
> elif [ -e "$mpoint/boot/grub/grub.cfg" ] && \
<code>

** Affects: os-prober (Ubuntu)
     Importance: Undecided
         Status: Confirmed


** Tags: grub-mkconfig grub2 os-prober update-grub

** Patch added: "Patch file"
   https://bugs.launchpad.net/bugs/2052382/+attachment/5744546/+files/40grub2.patch

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to os-prober in Ubuntu.
https://bugs.launchpad.net/bugs/2052382

Title:
  [os-prober] microcode still in grub.cfg after first update-grub

Status in os-prober package in Ubuntu:
  Confirmed

Bug description:
  If you install microcode-initrd and then remove it, after the FIRST
  update-grub, reference to microcode.cpio. but /boot/microcode.cpio
  don't exists anymore, causing boot failure.

  This problem only occure when using os-prober AND having SUBMENU
  enabled in grub.

  This is due to use of /usr/lib/linux-boot-probes/mounted/40grub2, in
  os-prober, wich use grub.cfg, but when update-grub run, it's
  grub.cfg.new which is the new reference.

  I propose managing grub.cfg.new in 40grub2 :

  <code>
  96c96,101
  < if [ -e "$mpoint/boot/grub/grub.cfg" ] && \
  ---
  > # If fresh grub.cfg.new exists, we where in update-grub/grub-mkconfig generation cycle
  > GRUB_NEW=$(find ${mpoint}/boot/grub/ -maxdepth 1 -type f -name grub.cfg.new -mmin -5 || true)
  > if [ -n "${GRUB_NEW}" ];then
  > 	debug "parsing grub.cfg.new"
  >         parse_grub_menu "$mpoint" "$partition" "$bootpart" < "$mpoint/boot/grub/grub.cfg.new"
  > elif [ -e "$mpoint/boot/grub/grub.cfg" ] && \
  <code>

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/os-prober/+bug/2052382/+subscriptions




More information about the foundations-bugs mailing list