stages/sfdisk: use device instead of file

Instead of operating directly on a file, which was previously specified
by `filename`, operate on a device. This is more flexible since a file
can be accessed via a loop back device; but the inverse is obviously
not true, like other devices can not be accessed via a plain file.
Therefore, re-factor the stage to use a device and adapt the existing
test (`fedora-ostree-image`).
This commit is contained in:
Christian Kellner 2021-06-13 18:37:00 +02:00 committed by Tom Gundersen
parent 386ff713cc
commit 98133add11
3 changed files with 77 additions and 56 deletions

View file

@ -840,8 +840,15 @@
},
{
"type": "org.osbuild.sfdisk",
"devices": {
"device": {
"type": "org.osbuild.loopback",
"options": {
"filename": "disk.img"
}
}
},
"options": {
"filename": "disk.img",
"uuid": "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
"label": "gpt",
"partitions": [

View file

@ -171,8 +171,15 @@
},
{
"type": "org.osbuild.sfdisk",
"devices": {
"device": {
"type": "org.osbuild.loopback",
"options": {
"filename": "disk.img"
}
}
},
"options": {
"filename": "disk.img",
"uuid": "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
"label": "gpt",
"partitions": [