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:
parent
7246f8fdd5
commit
4a68df45c7
1 changed files with 32 additions and 0 deletions
32
internal/osbuild/ostree_deployment_mount.go
Normal file
32
internal/osbuild/ostree_deployment_mount.go
Normal 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,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue