Skip to content

osbuild: use bootc install to deploy the container #4224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,25 +177,25 @@ write_archive_info() {
}

patch_osbuild() {
return # we have no patches right now
# return # we have no patches right now
## Add a few patches that either haven't made it into a release or
## that will be obsoleted with other work that will be done soon.

## To make it easier to apply patches we'll move around the osbuild
## code on the system first:
#rmdir /usr/lib/osbuild/osbuild
#mv /usr/lib/python3.13/site-packages/osbuild /usr/lib/osbuild/
#mkdir /usr/lib/osbuild/tools
#mv /usr/bin/osbuild-mpp /usr/lib/osbuild/tools/
rmdir /usr/lib/osbuild/osbuild
mv /usr/lib/python3.13/site-packages/osbuild /usr/lib/osbuild/
mkdir /usr/lib/osbuild/tools
mv /usr/bin/osbuild-mpp /usr/lib/osbuild/tools/

## Now all the software is under the /usr/lib/osbuild dir and we can patch
#cat foo.patch | patch -d /usr/lib/osbuild -p1
patch -d /usr/lib/osbuild -p1 < src/0001-stages-ignition-parametrize-the-path-to-boot.patch
#
## And then move the files back; supermin appliance creation will need it back
## in the places delivered by the RPM.
#mv /usr/lib/osbuild/tools/osbuild-mpp /usr/bin/osbuild-mpp
#mv /usr/lib/osbuild/osbuild /usr/lib/python3.13/site-packages/osbuild
#mkdir /usr/lib/osbuild/osbuild
mv /usr/lib/osbuild/tools/osbuild-mpp /usr/bin/osbuild-mpp
mv /usr/lib/osbuild/osbuild /usr/lib/python3.13/site-packages/osbuild
mkdir /usr/lib/osbuild/osbuild
}

if [ $# -ne 0 ]; then
Expand Down
69 changes: 69 additions & 0 deletions src/0001-stages-ignition-parametrize-the-path-to-boot.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
From e37bd5d256c02f2a7693ec220322cf131e8e5274 Mon Sep 17 00:00:00 2001
From: jbtrystram <[email protected]>
Date: Thu, 17 Jul 2025 15:59:27 +0200
Subject: [PATCH] stages/ignition: parametrize the path to boot

Allow passing a mount to specify where to write the igntion.firstboot
file.
This keeps the default `tree:///` value to not break existing stages.
---
stages/org.osbuild.ignition | 13 ++++++++-----
stages/org.osbuild.ignition.meta.json | 5 +++++
2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/stages/org.osbuild.ignition b/stages/org.osbuild.ignition
index 23f91c48..4466cabf 100755
--- a/stages/org.osbuild.ignition
+++ b/stages/org.osbuild.ignition
@@ -2,18 +2,17 @@
import sys

import osbuild.api
+from osbuild.util import parsing


-def main(tree, options):
- network = options.get("network", [])
-
+def main(network, location):
# grub, when detecting the '/boot/ignition.firstboot' file
# will set the "ignition_firstboot" option so that ignition
# gets triggered during that boot. Additionally, the file
# itself will be sourced this the 'ignition_network_kcmdline'
# that is also in the "ignition_firstboot" variable can be
# overwritten with the contents of `network`
- with open(f"{tree}/boot/ignition.firstboot", "w", encoding="utf8") as f:
+ with open(f"{location}/ignition.firstboot", "w", encoding="utf8") as f:
if network:
netstr = " ".join(network)
f.write(f"set ignition_network_kcmdline='{netstr}'")
@@ -23,5 +22,9 @@ def main(tree, options):

if __name__ == '__main__':
args = osbuild.api.arguments()
- r = main(args["tree"], args.get("options", {}))
+ options = args.get("options", {})
+ target = options.get("target", "tree:///boot")
+ location = parsing.parse_location(target, args)
+ network = options.get("network", [])
+ r = main(network, location)
sys.exit(r)
diff --git a/stages/org.osbuild.ignition.meta.json b/stages/org.osbuild.ignition.meta.json
index 612d59c7..dd295c24 100644
--- a/stages/org.osbuild.ignition.meta.json
+++ b/stages/org.osbuild.ignition.meta.json
@@ -22,6 +22,11 @@
"items": {
"type": "string"
}
+ },
+ "target": {
+ "type": "string",
+ "description": "Location to write the 'ignition.firstboot' file.",
+ "default": "tree:///boot"
}
}
}
--
2.50.1

Loading
Loading