Skip to content

Commit 89d331c

Browse files
committed
osbuild: add support for creating nvidiabluefield images
This is a proof of concept right now.
1 parent c6612bc commit 89d331c

5 files changed

Lines changed: 147 additions & 24 deletions

File tree

build.sh

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -193,27 +193,27 @@ write_archive_info() {
193193
}
194194

195195
patch_osbuild() {
196-
return # No patches at this time
197-
### Add a few patches that either haven't made it into a release or
198-
### that will be obsoleted with other work that will be done soon.
199-
###
200-
### To make it easier to apply patches we'll move around the osbuild
201-
### code on the system first:
202-
##rmdir /usr/lib/osbuild/osbuild
203-
##python_lib_dir=$(ls -d /usr/lib/python*)
204-
##mv "${python_lib_dir}/site-packages/osbuild" /usr/lib/osbuild/
205-
##mkdir -p /usr/lib/osbuild/tools
206-
##mv /usr/bin/osbuild-mpp /usr/lib/osbuild/tools/
207-
### Now all the software is under the /usr/lib/osbuild dir and we can patch
208-
### shellcheck disable=SC2002
209-
##cat \
210-
## /usr/lib/coreos-assembler/foo.patch \
211-
## | patch -d /usr/lib/osbuild -p1
212-
### And then move the files back; supermin appliance creation will need it back
213-
### in the places delivered by the RPM.
214-
##mv /usr/lib/osbuild/tools/osbuild-mpp /usr/bin/osbuild-mpp
215-
##mv /usr/lib/osbuild/osbuild "${python_lib_dir}/site-packages/osbuild"
216-
##mkdir -p /usr/lib/osbuild/osbuild
196+
##return # No patches at this time
197+
# Add a few patches that either haven't made it into a release or
198+
# that will be obsoleted with other work that will be done soon.
199+
#
200+
# To make it easier to apply patches we'll move around the osbuild
201+
# code on the system first:
202+
rmdir /usr/lib/osbuild/osbuild
203+
python_lib_dir=$(ls -d /usr/lib/python*)
204+
mv "${python_lib_dir}/site-packages/osbuild" /usr/lib/osbuild/
205+
mkdir -p /usr/lib/osbuild/tools
206+
mv /usr/bin/osbuild-mpp /usr/lib/osbuild/tools/
207+
# Now all the software is under the /usr/lib/osbuild dir and we can patch
208+
# shellcheck disable=SC2002
209+
cat \
210+
/usr/lib/coreos-assembler/0001-stages-add-org.osbuild.bfb-for-NVIDIA-BlueField-DPUs.patch \
211+
| patch -d /usr/lib/osbuild -p1
212+
# And then move the files back; supermin appliance creation will need it back
213+
# in the places delivered by the RPM.
214+
mv /usr/lib/osbuild/tools/osbuild-mpp /usr/bin/osbuild-mpp
215+
mv /usr/lib/osbuild/osbuild "${python_lib_dir}/site-packages/osbuild"
216+
mkdir -p /usr/lib/osbuild/osbuild
217217
}
218218

219219
fixup_file_permissions() {

src/cmd-osbuild

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ declare -A SUPPORTED_PLATFORMS=(
2323
['metal4k']='raw'
2424
['metal']='raw'
2525
['nutanix']='qcow2'
26+
['nvidiabluefield']='bfb'
2627
['openstack']='qcow2'
2728
['oraclecloud']='qcow2'
2829
['proxmoxve']='qcow2'
@@ -262,6 +263,7 @@ main() {
262263
"cmd-buildextend-ibmcloud") platforms=(ibmcloud);;
263264
"cmd-buildextend-kubevirt") platforms=(kubevirt);;
264265
"cmd-buildextend-nutanix") platforms=(nutanix);;
266+
"cmd-buildextend-nvidiabluefield") platforms=(nvidiabluefield);;
265267
"cmd-buildextend-openstack") platforms=(openstack);;
266268
"cmd-buildextend-oraclecloud") platforms=(oraclecloud);;
267269
"cmd-buildextend-proxmoxve") platforms=(proxmoxve);;
@@ -423,7 +425,7 @@ main() {
423425

424426
# Perform postprocessing
425427
case "$platform" in
426-
gcp|kubevirt|nutanix)
428+
gcp|kubevirt|nutanix|nvidiabluefield)
427429
# Update the meta.json and builddir with the generated artifact.
428430
# Skip Compression on these platforms as they are either already
429431
# compressed or the artifact itself has internal compression enabled.

