osbuild: add ostree.deployment mount type

New mount type added: org.osbuild.ostree.deployment.

Adding this to a stage will setup all needed bind mounts so that a given
`tree` will look like an active OSTree deployment, very much as OSTree
does during early boot.

This is often necessary when making changes to files in /etc for an
ostree image.
This commit is contained in:
Achilleas Koutsou 2022-08-22 12:57:16 +02:00 committed by Tom Gundersen
parent 7246f8fdd5
commit 4a68df45c7

View file

@ -0,0 +1,32 @@
package osbuild
type OSTreeMountOptions struct {
Deployment OSTreeMountDeployment `json:"deployment"`
}
func (OSTreeMountOptions) isMountOptions() {}
type OSTreeMountDeployment struct {
// Name of the stateroot to be used in the deployment
OSName string `json:"osname"`
// OStree ref to create and use for deployment
Ref string `json:"ref"`
// The deployment serial (usually '0')
Serial *int `json:"serial,omitempty"`
}
func NewOSTreeDeploymentMount(name, osName, ref string, serial int) *Mount {
return &Mount{
Type: "org.osbuild.ostree.deployment",
Name: name,
Options: &OSTreeMountOptions{
Deployment: OSTreeMountDeployment{
OSName: osName,
Ref: ref,
Serial: &serial,
},
},
}
}