Upstream block-device-efi DIB element hardcodes the root partition
filesystem type to 'ext4', hence ignoring our FS_TYPE env var
during image building. Although the image builds successfully,
booting the resulting ISO will run into various issues, especially
since most of our scripts assume an XFS root partition.
To allow overriding the rootfs type, provide our own block-device-efi
DIB element, identical to upstream [1] apart from hardcoding
mkfs.type for /. Our override will take precedence during image
building.
$ diff -Naur \
../diskimage-builder/diskimage_builder/elements/block-device-efi/
./dib_elements/block-device-efi/
@@ -22,7 +22,6 @@
type: '8300'
size: 100%
mkfs:
- type: ext4
mount:
mount_point: /
fstab:
[1] https://github.com/openstack/diskimage-builder/tree/2.29.1/ \
diskimage_builder/elements/block-device-efi
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Change-Id: Ic611bfcf00ad38e8a8a7332a64562f615096207a
--- /dev/null
+================
+Block Device EFI
+================
+
+This provides a block-device configuration for the ``vm`` element to
+get a single-partition disk suitable for EFI booting.
+
+Based on upstream DIB element block-device-efi, the only modification
+being the root fs type from hardcoded 'ext4' to relying on FS_TYPE.
+
+Note on x86 this provides the extra `BIOS boot partition
+<https://en.wikipedia.org/wiki/BIOS_boot_partition>`__ and a EFI boot
+partition for maximum compatability.
+
--- /dev/null
+- local_loop:
+ name: image0
+
+- partitioning:
+ base: image0
+ label: gpt
+ partitions:
+ - name: ESP
+ type: 'EF00'
+ size: 550MiB
+ mkfs:
+ type: vfat
+ mount:
+ mount_point: /boot/efi
+ fstab:
+ options: "defaults"
+ fsck-passno: 1
+ - name: BSP
+ type: 'EF02'
+ size: 8MiB
+ - name: root
+ type: '8300'
+ size: 100%
+ mkfs:
+ mount:
+ mount_point: /
+ fstab:
+ options: "defaults"
+ fsck-passno: 1
--- /dev/null
+block-device
\ No newline at end of file
--- /dev/null
+#
+# Arch gate
+#
+
+if [[ "ppc64 ppc64le ppc64el" =~ "$ARCH" ]]; then
+ echo "block-device-efi is not supported on Power; use block-device-gpt or block-device-mbr"
+ exit 1
+fi
+
+export DIB_BLOCK_DEVICE=efi