After making a backup of my EFI ESP partition in another partition, I was 
surprised to
find that efibootguard would no longer boot.

The relevant part of env/fatvars.c is:

        if (numHandles > ENV_NUM_CONFIG_PARTS) {
                ERROR(L"Too many config partitions found. Aborting.\n");
                goto lc_cleanup;
        }

        result = BG_SUCCESS;

        if (numHandles < ENV_NUM_CONFIG_PARTS) {
                WARNING(L"Too few config partitions: found: %d, but expected 
%d.\n",
                        numHandles, ENV_NUM_CONFIG_PARTS);
                /* Don't treat this as error because we may still be able to
                 * find a valid config */
                result = BG_CONFIG_PARTIALLY_CORRUPTED;
        }

While too few config parts might be considered fatal, the implementation is
optimistic because "we may still be able to find a valid config".

It seems odd that the opposite case where there is an oversupply of
config partitions should not be treated the same way because "we may still be
able to find a valid config".

The implementation of load_config() considers the loaded config data to
find the most recent two versions (the latest version N, and its predecessor
version N-1), then chooses one of them.

Instead of /* Load all config data */, load_config() could to walk all available
config files, but only retaining the two most recent versions. This would
allow load_config() succeed even when there is an oversupply of config 
partitions.

Thoughts?

Earl

--
You received this message because you are subscribed to the Google Groups "EFI Boot 
Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to efibootguard-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/01ce70a4-1dca-4cc6-9fa9-d103f43db8b0%40yahoo.com.

Reply via email to