Documentation
¶
Overview ¶
Package btpeer contains utilities for accessing and managing btpeer devices.
Index ¶
- func AddLineToFile(ctx context.Context, runner components.Runner, filePath string, option string) error
- func BuildInitrd(ctx context.Context, runner components.Runner) error
- func CreateShrinkInitrdHook(ctx context.Context, runner components.Runner, size int64) (func(context.Context) error, error)
- func FlashImage(ctx context.Context, runner components.Runner, timeout time.Duration, ...) error
- func GetCurrentBootPath(ctx context.Context, runner components.Runner) (string, error)
- func GetFSWithLabel(ctx context.Context, runner components.Runner, label string) (string, error)
- func GetUsedFSSpace(ctx context.Context, runner components.Runner, path string) (int64, error)
- func InitEXT4FS(ctx context.Context, runner components.Runner, device, label string) error
- func InitFAT32FS(ctx context.Context, runner components.Runner, device, label string) error
- func LoadImageAsLoopbackDevice(ctx context.Context, runner components.Runner, image string) (string, error)
- func MountDevice(ctx context.Context, runner components.Runner, device string) (string, error)
- func NewPartitionHelperForPath(ctx context.Context, runner components.Runner, path string) (*partitionHelper, error)
- func NewSshRunner(sshAccess ssh.Access, resource string) ssh.Runner
- func PermBootIntoPartition(ctx context.Context, runner components.Runner, ...) error
- func RemoveLineFromFile(ctx context.Context, runner components.Runner, filePath string, option string) error
- func ReplacePartID(ctx context.Context, runner components.Runner, oldDev, newDev, file string) error
- func SetEXTLabel(ctx context.Context, runner components.Runner, device string, label string) error
- func SetFAT32Label(ctx context.Context, runner components.Runner, device string, label string) error
- func SetLabelForEXTPath(ctx context.Context, runner components.Runner, path string, label string) error
- func SetLabelForFAT32Path(ctx context.Context, runner components.Runner, path string, label string) error
- func TempBootIntoPartition(ctx context.Context, runner components.Runner, bootPartitionLabel string, ...) error
- type Model
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLineToFile ¶
func AddLineToFile(ctx context.Context, runner components.Runner, filePath string, option string) error
AddLineToFile appends a single line option to a file if it does not already exist.
func BuildInitrd ¶
func BuildInitrd(ctx context.Context, runner components.Runner) error
BuildInitrd builds a new /boot/initrd.img image.
func CreateShrinkInitrdHook ¶
func CreateShrinkInitrdHook(ctx context.Context, runner components.Runner, size int64) (func(context.Context) error, error)
CreateShrinkInitrdHook creates an initrd image that will shrink the filesystem on the next reboot.
func FlashImage ¶
func FlashImage(ctx context.Context, runner components.Runner, timeout time.Duration, input string, outputDev string) error
FlashImage writes an image to a device using dd.
func GetCurrentBootPath ¶
GetCurrentBootPath gets the mounted boot directory that the OS is using.
Older versions of raspberry pi use /boot/, while newer versions use /boot/firmware. See: https://github.com/raspberrypi/documentation/blob/develop/documentation/asciidoc/computers/configuration/boot_folder.adoc
func GetFSWithLabel ¶
GetFSWithLabel returns a device whose FS has the matching label.
func GetUsedFSSpace ¶
GetUsedFSSpace returns the amount of used space on the filesystem.
func InitEXT4FS ¶
InitEXT4FS initializes an EXT4 FS on a new partition.
func InitFAT32FS ¶
InitFAT32FS initializes a FAT32 FS on a new partition.
func LoadImageAsLoopbackDevice ¶
func LoadImageAsLoopbackDevice(ctx context.Context, runner components.Runner, image string) (string, error)
LoadImageAsLoopbackDevice loads an image as a loopback device and returns the device.
func MountDevice ¶
MountDevice returns a devices mount point if it's already mounted or otherwise mounts it and returns the new mount path.
func NewPartitionHelperForPath ¶
func NewPartitionHelperForPath(ctx context.Context, runner components.Runner, path string) (*partitionHelper, error)
NewPartitionHelperForPath creates a new helper for the device that owns the requested path.
func NewSshRunner ¶
NewSshRunner creates a normal ssh.Runner for a resource. TODO(jaredbennett) Move to common package when ssh package is refactored.
func PermBootIntoPartition ¶
func PermBootIntoPartition(ctx context.Context, runner components.Runner, recoveryPartitionLabel, bootPartitionLabel string, rebootTime time.Duration) error
PermBootIntoPartition sets a partition as the permenent boot partition.
This is accomplished by writing a file "autoboot.txt" to the recovery partition which instructs the device as to which partition to boot from.
func RemoveLineFromFile ¶
func RemoveLineFromFile(ctx context.Context, runner components.Runner, filePath string, option string) error
RemoveLineFromFile removes any matching lines from a config file.
func ReplacePartID ¶
func ReplacePartID(ctx context.Context, runner components.Runner, oldDev, newDev, file string) error
ReplacePartID replaces the old partiion ID with the new one in the specified file.
func SetEXTLabel ¶
SetEXTLabel sets a label on an EXT FS.
func SetFAT32Label ¶
func SetFAT32Label(ctx context.Context, runner components.Runner, device string, label string) error
SetFAT32Label sets a label on a FAT32 FS.
func SetLabelForEXTPath ¶
func SetLabelForEXTPath(ctx context.Context, runner components.Runner, path string, label string) error
SetLabelForEXTPath sets a label for a EXT file system given a path.
func SetLabelForFAT32Path ¶
func SetLabelForFAT32Path(ctx context.Context, runner components.Runner, path string, label string) error
SetLabelForFAT32Path sets a label for a FAT32 file system given a path.
func TempBootIntoPartition ¶
func TempBootIntoPartition(ctx context.Context, runner components.Runner, bootPartitionLabel string, rebootTime time.Duration) error
TempBootIntoPartition temporarily boots into a specific partition.
This is done by passing an additional argument to the "reboot" command which tells the system to use a different partition on next boot. This is temporary and only applies to the next boot.
Types ¶
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package chameleond contains utilities for managing chameleond releases on btpeers devices.
|
Package chameleond contains utilities for managing chameleond releases on btpeers devices. |
Package image contains utilities for managing btpeer images.
|
Package image contains utilities for managing btpeer images. |