disk: calculate padding for secondary GPT header

Instead of hard coding a padding of 100 sectors for all layouts, i.e.
MBR and GTP, adjust the needed space depending on the layout: for MBR 
we don't need to reserve any space at all since it does not have a 
secondary header. For GTP we reserve 33 sectors, as indicated in the
UEFI specific, which allows for the header itself and up to 128 entries.
To not modify the layout of already released distributions, like RHEL
8.4 and 8.5, a new member called `ExtraPadding` is added to `Partition
Table` and then used in the corresponding layouts to preserve the
existing padding of 100.
This commit is contained in:
Christian Kellner 2022-02-18 16:45:24 +01:00 committed by Tom Gundersen
parent b3c769ae02
commit b7abef54e8
65 changed files with 269 additions and 225 deletions

View file

@ -1068,7 +1068,7 @@
},
{
"bootable": true,
"size": 19945372,
"size": 19945472,
"start": 1026048
}
]
@ -1110,7 +1110,7 @@
"options": {
"filename": "disk.img",
"start": 1026048,
"size": 19945372
"size": 19945472
}
}
}
@ -1154,7 +1154,7 @@
"options": {
"filename": "disk.img",
"start": 1026048,
"size": 19945372
"size": 19945472
}
}
},
@ -1199,7 +1199,7 @@
"options": {
"filename": "disk.img",
"start": 1026048,
"size": 19945372
"size": 19945472
}
}
},