osbuild2: new stages and osbuild features
Stages: - org.osbuild.copy - org.osbuild.truncate - org.osbuild.sfdisk - org.osbuild.qemu - org.osbuild.mkfs.btrfs - org.osbuild.mkfs.ext4 - org.osbuild.mkfs.fat - org.osbuild.mkfs.xfs - org.osbuild.grub2.inst Stages can now have devices and mounts in addition to options and inputs. Devices: - org.osbuild.loopback Mounts: - org.osbuild.btrfs - org.osbuild.ext4 - org.osbuild.fat - org.osbuild.xfs
This commit is contained in:
parent
4cf26bb628
commit
e85fc3b48c
17 changed files with 510 additions and 0 deletions
26
internal/osbuild2/loopback_device.go
Normal file
26
internal/osbuild2/loopback_device.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package osbuild2
|
||||
|
||||
// Expose a file (or part of it) as a device node
|
||||
|
||||
type LoopbackDeviceOptions struct {
|
||||
// File to associate with the loopback device
|
||||
Filename string `json:"filename"`
|
||||
|
||||
// Start of the data segment
|
||||
Start uint64 `json:"start,omitempty"`
|
||||
|
||||
// Size limit of the data segment (in sectors)
|
||||
Size uint64 `json:"size,omitempty"`
|
||||
|
||||
// Sector size (in bytes)
|
||||
SectorSize *uint64 `json:"sector-size,omitempty"`
|
||||
}
|
||||
|
||||
func (LoopbackDeviceOptions) isDeviceOptions() {}
|
||||
|
||||
func NewLoopbackDevice(options *LoopbackDeviceOptions) *Device {
|
||||
return &Device{
|
||||
Type: "org.osbuild.loopback",
|
||||
Options: options,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue