
Akashi-san,
efi_uintn_t *size, int idx)
[...]
The type of "idx" should be 'enum load_option_dp_type'.
Currently, "idx" is used as an index into the array of device paths, but given each device path is set to have its own guid, "idx" should be unlinked from the 'order' within the array.
Even if you don't want so, this function should at least take care of some special cases like <execution image> + (no initrd) + <dtb> Alternatively, "END device path" can be put at the second place.
I expect that handling those corner cases should be described explicitly.
True, I'll refactor this a bit and allow us to extend it to load DTBs in the future.
+{
- struct efi_device_path *instance = NULL;
[...]
+/**
- efi_get_fp_from_var() - Retrieve and return a device path from an EFI
Boot### variable
- @idx: index of the instance to retrieve
- Return: device path of NULL. Caller must free the returned value
- */
+struct efi_device_path *efi_get_fp_from_boot(int idx)
Are you sure that this function is called only when "BootCurrent" is appropriately set?
Yea, this is either used on the function called by the EFI-stub or try_load_entry() where the BootCurrent value is set explicitly.
Regards /Ilias