On Tue, Sep 04, 2018 at 05:44:07PM +0200, Jan Kiszka wrote:
> On 2018-09-03 16:09, [ext] Andreas J. Reichel wrote:
> > From: Andreas Reichel <[email protected]>
> >
> > Get the boot device out of the loaded image's handle and add a
> > function to compare a device path with the boot device's one.
> >
> > status);
> > }
> > + tmp = DevicePathToStr(DevicePathFromHandle(loaded_image->DeviceHandle));
>
> For my understanding: What is actually cut off there, ie. who does that path
> look like so that we only to cut off the last element, and there is not
> filesystem directory element remaining in it?
>
The DevicePath is pointing to the device, not to the file. That was my
argumentation all along regarding dirname/RemoveLastNodeFromDevicePath.
Since it is not just a directory.
Please read below.
> > +BOOLEAN IsOnBootDevice(EFI_DEVICE_PATH *dp)
> > +{
> > + extern CHAR16 *boot_device_path;
> > + CHAR16 *device_path, *tmp;
> > + BOOLEAN result = FALSE;
> > +
> > + tmp = DevicePathToStr(dp);
> > + device_path = dirname(tmp);
> > + mfree(tmp);
> > +
> > + if (StrCmp(device_path, boot_device_path) == 0) {
> > + result = TRUE;
> > + }
> > + mfree(device_path);
> > +
> > + return result;
> > +}
> > +
> > uint32_t calc_crc32(void *data, int32_t size)
> > {
> > uint32_t crc;
> >
>
> Looks good, /me just needs to understand the path structure, and maybe that
> should then also be documented in the code.
>
Agreed. We have something like
controller/bus/device/partition
in all cases.
Like
PciRoot(0)/Pci(0x1,0x1)/Ata(Primary,Master)/HD(Part2,Sig870E7D1B-3D9F-4E49-98BA-7283AB6AA632)
which gets cut to
PciRoot(0)/Pci(0x1,0x1)/Ata(Primary,Master)
I will add that to the documentation.
Andreas
> Jan
--
Andreas Reichel
Dipl.-Phys. (Univ.)
Software Consultant
[email protected], +49-174-3180074
TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterfoehring
Geschaeftsfuehrer: Henrik Klagges, Dr. Robert Dahlke, Gerhard Mueller
Sitz: Unterfoehring * Amtsgericht Muenchen * HRB 135082
--
You received this message because you are subscribed to the Google Groups "EFI
Boot Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/efibootguard-dev/20180905111207.GB14836%40iiotirae.
For more options, visit https://groups.google.com/d/optout.