From: longpanda <59477474+ventoy@users.noreply.github.com> Date: Thu, 5 Aug 2021 01:31:44 +0000 (+0800) Subject: Fix the "Failed to open random seed ..." message. X-Git-Tag: v250-rc1~863 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2846007ecfb1fc84005b942167d394294c707d7b;p=thirdparty%2Fsystemd.git Fix the "Failed to open random seed ..." message. When boot ArchLinux from Ventoy, it always print `Failed to open random seed file: write protected.` As Ventoy emulate the ISO file as a read-only CDROM, I didn't test with a real physical CDROM drive, but maybe it also has such problem. As we use `EFI_FILE_MODE_WRITE` to open the `loader\random-seed` file, so I think it's better to check the result with both `EFI_WRITE_PROTECTED` and `EFI_NOT_FOUND`. --- diff --git a/src/boot/efi/random-seed.c b/src/boot/efi/random-seed.c index ff364695f35..3e179851b08 100644 --- a/src/boot/efi/random-seed.c +++ b/src/boot/efi/random-seed.c @@ -245,7 +245,7 @@ EFI_STATUS process_random_seed(EFI_FILE *root_dir, RandomSeedMode mode) { err = uefi_call_wrapper(root_dir->Open, 5, root_dir, &handle, (CHAR16*) L"\\loader\\random-seed", EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, 0ULL); if (EFI_ERROR(err)) { - if (err != EFI_NOT_FOUND) + if (err != EFI_NOT_FOUND && err != EFI_WRITE_PROTECTED) Print(L"Failed to open random seed file: %r\n", err); return err; }