Documentation ¶
Index ¶
- Constants
- Variables
- func AtomicRsync(src, dst string, transitionalPath string, finalPath string, excluded []string, ...) error
- func AtomicSwap(src, dst string) error
- func BaseImagePackageDiff(currentDigest, newDigest string) (added, upgraded, downgraded, removed []diff.PackageDiff, err error)
- func CopyFile(source, dest string) error
- func DeleteImageForRoot(root string) error
- func DiffFiles(sourceFile, destFile string) ([]byte, error)
- func FindImageWithLabel(key, value string) (string, error)
- func GetLogFile() *os.File
- func GetRepoContentsForPkg(pkg string) (map[string]interface{}, error)
- func GetToken() (string, error)
- func IsVerbose() bool
- func KargsBackup() error
- func KargsEdit() (bool, error)
- func KargsFormat(content string) (string, error)
- func KargsRead() (string, error)
- func KargsWrite(content string) error
- func LogToFile(msg string, args ...interface{}) error
- func MergeDiff(firstFile, secondFile, destination string) error
- func OciExportRootFs(buildImageName string, imageRecipe *ImageRecipe, transDir string, dest string) error
- func OverlayPackageDiff() (added, upgraded, downgraded, removed []diff.PackageDiff, err error)
- func PrintVerbose(prefix, level string, depth float32, args ...interface{})
- func PrintVerboseErr(prefix string, depth float32, args ...interface{})
- func PrintVerboseErrNoLog(prefix string, depth float32, args ...interface{})
- func PrintVerboseInfo(prefix string, args ...interface{})
- func PrintVerboseInfoNoLog(prefix string, args ...interface{})
- func PrintVerboseNoLog(prefix, level string, depth float32, args ...interface{})
- func PrintVerboseSimple(args ...interface{})
- func PrintVerboseSimpleNoLog(args ...interface{})
- func PrintVerboseWarn(prefix string, depth float32, args ...interface{})
- func PrintVerboseWarnNoLog(prefix string, depth float32, args ...interface{})
- func RetrieveImageForRoot(root string) (string, error)
- func RootCheck(display bool) bool
- func WriteDiff(destFile string, diffLines []byte) error
- type ABImage
- type ABRollbackResponse
- type ABRootManager
- func (a *ABRootManager) GetBoot() (partition Partition, err error)
- func (a *ABRootManager) GetFuture() (partition ABRootPartition, err error)
- func (a *ABRootManager) GetInit() (partition Partition, err error)
- func (a *ABRootManager) GetOther() (partition ABRootPartition, err error)
- func (a *ABRootManager) GetPartition(label string) (partition ABRootPartition, err error)
- func (a *ABRootManager) GetPartitions() error
- func (a *ABRootManager) GetPresent() (partition ABRootPartition, err error)
- func (a *ABRootManager) IdentifyPartition(partition Partition) (identifiedAs string, err error)
- func (a *ABRootManager) IsCurrent(partition Partition) bool
- type ABRootPartition
- type ABRootPkgManagerStatus
- type ABSystem
- func (s *ABSystem) CheckAll() error
- func (s *ABSystem) CheckUpdate() (string, bool)
- func (s *ABSystem) CreateRootSymlinks(systemNewPath string) error
- func (s *ABSystem) CreateStageFile() error
- func (s *ABSystem) LockUpgrade() error
- func (s *ABSystem) RemoveStageFile() error
- func (s *ABSystem) Rollback(checkOnly bool) (response ABRollbackResponse, err error)
- func (s *ABSystem) RunOperation(operation ABSystemOperation) error
- func (s *ABSystem) UnlockUpgrade() error
- func (s *ABSystem) UpgradeLockExists() bool
- func (s *ABSystem) UserLockRequested() bool
- type ABSystemOperation
- type Checks
- type Children
- type Chroot
- type ConfEditResult
- type DiskManager
- type GPUInfo
- type Grub
- type ImageRecipe
- type IntegrityCheck
- type Manifest
- type NotEnoughSpaceError
- type PCSpecs
- type PackageManager
- func (p *PackageManager) AcceptUserAgreement() error
- func (p *PackageManager) Add(pkg string) error
- func (p *PackageManager) CheckStatus() error
- func (p *PackageManager) ClearUnstagedPackages() error
- func (p *PackageManager) ExistsInRepo(pkg string) error
- func (p *PackageManager) GetAddPackages() ([]string, error)
- func (p *PackageManager) GetAddPackagesString(sep string) (string, error)
- func (p *PackageManager) GetFinalCmd(operation ABSystemOperation) string
- func (p *PackageManager) GetRemovePackages() ([]string, error)
- func (p *PackageManager) GetRemovePackagesString(sep string) (string, error)
- func (p *PackageManager) GetUnstagedPackages() ([]UnstagedPackage, error)
- func (p *PackageManager) GetUnstagedPackagesPlain() ([]string, error)
- func (p *PackageManager) GetUserAgreementStatus() bool
- func (p *PackageManager) Remove(pkg string) error
- func (p *PackageManager) WriteSummaryToFile(summaryFilePath string) error
- type Partition
- type Registry
- type UnstagedPackage
Constants ¶
const ( CONF_CHANGED = iota CONF_UNCHANGED CONF_FAILED )
Supported results for the ConfEditResult type
const ( DefaultKargs = "quiet splash bgrt_disable $vt_handoff" KargsTmpFile = "/tmp/kargs-temp" )
const ( PackagesBaseDir = "/etc/abroot" PkgManagerUserAgreementFile = "/etc/abroot/ABPkgManager.userAgreement" DryRunPackagesBaseDir = "/tmp/abroot" PackagesAddFile = "packages.add" PackagesRemoveFile = "packages.remove" PackagesUnstagedFile = "packages.unstaged" )
Common Package manager paths
const ( ADD = "+" REMOVE = "-" )
Package manager operations
const ( PKG_MNG_DISABLED = 0 PKG_MNG_ENABLED = 1 PKG_MNG_REQ_AGREEMENT = 2 )
Package manager statuses
const ( // ABSystem operations UPGRADE = "upgrade" FORCE_UPGRADE = "force-upgrade" DRY_RUN_UPGRADE = "dry-run-upgrade" APPLY = "package-apply" DRY_RUN_APPLY = "dry-run-package-apply" INITRAMFS = "initramfs" DRY_RUN_INITRAMFS = "dry-run-initramfs" )
Supported ABSystemOperation types
const ( // can rollback ROLLBACK_RES_YES = "rollback-yes" // can't rollback ROLLBACK_RES_NO = "rollback-no" ROLLBACK_UNNECESSARY = "rollback-unnecessary" ROLLBACK_SUCCESS = "rollback-success" ROLLBACK_FAILED = "rollback-failed" )
ABSystem rollback response
Variables ¶
var ( // Errors ErrNoUpdate error = errors.New("no update available") )
Common variables and errors used by the ABSystem
var KargsPath = "/etc/abroot/kargs"
var Progressbar = pterm.ProgressbarPrinter{ Total: 100, BarCharacter: "■", LastCharacter: "■", ElapsedTimeRoundingFactor: time.Second, BarStyle: &pterm.Style{pterm.Bold, pterm.FgDefault}, TitleStyle: &pterm.Style{pterm.FgDefault}, ShowTitle: true, ShowCount: false, ShowPercentage: true, ShowElapsedTime: false, BarFiller: " ", MaxWidth: 60, Writer: os.Stdout, }
var ReservedMounts = []string{
"/dev",
"/dev/pts",
"/proc",
"/run",
"/sys",
}
ReservedMounts is a list of mount points from host which should be mounted inside the chroot environment to ensure it works properly in some cases, such as grub-mkconfig
Functions ¶
func AtomicRsync ¶
func AtomicRsync(src, dst string, transitionalPath string, finalPath string, excluded []string, keepUnwanted bool) error
AtomicRsync executes the rsync command in an atomic-like manner. It does so by dry-running the rsync, and if it succeeds, it runs the rsync again performing changes. If the keepUnwanted option is set to true, it will omit the --delete option, so that the already existing and unwanted files will not be deleted. To ensure the changes are applied atomically, we rsync on a _new directory first, and use atomicSwap to replace the _new with the dst directory.
func AtomicSwap ¶
atomicSwap allows swapping 2 files or directories in-place and atomically, using the renameat2 syscall. This should be used instead of os.Rename, which is not atomic at all
func BaseImagePackageDiff ¶
func BaseImagePackageDiff(currentDigest, newDigest string) ( added, upgraded, downgraded, removed []diff.PackageDiff, err error, )
BaseImagePackageDiff retrieves the added, removed, upgraded and downgraded base packages (the ones bundled with the image).
func DeleteImageForRoot ¶
DeleteImageForRoot deletes the image created for the provided root
func DiffFiles ¶
DiffFiles returns the diff lines between source and dest files using the diff command (assuming it is installed). If no diff is found, nil is returned. If any errors occur, they are returned.
func FindImageWithLabel ¶
FindImageWithLabel returns the name of the first image containinig the provided key-value pair or an empty string if none was found FindImageWithLabel returns the name of the first image containing the provided key-value pair or an empty string if none was found
func GetRepoContentsForPkg ¶
GetRepoContentsForPkg retrieves package information from the repository API
func KargsEdit ¶
KargsEdit copies the kargs file to a temporary file and opens it in the user's preferred editor by querying the $EDITOR environment variable. Once closed, its contents are written back to the main kargs file. This function returns a boolean parameter indicating whether any changes were made to the kargs file.
func KargsFormat ¶
KargsFormat formats the contents of the kargs file, ensuring that there are no duplicate entries, multiple spaces or trailing newline
func KargsWrite ¶
KargsWrite makes a backup of the current kargs file and then writes the new content to it
func MergeDiff ¶
MergeDiff merges the diff lines between the first and second files into the destination file. If any errors occur, they are returned.
func OciExportRootFs ¶
func OciExportRootFs(buildImageName string, imageRecipe *ImageRecipe, transDir string, dest string) error
OciExportRootFs generates a rootfs from an image recipe file
func OverlayPackageDiff ¶
func OverlayPackageDiff() ( added, upgraded, downgraded, removed []diff.PackageDiff, err error, )
OverlayPackageDiff retrieves the added, removed, upgraded and downgraded overlay packages (the ones added manually via `abroot pkg add`).
func PrintVerbose ¶
PrintVerbose prints verbose messages and logs to the file if enabled
func PrintVerboseErr ¶
PrintVerboseErr prints verbose error messages and logs to the file if enabled
func PrintVerboseErrNoLog ¶
PrintVerboseErrNoLog prints verbose error messages without logging to the file
func PrintVerboseInfo ¶
func PrintVerboseInfo(prefix string, args ...interface{})
PrintVerboseInfo prints verbose info messages and logs to the file if enabled
func PrintVerboseInfoNoLog ¶
func PrintVerboseInfoNoLog(prefix string, args ...interface{})
PrintVerboseInfoNoLog prints verbose info messages without logging to the file
func PrintVerboseNoLog ¶
PrintVerboseNoLog prints verbose messages without logging to the file
func PrintVerboseSimple ¶
func PrintVerboseSimple(args ...interface{})
PrintVerboseSimple prints simple verbose messages and logs to the file if enabled
func PrintVerboseSimpleNoLog ¶
func PrintVerboseSimpleNoLog(args ...interface{})
PrintVerboseSimpleNoLog prints simple verbose messages without logging to the file
func PrintVerboseWarn ¶
PrintVerboseWarn prints verbose warning messages and logs to the file if enabled
func PrintVerboseWarnNoLog ¶
PrintVerboseWarnNoLog prints verbose warning messages without logging to the file
func RetrieveImageForRoot ¶
RetrieveImageForRoot retrieves the image created for the provided root based on the label. Note for distro maintainers: labels must follow those defined in the ABRoot config file
Types ¶
type ABImage ¶
type ABImage struct { Digest string `json:"digest"` Timestamp time.Time `json:"timestamp"` Image string `json:"image"` }
The ABImage is the representation of an OCI image used by ABRoot, it contains the digest, the timestamp and the image name. If you need to investigate the current ABImage on an ABRoot system, you can find it at /abimage.abr
func NewABImage ¶
NewABImage creates a new ABImage instance and returns a pointer to it, if the digest is empty, it returns an error
func NewABImageFromRoot ¶
NewABImageFromRoot returns the current ABImage by parsing /abimage.abr, if it fails, it returns an error (e.g. if the file doesn't exist). Note for distro maintainers: if the /abimage.abr is not present, it could mean that the user is running an older version of ABRoot (pre v2) or the root state is corrupted. In the latter case, generating a new ABImage should fix the issue, Digest and Timestamp can be random, but Image should reflect an existing image on the configured Docker registry. Anyway, support on this is not guaranteed, so please don't open issues about this.
type ABRollbackResponse ¶
type ABRollbackResponse string
ABRollbackResponse represents the response of a rollback operation
type ABRootManager ¶
type ABRootManager struct { // Partitions is a list of partitions managed by ABRoot Partitions []ABRootPartition // VarPartition is the partition where /var is mounted VarPartition Partition }
ABRootManager exposes methods to manage ABRoot partitions, this includes getting the present and future partitions, the boot partition, the init volume (when using LVM Thin-Provisioning), and the other partition. If you need to operate on an ABRoot partition, you should use this struct, each partition is a pointer to a Partition struct, which contains methods to operate on the partition itself
func NewABRootManager ¶
func NewABRootManager() *ABRootManager
NewABRootManager creates a new ABRootManager
func (*ABRootManager) GetBoot ¶
func (a *ABRootManager) GetBoot() (partition Partition, err error)
GetBoot gets the boot partition from the current device
func (*ABRootManager) GetFuture ¶
func (a *ABRootManager) GetFuture() (partition ABRootPartition, err error)
GetFuture gets the future partition
func (*ABRootManager) GetInit ¶
func (a *ABRootManager) GetInit() (partition Partition, err error)
GetInit gets the init volume when using LVM Thin-Provisioning
func (*ABRootManager) GetOther ¶
func (a *ABRootManager) GetOther() (partition ABRootPartition, err error)
GetOther gets the other partition
func (*ABRootManager) GetPartition ¶
func (a *ABRootManager) GetPartition(label string) (partition ABRootPartition, err error)
GetPartition gets a partition by label
func (*ABRootManager) GetPartitions ¶
func (a *ABRootManager) GetPartitions() error
GetPartitions gets the root partitions from the current device
func (*ABRootManager) GetPresent ¶
func (a *ABRootManager) GetPresent() (partition ABRootPartition, err error)
GetPresent gets the present partition
func (*ABRootManager) IdentifyPartition ¶
func (a *ABRootManager) IdentifyPartition(partition Partition) (identifiedAs string, err error)
IdentifyPartition identifies a partition
func (*ABRootManager) IsCurrent ¶
func (a *ABRootManager) IsCurrent(partition Partition) bool
IsCurrent checks if a partition is the current one
type ABRootPartition ¶
type ABRootPartition struct { Label string // Matches `partLabelA` and `partLabelB` settings entries IdentifiedAs string // Either `present` or `future` Partition Partition MountPoint string MountOptions string Uuid string FsType string Current bool }
ABRootPartition represents a partition managed by ABRoot
type ABRootPkgManagerStatus ¶
type ABRootPkgManagerStatus int
ABRootPkgManagerStatus represents the status of the package manager in the ABRoot configuration file
type ABSystem ¶
type ABSystem struct { // Checks contains an instance of Checks which allows to perform // compatibility checks on the system such as filesystem compatibility, // connectivity and root check. Checks *Checks // RootM contains an instance of the ABRootManager which allows to // manage the ABRoot partition scheme. RootM *ABRootManager // Registry contains an instance of the Registry used to retrieve resources // from the configured Docker registry. Registry *Registry // CurImage contains an instance of ABImage which represents the current // image used by the system (abimage.abr). CurImage *ABImage }
An ABSystem allows to perform system operations such as upgrades, package changes and rollback on an ABRoot-compliant system.
func NewABSystem ¶
NewABSystem initializes a new ABSystem, which contains all the functions to perform system operations such as upgrades, package changes and rollback. It returns a pointer to the initialized ABSystem and an error, if any.
func (*ABSystem) CheckUpdate ¶
CheckUpdate checks if there is an update available
func (*ABSystem) CreateRootSymlinks ¶
func (*ABSystem) CreateStageFile ¶
CreateStageFile creates the stage file, which is used to determine if the upgrade can be interrupted or not. If the stage file is present, it means that the upgrade is in a state where it is still possible to interrupt it, otherwise it is not. This is useful for third-party applications like update managers.
func (*ABSystem) LockUpgrade ¶
LockUpgrade creates a lock file, preventing upgrades from proceeding
func (*ABSystem) RemoveStageFile ¶
RemoveStageFile removes the stage file disabling the ability to interrupt the upgrade process
func (*ABSystem) Rollback ¶
func (s *ABSystem) Rollback(checkOnly bool) (response ABRollbackResponse, err error)
Rollback swaps the master grub files if the current root is not the default
func (*ABSystem) RunOperation ¶
func (s *ABSystem) RunOperation(operation ABSystemOperation) error
RunOperation executes a root-switching operation from the options below:
UPGRADE: Upgrades to a new image, if available, FORCE_UPGRADE: Forces the upgrade operation, even if no new image is available, APPLY: Applies package changes, but doesn't update the system. INITRAMFS: Updates the initramfs for the future root, but doesn't update the system.
func (*ABSystem) UnlockUpgrade ¶
UnlockUpgrade removes the lock file, allowing upgrades to proceed
func (*ABSystem) UpgradeLockExists ¶
UpgradeLockExists checks if the lock file exists and returns a boolean
func (*ABSystem) UserLockRequested ¶
UserLockRequested checks if the user lock file exists and returns a boolean note that if the user lock file exists, it means that the user explicitly requested the upgrade to be locked (using an update manager for example)
type ABSystemOperation ¶
type ABSystemOperation string
ABSystemOperation represents a system operation to be performed by the ABSystem, must be given as a parameter to the RunOperation function.
type Checks ¶
type Checks struct{}
Represents a Checks struct which contains all the checks which can be performed one by one or all at once using PerformAllChecks()
func (*Checks) CheckCompatibilityFS ¶
CheckCompatibilityFS checks if the filesystem is compatible with ABRoot v2 if not, it returns an error. Note that currently only ext4, btrfs and xfs are supported/tested. Here we assume some utilities are installed, such as findmnt and lsblk
func (*Checks) CheckConnectivity ¶
CheckConnectivity checks if the system is connected to the internet
func (*Checks) PerformAllChecks ¶
PerformAllChecks performs all checks
type Children ¶
type Children struct { MountPoint string `json:"mountpoint"` FsType string `json:"fstype"` Label string `json:"label"` Uuid string `json:"uuid"` LogicalName string `json:"name"` Size string `json:"size"` MountOptions string `json:"mountopts"` Children []Children `json:"children"` }
The children a block device or partition may have
type Chroot ¶
type Chroot struct {
// contains filtered or unexported fields
}
Chroot represents a chroot instance, which can be used to run commands inside a chroot environment
func NewChroot ¶
func NewChroot(root string, rootUuid string, rootDevice string, mountUserEtc bool, userEtcPath string) (*Chroot, error)
NewChroot creates a new chroot environment from the given root path and returns its Chroot instance or an error if something went wrong
func (*Chroot) Execute ¶
Execute runs a command in the chroot environment, the command is a string and the arguments are a list of strings. If an error occurs it is returned.
func (*Chroot) ExecuteCmds ¶
ExecuteCmds runs a list of commands in the chroot environment, stops at the first error
type ConfEditResult ¶
type ConfEditResult int
ConfEditResult is the result of the ConfEdit function
func ConfEdit ¶
func ConfEdit() (ConfEditResult, error)
ConfEdit opens the configuration file in the default editor
type DiskManager ¶
type DiskManager struct{}
DiskManager exposes functions to interact with the system's disks and partitions (e.g. mount, unmount, get partitions, etc.)
func NewDiskManager ¶
func NewDiskManager() *DiskManager
NewDiskManager creates and returns a pointer to a new DiskManager instance from which you can interact with the system's disks and partitions
func (*DiskManager) GetPartitionByLabel ¶
func (d *DiskManager) GetPartitionByLabel(label string) (Partition, error)
GetPartitionByLabel finds a partition by searching for its label. If no partition can be found with the given label, returns error.
func (*DiskManager) GetPartitions ¶
func (d *DiskManager) GetPartitions(device string) ([]Partition, error)
getPartitions gets a disk's partitions. If device is an empty string, gets all partitions from all disks
type Grub ¶
Grub represents a grub instance, it exposes methods to generate a new grub config compatible with ABRoot, and to check if the system is booted into the present root or the future root
func (*Grub) IsBootedIntoPresentRoot ¶
type ImageRecipe ¶
type ImageRecipe struct { From string Labels map[string]string Args map[string]string Content string }
An ImageRecipe represents a Dockerfile/Containerfile-like recipe
func NewImageRecipe ¶
func NewImageRecipe(image string, labels map[string]string, args map[string]string, content string) *ImageRecipe
NewImageRecipe creates a new ImageRecipe instance and returns a pointer to it
func (*ImageRecipe) Write ¶
func (c *ImageRecipe) Write(path string) error
Write writes a ImageRecipe to the given path, returning an error if any
type IntegrityCheck ¶
type IntegrityCheck struct {
// contains filtered or unexported fields
}
func NewIntegrityCheck ¶
func NewIntegrityCheck(root ABRootPartition, repair bool) (*IntegrityCheck, error)
NewIntegrityCheck creates a new IntegrityCheck instance for the given root partition, and returns a pointer to it or an error if something went wrong
type Manifest ¶
Manifest is the struct used to parse the manifest response from the registry it contains the manifest itself, the digest and the list of layers. This should be compatible with most registries, but it's not guaranteed
type NotEnoughSpaceError ¶
type NotEnoughSpaceError struct{}
func (*NotEnoughSpaceError) Error ¶
func (v *NotEnoughSpaceError) Error() string
type PCSpecs ¶
func GetPCSpecs ¶
func GetPCSpecs() PCSpecs
type PackageManager ¶
type PackageManager struct { Status ABRootPkgManagerStatus // contains filtered or unexported fields }
PackageManager struct
func NewPackageManager ¶
func NewPackageManager(dryRun bool) (*PackageManager, error)
NewPackageManager returns a new PackageManager struct
func (*PackageManager) AcceptUserAgreement ¶
func (p *PackageManager) AcceptUserAgreement() error
AcceptUserAgreement sets the package manager status to enabled
func (*PackageManager) Add ¶
func (p *PackageManager) Add(pkg string) error
Add adds a package to the packages.add file
func (*PackageManager) CheckStatus ¶
func (p *PackageManager) CheckStatus() error
CheckStatus checks if the package manager is enabled or not
func (*PackageManager) ClearUnstagedPackages ¶
func (p *PackageManager) ClearUnstagedPackages() error
ClearUnstagedPackages removes all packages from the unstaged list
func (*PackageManager) ExistsInRepo ¶
func (p *PackageManager) ExistsInRepo(pkg string) error
func (*PackageManager) GetAddPackages ¶
func (p *PackageManager) GetAddPackages() ([]string, error)
GetAddPackages returns the packages in the packages.add file
func (*PackageManager) GetAddPackagesString ¶
func (p *PackageManager) GetAddPackagesString(sep string) (string, error)
GetAddPackagesString returns the packages in the packages.add file as a string
func (*PackageManager) GetFinalCmd ¶
func (p *PackageManager) GetFinalCmd(operation ABSystemOperation) string
func (*PackageManager) GetRemovePackages ¶
func (p *PackageManager) GetRemovePackages() ([]string, error)
GetRemovePackages returns the packages in the packages.remove file
func (*PackageManager) GetRemovePackagesString ¶
func (p *PackageManager) GetRemovePackagesString(sep string) (string, error)
GetRemovePackagesString returns the packages in the packages.remove file as a string
func (*PackageManager) GetUnstagedPackages ¶
func (p *PackageManager) GetUnstagedPackages() ([]UnstagedPackage, error)
GetUnstagedPackages returns the package changes that are yet to be applied
func (*PackageManager) GetUnstagedPackagesPlain ¶
func (p *PackageManager) GetUnstagedPackagesPlain() ([]string, error)
GetUnstagedPackagesPlain returns the package changes that are yet to be applied as strings
func (*PackageManager) GetUserAgreementStatus ¶
func (p *PackageManager) GetUserAgreementStatus() bool
GetUserAgreementStatus returns if the user has accepted the package manager agreement or not
func (*PackageManager) Remove ¶
func (p *PackageManager) Remove(pkg string) error
Remove either removes a manually added package from packages.add or adds a package to be deleted into packages.remove
func (*PackageManager) WriteSummaryToFile ¶
func (p *PackageManager) WriteSummaryToFile(summaryFilePath string) error
WriteSummaryToFile writes added and removed packages to summaryFilePath
added packages get the + prefix, while removed packages get the - prefix
type Partition ¶
type Partition struct { Label string MountPoint string MountOptions string Uuid string FsType string // If standard partition, Device will be the partition's name (e.g. sda1, nvme0n1p1). // If LUKS-encrypted or LVM volume, Device will be the name in device-mapper. Device string // If the partition is LUKS-encrypted or an LVM volume, the logical volume // opened in /dev/mapper will be a child of the physical partition in /dev. // Otherwise, the partition will be a direct child of the block device, and // Parent will be nil. // // The same logic applies for encrypted LVM volumes. When this is the case, // the filesystem hirearchy is as follows: // // NAME FSTYPE // -- sda1 LVM2_member // |-- myVG-myLV crypto_LUKS // |-- luks-volume btrfs // // In this case, the parent of "luks-volume" is "myVG-myLV", which, // in turn, has "sda1" as parent. Since "sda1" is a physical partition, // its parent is nil. Parent *Partition }
Partition represents either a standard partition or a device-mapper partition, such as an LVM volume
func (*Partition) IsDevMapper ¶
Returns whether the partition is a device-mapper virtual partition
func (*Partition) IsEncrypted ¶
IsEncrypted returns whether the partition is encrypted
type Registry ¶
type Registry struct {
API string
}
A Registry instance exposes functions to interact with the configured Docker registry
func NewRegistry ¶
func NewRegistry() *Registry
NewRegistry returns a new Registry instance, exposing functions to interact with the configured Docker registry
func (*Registry) GetManifest ¶
GetManifest returns the manifest of the image, a token is required to perform the request and is generated using GetToken()
type UnstagedPackage ¶
type UnstagedPackage struct {
Name, Status string
}
An unstaged package is a package that is waiting to be applied to the next root.
Every time a `pkg apply` or `upgrade` operation is executed, all unstaged packages are consumed and added/removed in the next root.