Documentation
¶
Index ¶
Constants ¶
View Source
const ( BootNone = "none" BootGrub = "grub" )
View Source
const ( OsReleasePath = "/etc/os-release" Initrd = "initrd" DefaultBootID = "active" RecoveryBootID = "recovery" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bootloader ¶
type Bootloader interface {
Install(i InstallCtx) error
InstallLive(i InstallCtx) error
Prune(rootPath, espDir string, keepEntryIDs []int) error
}
type Grub ¶
type Grub struct {
// contains filtered or unexported fields
}
func (*Grub) Install ¶
func (g *Grub) Install(i InstallCtx) error
Install installs the bootloader to the specified root.
func (*Grub) InstallLive ¶
func (g *Grub) InstallLive(i InstallCtx) error
InstallLive installs the live bootloader to the specified target.
type InstallCtx ¶
type InstallCtx struct {
// RootDir is the path for the root tree of the system to install the bootloader for. This path
// is expected to be a full OS including the kernel, initrd and bootloader binaries at default
// known locations.
RootDir string
// Target is the path where the bootloader binaries and configuration should be installed. This is
// typically the mountpoint of the ESP partition.
Target string
// ESPLabel is the filesystem label of the ESP partition.
ESPLabel string
// EntryID this is the ID if the current bootloader entry to be installed.
EntryID string
// KernelCmdline is the full kernel command line we want to set for this specific entry.
KernelCmdline string
// RecKernelCmdline is the full kernel command line for the recovery entry, if any.
RecKernelCmdline string
// InitrdExtensions is the list of CPIO files to stack into the stock initrd. These CPIO files are mostly
// used to inject additional setup into the stock initrd.
InitrdExtensions []string
}
InstallCtx defines the parameters requierd by the bootloader to perform an installation
type None ¶
type None struct {
// contains filtered or unexported fields
}
func (*None) Install ¶
func (n *None) Install(_ InstallCtx) error
func (*None) InstallLive ¶
func (n *None) InstallLive(_ InstallCtx) error
Click to show internal directories.
Click to hide internal directories.