From: Jan Janssen Date: Tue, 5 Jul 2022 08:28:30 +0000 (+0200) Subject: boot: Use open_volume when creating cpio X-Git-Tag: v252-rc1~712^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ed785e591353466259317e1483aa57d5908c086;p=thirdparty%2Fsystemd.git boot: Use open_volume when creating cpio --- diff --git a/src/boot/efi/cpio.c b/src/boot/efi/cpio.c index 5f0f0cf6863..1cf7211b53e 100644 --- a/src/boot/efi/cpio.c +++ b/src/boot/efi/cpio.c @@ -325,7 +325,6 @@ EFI_STATUS pack_cpio( _cleanup_freepool_ void *buffer = NULL; uint32_t inode = 1; /* inode counter, so that each item gets a new inode */ EFI_STATUS err; - EFI_FILE_IO_INTERFACE *volume; assert(loaded_image); assert(target_dir_prefix); @@ -339,21 +338,14 @@ EFI_STATUS pack_cpio( return EFI_SUCCESS; } - err = BS->HandleProtocol(loaded_image->DeviceHandle, - &FileSystemProtocol, (void*)&volume); - /* Error will be unsupported if the bootloader doesn't implement the - * file system protocol on its file handles. - */ + err = open_volume(loaded_image->DeviceHandle, &root); if (err == EFI_UNSUPPORTED) { + /* Error will be unsupported if the bootloader doesn't implement the file system protocol on + * its file handles. */ *ret_buffer = NULL; *ret_buffer_size = 0; return EFI_SUCCESS; } - if (err != EFI_SUCCESS) - return log_error_status_stall( - err, L"Unable to load file system protocol: %r", err); - - err = volume->OpenVolume(volume, &root); if (err != EFI_SUCCESS) return log_error_status_stall( err, L"Unable to open root directory: %r", err);