Partial device paths not properly handled by Bds

Bug #1304442 reported by Mark Salter
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Linaro UEFI
Fix Released
Critical
Leif Lindholm

Bug Description

Boot entries created by efibootmgr may contain a partial device path
to the EFI application to boot. These entries begin with a partition
device path whereas entries created via ARM Boot Manager contain a
full path to the EFI application. The ARM BDS code will fill in the
missing parts of this partial device path as it does for removeable
device paths. This allows the application to be loaded and started.
However, the current code passes the original partial device path to
gBS->LoadImage() and thus LoadImage is unable to find a DeviceHandle
for the path. This means the application being booted cannot find the
boot device from the Loaded Image Protocol structure. In the case of
grub, this prevents the grub config file from being found. This patch
fixes this by making sure the full path is propagated back to the
caller of gBS->LoadImage() so that a proper DeviceHandle is passed
to the application being booted.

Revision history for this message
Mark Salter (msalter) wrote :
Revision history for this message
Leif Lindholm (leif-lindholm) wrote :

Note to self: check with ARM, but include this patch in 2014.05 if no upstream fix available in time.

Changed in linaro-uefi:
status: New → Confirmed
assignee: nobody → Leif Lindholm (leif-lindholm)
importance: Undecided → Critical
Revision history for this message
Fu Wei (fu-wei) wrote :
Revision history for this message
Leif Lindholm (leif-lindholm) wrote :

The failure in build 18 is not the same as the one reported.
With a clean boot menu (i.e. no fallbacks), the output when rebooting is:
---
The default boot selection will start in 1 seconds
ERROR: Did not find Device Tree blob.
[1] grub
[2] Linaro disk image on virtio
[3] Shell
[4] Boot Manager
Start:
---

Revision history for this message
Fu Wei (fu-wei) wrote :

I tested this again, the bug is still present
Test steps:
(1)boot into shell by startup.nsh
(2)"mkdir -p /boot/efi", "mount /dev/vda1 /boot/efi", "grub-install", "sync", "umount /dev/vda1"
(3)reboot into uefi, [1] grub, fail
(4)Add a entry manually(using "\"), boot successfully

Revision history for this message
Leif Lindholm (leif-lindholm) wrote :

Problem identified:
Patch cdc36d513 - "MdeModulePkg/PartitionDxe: hack MBR unique signature to zero" - corrupts the stored device path and causes GRUB not to be found. Verified by reverting this patch from linaro-edk2-2014.06-a1.
Will be fixed in 2014.06.

Changed in linaro-uefi:
status: Confirmed → Fix Committed
milestone: none → 14.06
Revision history for this message
Fu Wei (fu-wei) wrote :

I just tested the linaro-edk2-2014.06-a2, this bug has been fixed.

now we can add boot entries for
(1) GRUB : grub-install
(2) Linux kernel :
echo "console=ttyAMA0 earlyprintk=pl011,0x1c090000 debug user_debug=31 loglevel=9 root=/dev/vda2 rootwait rw"| iconv -f ascii -t ucs2 |efibootmgr -c -d /dev/vda -l Image --part 1 --label "LEG kernel " --append-binary-args -

After that , we can reboot the FVP model and then the model will boot into GRUB or Linux automatically

Ilias Biris (ibiris)
Changed in linaro-uefi:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.