Versions in this module Expand all Collapse all v0 v0.1.0 Nov 12, 2022 v0.0.1 Nov 10, 2022 Changes in this version + const ChangeAbort + const ChangeApply + const ChangeIgnore + const ContentRollback + const ContentUpdate + const ContentWrite + const GPTPartitionGUIDESP + const SizeLBA48Pointer + const SizeMBR + const SystemBoot + const SystemData + const SystemSave + const SystemSeed + var DefaultConstraints = LayoutConstraints + var ErrDeviceNotFound = errors.New("device not found") + var ErrMountNotFound = errors.New("mount point not found") + var ErrNoFilesystemDefined = errors.New("no filesystem defined") + var ErrNoKernelCommandline = errors.New("no kernel command line in the gadget") + var ErrNoUpdate = errors.New("nothing to update") + func AllDiskVolumeDeviceTraits(allLaidOutVols map[string]*LaidOutVolume, ...) (map[string]DiskVolumeDeviceTraits, error) + func EnsureLayoutCompatibility(gadgetLayout *LaidOutVolume, diskLayout *OnDiskVolume, ...) error + func FindDeviceForStructure(ps *LaidOutStructure) (string, error) — darwin/amd64, linux/amd64 + func IsCompatible(current, new *Info) error + func IsCreatableAtInstall(gv *VolumeStructure) bool + func IsRoleMBR(ls LaidOutStructure) bool + func KernelCommandLineFromGadget(gadgetDirOrSnapPath string) (cmdline string, full bool, err error) + func LoadDiskVolumesDeviceTraits(dir string) (map[string]DiskVolumeDeviceTraits, error) + func MockUpdaterForStructure(...) (restore func()) + func MockVolumeStructureToLocationMap(...) (restore func()) + func SaveDiskVolumesDeviceTraits(dir string, mapping map[string]DiskVolumeDeviceTraits) error + func SystemDefaults(gadgetDefaults map[string]map[string]interface{}) map[string]interface + func Update(model Model, old, new GadgetData, rollbackDirPath string, ...) error + func Validate(info *Info, model Model, extra *ValidationConstraints) error + func ValidateContent(info *Info, gadgetSnapRootDir, kernelSnapRootDir string) error + type Connection struct + Plug ConnectionPlug + Slot ConnectionSlot + type ConnectionPlug struct + Plug string + SnapID string + func (gcplug *ConnectionPlug) Empty() bool + func (gcplug *ConnectionPlug) UnmarshalYAML(unmarshal func(interface{}) error) error + type ConnectionSlot struct + Slot string + SnapID string + func (gcslot *ConnectionSlot) Empty() bool + func (gcslot *ConnectionSlot) UnmarshalYAML(unmarshal func(interface{}) error) error + type ContentChange struct + After string + Before string + type ContentChangeAction int + type ContentObserver interface + Observe func(op ContentOperation, sourceStruct *LaidOutStructure, ...) (ContentChangeAction, error) + type ContentOperation int + type ContentUpdateObserver interface + BeforeWrite func() error + Canceled func() error + type DiskEncryptionMethod string + const EncryptionICE + const EncryptionLUKS + type DiskStructureDeviceTraits struct + FilesystemLabel string + FilesystemType string + FilesystemUUID string + Offset quantity.Offset + OriginalDevicePath string + OriginalKernelPath string + PartitionLabel string + PartitionType string + PartitionUUID string + Size quantity.Size + type DiskVolumeDeviceTraits struct + DiskID string + OriginalDevicePath string + OriginalKernelPath string + Schema string + SectorSize quantity.Size + Size quantity.Size + Structure []DiskStructureDeviceTraits + StructureEncryption map[string]StructureEncryptionParameters + func DiskTraitsFromDeviceAndValidate(expLayout *LaidOutVolume, dev string, opts *DiskVolumeValidationOptions) (res DiskVolumeDeviceTraits, err error) + type DiskVolumeValidationOptions struct + AllowImplicitSystemData bool + ExpectedStructureEncryption map[string]StructureEncryptionParameters + type EnsureLayoutCompatibilityOptions struct + AllowImplicitSystemData bool + AssumeCreatablePartitionsCreated bool + ExpectedStructureEncryption map[string]StructureEncryptionParameters + type GadgetData struct + Info *Info + KernelRootDir string + RootDir string + type Info struct + Connections []Connection + Defaults map[string]map[string]interface{} + Volumes map[string]*Volume + func InfoFromGadgetYaml(gadgetYaml []byte, model Model) (*Info, error) + func ReadInfo(gadgetSnapRootDir string, model Model) (*Info, error) + func ReadInfoAndValidate(gadgetSnapRootDir string, model Model, ...) (*Info, error) + func ReadInfoFromSnapFile(snapf snap.Container, model Model) (*Info, error) + func ReadInfoFromSnapFileNoValidate(snapf snap.Container, model Model) (*Info, error) + type LaidOutContent struct + AbsoluteOffsetWrite *quantity.Offset + Index int + Size quantity.Size + StartOffset quantity.Offset + func (p LaidOutContent) String() string + type LaidOutStructure struct + AbsoluteOffsetWrite *quantity.Offset + LaidOutContent []LaidOutContent + ResolvedContent []ResolvedContent + StartOffset quantity.Offset + YamlIndex int + func ShiftStructureTo(ps LaidOutStructure, offset quantity.Offset) LaidOutStructure + func (p LaidOutStructure) String() string + type LaidOutVolume struct + LaidOutStructure []LaidOutStructure + RootDir string + Size quantity.Size + func LaidOutVolumesFromGadget(gadgetRoot, kernelRoot string, model Model) (system *LaidOutVolume, all map[string]*LaidOutVolume, err error) + func LayoutVolume(volume *Volume, constraints LayoutConstraints, opts *LayoutOptions) (*LaidOutVolume, error) + type LayoutConstraints struct + NonMBRStartOffset quantity.Offset + type LayoutOptions struct + GadgetRootDir string + IgnoreContent bool + KernelRootDir string + SkipResolveContent bool + type Model interface + Classic func() bool + Grade func() asserts.ModelGrade + type MountedFilesystemWriter struct + func NewMountedFilesystemWriter(ps *LaidOutStructure, observer ContentObserver) (*MountedFilesystemWriter, error) + func (m *MountedFilesystemWriter) Write(whereDir string, preserve []string) error + type OnDiskStructure struct + DiskIndex int + Node string + Size quantity.Size + func OnDiskStructureFromPartition(p disks.Partition) (OnDiskStructure, error) + type OnDiskVolume struct + Device string + ID string + Schema string + SectorSize quantity.Size + Size quantity.Size + Structure []OnDiskStructure + UsableSectorsEnd uint64 + func OnDiskVolumeFromDevice(device string) (*OnDiskVolume, error) + func OnDiskVolumeFromDisk(disk disks.Disk) (*OnDiskVolume, error) + type PartiallyLaidOutVolume struct + LaidOutStructure []LaidOutStructure + func LayoutVolumePartially(volume *Volume, constraints LayoutConstraints) (*PartiallyLaidOutVolume, error) + type RawStructureWriter struct + func NewRawStructureWriter(contentDir string, ps *LaidOutStructure) (*RawStructureWriter, error) + func (r *RawStructureWriter) Write(out io.WriteSeeker) error + type RelativeOffset struct + Offset quantity.Offset + RelativeTo string + func (r *RelativeOffset) String() string + func (s *RelativeOffset) UnmarshalYAML(unmarshal func(interface{}) error) error + type ResolvedContent struct + KernelUpdate bool + ResolvedSource string + type ResolvedContentFilterFunc func(*ResolvedContent) bool + func KernelUpdatePolicy(from, to *LaidOutStructure) (bool, ResolvedContentFilterFunc) + func RemodelUpdatePolicy(from, to *LaidOutStructure) (bool, ResolvedContentFilterFunc) + type StructureEncryptionParameters struct + Method DiskEncryptionMethod + func (s *StructureEncryptionParameters) UnmarshalJSON(b []byte) error + type StructureLocation struct + Device string + Offset quantity.Offset + RootMountPoint string + type UpdatePolicyFunc func(from, to *LaidOutStructure) (bool, ResolvedContentFilterFunc) + type Updater interface + Backup func() error + Rollback func() error + Update func() error + type ValidationConstraints struct + EncryptedData bool + type Volume struct + Bootloader string + ID string + Name string + Schema string + Structure []VolumeStructure + type VolumeContent struct + Image string + Offset *quantity.Offset + OffsetWrite *RelativeOffset + Size quantity.Size + Target string + Unpack bool + UnresolvedSource string + func (vc VolumeContent) String() string + type VolumeStructure struct + Content []VolumeContent + Device string + Filesystem string + ID string + Label string + Name string + Offset *quantity.Offset + OffsetWrite *RelativeOffset + Role string + Size quantity.Size + Type string + Update VolumeUpdate + VolumeName string + func (vs *VolumeStructure) HasFilesystem() bool + func (vs *VolumeStructure) IsPartition() bool + type VolumeUpdate struct + Edition edition.Number + Preserve []string