Partition sizes need to be divisible by 4096

This commit is contained in:
Davide Cavalca 2022-11-05 05:05:39 +00:00
parent 64f71cdf0f
commit 81f2a876b5
2 changed files with 11 additions and 6 deletions

View File

@ -47,11 +47,17 @@ fatcat "${workdir}/${imagename}1" -x "${workdir}/package/esp"
mv "${workdir}/${imagename}2" "${workdir}/package/boot.img"
mv "${workdir}/${imagename}3" "${workdir}/package/root.img"
esp_volume_id="$(file "${workdir}/${imagename}1" | awk -v 'RS=,' '/serial number/ { print $3 }')"
esp_size="$(stat -c %s "${workdir}/${imagename}1")"
boot_size="$(stat -c %s "${workdir}/package/boot.img")"
# TODO: round up the size instead of hardcoding
truncate -s 10G "${workdir}/package/root.img"
root_size="$(stat -c %s "${workdir}/package/root.img")"
pushd "${workdir}/package" > /dev/null
zip -r "${basedir}/${package}" .
popd > /dev/null
volume_id="$(file "${workdir}/${imagename}1" | awk -v 'RS=,' '/serial number/ { print $3 }')"
cat > installer_data.json <<EOF
{
"os_list": [
@ -66,9 +72,9 @@ cat > installer_data.json <<EOF
{
"name": "EFI",
"type": "EFI",
"size": "500MB",
"size": "${esp_size}B",
"format": "fat",
"volume_id": "${volume_id}",
"volume_id": "${esp_volume_id}",
"copy_firmware": true,
"copy_installer_data": true,
"source": "esp"
@ -76,13 +82,13 @@ cat > installer_data.json <<EOF
{
"name": "Boot",
"type": "Linux",
"size": "1050MB",
"size": "${boot_size}B",
"image": "boot.img"
},
{
"name": "Root",
"type": "Linux",
"size": "15GB",
"size": "${root_size}B",
"expand": true,
"image": "root.img"
}

View File

@ -20,7 +20,6 @@
<volume name="home"/>
<volume name="root"/>
</systemdisk>
<size unit="G">15</size>
<oemconfig>
<oem-resize>false</oem-resize>
</oemconfig>