tests: add metal output to fedora-coreos-container manifest

Also switch the qcow2 output to be a "qemu" platform image. This
change takes advantage of the recent org.osbuild.kernel-cmdline.bls-append
stage addition to modify kernel arguments in later pipelines.

To get a qemu image output:

- osbuild --output-directory out/ --export qemu test/data/manifests/fedora-coreos-container.json

To get a metal image output:

- osbuild --output-directory out/ --export metal test/data/manifests/fedora-coreos-container.json
This commit is contained in:
Dusty Mabe 2023-11-06 20:23:43 -05:00 committed by Achilleas Koutsou
parent 52adfe01f7
commit 0529ae79d1
3 changed files with 233 additions and 20 deletions

View file

@ -442,7 +442,7 @@
]
},
{
"name": "image-tree",
"name": "tree",
"build": "name:build",
"source-epoch": 1659397331,
"stages": [
@ -492,9 +492,6 @@
],
"kernel_opts": [
"rw",
"console=tty0",
"console=ttyS0",
"ignition.platform.id=qemu",
"$ignition_firstboot"
]
},
@ -541,7 +538,7 @@
]
},
{
"name": "image",
"name": "raw-image",
"build": "name:build",
"stages": [
{
@ -654,7 +651,7 @@
"type": "org.osbuild.tree",
"origin": "org.osbuild.pipeline",
"references": [
"name:image-tree"
"name:tree"
]
}
},
@ -735,7 +732,141 @@
]
},
{
"name": "qcow2",
"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": 264192,
"size": 786432
}
}
},
"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": 264192,
"size": 786432
}
}
},
"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": [
{
@ -745,14 +876,14 @@
"type": "org.osbuild.files",
"origin": "org.osbuild.pipeline",
"references": {
"name:image": {
"name:raw-qemu-image": {
"file": "disk.img"
}
}
}
},
"options": {
"filename": "disk.qcow2",
"filename": "qemu.qcow2",
"format": {
"type": "qcow2",
"compat": "1.1"

View file

@ -33,7 +33,7 @@ pipelines:
id: build
runner:
mpp-format-string: org.osbuild.fedora{release}
- name: image-tree
- name: tree
build: name:build
source-epoch: 1659397331
stages:
@ -63,9 +63,6 @@ pipelines:
- /boot/efi
kernel_opts:
- rw
- console=tty0
- console=ttyS0
- ignition.platform.id=qemu
- '$ignition_firstboot'
inputs:
images:
@ -93,7 +90,7 @@ pipelines:
write_defaults: false
greenboot: false
ignition: true
- name: image
- name: raw-image
build: name:build
stages:
- type: org.osbuild.truncate
@ -157,7 +154,7 @@ pipelines:
type: org.osbuild.tree
origin: org.osbuild.pipeline
references:
- name:image-tree
- name:tree
options:
paths:
- from: input://tree/
@ -217,7 +214,89 @@ pipelines:
number:
mpp-format-int: '{image.layout[''boot''].index}'
path: /grub2
- name: qcow2
- 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
@ -226,10 +305,10 @@ pipelines:
type: org.osbuild.files
origin: org.osbuild.pipeline
references:
name:image:
name:raw-qemu-image:
file: disk.img
options:
filename: disk.qcow2
filename: qemu.qcow2
format:
type: qcow2
compat: '1.1'