manifest

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manifest

type Manifest struct {
	Name       string            `json:"name"`
	Date       string            `json:"build_time"`
	Version    string            `json:"build_version"`
	BuildID    string            `json:"id"`
	Image      string            `json:"image"`
	ImageHash  string            `json:"image_hash"`
	Loader     string            `json:"loader"`
	LoaderHash string            `json:"loader_hash"`
	Pkgs       []*ManifestPkg    `json:"pkgs"`
	LoaderPkgs []*ManifestPkg    `json:"loader_pkgs,omitempty"`
	TgtVars    []string          `json:"target"`
	Repos      []*ManifestRepo   `json:"repos"`
	Syscfg     map[string]string `json:"syscfg"`

	PkgSizes       []*ManifestSizePkg `json:"pkgsz"`
	LoaderPkgSizes []*ManifestSizePkg `json:"loader_pkgsz,omitempty"`
}

func ReadManifest

func ReadManifest(path string) (Manifest, error)

ReadManifest reads a JSON manifest from a file.

func (*Manifest) FindTargetVar

func (m *Manifest) FindTargetVar(key string) string

FindTargetVar searches a manifest's target definition for a setting with the specified key. Examples of keys are: "app", "bsp", and "syscfg".

func (*Manifest) Write

func (m *Manifest) Write(w io.Writer) (int, error)

Write serializes a manifest as JSON and writes it to the given writer.

type ManifestPkg

type ManifestPkg struct {
	Name string `json:"name"`
	Repo string `json:"repo"`
}

type ManifestRepo

type ManifestRepo struct {
	Name   string `json:"name"`
	Commit string `json:"commit"`
	Dirty  bool   `json:"dirty,omitempty"`
	URL    string `json:"url,omitempty"`
}

type ManifestSizeArea

type ManifestSizeArea struct {
	Name string `json:"name"`
	Size uint32 `json:"size"`
}

* Data that's going to go to build manifest file

type ManifestSizeFile

type ManifestSizeFile struct {
	Name string             `json:"name"`
	Syms []*ManifestSizeSym `json:"sym"`
}

type ManifestSizePkg

type ManifestSizePkg struct {
	Name  string              `json:"name"`
	Files []*ManifestSizeFile `json:"files"`
}

type ManifestSizeSym

type ManifestSizeSym struct {
	Name  string              `json:"name"`
	Areas []*ManifestSizeArea `json:"areas"`
}

type MfgManifest

type MfgManifest struct {
	Name       string            `json:"name"`
	BuildTime  string            `json:"build_time"`
	Format     int               `json:"format"`
	MfgHash    string            `json:"mfg_hash"`
	Version    string            `json:"version"`
	Device     int               `json:"device"`
	BinPath    string            `json:"bin_path"`
	HexPath    string            `json:"hex_path"`
	Bsp        string            `json:"bsp"`
	EraseVal   byte              `json:"erase_val"`
	Signatures []MfgManifestSig  `json:"signatures,omitempty"`
	FlashAreas []flash.FlashArea `json:"flash_map"`
	FlashNames []string          `json:"flash_names",omitempty`

	Targets []MfgManifestTarget `json:"targets"`
	Raws    []MfgManifestRaw    `json:"raws"`
	Meta    *MfgManifestMeta    `json:"meta,omitempty"`
}

func ParseMfgManifest

func ParseMfgManifest(jsonText []byte) (MfgManifest, error)

ReadMfgManifest reads a JSON mfg manifest from a byte slice and produces an MfgManifest object.

func ReadMfgManifest

func ReadMfgManifest(path string) (MfgManifest, error)

ReadMfgManifest reads a JSON mfg manifest from a file and produces an MfgManifest object.

func (*MfgManifest) FindFlashAreaDevOff

func (m *MfgManifest) FindFlashAreaDevOff(device int, offset int) *flash.FlashArea

FindFlashAreaDevOff searches an mfg manifest for a flash area with the specified device and offset.

func (*MfgManifest) FindFlashAreaName

func (m *MfgManifest) FindFlashAreaName(name string) *flash.FlashArea

FindFlashAreaName searches an mfg manifest for a flash area with the specified name.

func (*MfgManifest) FindWithinFlashAreaDevOff added in v0.0.17

func (m *MfgManifest) FindWithinFlashAreaDevOff(device int, offset int) *flash.FlashArea

FindWithinFlashAreaDevOff searches an mfg manifest for a flash area with the specified device that contains the given offset.

func (*MfgManifest) MarshalJson

func (m *MfgManifest) MarshalJson() ([]byte, error)

MarshalJson produces a JSON representation of an mfg manifest.

func (*MfgManifest) SecSigs

func (m *MfgManifest) SecSigs() ([]sec.Sig, error)

SecSigs converts all the signutures in the provided mfg manifest into sec.Sig objects.

type MfgManifestMeta

type MfgManifestMeta struct {
	EndOffset int                  `json:"end_offset"`
	Size      int                  `json:"size"`
	Hash      bool                 `json:"hash_present"`
	FlashMap  bool                 `json:"flash_map_present"`
	Mmrs      []MfgManifestMetaMmr `json:"mmrs,omitempty"`
}

type MfgManifestMetaMmr

type MfgManifestMetaMmr struct {
	Area      string `json:"area"`
	Device    int    `json:"_device"`
	EndOffset int    `json:"_end_offset"`
}

type MfgManifestRaw added in v0.0.7

type MfgManifestRaw struct {
	Filename string                 `json:"filename"`
	Offset   int                    `json:"offset"`
	Size     int                    `json:"size"`
	BinPath  string                 `json:"bin_path"`
	Extra    map[string]interface{} `json:"extra,omitempty"`
}

type MfgManifestSig

type MfgManifestSig struct {
	Type string `json:"type"`
	Key  string `json:"key"`
	Sig  string `json:"sig"`
}

func (*MfgManifestSig) SecSig

func (ms *MfgManifestSig) SecSig() (sec.Sig, error)

SecSig converts the provided mfg manifest signature into a sec.Sig object.

type MfgManifestTarget

type MfgManifestTarget struct {
	Name         string                 `json:"name"`
	Offset       int                    `json:"offset"`
	Size         int                    `json:"size"`
	BinPath      string                 `json:"bin_path,omitempty"`
	ImagePath    string                 `json:"image_path,omitempty"`
	HexPath      string                 `json:"hex_path,omitempty"`
	ManifestPath string                 `json:"manifest_path"`
	Extra        map[string]interface{} `json:"extra,omitempty"`
}

func (*MfgManifestTarget) IsBoot

func (mt *MfgManifestTarget) IsBoot() bool

IsBoot indicates whether an mfg manifest target is a boot loader.

Jump to

Keyboard shortcuts

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