-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
image-hd: add forced-primary flag for higher MBR layout flexibility
The current limitation of Genimage is that it is not able to create MBR images that have primary partitions that start after a logical partition. This can be useful for images that can be later resized based on the actual device size - for this operation the partition must be at the end of the device, and if it is present in a logical partition, it must be resized first, making it a two-step process. This commit adds the "forced-primary" flag which can be used to indicate that the partition should be put into the disk's MBR instead of creating another logical partition. Validation ensures that this syntax allows to create such partitions only after an existing logical partition, and that the maximum number of MBR entries woudn't be exceeded by doing so. Test cases for valid and invalid configuiration has been added. Also added few more details in the debug print to make it more obvious how the MBR/EBR layout looks like. Signed-off-by: Jan Čermák <[email protected]>
- Loading branch information
1 parent
df4923c
commit d52b233
Showing
12 changed files
with
282 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
image test.hdimage { | ||
hdimage { | ||
align = 1M | ||
extended-partition = 3 | ||
} | ||
partition primary1 { | ||
image = "part1.img" | ||
partition-type = 0x83 | ||
} | ||
partition primary2 { | ||
image = "part1.img" | ||
partition-type = 0x83 | ||
} | ||
partition extended1 { | ||
image = "part1.img" | ||
partition-type = 0x83 | ||
} | ||
partition extended2 { | ||
image = "part1.img" | ||
partition-type = 0x83 | ||
} | ||
partition primary3 { | ||
image = "part1.img" | ||
partition-type = 0x83 | ||
forced-primary = "yes" | ||
} | ||
partition primary4 { | ||
image = "part1.img" | ||
partition-type = 0x83 | ||
/* would be 5th primary partition */ | ||
forced-primary = "yes" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
image test.hdimage { | ||
hdimage { | ||
align = 1M | ||
extended-partition = 1 | ||
} | ||
partition extended1 { | ||
image = "part1.img" | ||
partition-type = 0x83 | ||
} | ||
partition extended2 { | ||
image = "part1.img" | ||
partition-type = 0x83 | ||
} | ||
partition extended3 { | ||
image = "part1.img" | ||
partition-type = 0x83 | ||
} | ||
partition extended4 { | ||
image = "part1.img" | ||
partition-type = 0x83 | ||
} | ||
partition primary2 { | ||
image = "part1.img" | ||
partition-type = 0x83 | ||
forced-primary = "yes" | ||
} | ||
partition extended5 { | ||
image = "part1.img" | ||
partition-type = 0x83 | ||
/* extended partition would overlap the forced-primary one */ | ||
} | ||
} |
Oops, something went wrong.