Documentation ¶
Overview ¶
Package configStep implements manufacturing steps that can be specified in manufData.json. This step can have one or more downloadable files and one or more executed commands. It can be run at different points in the manufacturing process, and individual command success/failure can be required or ignored.
Files with suffix '.tar.xz' or '.txz' are automatically extracted into the temp dir.
Commands first have templating resolved, then are split into args via github.com/google/shlex. Commands for a step are executed in order. Steps with the same When value are executed in the order listed in json.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( EEXECSUCCESS = fmt.Errorf("Execution succeeded but must fail") EEXECFAIL = fmt.Errorf("Execution failed but must succeed") )
Functions ¶
Types ¶
type CommonData ¶
type CommonData struct { RecoveryDir string // where RECOVERY volume is mounted Serial string // unit serial number BiosPass string // what the bios password has been/will be set to IpmiPass string // ditto, for ipmi OSPass string // ditto, for OS }
Data usable in step templates, but not unique to any one step
var CommonTemplateData CommonData
type ConfigSteps ¶
type ConfigSteps []Step
func (ConfigSteps) RunApplicable ¶
func (c ConfigSteps) RunApplicable(When WhenType) (success bool)
type ExitStatus ¶
type ExitStatus int
const ( ESMustSucceed ExitStatus = iota ESDontCare ESMustFail )
func (*ExitStatus) UnmarshalJSON ¶
func (es *ExitStatus) UnmarshalJSON(b []byte) error
type PlatformConfig ¶
type PlatformConfig struct { DevCodeName string ConfigSteps ConfigSteps }
A set of config steps for a platform.
type PlatformConfigs ¶
type PlatformConfigs []PlatformConfig
func (PlatformConfigs) Find ¶
func (configs PlatformConfigs) Find(codeName string) (cs ConfigSteps)
type Step ¶
type Step struct { Name string When WhenType Files []xfer.TVFile Commands []StepCmd Verbose bool // contains filtered or unexported fields }
A Step specifies a sequence of 0 or more file downloads followed by 0 or more command executions. Commands are subject to template expansion.
type StepCmd ¶
type StepCmd struct { ExitStatus ExitStatus Command string AddPath, AddLibPath string }
A command to be executed during a Step. Command, AddPath, and AddLibPath are subject
** to template expansion using the values in StepData (which includes CommonData). ** Templating is via golang's package text/template. ** ** Example: Print the serial number ** Command could be "echo 'Serial number is {{.Serial}}'". ** If the serial is SN123, the command would print "Serial number is SN123". ** ** Example: Execute a binary auto-extracted from a .tar.xz file ** Command could be "{{.DLDir}}/path/in/tar/to/binary --arg --arg2" ** {{.DLDir}} would be replaced with the temp dir, resulting in an absolute path, and ** the executable is executed (assuming correct file mode). ** ** Note that passwords won't be available until close to the password-setting step. ** Also note that AddPath only applies to additional executables used by Command, and cannot be used to search for Command itself. ** AddLibPath, however, _will_ apply to Command.
type StepData ¶
type StepData struct { *CommonData DLDir string //temp dir where file(s) for this step were downloaded }
All data for step templates, including step-specific data (currently only DLDir)