Merge pull request #347 from marineam/align

Update disk/partition alignment, hopefully resolves issues with VHD images
This commit is contained in:
Michael Marineau 2014-11-03 14:19:13 -08:00
commit d4f1e55718
2 changed files with 8 additions and 8 deletions

View File

@ -1,9 +1,9 @@
{ {
"_comment": "See http://www.chromium.org/chromium-os/building-chromium-os/disk-layout-format", "_comment": "See http://www.chromium.org/chromium-os/building-chromium-os/disk-layout-format",
"metadata":{ "metadata":{
"_comment": "Partitions are aligned to 1MB (2048 blocks), disks sizes should align to *both* 1MB and a CHS cylender boundry for the common 16H 63S geometry (16*63 = 1008 blocks). The least common multiple of 2048 and 1008 is 129024 blocks.", "_comment": "Partitions are aligned to 2MB (4096 blocks). For the sake of VHD disks sizes should align to *both* 2MB and a CHS cylender boundry for the common 16H 63S geometry (16*63 = 1008 blocks). The least common multiple of 4096 and 1008 is 258048 blocks.",
"part_alignment": 2048, "part_alignment": 4096,
"disk_alignment": 129024, "disk_alignment": 258048,
"block_size": 512, "block_size": 512,
"fs_block_size": 4096 "fs_block_size": 4096
}, },
@ -64,7 +64,7 @@
"9":{ "9":{
"label":"ROOT", "label":"ROOT",
"type":"coreos-resize", "type":"coreos-resize",
"blocks":"4302848", "blocks":"4427776",
"fs_type":"btrfs", "fs_type":"btrfs",
"fs_subvolume":"root", "fs_subvolume":"root",
"mount":"/" "mount":"/"
@ -73,19 +73,19 @@
"vm":{ "vm":{
"9":{ "9":{
"label":"ROOT", "label":"ROOT",
"blocks":"12689408" "blocks":"12943360"
} }
}, },
"azure":{ "azure":{
"9":{ "9":{
"label":"ROOT", "label":"ROOT",
"blocks":"58752990" "blocks":"58875904"
} }
}, },
"vagrant":{ "vagrant":{
"9":{ "9":{
"label":"ROOT", "label":"ROOT",
"blocks":"33591296" "blocks":"33845248"
} }
}, },
"onmetal":{ "onmetal":{

View File

@ -127,7 +127,7 @@ def LoadPartitionConfig(options):
for base_key, base_value in base_part.iteritems(): for base_key, base_value in base_part.iteritems():
part.setdefault(base_key, base_value) part.setdefault(base_key, base_value)
for part_num, part in layout.iteritems(): for part_num, part in sorted(layout.iteritems(), key=lambda t: int(t[0])):
if part['type'] == 'blank': if part['type'] == 'blank':
continue continue