packer

package
v0.0.0-...-80a59f1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2023 License: BSD-3-Clause Imports: 19 Imported by: 1

Documentation

Overview

Package packer is a gokrazy-internal package which provides functionality shared between gokr-packer and rtr7-recovery-init.

Index

Constants

View Source
const MB = 1024 * 1024

Variables

View Source
var (
	FAT      = byte(0xc)
	Linux    = byte(0x83)
	SquashFS = Linux // SquashFS does not have a dedicated type

)

Functions

func BuildDir

func BuildDir(importPath string) string

func BuildDirOrMigrate

func BuildDirOrMigrate(importPath string) (string, error)

func DefaultTags

func DefaultTags() []string

func Env

func Env() []string

func InitDeps

func InitDeps(initPkg string) []string

func PackageDir

func PackageDir(pkg string) (string, error)

func PackageDirs

func PackageDirs(pkgs []string) ([]string, error)

PackageDirs returns the package directories, in the same order as the argument

func PermSizeInKB

func PermSizeInKB(devsize uint64) uint32

func TargetArch

func TargetArch() string

Types

type BuildEnv

type BuildEnv struct {
	BuildDir func(string) (string, error)
}

func (*BuildEnv) Build

func (be *BuildEnv) Build(bindir string, packages []string, packageBuildFlags, packageBuildTags map[string][]string, noBuildPackages []string) error

func (*BuildEnv) MainPackages

func (be *BuildEnv) MainPackages(pkgs []string) ([]Pkg, error)

type Pack

type Pack struct {
	Partuuid       uint32
	UsePartuuid    bool
	UseGPTPartuuid bool
	UseGPT         bool
	ExistingEEPROM struct {
		PieepromSHA256 string // pieeprom.sig
		VL805SHA256    string // vl805.sig
	}
}

Pack represents one pack process.

func NewPackForHost

func NewPackForHost(hostname string) Pack

func (*Pack) GPTPARTUUID

func (p *Pack) GPTPARTUUID(partition uint16) string

GPTPARTUUID derives a GPT partition GUID for the specified partition.

All gokrazy GPT partition GUIDs start with the same prefix and contain the hostname-derived hash + the partition number in the last block (“node identifier”).

func (*Pack) ModifyCmdlineRoot

func (p *Pack) ModifyCmdlineRoot() bool

ModifyCmdlineRoot() returns true if the -kernel_pkgs cmdline.txt file needs any modifications. This will be true on most gokrazy installations.

func (*Pack) Partition

func (p *Pack) Partition(o *os.File, devsize uint64) error

func (*Pack) PermUUID

func (p *Pack) PermUUID() string

func (*Pack) RereadPartitions

func (p *Pack) RereadPartitions(o *os.File) error

func (*Pack) Root

func (p *Pack) Root() string

type Pkg

type Pkg struct {
	Name       string `json:"Name"`
	ImportPath string `json:"ImportPath"`
	Target     string `json:"Target"`
}

func (*Pkg) Basename

func (p *Pkg) Basename() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL