Documentation
¶
Overview ¶
Subpackages contain code for use in provisioning (also referred to as manufacture) and factory restore (aka recovery) as well as services which run in the image.
Three main flavors of kernel can be built. The kernel code remains the same, with the initramfs changing. The flavors are:
provisioning: pxebooted, used to image large numbers of servers with full functionality. Requires at least two physical storage devices within the unit - a small recovery device containing a copy of the image, and a (generally much larger) primary device onto which the image is decompressed. Recovery device could be a usb key, ssd, etc. Depends upon additional infrastructure - dhcp and tftp config for pxe, ipxe and boot menu(s), http file server, logging server, and some mechanism to store (and optionally, generate) passwords.
recipe: a "downloadable installer"
downloaded by a customer for installation onto hardware they source, for use in regions where shipping from the US is painful.
combines the QA functionality of provisioning with some functionality of factory restore. Imaged unit _lacks_ factory restore functionality on its own as that requires the secondary storage.
norm: after recipe or provisioning, this is the kernel that is always used. Includes factory restore functionality, though this only functions if the unit was provisioned (as opposed to recipe). For provisioned units, factory restore:
will be triggered if the primary device's filesystem (or a flag file therein) is missing, or
may be triggered on demand by the user. In all other cases, the root volume is located and mounted, the initramfs is cleaned up, and systemd is started.
Use `mage` to build these targets.
Directories
¶
Path | Synopsis |
---|---|
build
|
|
paths
Package paths contains functions used by integ tests and by mage.
|
Package paths contains functions used by integ tests and by mage. |
cmd
|
|
dummy
A helper/dummy multi-call binary used in integ testing.
|
A helper/dummy multi-call binary used in integ testing. |
img/corer
Service corer listens for fs events on given dir, and if the events are for a coredump, it creates a backtrace via gdb.
|
Service corer listens for fs events on given dir, and if the events are for a coredump, it creates a backtrace via gdb. |
img/nic_config
Service nic_config configures RFS, RSS, XPS for interfaces.
|
Service nic_config configures RFS, RSS, XPS for interfaces. |
init
Command init replaces the sh script /init in an initramfs, doing the normal early userspace tasks.
|
Command init replaces the sh script /init in an initramfs, doing the normal early userspace tasks. |
util/appliance-schema
Appliance-schema generates a json schema for github.com/purecloudlabs/gprovision/pkg/appliance or github.com/purecloudlabs/gprovision/pkg/mfg/qa.
|
Appliance-schema generates a json schema for github.com/purecloudlabs/gprovision/pkg/appliance or github.com/purecloudlabs/gprovision/pkg/mfg/qa. |
util/blink
Test app for github.com/purecloudlabs/gprovision/pkg/hw/ipmi/uid, blinking the IPMI UID light.
|
Test app for github.com/purecloudlabs/gprovision/pkg/hw/ipmi/uid, blinking the IPMI UID light. |
util/currentBoot
Command currentBoot reads the current boot var
|
Command currentBoot reads the current boot var |
util/devvm
Cmd devvm re-uses integ test logic to spin up VMs for dev work.
|
Cmd devvm re-uses integ test logic to spin up VMs for dev work. |
util/identify
Command identify identifies a hardware device from dmi data, using github.com/purecloudlabs/gprovision/pkg/appliance.
|
Command identify identifies a hardware device from dmi data, using github.com/purecloudlabs/gprovision/pkg/appliance. |
windows/netexport
Netexport.exe exports network config data from windows.
|
Netexport.exe exports network config data from windows. |
pkg
|
|
appliance
Package appliance contains data on various models/revisions of appliance.
|
Package appliance contains data on various models/revisions of appliance. |
appliance/altIdent
Package altIdent allows reading, writing a file containing the platform's identity, for use as a fallback if the dmi data doesn't clearly identify the platform.
|
Package altIdent allows reading, writing a file containing the platform's identity, for use as a fallback if the dmi data doesn't clearly identify the platform. |
common
Common (and subpackages) contains interfaces that make it easier to avoid import cycles, swap out functionality for testing, etc.
|
Common (and subpackages) contains interfaces that make it easier to avoid import cycles, swap out functionality for testing, etc. |
common/fr
Interface for a mechanism storing data for use by factory restore
|
Interface for a mechanism storing data for use by factory restore |
common/rkeep
Some sort of external mechanism recording details about units imaged.
|
Some sort of external mechanism recording details about units imaged. |
common/rlog
Interfaces related to setting up or mocking remote logging.
|
Interfaces related to setting up or mocking remote logging. |
common/strs
Abstraction for strings that implementors will likely wish to change.
|
Abstraction for strings that implementors will likely wish to change. |
corer/backtrace
Package backtrace creates backtraces from coredumps.
|
Package backtrace creates backtraces from coredumps. |
corer/opts
Package opts parses flags and stores config used elsewhere in corer.
|
Package opts parses flags and stores config used elsewhere in corer. |
corer/stream
Package stream contains chainable functions acting on sizeable data streams such as cores.
|
Package stream contains chainable functions acting on sizeable data streams such as cores. |
corer/testhelper
Package testhelper does setup for tests requiring a core dump.
|
Package testhelper does setup for tests requiring a core dump. |
disktag
Package disktag encodes and decodes disktags.
|
Package disktag encodes and decodes disktags. |
erase
Package erase handles data erase of data on units, for use when a customer's data is sufficiently sensitive and they need to ship a unit without data.
|
Package erase handles data erase of data on units, for use when a customer's data is sufficiently sensitive and they need to ship a unit without data. |
erase/raid
Package raid handles reading, storing, and re-writing raid metadata as necessary during the erase process.
|
Package raid handles reading, storing, and re-writing raid metadata as necessary during the erase process. |
fileutil
Package fileutil contains various utility functions useful for dealing with files and dirs.
|
Package fileutil contains various utility functions useful for dealing with files and dirs. |
guid
Package guid handles uuid's encoded in the mixed-endianness format used by microsoft and uefi.
|
Package guid handles uuid's encoded in the mixed-endianness format used by microsoft and uefi. |
hw
Sub-packages of hw deal with specific hardware or other low-level interfaces.
|
Sub-packages of hw deal with specific hardware or other low-level interfaces. |
hw/beep
Package beep activates PC Speaker on hardware supporting it.
|
Package beep activates PC Speaker on hardware supporting it. |
hw/block
Package block contains functions dealing with linux block devices and the underlying hardware.
|
Package block contains functions dealing with linux block devices and the underlying hardware. |
hw/block/md
Package md does various things with mdadm.
|
Package md does various things with mdadm. |
hw/block/partitioning
Package partitioning allows creation of MBR and GPT partition tables and partitions, DESTROYING ANY EXISTING DATA.
|
Package partitioning allows creation of MBR and GPT partition tables and partitions, DESTROYING ANY EXISTING DATA. |
hw/cfa
Package cfa implements communication with Crystalfontz LCDs such as CFA-631 and CFA-635, without use of CGO.
|
Package cfa implements communication with Crystalfontz LCDs such as CFA-631 and CFA-635, without use of CGO. |
hw/cfa/demo
Demo app to exercise a compatible Crystalfontz LCD.
|
Demo app to exercise a compatible Crystalfontz LCD. |
hw/cfa/serial
Package serial configures a serial port for use with Crystalfontz LCDs.
|
Package serial configures a serial port for use with Crystalfontz LCDs. |
hw/console
Package console allows for some trivial manipulations of linux virtual terminals, such as switching which one is in the foreground, displaying messages, then switching back.
|
Package console allows for some trivial manipulations of linux virtual terminals, such as switching which one is in the foreground, displaying messages, then switching back. |
hw/console/contest
Test app for console package; normal unit test won't work as the vt commands require root privs.
|
Test app for console package; normal unit test won't work as the vt commands require root privs. |
hw/cpu
Package cpu allows determining topological arrangement of CPU cores, generally for use in setting RSS IRQs.
|
Package cpu allows determining topological arrangement of CPU cores, generally for use in setting RSS IRQs. |
hw/dmi
Package dmi reads DMI (aka SMBIOS) data via dmidecode.
|
Package dmi reads DMI (aka SMBIOS) data via dmidecode. |
hw/ioctl
Package ioctl uses IOCTL's to find block device size, adjust network interface state, etc.
|
Package ioctl uses IOCTL's to find block device size, adjust network interface state, etc. |
hw/ipmi
Package ipmi interacts with the platform BMC.
|
Package ipmi interacts with the platform BMC. |
hw/ipmi/uid
Package uid allows control of the IPMI UID light (AKA Chassis ID light).
|
Package uid allows control of the IPMI UID light (AKA Chassis ID light). |
hw/kmsg
Package kmsg facilitates processes writing to the kernel ring buffer.
|
Package kmsg facilitates processes writing to the kernel ring buffer. |
hw/nic
Package nic allows enabling/disabling NICs, configuring XPS, RFS, and RSS, etc.
|
Package nic allows enabling/disabling NICs, configuring XPS, RFS, and RSS, etc. |
hw/power
Package power handles poweroff- and reboot-related functionality, including running pre-reboot (Preboot) functions registered with the housekeeping pkg.
|
Package power handles poweroff- and reboot-related functionality, including running pre-reboot (Preboot) functions registered with the housekeeping pkg. |
hw/udev
Package udev allows starting udev and finding udevd if running.
|
Package udev allows starting udev and finding udevd if running. |
hw/uefi
Package uefi manipulates UEFI boot entries and other variables.
|
Package uefi manipulates UEFI boot entries and other variables. |
id
Package id returns UID, GID for given user from given filesystem (not necessarily mounted at /)
|
Package id returns UID, GID for given user from given filesystem (not necessarily mounted at /) |
init
Package init implements early userspace logic in go, replacing the functionality of initramfs's /init.
|
Package init implements early userspace logic in go, replacing the functionality of initramfs's /init. |
init/consts
Package consts contains init-related consts so they can be shared outside of pkg init.
|
Package consts contains init-related consts so they can be shared outside of pkg init. |
init/housekeeping
Package housekeeping works with lists of tasks to be performed in the future.
|
Package housekeeping works with lists of tasks to be performed in the future. |
init/progress
Provides feedback on the LCD that the boot is progressing.
|
Provides feedback on the LCD that the boot is progressing. |
log
Package log is a flexible logging mechanism allowing multiple log sinks, outputting to one or more of: the console, a file, an LCD, a networked log ingester, etc.
|
Package log is a flexible logging mechanism allowing multiple log sinks, outputting to one or more of: the console, a file, an LCD, a networked log ingester, etc. |
log/lcd
Package lcd is a StackableLog that logs events to cfa.DefaultLcd, as long as those events have the EndUserFlag set.
|
Package lcd is a StackableLog that logs events to cfa.DefaultLcd, as long as those events have the EndUserFlag set. |
log/testlog
Package testlog hijacks the output of github.com/purecloudlabs/gprovision/pkg/log, and can hijack log.Cmd().
|
Package testlog hijacks the output of github.com/purecloudlabs/gprovision/pkg/log, and can hijack log.Cmd(). |
mfg
Package mfg is used to validate the hardware of freshly-assembled units and to image them.
|
Package mfg is used to validate the hardware of freshly-assembled units and to image them. |
mfg/configStep
Package configStep implements manufacturing steps that can be specified in manufData.json.
|
Package configStep implements manufacturing steps that can be specified in manufData.json. |
mfg/mfgflags
Package mfgflags handles flags used to alter mfg behavior for testing.
|
Package mfgflags handles flags used to alter mfg behavior for testing. |
mfg/qa
Package QA implements quality checks for the mfg process.
|
Package QA implements quality checks for the mfg process. |
net
Package net implements some network-related functions for recovery.
|
Package net implements some network-related functions for recovery. |
net/xfer
Package xfer handles robust file transfers, primarily for use in mfg process.
|
Package xfer handles robust file transfers, primarily for use in mfg process. |
netexport
Package netexport reads network config data from windows.
|
Package netexport reads network config data from windows. |
oss
Sub-packages of oss contain replacements for proprietary functionality that could not be open sourced.
|
Sub-packages of oss contain replacements for proprietary functionality that could not be open sourced. |
oss/frd
Minimal, OSS impl of a mechanism storing data for use by factory restore.
|
Minimal, OSS impl of a mechanism storing data for use by factory restore. |
oss/pblog
Package pblog is the client for a logger using gRPC.
|
Package pblog is the client for a logger using gRPC. |
oss/stash
Package stash - oss impl of stash
|
Package stash - oss impl of stash |
recovery
Package recovery, known alternately as factory restore, is used to overwrite the main drive of a unit with a fresh image.
|
Package recovery, known alternately as factory restore, is used to overwrite the main drive of a unit with a fresh image. |
recovery/archive
Package archive sorts, verifies, and extracts .upd (xz-compressed tar) files.
|
Package archive sorts, verifies, and extracts .upd (xz-compressed tar) files. |
recovery/disk
Package disk handles logical disks, filesystems, and boot entries for the purposes of factory restore.
|
Package disk handles logical disks, filesystems, and boot entries for the purposes of factory restore. |
recovery/emode
Package emode checks any emergency-mode files to determine whether they are updates, json data, or unknown.
|
Package emode checks any emergency-mode files to determine whether they are updates, json data, or unknown. |
recovery/history
Package history logs image success/failure to disk.
|
Package history logs image success/failure to disk. |
systemd/networkd
Package networkd can be used to write config files for systemd-networkd.
|
Package networkd can be used to write config files for systemd-networkd. |
systemd/status
Package status can be used to query service status, stop/start services, etc.
|
Package status can be used to query service status, stop/start services, etc. |
fakeupd
Package fakeupd creates a fake .upd file with enough content to keep factory restore happy and to boot to a point where it can print a message.
|
Package fakeupd creates a fake .upd file with enough content to keep factory restore happy and to boot to a point where it can print a message. |
fakeupd/consts
Package consts contains consts used with fake update.
|
Package consts contains consts used with fake update. |
integ
Package integ contains integ tests run by mage.
|
Package integ contains integ tests run by mage. |
integ/helper/erase
prepare for erase integ test - create filesystem on recovery, write pattern on main volume
|
prepare for erase integ test - create filesystem on recovery, write pattern on main volume |
vm
Package vm contains utility functions used in integ tests with qemu VMs.
|
Package vm contains utility functions used in integ tests with qemu VMs. |