cmd: eficonfig: create shortened boot options

The boot options created by eficonfig should use shortened device-paths to
avoid problems if drives are enumerated in a different sequence.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
Heinrich Schuchardt 2023-11-18 12:40:32 +01:00
parent ce68a25448
commit 64658007f3
1 changed files with 4 additions and 1 deletions

View File

@ -528,7 +528,10 @@ struct efi_device_path *eficonfig_create_device_path(struct efi_device_path *dp_
p += fp_size;
*((struct efi_device_path *)p) = END;
dp = efi_dp_append(dp_volume, (struct efi_device_path *)buf);
dp = efi_dp_shorten(dp_volume);
if (!dp)
dp = dp_volume;
dp = efi_dp_append(dp, &fp->dp);
free(buf);
return dp;