create org.osbuild.bootupd stage

Add the bootupd stage to install GRUB on both BIOS and UEFI systems,
ensuring that your bootloader stays up-to-date.

Signed-off-by: Renata Ravanelli <rravanel@redhat.com>
This commit is contained in:
Renata Ravanelli 2023-11-16 09:41:18 -05:00 committed by Achilleas Koutsou
parent c03e6be52a
commit cdcb4598bb
3 changed files with 275 additions and 62 deletions

View file

@ -529,25 +529,6 @@
"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
}
}
]
},
@ -715,23 +696,49 @@
]
},
{
"type": "org.osbuild.grub2.inst",
"type": "org.osbuild.bootupd",
"options": {
"platform": "i386-pc",
"filename": "disk.img",
"location": 2048,
"core": {
"type": "mkimage",
"partlabel": "gpt",
"filesystem": "ext4"
"bios": {
"device": "disk"
},
"prefix": {
"type": "partition",
"partlabel": "gpt",
"number": 2,
"path": "/grub2"
"static-configs": true,
"deployment": {
"osname": "fedora-coreos",
"ref": "ostree/1/1/0"
}
}
},
"devices": {
"disk": {
"type": "org.osbuild.loopback",
"options": {
"filename": "disk.img",
"partscan": true
}
}
},
"mounts": [
{
"name": "root",
"type": "org.osbuild.xfs",
"source": "disk",
"partition": 4,
"target": "/"
},
{
"name": "boot",
"type": "org.osbuild.ext4",
"source": "disk",
"partition": 3,
"target": "/boot"
},
{
"name": "efi",
"type": "org.osbuild.fat",
"source": "disk",
"partition": 2,
"target": "/boot/efi"
}
]
}
]
},
@ -902,6 +909,49 @@
"target": "/boot/efi"
}
]
},
{
"type": "org.osbuild.bootupd",
"options": {
"static-configs": true,
"deployment": {
"osname": "fedora-coreos",
"ref": "ostree/1/1/0"
}
},
"devices": {
"disk": {
"type": "org.osbuild.loopback",
"options": {
"filename": "disk.img",
"partscan": true,
"sector-size": 4096
}
}
},
"mounts": [
{
"name": "root",
"type": "org.osbuild.xfs",
"source": "disk",
"partition": 4,
"target": "/"
},
{
"name": "boot",
"type": "org.osbuild.ext4",
"source": "disk",
"partition": 3,
"target": "/boot"
},
{
"name": "efi",
"type": "org.osbuild.fat",
"source": "disk",
"partition": 2,
"target": "/boot/efi"
}
]
}
]
},

View file

@ -124,19 +124,6 @@ pipelines:
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:
@ -231,23 +218,39 @@ pipelines:
partition:
mpp-format-int: '{image.layout[''EFI-SYSTEM''].partnum}'
target: /boot/efi
- type: org.osbuild.grub2.inst
- type: org.osbuild.bootupd
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
bios:
device: disk
static-configs: true
deployment:
osname: fedora-coreos
ref: ostree/1/1/0
devices:
disk:
type: org.osbuild.loopback
options:
filename: disk.img
partscan: true
mounts:
- name: root
type: org.osbuild.xfs
source: disk
partition:
mpp-format-int: '{image.layout[''root''].partnum}'
target: /
- name: boot
type: org.osbuild.ext4
source: disk
partition:
mpp-format-int: '{image.layout[''boot''].partnum}'
target: /boot
- name: efi
type: org.osbuild.fat
source: disk
partition:
mpp-format-int: '{image.layout[''EFI-SYSTEM''].partnum}'
target: /boot/efi
- name: raw-4k-image
build: name:build
stages:
@ -352,6 +355,39 @@ pipelines:
partition:
mpp-format-int: '{image4k.layout[''EFI-SYSTEM''].partnum}'
target: /boot/efi
- type: org.osbuild.bootupd
options:
static-configs: true
deployment:
osname: fedora-coreos
ref: ostree/1/1/0
devices:
disk:
type: org.osbuild.loopback
options:
filename: disk.img
partscan: true
sector-size:
mpp-format-int: "{four_k_sector_size}"
mounts:
- name: root
type: org.osbuild.xfs
source: disk
partition:
mpp-format-int: '{image4k.layout[''root''].partnum}'
target: /
- name: boot
type: org.osbuild.ext4
source: disk
partition:
mpp-format-int: '{image4k.layout[''boot''].partnum}'
target: /boot
- name: efi
type: org.osbuild.fat
source: disk
partition:
mpp-format-int: '{image4k.layout[''EFI-SYSTEM''].partnum}'
target: /boot/efi
- name: raw-metal-image
build: name:build
stages: