Merge "Add element block-device-efi-lvm"

changes/92/801092/1
Zuul 1 year ago committed by Gerrit Code Review
commit d286f64a76
  1. 16
      diskimage_builder/elements/block-device-efi-lvm/README.rst
  2. 73
      diskimage_builder/elements/block-device-efi-lvm/block-device-default.yaml
  3. 1
      diskimage_builder/elements/block-device-efi-lvm/element-provides
  4. 10
      diskimage_builder/elements/block-device-efi-lvm/environment.d/15-block-device.bash
  5. 2
      diskimage_builder/elements/block-device-efi/block-device-default.yaml
  6. 4
      diskimage_builder/lib/common-functions
  7. 10
      releasenotes/notes/block-device-efi-lvm-c53272600ccd6d18.yaml

@ -0,0 +1,16 @@
====================
Block Device EFI LVM
====================
This provides a block-device configuration for the ``vm`` element to
get a disk suitable for EFI booting which uses LVM to define multiple
volumes mounted to /, /tmp, /var, and /home.
Please note that the sizes of the partitions may not
be enough for production usage, they will need to be resized properly after
deployment depending on the available disk size.
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.

@ -0,0 +1,73 @@
- 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: 2
- name: BSP
type: 'EF02'
size: 8MiB
- name: root
flags: [ boot ]
size: 40G
- lvm:
name: lvm
base: [ root ]
pvs:
- name: pv
base: root
options: [ "--force" ]
vgs:
- name: vg
base: [ "pv" ]
options: [ "--force" ]
lvs:
- name: lv_root
base: vg
extents: 23%VG
- name: lv_var
base: vg
extents: 57%VG
- name: lv_home
base: vg
extents: 20%VG
- mkfs:
name: fs_root
base: lv_root
type: xfs
label: "img-rootfs"
mount:
mount_point: /
fstab:
options: "rw,relatime"
fsck-passno: 1
- mkfs:
name: fs_var
base: lv_var
type: xfs
mount:
mount_point: /var
fstab:
options: "rw,relatime"
fsck-passno: 2
- mkfs:
name: fs_home
base: lv_home
type: xfs
mount:
mount_point: /home
fstab:
options: "rw,nodev,relatime"
fsck-passno: 2

@ -0,0 +1,10 @@
#
# 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

@ -14,7 +14,7 @@
mount_point: /boot/efi
fstab:
options: "defaults"
fsck-passno: 1
fsck-passno: 2
- name: BSP
type: 'EF02'
size: 8MiB

@ -285,9 +285,9 @@ function _arg_defaults_hack() {
local elements
for arg do
if [[ "$arg" =~ "vm" ]]; then
if [[ $arg = vm ]]; then
vm_seen=1
elif [[ "$arg" =~ "block-device-" ]]; then
elif [[ $arg = block-device-* ]]; then
blockdev_seen=1
fi
elements="$elements $arg"

@ -0,0 +1,10 @@
---
features:
- |
Element block-device-efi-lvm has been added which is like block-device-efi
but defines an LVM logical group in the root partition. Four logical
volumes are defined in that group, mounted to /, /tmp, /var, and /home.
This volume layout will not meet all requirements, but this is more of an
example demonstrating the capability to encourage more usage of this
existing feature.
Loading…
Cancel
Save