Browse Source

Merge "block-device-efi : expand disk size calculation"

tags/2.26.0^0
Zuul 2 months ago
parent
commit
3b2b87dde1

+ 12
- 0
diskimage_builder/lib/disk-image-create View File

@@ -446,6 +446,18 @@ if [ "$DIB_ROOT_FSTYPE" = "ext4" ] ; then
446 446
   fi
447 447
 fi
448 448
 
449
+# EFI system partitions default to be quite large at 512mb for maximum
450
+# compatability (see notes in
451
+# 7fd52ba84180b4e749ccf4c9db8c49eafff46ea8) .  We need to increase the
452
+# total size to account for this, or we run out of space creating the
453
+# final image.  See if we have included the block-device-efi element,
454
+# which implies we have a large EFI partition, and then pad the final
455
+# image size.
456
+if [[ ${IMAGE_ELEMENT} =~ "block-device-efi" ]]; then
457
+    echo "Expanding disk for EFI partition"
458
+    du_size=$(( $du_size + (525 * 1024) ))
459
+fi
460
+
449 461
 # Rounding down size so that is is a multiple of 64, works around a bug in
450 462
 # qemu-img that may occur when compressing raw images that aren't a multiple
451 463
 # of 64k. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1180021

+ 6
- 0
releasenotes/notes/efi-bootloader-disk-size-4c1a9f18967104fb.yaml View File

@@ -0,0 +1,6 @@
1
+---
2
+fixes:
3
+  - |
4
+    When using the ``block-device-efi`` element to create an EFI based
5
+    system (most notably, with ARM64), the final disk size is now
6
+    expanded for the 512MiB system EFI partition introduced with 2.24.0

Loading…
Cancel
Save