History rewrite
This commit is contained in:
109
builds/linux/ubuntu/22-04-lts/data/storage.pkrtpl.hcl
Normal file
109
builds/linux/ubuntu/22-04-lts/data/storage.pkrtpl.hcl
Normal file
@@ -0,0 +1,109 @@
|
||||
%{~ if length(partitions) == 1 && partitions[0].name == "autopart" ~}
|
||||
%{~ if partitions[0].format.fstype == "lvm" ~}
|
||||
storage:
|
||||
layout:
|
||||
name: lvm
|
||||
%{~ endif ~}
|
||||
%{~ if partitions[0].format.fstype == "simple" ~}
|
||||
storage:
|
||||
layout:
|
||||
name: direct
|
||||
%{~ endif ~}
|
||||
%{~ if partitions[0].format.fstype == "" ~}
|
||||
storage:
|
||||
layout:
|
||||
name: direct
|
||||
%{~ endif ~}
|
||||
%{~ else ~}
|
||||
storage:
|
||||
config:
|
||||
- ptable: gpt
|
||||
path: /dev/${device}
|
||||
wipe: superblock
|
||||
preserve: false
|
||||
name: ''
|
||||
%{ if vm_bios == "ovmf" ~}
|
||||
grub_device: false
|
||||
%{ endif ~}
|
||||
%{ if vm_bios == "seabios" ~}
|
||||
grub_device: true
|
||||
%{ endif ~}
|
||||
type: disk
|
||||
id: disk-${device}
|
||||
# BIOS boot partition
|
||||
%{ for index, partition in partitions ~}
|
||||
- device: disk-${device}
|
||||
%{ if partition.size != -1 ~}
|
||||
size: ${partition.size}M
|
||||
%{ else ~}
|
||||
size: ${partition.size}
|
||||
%{ endif ~}
|
||||
wipe: superblock
|
||||
preserve: false
|
||||
%{ if partition.name == "bios_grub" && vm_bios == "seabios" && index == 0 ~}
|
||||
flag: bios_grub
|
||||
grub_device: false
|
||||
%{ endif ~}
|
||||
%{ if partition.mount.path == "/boot/efi" && index == 0 ~}
|
||||
flag: boot
|
||||
grub_device: true
|
||||
%{ endif ~}
|
||||
type: partition
|
||||
id: partition-${partition.name}
|
||||
%{ if partition.format.fstype != "" ~}
|
||||
- id: format-${partition.name}
|
||||
type: format
|
||||
volume: partition-${partition.name}
|
||||
label: ${partition.format.label}
|
||||
fstype: ${partition.format.fstype}
|
||||
%{ endif ~}
|
||||
# Don't create a mount for the GRUB partition when using BIOS
|
||||
%{ if partition.volume_group == "" && partition.name != "bios_grub" ~}
|
||||
- id: mount-${partition.name}
|
||||
type: mount
|
||||
%{ if partition.mount.path == "" ~}
|
||||
path: none
|
||||
%{ else ~}
|
||||
path: ${partition.mount.path}
|
||||
%{ endif ~}
|
||||
device: format-${partition.name}
|
||||
%{ if partition.mount.options != "" ~}
|
||||
options: ${partition.mount.options}
|
||||
%{ endif ~}
|
||||
%{ endif ~}
|
||||
%{ endfor ~}
|
||||
%{ for index, volume_group in lvm ~}
|
||||
- id: volgroup-${volume_group.name}
|
||||
type: lvm_volgroup
|
||||
name: ${volume_group.name}
|
||||
devices:
|
||||
%{ for index, partition in partitions ~}
|
||||
%{ if lookup(partition, "volume_group", "") == volume_group.name ~}
|
||||
- partition-${partition.name}
|
||||
%{ endif ~}
|
||||
%{ endfor ~}
|
||||
%{ for index, partition in volume_group.partitions ~}
|
||||
- id: partition-${partition.name}
|
||||
type: lvm_partition
|
||||
name: ${partition.name}
|
||||
size: ${partition.size}M
|
||||
volgroup: volgroup-${volume_group.name}
|
||||
- id: format-${partition.name}
|
||||
type: format
|
||||
volume: partition-${partition.name}
|
||||
label: ${partition.format.label}
|
||||
fstype: ${partition.format.fstype}
|
||||
- id: mount-${partition.name}
|
||||
type: mount
|
||||
%{ if partition.mount.path == "" ~}
|
||||
path: none
|
||||
%{ else ~}
|
||||
path: ${partition.mount.path}
|
||||
%{ endif ~}
|
||||
device: format-${partition.name}
|
||||
%{ if partition.mount.options != "" ~}
|
||||
options: ${partition.mount.options}
|
||||
%{ endif ~}
|
||||
%{ endfor ~}
|
||||
%{ endfor ~}
|
||||
%{~ endif ~}
|
||||
Reference in New Issue
Block a user