From: Lennart Poettering Date: Wed, 6 Feb 2019 17:07:50 +0000 (+0100) Subject: sd-boot: pass device handle to config_entry_add_linux() X-Git-Tag: v242-rc1~218^2~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c8ad5996b0c209511365f03ec82a1812c444f414;p=thirdparty%2Fsystemd.git sd-boot: pass device handle to config_entry_add_linux() This makes the code a bit simpler (after all the call is not interested in the loaded image, just where it is found), and more like config_load_entries() which takes the same arguments. This also makes things easier for us later on, when we add support for discovering images in $XBOOTLDR partitions. --- diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index 9bf6895831b..909e4b0e62f 100644 --- a/src/boot/efi/boot.c +++ b/src/boot/efi/boot.c @@ -1836,7 +1836,7 @@ static VOID config_entry_add_osx(Config *config) { static VOID config_entry_add_linux( Config *config, - EFI_LOADED_IMAGE *loaded_image, + EFI_HANDLE *device, EFI_FILE *root_dir) { EFI_FILE_HANDLE linux_dir; @@ -1926,7 +1926,7 @@ static VOID config_entry_add_linux( conf = PoolPrint(L"%s-%s", os_id, os_version ? : os_build); path = PoolPrint(L"\\EFI\\Linux\\%s", f->FileName); - entry = config_entry_add_loader(config, loaded_image->DeviceHandle, LOADER_LINUX, conf, 'l', os_name, path); + entry = config_entry_add_loader(config, device, LOADER_LINUX, conf, 'l', os_name, path); FreePool(content); content = NULL; @@ -2142,7 +2142,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { config_load_defaults(&config, root_dir); /* scan /EFI/Linux/ directory */ - config_entry_add_linux(&config, loaded_image, root_dir); + config_entry_add_linux(&config, loaded_image->DeviceHandle, root_dir); /* scan /loader/entries/\*.conf files */ config_load_entries(&config, loaded_image->DeviceHandle, root_dir, loaded_image_path);