I didn't see the same issue because I'm testing on a configuration with a version of shim that doesn't call GetEventLog() before starting grub (see https://github.com/rhboot/shim/commit/fd7c3bd920ba39082cb7c619afb7203d150a4cd3), and so the final 2 events that shim record don't end up in the final events table and aren't duplicated.
I think the reason for your issue is that the final 2 events extended to PCR7 are recorded twice in the log, most likely because the test kernel from comment 12 doesn't contain https:/ /git.kernel. org/pub/ scm/linux/ kernel/ git/torvalds/ linux.git/ commit/ ?id=166a2809d65 b282272c474835e c22c882a39ca1b
I didn't see the same issue because I'm testing on a configuration with a version of shim that doesn't call GetEventLog() before starting grub (see https:/ /github. com/rhboot/ shim/commit/ fd7c3bd920ba390 82cb7c619afb720 3d150a4cd3), and so the final 2 events that shim record don't end up in the final events table and aren't duplicated.
Note that some additional follow-up changes would be required too - eg, https:/ /git.kernel. org/pub/ scm/linux/ kernel/ git/torvalds/ linux.git/ commit/ ?id=b61fbc887af 7a13a1c90c84c1f eaeb4c9780e1e2, https://<email address hidden>/, https://<email address hidden>/ and https://<email address hidden>/