On Wed, May 10, 2017 at 08:35:28PM +0200, Patrick Wildt wrote: > On Wed, May 10, 2017 at 03:14:30PM +0200, Stefan Sperling wrote: > > On Tue, May 09, 2017 at 09:47:14PM +0200, Michele Curti wrote: > > > bios_bootdev = 0x80; > > > - efi_bootdp = dp0; > > > + efi_bootdp = dp; > > > break; > > > } > > > } > > > > > > > I don't think this is the correct fix. It might solve your issue, but I > don't think it's completely right. So EFI has those so called device > paths. A path is basically a list of nodes. To compare two paths you > need to compare the whole path and not just a single node of it. If you > store dp instead of dp0 you will basically only save a part of the path, > not the full path. > > What you can do is print the full path of efi_bootdp like.. > > for (dp = efi_bootdp; !IsDevicePathEnd(dp); > dp = NextDevicePathNode(dp)) { > printf("%x %x - ", DevicePathType(dp), DevicePathSubType(dp)); > } > printf("\n"); >
4e 6f - 5f 2d - 22 4e - 4e 55 - 3a 48 - 1e ce - and many others ........ I got the same values starting the for loop with dp = dp0 or dp = NULL So dp0 was not intialized by the EFI_CALL() above? if (status == EFI_SUCCESS) status = EFI_CALL(BS->HandleProtocol, imgp->DeviceHandle, &devp_guid, (void **)&dp0); if (status == EFI_SUCCESS) { I'm going to study a bit about EFI.. :p Thanks, Michele > And do the same for the DPs that are being put into the > efi_device_path_cmp function. That will at least print the types, but > not the content of the nodes. That's a start into figuring out why it > does not correctly compare the paths. > > Maybe there's a bug in the compare code?