Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#3698 - x86 EFI image GUID Partition Table (GPT) is corrupt #8714

Open
openwrt-bot opened this issue Mar 21, 2021 · 0 comments
Open

FS#3698 - x86 EFI image GUID Partition Table (GPT) is corrupt #8714

openwrt-bot opened this issue Mar 21, 2021 · 0 comments
Labels
flyspray toolchain pull request/issue with toolchain related changes

Comments

@openwrt-bot
Copy link

kane:

If you use fdisk to check an OpenWrt image of x86_64 EFI, you will get an error message:

$ fdisk -l openwrt-x86-64-generic-ext4-combined-efi.img
GPT PMBR size mismatch (246303 != 246334) will be corrected by write.
The backup GPT table is corrupt, but the primary appears OK, so that will be used.
The backup GPT table is not on the end of the device. This problem will be corrected by write.
...

  • No matter what size the image are, the PMBR size is always 31 less than real value.
  • There is no secondary partition table at the end of the image.
  • The Backup LBA (offset of image file: 0x220) and Last usable LBA (0x230) values are wrong.

This doesn't hurt the boot or the usage of OpenWrt x86. However this is NOT a correct way.

According the git history, these EFI support is introduced in this [[https://github.com/openwrt/openwrt/commit/1963bbaa8f035c0a3c71233a049a7a4d7cd32711|commit 1963bba]]. And it disabled the secondary partition table.
In the commit message, this incorret operation is 'to reduce size'. However, this secondary partition table, which has 33 LBAs, takes only 16.5 KiB. I don't think 16.5 KiB is worth to 'save' for an x86_64 device.
Besides, in the commit message the author said 'This may cause problems when generate vmdk images or vdi images. We have to pad enough sectors when generate these images.' So, this 'reduce size' operation also has side effects, and is not a good tradeoff.

As a conclusion, I hope this problem can be fixed.

@aparcar aparcar added the toolchain pull request/issue with toolchain related changes label Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray toolchain pull request/issue with toolchain related changes
Projects
None yet
Development

No branches or pull requests

2 participants