debian-forge-composer/internal/osbuild/ostree_deployment_mount.go
Achilleas Koutsou 4a68df45c7 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.
2022-09-13 16:06:19 +01:00

32 lines
725 B
Go

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,
},
},
}
}