debian-forge-composer/internal/osbuild2/loopback_device.go
Achilleas Koutsou e85fc3b48c 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
2021-07-24 15:54:00 +02:00

26 lines
618 B
Go

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