debian-forge/test/data/manifests/fedora-coreos-container.mpp.yaml
Dusty Mabe e191dc1d0d tools/osbuild-mpp: set part ID from name if missing
For our Fedora CoreOS disk images we set the partition labels (name)
for the partitions. This is also supported using the primitives here
in OSBuild, but it wasn't obvious that I needed to set the name in
the mpp-define-images definition. Let's set the name there, but let's
also allow osbuild-mpp to set the `id`, which is what is used later
to access that partition from the `name` too if `id` isn't set.

This means we allow something like:

   - name: BIOS-BOOT
     type: 21686148-6449-6E6F-744E-656564454649
     bootable: true
     uuid: FAC7F1FB-3E8D-4137-A512-961DE09A5549
     size: 100

rather than requiring something like:

   - id: BIOS-BOOT
     name: BIOS-BOOT
     type: 21686148-6449-6E6F-744E-656564454649
     bootable: true
     uuid: FAC7F1FB-3E8D-4137-A512-961DE09A5549
     size: 100
2023-11-29 10:37:08 +01:00

525 lines
16 KiB
YAML

version: '2'
mpp-vars:
disk_size_gb: 10
bios_boot_size_mb: 1
efi_system_size_mb: 127
boot_size_mb: 384
root_size_mb: 2048
sector_size: 512
four_k_sector_size: 4096
mpp-define-images:
- id: image
size:
mpp-format-string: "{disk_size_gb * 1024 * 1024 * 1024}"
table:
uuid: 00000000-0000-4000-a000-000000000001
label: gpt
partitions:
- name: BIOS-BOOT
type: 21686148-6449-6E6F-744E-656564454649
bootable: true
uuid: FAC7F1FB-3E8D-4137-A512-961DE09A5549
size:
mpp-format-int: "{bios_boot_size_mb * 1024 * 1024 / sector_size}"
- name: EFI-SYSTEM
type: C12A7328-F81F-11D2-BA4B-00A0C93EC93B
uuid: 68B2905B-DF3E-4FB3-80FA-49D1E773AA33
size:
mpp-format-int: "{efi_system_size_mb * 1024 * 1024 / sector_size}"
- name: boot
type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4
uuid: 61B2905B-DF3E-4FB3-80FA-49D1E773AA32
size:
mpp-format-int: "{boot_size_mb * 1024 * 1024 / sector_size}"
- name: root
type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4
uuid: CA7D7CCB-63ED-4C53-861C-1742536059CC
size:
mpp-format-int: "{root_size_mb * 1024 * 1024 / sector_size}"
- id: image4k
sector_size:
mpp-format-int: "{four_k_sector_size}"
size:
mpp-format-string: "{disk_size_gb * 1024 * 1024 * 1024}"
table:
uuid: 00000000-0000-4000-a000-000000000001
label: gpt
partitions:
- name: BIOS-BOOT
type: 21686148-6449-6E6F-744E-656564454649
bootable: true
uuid: FAC7F1FB-3E8D-4137-A512-961DE09A5549
size:
mpp-format-int: "{bios_boot_size_mb * 1024 * 1024 / four_k_sector_size}"
- name: EFI-SYSTEM
type: C12A7328-F81F-11D2-BA4B-00A0C93EC93B
uuid: 68B2905B-DF3E-4FB3-80FA-49D1E773AA33
size:
mpp-format-int: "{efi_system_size_mb * 1024 * 1024 / four_k_sector_size}"
- name: boot
type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4
uuid: 61B2905B-DF3E-4FB3-80FA-49D1E773AA32
size:
mpp-format-int: "{boot_size_mb * 1024 * 1024 / four_k_sector_size}"
- name: root
type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4
uuid: CA7D7CCB-63ED-4C53-861C-1742536059CC
size:
mpp-format-int: "{root_size_mb * 1024 * 1024 / four_k_sector_size}"
pipelines:
- mpp-import-pipelines:
path: fedora-vars.ipp.yaml
- mpp-import-pipeline:
path: fedora-build-v2.ipp.yaml
id: build
runner:
mpp-format-string: org.osbuild.fedora{release}
- name: tree
build: name:build
source-epoch: 1659397331
stages:
- type: org.osbuild.ostree.init-fs
- type: org.osbuild.ostree.os-init
options:
osname: fedora-coreos
- type: org.osbuild.ostree.config
options:
repo: /ostree/repo
config:
sysroot:
readonly: false
bootloader: none
- type: org.osbuild.mkdir
options:
paths:
- path: /boot/efi
mode: 448
- type: org.osbuild.ignition
- type: org.osbuild.ostree.deploy.container
options:
osname: fedora-coreos
target_imgref: ostree-remote-registry:fedora:quay.io/fedora/fedora-coreos:stable
mounts:
- /boot
- /boot/efi
kernel_opts:
- rw
- '$ignition_firstboot'
inputs:
images:
type: org.osbuild.containers
origin: org.osbuild.source
mpp-resolve-images:
images:
- source: registry.gitlab.com/redhat/services/products/image-builder/ci/images/fedora-coreos
tag: stable
- type: org.osbuild.ostree.selinux
options:
deployment:
osname: fedora-coreos
ref: ostree/1/1/0
- type: org.osbuild.grub2
options:
rootfs:
label: root
bootfs:
label: boot
uefi:
vendor: fedora
install: true
legacy: i386-pc
write_defaults: false
greenboot: false
ignition: true
- name: raw-image
build: name:build
stages:
- type: org.osbuild.truncate
options:
filename: disk.img
size:
mpp-format-string: '{image.size}'
- type: org.osbuild.sfdisk
devices:
device:
type: org.osbuild.loopback
options:
filename: disk.img
options:
mpp-format-json: '{image.layout}'
- type: org.osbuild.mkfs.fat
devices:
device:
type: org.osbuild.loopback
options:
filename: disk.img
start:
mpp-format-int: '{image.layout[''EFI-SYSTEM''].start}'
size:
mpp-format-int: '{image.layout[''EFI-SYSTEM''].size}'
lock: true
options:
label: EFI-SYSTEM
volid: 7B7795E7
- type: org.osbuild.mkfs.ext4
devices:
device:
type: org.osbuild.loopback
options:
filename: disk.img
start:
mpp-format-int: '{image.layout[''boot''].start}'
size:
mpp-format-int: '{image.layout[''boot''].size}'
lock: true
options:
uuid: 96d15588-3596-4b3c-adca-a2ff7279ea63
label: boot
- type: org.osbuild.mkfs.xfs
devices:
device:
type: org.osbuild.loopback
options:
filename: disk.img
start:
mpp-format-int: '{image.layout[''root''].start}'
size:
mpp-format-int: '{image.layout[''root''].size}'
lock: true
options:
uuid: 910678ff-f77e-4a7d-8d53-86f2ac47a823
label: root
- type: org.osbuild.copy
inputs:
tree:
type: org.osbuild.tree
origin: org.osbuild.pipeline
references:
- name:tree
options:
paths:
- from: input://tree/
to: mount://root/
devices:
efi:
type: org.osbuild.loopback
options:
filename: disk.img
start:
mpp-format-int: '{image.layout[''EFI-SYSTEM''].start}'
size:
mpp-format-int: '{image.layout[''EFI-SYSTEM''].size}'
boot:
type: org.osbuild.loopback
options:
filename: disk.img
start:
mpp-format-int: '{image.layout[''boot''].start}'
size:
mpp-format-int: '{image.layout[''boot''].size}'
root:
type: org.osbuild.loopback
options:
filename: disk.img
start:
mpp-format-int: '{image.layout[''root''].start}'
size:
mpp-format-int: '{image.layout[''root''].size}'
mounts:
- name: root
type: org.osbuild.xfs
source: root
target: /
- name: boot
type: org.osbuild.ext4
source: boot
target: /boot
- name: efi
type: org.osbuild.fat
source: efi
target: /boot/efi
- type: org.osbuild.grub2.inst
options:
platform: i386-pc
filename: disk.img
location:
mpp-format-int: '{image.layout[''BIOS-BOOT''].start}'
core:
type: mkimage
partlabel: gpt
filesystem: ext4
prefix:
type: partition
partlabel:
mpp-format-string: '{image.layout.label}'
number:
mpp-format-int: '{image.layout[''boot''].index}'
path: /grub2
- name: raw-4k-image
build: name:build
stages:
- type: org.osbuild.truncate
options:
filename: disk.img
size:
mpp-format-string: '{image4k.size}'
- type: org.osbuild.sfdisk
devices:
device:
type: org.osbuild.loopback
options:
filename: disk.img
sector-size:
mpp-format-int: "{four_k_sector_size}"
options:
mpp-format-json: '{image4k.layout}'
- type: org.osbuild.mkfs.fat
devices:
device:
type: org.osbuild.loopback
options:
filename: disk.img
start:
mpp-format-int: '{image4k.layout[''EFI-SYSTEM''].start}'
size:
mpp-format-int: '{image4k.layout[''EFI-SYSTEM''].size}'
lock: true
sector-size:
mpp-format-int: "{four_k_sector_size}"
options:
label: EFI-SYSTEM
volid: 7B7795E7
- type: org.osbuild.mkfs.ext4
devices:
device:
type: org.osbuild.loopback
options:
filename: disk.img
start:
mpp-format-int: '{image4k.layout[''boot''].start}'
size:
mpp-format-int: '{image4k.layout[''boot''].size}'
lock: true
sector-size:
mpp-format-int: "{four_k_sector_size}"
options:
uuid: 96d15588-3596-4b3c-adca-a2ff7279ea63
label: boot
- type: org.osbuild.mkfs.xfs
devices:
device:
type: org.osbuild.loopback
options:
filename: disk.img
start:
mpp-format-int: '{image4k.layout[''root''].start}'
size:
mpp-format-int: '{image4k.layout[''root''].size}'
lock: true
sector-size:
mpp-format-int: "{four_k_sector_size}"
options:
uuid: 910678ff-f77e-4a7d-8d53-86f2ac47a823
label: root
- type: org.osbuild.copy
inputs:
tree:
type: org.osbuild.tree
origin: org.osbuild.pipeline
references:
- name:tree
options:
paths:
- from: input://tree/
to: mount://root/
devices:
efi:
type: org.osbuild.loopback
options:
filename: disk.img
start:
mpp-format-int: '{image4k.layout[''EFI-SYSTEM''].start}'
size:
mpp-format-int: '{image4k.layout[''EFI-SYSTEM''].size}'
sector-size:
mpp-format-int: "{four_k_sector_size}"
boot:
type: org.osbuild.loopback
options:
filename: disk.img
start:
mpp-format-int: '{image4k.layout[''boot''].start}'
size:
mpp-format-int: '{image4k.layout[''boot''].size}'
sector-size:
mpp-format-int: "{four_k_sector_size}"
root:
type: org.osbuild.loopback
options:
filename: disk.img
start:
mpp-format-int: '{image4k.layout[''root''].start}'
size:
mpp-format-int: '{image4k.layout[''root''].size}'
sector-size:
mpp-format-int: "{four_k_sector_size}"
mounts:
- name: root
type: org.osbuild.xfs
source: root
target: /
- name: boot
type: org.osbuild.ext4
source: boot
target: /boot
- name: efi
type: org.osbuild.fat
source: efi
target: /boot/efi
- name: raw-metal-image
build: name:build
stages:
- type: org.osbuild.copy
inputs:
tree:
type: org.osbuild.tree
origin: org.osbuild.pipeline
references:
- name:raw-image
options:
paths:
- from: input://tree/disk.img
to: tree:///disk.img
- type: org.osbuild.kernel-cmdline.bls-append
options:
bootpath: mount:///
kernel_opts:
- ignition.platform.id=metal
devices:
boot:
type: org.osbuild.loopback
options:
filename: disk.img
start:
mpp-format-int: '{image.layout[''boot''].start}'
size:
mpp-format-int: '{image.layout[''boot''].size}'
mounts:
- name: boot
type: org.osbuild.ext4
source: boot
target: /
- name: raw-metal4k-image
build: name:build
stages:
- type: org.osbuild.copy
inputs:
tree:
type: org.osbuild.tree
origin: org.osbuild.pipeline
references:
- name:raw-4k-image
options:
paths:
- from: input://tree/disk.img
to: tree:///disk.img
- type: org.osbuild.kernel-cmdline.bls-append
options:
bootpath: mount:///
kernel_opts:
- ignition.platform.id=metal
devices:
boot:
type: org.osbuild.loopback
options:
filename: disk.img
start:
mpp-format-int: '{image4k.layout[''boot''].start}'
size:
mpp-format-int: '{image4k.layout[''boot''].size}'
sector-size:
mpp-format-int: "{four_k_sector_size}"
mounts:
- name: boot
type: org.osbuild.ext4
source: boot
target: /
- name: raw-qemu-image
build: name:build
stages:
- type: org.osbuild.copy
inputs:
tree:
type: org.osbuild.tree
origin: org.osbuild.pipeline
references:
- name:raw-image
options:
paths:
- from: input://tree/disk.img
to: tree:///disk.img
- type: org.osbuild.kernel-cmdline.bls-append
options:
bootpath: mount:///
kernel_opts:
- console=tty0
- console=ttyS0,115200n8
- ignition.platform.id=qemu
devices:
boot:
type: org.osbuild.loopback
options:
filename: disk.img
start:
mpp-format-int: '{image.layout[''boot''].start}'
size:
mpp-format-int: '{image.layout[''boot''].size}'
mounts:
- name: boot
type: org.osbuild.ext4
source: boot
target: /
- name: metal
build: name:build
stages:
- type: org.osbuild.copy
inputs:
tree:
type: org.osbuild.tree
origin: org.osbuild.pipeline
references:
- name:raw-metal-image
options:
paths:
- from: input://tree/disk.img
to: tree:///metal.raw
- name: metal4k
build: name:build
stages:
- type: org.osbuild.copy
inputs:
tree:
type: org.osbuild.tree
origin: org.osbuild.pipeline
references:
- name:raw-metal4k-image
options:
paths:
- from: input://tree/disk.img
to: tree:///metal4k.raw
- name: qemu
build: name:build
stages:
- type: org.osbuild.qemu
inputs:
image:
type: org.osbuild.files
origin: org.osbuild.pipeline
references:
name:raw-qemu-image:
file: disk.img
options:
filename: qemu.qcow2
format:
type: qcow2
compat: '1.1'