stages/bootc.install: make boot and root mount spec customizable
Allow passing custom mount specs for boot and root. Optional fields.
This commit is contained in:
parent
825045a914
commit
e930eeb519
2 changed files with 31 additions and 2 deletions
|
|
@ -46,6 +46,23 @@ def main(options, inputs, paths):
|
||||||
stateroot = options.get("stateroot")
|
stateroot = options.get("stateroot")
|
||||||
if stateroot:
|
if stateroot:
|
||||||
pargs.extend(["--stateroot", stateroot])
|
pargs.extend(["--stateroot", stateroot])
|
||||||
|
# Passing the flag with an empty value is intentional:
|
||||||
|
# it triggers a supported behaviour where mountspec
|
||||||
|
# kernel arguments are ommited.
|
||||||
|
# See https://github.com/bootc-dev/bootc/pull/1451
|
||||||
|
if "root-mount-spec" in options:
|
||||||
|
root_spec = options["root-mount-spec"]
|
||||||
|
if root_spec == "":
|
||||||
|
pargs.extend(["--root-mount-spec="])
|
||||||
|
else:
|
||||||
|
pargs.extend(["--root-mount-spec", root_spec])
|
||||||
|
if "boot-mount-spec" in options:
|
||||||
|
boot_spec = options["boot-mount-spec"]
|
||||||
|
if boot_spec == "":
|
||||||
|
pargs.extend(["--boot-mount-spec="])
|
||||||
|
else:
|
||||||
|
pargs.extend(["--boot-mount-spec", boot_spec])
|
||||||
|
|
||||||
# add target and go
|
# add target and go
|
||||||
pargs.append(dst)
|
pargs.append(dst)
|
||||||
subprocess.run(pargs, env=env, check=True)
|
subprocess.run(pargs, env=env, check=True)
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,16 @@
|
||||||
"mounted in the \"mounts\" path.",
|
"mounted in the \"mounts\" path.",
|
||||||
"Buildhost commands used: bootc"
|
"Buildhost commands used: bootc"
|
||||||
],
|
],
|
||||||
"capabilities": ["CAP_MAC_ADMIN"],
|
"capabilities": [
|
||||||
|
"CAP_MAC_ADMIN"
|
||||||
|
],
|
||||||
"schema_2": {
|
"schema_2": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"required": ["images"],
|
"required": [
|
||||||
|
"images"
|
||||||
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"images": {
|
"images": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|
@ -44,6 +48,14 @@
|
||||||
"stateroot": {
|
"stateroot": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The stateroot name to use. If not specified, defer to bootc's default"
|
"description": "The stateroot name to use. If not specified, defer to bootc's default"
|
||||||
|
},
|
||||||
|
"root-mount-spec": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Source device specification for the root filesystem. If not provided, the UUID of the target filesystem will be used."
|
||||||
|
},
|
||||||
|
"boot-mount-spec": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Mount specification for the /boot filesystem. If `/boot` is detected as a mounted partition, then its UUID will be used."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue