bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #58815] GRUB2 probe fails on MS Reserved partition


From: Vincent Yu
Subject: [bug #58815] GRUB2 probe fails on MS Reserved partition
Date: Thu, 23 Jul 2020 22:16:26 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0

URL:
  <https://savannah.gnu.org/bugs/?58815>

                 Summary: GRUB2 probe fails on MS Reserved partition
                 Project: GNU GRUB
            Submitted by: vincentyu1130
            Submitted on: Fri 24 Jul 2020 02:16:24 AM UTC
                Category: Disk &amp; Partition
                Severity: Major
                Priority: 5 - Normal
              Item Group: Software Error
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 
                 Release: other
         Discussion Lock: Any
         Reproducibility: Intermittent
         Planned Release: None

    _______________________________________________________

Details:

In my grub.cfg script for recovery boot linux, the "for dev in (*) do" loop,
probing filesystem type generates gobbles of "failed to load module because of
uefi secure boot" messages for the MS Reserved partition. This partition is
basically a reservation and contains nothing. It should fail gracefully and
return a false.

I'm on GRUB 2.04 from debian sid repository, h/w x86-64, windows 8.1 pro.

On a side note, there should be ways to probe for gpt partition types, but
this will be a new feature request.

######################
insmod regexp
set gptdevs=""
for dev in (*); do
  if regexp "\(hd[0-9],gpt[0-9]\)" $dev; then
    set gptdevs="${gptdevs} ${dev}"
  fi
done
rmmod regexp

set debfound=0
set winfound=0
set windev=""
set debdev=""
for dev in ${gptdevs}; do
  if ! probe -s fstype -f $dev; then continue; fi #assume=MS Reserved
  if [ $winfound -eq 0]; then
    if [ "$fstype" = "fat" ]; then
      if test -f $dev/EFI/Boot/bootx64.efi; then
        set windev=$dev
        set winfound=1
        if [ $debfound -eq 1]; then break; fi
        continue
      fi
    fi
  fi
  if [ $debfound -eq 0 ]; then
    if [ "$fstype" = "ext2" ]; then
      if test -f $dev/boot/vmlinuz-4.19.0-9-amd64; then
        probe -s uuid -u $dev
        set debdev=$dev
        set debfound=1
        if [ $winfound -eq 1]; then break; fi
        continue
      fi
    fi
  fi
done

if [ $debfound -eq 1]; then
menuentry "Debian 10" $debdev $uuid {
set root=$2
linux /boot/vmlinuz-4.19.0-9-amd64 root=UUID=$3 ro
initrd /boot/initrd.img-4.19.0-9-amd64
}
menuentry "Debian 10 (Single)" $devdev $uuid {
set root=$2
linux /boot/vmlinuz-4.19.0-9-amd64 root=UUID=$3 ro single
initrd /boot/initrd.img-4.19.0-9-amd64
}
fi

if [ $winfound -eq 1]; then
menuentry "Windows" $windev {
set root=$2
chainloader /EFI/Boot/bootx64.efi
}
fi

menuentry "Reboot" { reboot }
menuentry "Shutdown" { halt }
menuentry "SuperGrub Disk" { configfile "${prefix}/sgdgrub.cfg" }

###################

Vincent




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58815>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]