debian-forge/test/data/manifests/fedora-coreos-container.mpp.yaml
Dusty Mabe 2e1f6e2553 tools/osbuild-mpp: support defining multiple image layouts
Right now you can only define a single image, lets add mpp-define-images
and accept a list.
2023-11-29 10:37:08 +01:00

324 lines
9.4 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
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:
- id: 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}"
- id: 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}"
- id: boot
type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4
uuid: 61B2905B-DF3E-4FB3-80FA-49D1E773AA32
size:
mpp-format-int: "{boot_size_mb * 1024 * 1024 / sector_size}"
- id: root
type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4
uuid: CA7D7CCB-63ED-4C53-861C-1742536059CC
size:
mpp-format-int: "{root_size_mb * 1024 * 1024 / 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-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-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: 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'