]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: eficonfig: create shortened boot options
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 18 Nov 2023 11:40:32 +0000 (12:40 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 20 Nov 2023 18:06:22 +0000 (19:06 +0100)
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>
cmd/eficonfig.c

index e6e8a0a488e71f472e1b64ad7c00df0440eb2ef9..34a59cb15d0df94bee204fb773f004a42727b0a0 100644 (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;