Ship a 4M variable store so UEFI variables survive a reboot - #278
Open
gmipf wants to merge 1 commit into
Open
Conversation
OVMF_CODE_4M.fd is a 4 MiB build, but the repository only ships 128 KiB variable stores. QEMU maps both pflash images so the pair ends at 4 GiB, and OVMF has the address of its store compiled in, so a 4M CODE image paired with a 128K VARS image looks for its variables 0x64000 bytes away from where they are. This does not fail loudly. The guest boots, the firmware setup opens and accepts changes, and nothing is written back. Symptoms: - "Preferred Resolution at Next Boot" stays Unset however often it is committed - OpenCore's NVRAM writes are lost across reboots - the mtime of the nvram file never moves OVMF_VARS.fd, OVMF_VARS-1024x768.fd and OVMF_VARS-1920x1080.fd are all 2 MiB-era stores and are byte for byte identical: empty templates whose names promise a resolution that was never baked in. Add OVMF_VARS_4M.fd (540672 B, converted from the edk2 package) and use it wherever OVMF_CODE_4M.fd is used. Also point the Catalina template at an OVMF file that is actually present. OVMF-notes.txt explains the pairing so the next person does not have to rediscover it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OVMF_CODE_4M.fdis a 4 MiB build, but the repository only ships 128 KiB variable stores. QEMU maps both pflash images so the pair ends at the 4 GiB mark, and OVMF has the address of its variable store compiled in — so a 4M CODE image paired with a 128K VARS image looks for its variables 0x64000 bytes away from where they actually are.This does not fail loudly, which is why it is easy to miss. The guest boots, the firmware setup opens and accepts changes, and nothing is written back:
Unset, however often it is committedmtimeof the nvram file never moves — the quickest way to confirm itOVMF_VARS.fd,OVMF_VARS-1024x768.fdandOVMF_VARS-1920x1080.fdare all 2 MiB-era stores, and all three are byte for byte identical: empty templates whose file names promise a resolution that was never baked in.This adds
OVMF_VARS_4M.fd(540672 B, converted from the edk2 package withqemu-img convert -O raw) and uses it whereverOVMF_CODE_4M.fdis used. It also points the Catalina template at an OVMF file that is present at all — it currently referencesOVMF_CODE.fd, which is not in the repository.OVMF-notes.txtgains a short section on the pairing, so the next person does not have to rediscover it.Prepared with AI assistance (Claude Opus 4.8) and reviewed before submission.