Booting my multiboot flash drive via EFI
In December 2019, I posted about my new multiboot flash drive that I put together. In that post, I partitioned a flash drive and installed grub to it such that I could boot from any one of a selection of ISOs that I put in a directory.
Here's a link to that post: Multi-boot + data + multi-partition = octopus flash drive 2.0?
This has been working brilliantly, except that I noticed after posting it that it had a tendency to hang infinitely if I booted into an ISO via UEFI instead of legacy BIOS. I've been hunting for a solution to this awkward issue ever since then - and as you might have guessed by the fact that you're reading this post now, I've finally found a solution.
As I suspected - the solution is really very simple:
# Ref https://askubuntu.com/q/1186040/139735
# As far as I can tell, this bug only affects UEFI / EFI
rmmod tpm
Adding rmmod tpm
to the top of the grub.cfg
grub configuration file fixes the issue - as far as I can tell (I still want to run some more tests on different machines).
I've also taken the unusual step of retroactively going back and updating the original post.
I found the solution in an answer on Ask Ubuntu. As it turns out, sometimes it's just a case of trying different search terms. I had tried a number of times to find a solution previously, but I kept coming up against solutions such as recompiling grub from source myself, which would require an enormous amount of effort, or suggestions to install grub from a different version of Ubuntu (which didn't work).
As far as I understand it, the solution disables the Trusted Platform Module support built into grub. As for why this fixes my ISO booting issue, I'm not sure.
If you're trying to find a solution to a problem you're encountering, never give up! You'll find a solution eventually :-)