Installation fails with: efibootmgr failed to register the boot entry

During a recent system installation we’ve hit an interesting issue:

Could not prepare Boot variable: No space left on device
/gnu/store/q5mhiwj4rap24i2b2y9svwbfsn3ya0v1-grub-efi-2.04/sbin/grub-install: error: efibootmgr failed to register the boot entry: Input/output error.

A little research turned-up similar reports and suggested solutions:

Apparently this issue is related to the NVRAM filling-up (the installer is trying to write to /sys/firmware/efi/efivars).

A solution that commonly helped is the following:

Important: This may brick your motherboard firmware! I’m sure there are more elegant ways to go about this but it did the trick for this testing machine. Do your own research and have a UEFI recovery medium from your motherboard / PC manufacturer on standby.

rm /sys/firmware/efi/efivars/dump-*

You will need to reboot before starting the installation again.