[Bug 1097570] Re: grub2-signed can not find the right device when there are two filesystems containing the file '.disk/info'.

Mathieu Trudel-Lapierre mathieu.tl at gmail.com
Tue May 26 17:13:20 UTC 2015


Indeed you can use BootCurrent (or, as grub already provides that, use
$cmdpath or some variation of it) to specify the right device as a basis
for where to search for the files.

Rather than simply using search --file --set=root /.disk/info; I think
we can make use of hints to specify where to search first. I've
experimented with this over the past few days and it looks like it works
properly. I've also prepared a patch to grub to provide an extra
environment variable "$bootdrive" that would include just the disk
specification for the device used for the EFI booting -- in other words,
while $cmdpath contains the full path to the directory containing the
EFI binaries used to boot ((hd2,gpt2)/EFI/ubuntu); it would contain just
the drive without partition specification (hd2 in the same example).

Then, 'search --file --hint=$bootdrive --set=root /.disk/info' appears
to return the right paths according to my tests.

I've sent the patch upstream (waiting to see that it was indeed received
on the mailing list), and I'll do one final run of testing to make sure
this behaves properly before considering an upload first to the current
development release (since it does appear to be reproducible there
still).

** Changed in: grub2 (Ubuntu)
     Assignee: Colin Watson (cjwatson) => Mathieu Trudel-Lapierre (mathieu-tl)

** Changed in: grub2 (Ubuntu)
       Status: Confirmed => In Progress

** Changed in: grub2 (Ubuntu Trusty)
       Status: Confirmed => Triaged

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

Title:
  grub2-signed can not find the right device when there are two
  filesystems containing the file '.disk/info'.

Status in OEM Priority Project:
  Triaged
Status in OEM Priority Project precise series:
  Won't Fix
Status in OEM Priority Project trusty series:
  Confirmed
Status in grub2 package in Ubuntu:
  In Progress
Status in grub2 source package in Precise:
  Triaged
Status in grub2 source package in Raring:
  Invalid
Status in grub2 source package in Trusty:
  Triaged

Bug description:
  SRU justification:

  [Impact] When using UEFI, GRUB doesn't always determine the correct boot device to chain to if multiple Ubuntu bootable media are attached.
  [Test Case] Described below.
  [Regression Potential] When I fixed this in saucy, I made a mistake that broke UEFI Secure Boot (fixed in 2.00-18ubuntu4).  I made sure to cherry-pick that fix as well here, but it's worth testing both paths.

  Original report follows:

  * Ubuntu 12.04.2 LTS "Precise Pangolin" - Release amd64 (20130108)
  precise-desktop-amd64.iso from http://cdimage.ubuntu.com/precise/daily-live/current/ .

  * Package Version
  grub2-signed 1.9~ubuntu12.04.2+1.99-21ubuntu3.7

  * Reproduce Steps
  1. Use `usb-creator-gtk` to create a bootable USB drive by precise-desktop-amd64.iso
  2. Use this USB drive to boot "Try Ubuntu without installing" on an UEFI secure boot enabled laptop.
  3. Create only one 1GB primary fat32 partition on the disk of the laptop with GPT-based disk layout.
  4. Mount fat32 partition on /mnt
      $ sudo mount /dev/sda1 /mnt
  5. Manually copy all contents from the USB stick into the fat32 partition.
      $ sudo cp -av /cdrom/.disk /cdrom/* /mnt
  6. Set up the EFI boot entry.
      $ sudo apt-get install efibootmgr grub-efi-amd64-signed shim-signed
      $ sudo grub-install --removable --uefi-secure-boot --root-directory /mnt /dev/sda1
      $ sudo efibootmgr -c -d /dev/sda -p 1 -l "\\EFI\\BOOT\\BOOTx64.EFI" -L recovery
  7. Append 'from recovery partition' to every menuentry title in /mnt/boot/grub/grub.cfg .
  8. Reboot and select the boot entry 'recovery' from UEFI boot option menu.

  * Expected Result
  We can see every menu entry of grub with the suffix 'from recovery partition'.

  * Actual Result
  There is no suffix 'from recovery partition' on menu entries of grub.

  P.S. The USB drive is still plunged in the laptop. After we unplug the
  USB drive and select the boot entry 'recovery' from UEFI boot option
  menu, we can see every menu entry of grub with the suffix 'from
  recovery partition'.

To manage notifications about this bug go to:
https://bugs.launchpad.net/oem-priority/+bug/1097570/+subscriptions



More information about the foundations-bugs mailing list