src/cmdlib.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,8 +746,8 @@ runvm() {
746746
# include COSA in the image
747747
find /usr/lib/coreos-assembler/ -type f > "${vmpreparedir}/hostfiles"
748748
cat <<EOF >> "${vmpreparedir}/hostfiles"
749-
/usr/lib/osbuild/stages/org.osbuild.coreos.live-artifacts.mono
750-
/usr/lib/osbuild/stages/org.osbuild.coreos.live-artifacts.mono.meta.json
749+
/usr/lib/osbuild/stages/org.osbuild.bfb
750+
/usr/lib/osbuild/stages/org.osbuild.bfb.meta.json
751751
EOF
752752

753753
# and include all GPG keys

src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,3 +775,5 @@ pipelines:
775775
path: platform.qemu.ipp.yaml
776776
- mpp-import-pipelines:
777777
path: platform.live.ipp.yaml
778+
- mpp-import-pipelines:
779+
path: platform.nvidiabluefield.yaml
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# This file defines the pipeline for building the NVIDIA Bluefield artifacts.
2+
version: '2'
3+
pipelines:
4+
- name: nvidiabluefield-buildroot
5+
stages:
6+
# Copy in the original buildroot
7+
- type: org.osbuild.copy
8+
inputs:
9+
tree:
10+
type: org.osbuild.tree
11+
origin: org.osbuild.pipeline
12+
references:
13+
- mpp-format-string: '{buildroot}'
14+
options:
15+
paths:
16+
- from: input://tree/
17+
to: tree:///
18+
devices:
19+
disk:
20+
type: org.osbuild.loopback
21+
options:
22+
filename: disk.img
23+
partscan: true
24+
# And then install two mlx* RPMs that will be used to create the BFB image
25+
- type: org.osbuild.rpm
26+
inputs:
27+
packages:
28+
type: org.osbuild.files
29+
origin: org.osbuild.source
30+
mpp-depsolve:
31+
architecture:
32+
mpp-format-string: '{arch}'
33+
repos:
34+
- id: mellanox
35+
# Using `rhel-9.6` here because the packages we need aren't in the rhel 10 versions of the repos yet.
36+
baseurl: https://linux.mellanox.com/public/repo/doca/3.3.0/rhel9.6/arm64-dpu
37+
packages:
38+
# mlxbf-bfscripts contains the mlx-mkbfb.py, a python script that runs well with the stdlib
39+
- mlxbf-bfscripts
40+
# mlxbf-bootimages-signed contains the binary blobs we use to build the BFB
41+
- mlxbf-bootimages-signed
42+
excludes:
43+
- binutils
44+
- mlxbf-bootctl
45+
options:
46+
exclude:
47+
docs: true
48+
gpgkeys:
49+
# https://linux.mellanox.com/public/repo/doca/latest-3.2-LTS/rhel9.6/aarch64/GPG-KEY-Mellanox.pub
50+
- |
51+
-----BEGIN PGP PUBLIC KEY BLOCK-----
52+
Version: GnuPG v1
53+
54+
mQENBFpbc0cBCADDST+ekKD1YJje77oDX94gRolmUlh0df4n6/xvE700M1vPAiTT
55+
kU3WJcvwnuTZpyMGSsAQCXXQRJuQObnkPEvjVAPgh8fvghCXgVElcr6dqXu3EVze
56+
iCkdYm08t/+FF3kg/P6VYPjgEM/GIFnKTz37LrQlUM4ArG0ENIYM9xjurnKWuV9r
57+
JuckJcUsmZUS/D9QMM2fuurYOEWHrE8t+n2EcO4aoY2x0ogYce0vON539rJiskjz
58+
OPhIB9G7ZFQabQnyxzEKiUUDyJsbe38XDT4eyjUR2mlHGgTY/WzGdDEtIKRBWsd3
59+
TV3wXt42nF9YA3oieeaTbIluyywNnOj1vyT1ABEBAAG0VU1lbGxhbm94IFRlY2hu
60+
b2xvZ2llcyAoTWVsbGFub3ggVGVjaG5vbG9naWVzIC0gU2lnbmluZyBLZXkgdjMp
61+
IDxzdXBwb3J0QG1lbGxhbm94LmNvbT6JATcEEwEIACEFAlpbc0cCGwMFCwkIBwMF
62+
FQoJCAsFFgIDAQACHgECF4AACgkQoCT28ObWooFXYwgAunwBFELGlwKonnmnbi4/
63+
avUa8e0wRpww//DJjI0HQWjMk7oPLDbS50CVps1Mu0SxBAPYGtsFeSH6UMC6A0K4
64+
yoxXICVl409vYkycNu/vq6eLTbM2Y0PFvBDzRAf3rJXL0ApLuUb57ARZvc7Np7LA
65+
v8K53PdOJUEFns8Ipp+2puEVx5dfezm7LwRca6ohoLUEdI/PobmGUeNvO5dvfiix
66+
LvSVw2A2awihB7dcs5cpo57VxBWPs7+sYBZ0+EUJbtQEiHAyPvKs29nMeaCIwPTd
67+
88A5RrhsEJx+QWXuG6NA4rfehy5e9j1PW3XnC2fMl6w7gNLY5I8Vq6c2MJ73NZ6y
68+
wLkBDQRaW3NHAQgAynkQ+mf4f5cdM4/bJuRWlPxxuN3CUxN9Q6B5B1/13p6tkydP
69+
C7S4ro8H8sSlO5FbbxihfZLPTbFNrBkd///OQYMJW/slbtT6D9dYmCIeuHObMEMb
70+
V+Bn1bWQId2vZgr0+m0Xe3K+KqhsylsrmC1ebShMnny/V+MlOQQt+L089BNiyCB4
71+
70mhgM1NiJFv9EOQlXWWaMqWTxZGYkdOuFW0q8NnSGOqI5xjrAUxaHZ/1U3yPy0k
72+
eAjX1AKJngaj86SvIzEefxq4oA2gZ8UFVO/qFH5OhfoovrEwudJEuIgGb76XOb9m
73+
AoZlAqQLJniC97ld515ivBdSi4SZkaFbypnX4QARAQABiQEfBBgBCAAJBQJaW3NH
74+
AhsMAAoJEKAk9vDm1qKBHhMIAJuGbb6S3nb2xAD3GjB8F2xNcZxWQ+Qz70DY5vV/
75+
WhrJl7cknXMxsbWvQupuYk6LujZraG9YoD4csZ5o+k3s3BGKVUXdZdhjaHpcAa5F
76+
X12ADLHca5mlmdCaaORYXQ+xHYRlOKas4I6LPpZ79BauVomEnPcv/bL0kGFzDvLr
77+
K3RdQ1n/pbcWcxxSY3InphAnslLUg0PTAME6Yay5F7WrJsnZnXApUjOlZvlPIl2c
78+
iplivN8o85eBKQXvYRg/c5iyc0koTmkM6OXNvUy0hV9z8WhhK9O+ApXwMUMf43DS
79+
KOIg9RxhZFQoPXptaQZDLz89sWmZaiXsyBPJyjlmaTjwHGM=
80+
=Iy5R
81+
-----END PGP PUBLIC KEY BLOCK-----
82+
- name: nvidiabluefield
83+
build: name:nvidiabluefield-buildroot
84+
stages:
85+
- type: org.osbuild.coreos.live-artifacts.mono
86+
inputs:
87+
kernel:
88+
type: org.osbuild.files
89+
origin: org.osbuild.pipeline
90+
references:
91+
name:live:
92+
file:
93+
mpp-format-string: '/{artifact_name_prefix}-live-kernel.{arch}'
94+
initramfs:
95+
type: org.osbuild.files
96+
origin: org.osbuild.pipeline
97+
references:
98+
name:live:
99+
file:
100+
mpp-format-string: '/{artifact_name_prefix}-live-initramfs.{arch}.img'
101+
rootfs:
102+
type: org.osbuild.files
103+
origin: org.osbuild.pipeline
104+
references:
105+
name:live:
106+
file:
107+
mpp-format-string: '/{artifact_name_prefix}-live-rootfs.{arch}.img'
108+
options:
109+
boot_args_v2:
110+
- "console=hvc0"
111+
- "console=ttyAMA0"
112+
- "earlycon=pl011,0x13010000"
113+
- "initrd=initramfs"
114+
- "modprobe.blacklist=mlxbf_pmc"
115+
- "ignition.firstboot"
116+
- "ignition.platform.id=nvidiabluefield"
117+
filename:
118+
mpp-format-string: '{artifact_name_prefix}-nvidiabluefield.{arch}.bfb'
119+

0 commit comments

Comments
 (0)