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

image-hd: set the first usable lba correctly #273

Merged
merged 2 commits into from
Nov 29, 2024

Conversation

michaelolbrich
Copy link
Member

Before this, the begining of the first partition was used. This leaves
some unusable space between the partition table and the first partition
and causes some Windows versions to alter the GPT.

So set the first usable lba correctly: Set it to the first lba after the
last non-partition data before the first partition.
This will either be directly behind the GPT entry array or, for example
after a bootloader that is placed between the partition table and the
first partition.

Fixes: #262

image-hd.c Outdated Show resolved Hide resolved
image-hd.c Outdated Show resolved Hide resolved
image-hd.c Outdated Show resolved Hide resolved
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Before this, the begining of the first partition was used. This leaves
some unusable space between the partition table and the first partition
and causes some Windows versions to alter the GPT.

So set the first usable lba correctly: Set it to the first lba after the
last non-partition data before the first partition.
This will either be directly behind the GPT entry array or, for example
after a bootloader that is placed between the partition table and the
first partition.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Copy link
Contributor

@sairon sairon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable and provides more flexibility than #270, closing that one in favor of this change.

@michaelolbrich michaelolbrich merged commit 6651fa4 into pengutronix:master Nov 29, 2024
4 checks passed
@michaelolbrich michaelolbrich deleted the first_usable_lba branch November 29, 2024 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GPT table in Genimage-created images may be mangled by Windows OS
3 participants