Documentation
¶
Overview ¶
Package migrate runs printer migration operations.
Index ¶
- Constants
- func BootstrapConnectionArgs(printer inventory.Printer) []string
- func ConnectionArgs(printer inventory.Printer) []string
- func KlippeeVariableValueSHA256(value string) string
- func MaybeRunAskpass(args []string, writer io.Writer) (handled bool, exitCode int)
- func MaybeRunBackend(ctx context.Context, args []string, out, errOut io.Writer) (bool, int)
- func RequirePlus4(printer inventory.Printer) error
- func SafeDiagnosticSummary(raw []byte) string
- func ValidateBootstrapConnection(printer inventory.Printer) error
- func ValidateConnectionArguments(printer inventory.Printer, args []string) error
- func ValidatePLRBackupManifest(manifest, account string) error
- func ValidatePLRLifecycle(result PLROperationResult) error
- func ValidatePLRTarget(result PLROperationResult, expectedAccount string) error
- func ValidatePasswordEnvironmentName(name string) error
- func ValidateSSHConnection(printer inventory.Printer) error
- type BoxClockGuardFile
- type BoxClockGuardInstallResult
- type BoxMotionGuardBackup
- type BoxMotionGuardResult
- type BoxMotionGuardTarget
- type EMMCDisk
- type EMMCWritePlan
- type KlippeeAgentArtifact
- type KlippeeAgentRefreshResult
- type KlippeeAgentUpgradeResult
- type KlippeeVariableSetResult
- type KlipperServiceRestartResult
- type KlipperUpdateResult
- type PLROperationResult
- type PLRPaths
- type PLRStabilitySample
- type QIDIArtifact
- type QIDIFixesResult
- type QIDIRelease
- type QIDIUpdateResult
- type Runner
- func (r Runner) KlippeeDiagnosticsSSHOutput(ctx context.Context, printer inventory.Printer, connectTimeout time.Duration) ([]byte, error)
- func (r Runner) KlippeeDiffSSHOutput(ctx context.Context, printer inventory.Printer, connectTimeout time.Duration) ([]byte, error)
- func (r Runner) KlippeeForceApplySSHOutput(ctx context.Context, printer inventory.Printer, connectTimeout time.Duration) ([]byte, error)
- func (r Runner) KlippeePreviousDiagnosticsSSHOutput(ctx context.Context, printer inventory.Printer, connectTimeout time.Duration) ([]byte, error)
- func (r Runner) KlipperServiceRestartSSHOutput(ctx context.Context, printer inventory.Printer, connectTimeout time.Duration) ([]byte, error)
- func (r Runner) Output(ctx context.Context, args ...string) ([]byte, error)
- func (r Runner) Run(ctx context.Context, args ...string) error
- func (r Runner) ToolRoot() (string, error)
- func (r Runner) Validate() error
Constants ¶
const ( BoxClockGuardInstallSchema = "qidi-plus4-box-output-clock-guard-install/v1" BoxClockGuardInstallAction = "INSTALL-BOX-OUTPUT-CLOCK-GUARD" BoxClockGuardAccount = "mks" BoxClockGuardTargetPath = "/home/mks/klipper/klippy/extras/box_output_clock_guard.py" BoxClockGuardTargetMode = "0644" BoxClockGuardConfigSection = "[box_output_clock_guard]" )
const ( BoxMotionGuardSchema = "qidi-plus4-box-motion-template-guard/v1" BoxMotionGuardAction = "HARDEN-BOX-MOTION-TEMPLATE" BoxMotionVendorAction = "RESTORE-BOX-MOTION-VENDOR" )
const ( KlippeeAgentRefreshSchema = "qidi-plus4-klippee-agent-refresh/v1" KlippeeAgentService = "klippee-moonraker.service" KlippeeAgentRefreshAction = "REFRESH-KLIPPEE-AGENT" )
const ( KlippeeAgentUpgradeSchema = "qidi-plus4-klippee-agent-upgrade/v1" KlippeeAgentUpgradeAction = "UPGRADE-KLIPPEE-AGENT" KlippeeAgentAccount = "mks" KlippeeAgentCLIPath = "/home/mks/.local/bin/klippee" KlippeeAgentOfficialSource = "https://klippee.xyz/install/klippee.py" )
const ( KlippeeVariableSetSchema = "qidi-plus4-klippee-variable-set/v1" KlippeeVariableSetAction = "SET-KLIPPEE-VARIABLE" KlippeeVariableCLIPath = "/home/mks/.local/bin/klippee" )
const ( PLRDeploymentSchema = "qidi-plus4-plr-deployment/v1" KlipperStartSchema = "qidi-plus4-klipper-start/v1" PLRRollbackSchema = "qidi-plus4-plr-rollback/v1" KlipperService = "klipper.service" PLRTransactionNotStarted = "not_started" PLRTransactionApplied = "applied" PLRTransactionAutoRolledBack = "auto_rolled_back" PLRTransactionRolledBack = "rolled_back" PLRTransactionSafetyRestored = "safety_restored" PLRTransactionPartial = "partial" PLRTransactionIndeterminate = "indeterminate" )
const ( KlipperRef = "214fdb2877ff4640e9316a663c1b8b2e232c86fd" MoonrakerRef = "1cfb0c41e468645951a371621f06d32777b6107c" KatapultRef = "ec59b9bb9ad6c2ec8d4dc6831fbc77f0b308e29e" )
const ( MainboardImage = "plus4-mainboard-klipper.bin" ToolheadImage = "plus4-toolhead-klipper.bin" ToolheadKatapultImage = "plus4-toolhead-katapult.bin" )
Image file names written by the native backend's build stage. An artifact directory is enough to locate every image without further configuration.
const KlipperServiceRestartSchema = "printerlab-klipper-service-restart/v1"
const KlipperUpdateAction = "UPDATE-KLIPPER"
const QIDIFixesAction = "APPLY-QIDI-FIXES"
const QIDIUpdateAction = "UPDATE-QIDI-FIRMWARE"
Variables ¶
This section is empty.
Functions ¶
func BootstrapConnectionArgs ¶
BootstrapConnectionArgs explicitly opts setup-ssh into the one-time password path. Every ordinary connection uses ConnectionArgs and therefore cannot inherit a bootstrap secret from inventory by accident.
func ConnectionArgs ¶
func MaybeRunAskpass ¶
MaybeRunAskpass handles the private OpenSSH password callback. It validates the request token and returns passwords only for authorized requests.
func MaybeRunBackend ¶
MaybeRunBackend handles the migration subprocess entry point. The internal environment flag authorizes this mode.
func RequirePlus4 ¶
func SafeDiagnosticSummary ¶
SafeDiagnosticSummary bounds subprocess diagnostics and removes terminal controls.
func ValidateBootstrapConnection ¶
ValidateBootstrapConnection checks SSH settings before setup-ssh starts. The password value is supplied through the gated OpenSSH askpass callback.
func ValidateConnectionArguments ¶
ValidateConnectionArguments lets orchestration reject any attempt to attach a bootstrap secret to an ordinary stage before recording or spawning it.
func ValidatePLRBackupManifest ¶
ValidatePLRBackupManifest rejects a caller-supplied handle unless it names an exact installer manifest under the effective printer account's canonical scripts directory. Callers can therefore fail before any network request.
func ValidatePLRLifecycle ¶
func ValidatePLRLifecycle(result PLROperationResult) error
ValidatePLRLifecycle checks successful stop/apply/verify results. Failed results retain their rollback instructions for display.
func ValidatePLRTarget ¶
func ValidatePLRTarget(result PLROperationResult, expectedAccount string) error
ValidatePLRTarget binds a parsed deploy/rollback result to the effective printer account from inventory and validates every canonical remote path and recovery handle. It performs no printer discovery.
func ValidatePasswordEnvironmentName ¶
ValidatePasswordEnvironmentName accepts portable process environment names while rejecting the variables that control the askpass boundary itself.
func ValidateSSHConnection ¶ added in v0.2.0
ValidateSSHConnection checks target syntax without connecting or changing it. The same rules apply to inventory entries and transient firmware targets.
Types ¶
type BoxClockGuardFile ¶
type BoxClockGuardFile struct {
Path string `json:"path" yaml:"path"`
SHA256 string `json:"sha256,omitempty" yaml:"sha256,omitempty"`
Owner string `json:"owner,omitempty" yaml:"owner,omitempty"`
Group string `json:"group,omitempty" yaml:"group,omitempty"`
Mode string `json:"mode,omitempty" yaml:"mode,omitempty"`
}
type BoxClockGuardInstallResult ¶
type BoxClockGuardInstallResult struct {
Schema string `json:"schema" yaml:"schema"`
OK *bool `json:"ok" yaml:"ok"`
Changed *bool `json:"changed,omitempty" yaml:"changed,omitempty"`
Applied *bool `json:"applied,omitempty" yaml:"applied,omitempty"`
Verified *bool `json:"verified" yaml:"verified"`
Account string `json:"account" yaml:"account"`
TransactionID string `json:"transaction_id" yaml:"transaction_id"`
SourceSHA256 string `json:"source_sha256" yaml:"source_sha256"`
Target BoxClockGuardFile `json:"target" yaml:"target"`
Backup *BoxClockGuardFile `json:"backup" yaml:"backup"`
KlipperServiceAction string `json:"klipper_service_action" yaml:"klipper_service_action"`
KlipperRestarted *bool `json:"klipper_restarted" yaml:"klipper_restarted"`
ConfigChanged *bool `json:"config_changed" yaml:"config_changed"`
ActivationRequired *bool `json:"activation_required" yaml:"activation_required"`
RequiredConfigSection string `json:"required_config_section" yaml:"required_config_section"`
StagingCleanupVerified *bool `json:"staging_cleanup_verified" yaml:"staging_cleanup_verified"`
Phase string `json:"phase,omitempty" yaml:"phase,omitempty"`
Error string `json:"error,omitempty" yaml:"error,omitempty"`
StagingCleanupError string `json:"staging_cleanup_error,omitempty" yaml:"staging_cleanup_error,omitempty"`
}
BoxClockGuardInstallResult is the narrow structured contract returned by qidi-plus4-firmware's fixed-purpose installer. Pointer booleans distinguish explicit safety proofs from omitted zero values.
func ParseBoxClockGuardInstall ¶
func ParseBoxClockGuardInstall(raw []byte) (BoxClockGuardInstallResult, error)
ParseBoxClockGuardInstall validates a bounded v1 installation result. It rejects duplicate fields and accepts additional diagnostic fields.
func (BoxClockGuardInstallResult) DiagnosticSummary ¶
func (result BoxClockGuardInstallResult) DiagnosticSummary() string
func (BoxClockGuardInstallResult) DidChange ¶
func (result BoxClockGuardInstallResult) DidChange() bool
func (BoxClockGuardInstallResult) Succeeded ¶
func (result BoxClockGuardInstallResult) Succeeded() bool
type BoxMotionGuardBackup ¶
type BoxMotionGuardResult ¶
type BoxMotionGuardResult struct {
Schema string `json:"schema" yaml:"schema"`
OK *bool `json:"ok" yaml:"ok"`
Changed *bool `json:"changed" yaml:"changed"`
Verified *bool `json:"verified" yaml:"verified"`
BoxCount int `json:"box_count" yaml:"box_count"`
TransactionID string `json:"transaction_id" yaml:"transaction_id"`
Target BoxMotionGuardTarget `json:"target" yaml:"target"`
Backup *BoxMotionGuardBackup `json:"backup" yaml:"backup"`
UseIRQ *bool `json:"use_irq" yaml:"use_irq"`
DebounceUSPresent *bool `json:"debounce_us_present" yaml:"debounce_us_present"`
ActiveConfigChanged *bool `json:"active_config_changed" yaml:"active_config_changed"`
KlipperServiceAction string `json:"klipper_service_action" yaml:"klipper_service_action"`
KlipperRestarted *bool `json:"klipper_restarted" yaml:"klipper_restarted"`
ActivationRequired *bool `json:"activation_required" yaml:"activation_required"`
Error string `json:"error,omitempty" yaml:"error,omitempty"`
}
func ParseBoxMotionGuard ¶
func ParseBoxMotionGuard(raw []byte) (BoxMotionGuardResult, error)
func ParseBoxMotionVendorRestore ¶
func ParseBoxMotionVendorRestore(raw []byte) (BoxMotionGuardResult, error)
func (BoxMotionGuardResult) DidChange ¶
func (result BoxMotionGuardResult) DidChange() bool
func (BoxMotionGuardResult) Succeeded ¶
func (result BoxMotionGuardResult) Succeeded() bool
type BoxMotionGuardTarget ¶
type BoxMotionGuardTarget struct {
Path string `json:"path" yaml:"path"`
BeforeSHA256 string `json:"before_sha256" yaml:"before_sha256"`
AfterSHA256 string `json:"after_sha256" yaml:"after_sha256"`
Mode string `json:"mode" yaml:"mode"`
UID int `json:"uid" yaml:"uid"`
GID int `json:"gid" yaml:"gid"`
}
type EMMCDisk ¶
type EMMCDisk struct {
Device string `json:"device"`
Number int `json:"number"`
FriendlyName string `json:"friendlyName"`
SerialNumber string `json:"serialNumber"`
UniqueID string `json:"uniqueId"`
BusType string `json:"busType"`
Size int64 `json:"size"`
LogicalSectorSize int64 `json:"logicalSectorSize"`
IsBoot bool `json:"isBoot"`
IsSystem bool `json:"isSystem"`
IsReadOnly bool `json:"isReadOnly"`
IsOffline bool `json:"isOffline"`
}
EMMCDisk is the identity shown before approval, rechecked before offlining, and checked against the opened raw handle before any image bytes are written.
type EMMCWritePlan ¶
type EMMCWritePlan struct {
Schema string `json:"schema"`
Manifest string `json:"manifest"`
Image string `json:"image"`
ImageSHA256 string `json:"imageSha256"`
RawImage string `json:"rawImage"`
RawSHA256 string `json:"rawSha256"`
Bytes int64 `json:"bytes"`
Disk EMMCDisk `json:"disk"`
CreatedAt string `json:"createdAt"`
}
type KlippeeAgentArtifact ¶
type KlippeeAgentRefreshResult ¶
type KlippeeAgentRefreshResult struct {
Schema string `json:"schema" yaml:"schema"`
OK bool `json:"ok" yaml:"ok"`
Service string `json:"service" yaml:"service"`
Scope string `json:"scope" yaml:"scope"`
Account string `json:"account" yaml:"account"`
ObservedState string `json:"observed_state" yaml:"observed_state"`
RestartExit *int `json:"restart_exit" yaml:"restart_exit"`
StateExit *int `json:"state_exit" yaml:"state_exit"`
KlipperActionsPerformed *bool `json:"klipper_actions_performed" yaml:"klipper_actions_performed"`
ConfigDeploymentPerformed *bool `json:"config_deployment_performed" yaml:"config_deployment_performed"`
Error string `json:"error,omitempty" yaml:"error,omitempty"`
}
func ParseKlippeeAgentRefresh ¶
func ParseKlippeeAgentRefresh(raw []byte) (KlippeeAgentRefreshResult, error)
type KlippeeAgentUpgradeResult ¶
type KlippeeAgentUpgradeResult struct {
Schema string `json:"schema" yaml:"schema"`
OK *bool `json:"ok" yaml:"ok"`
Changed *bool `json:"changed" yaml:"changed"`
Account string `json:"account" yaml:"account"`
CLIPath string `json:"cli_path" yaml:"cli_path"`
SourceURL string `json:"source_url" yaml:"source_url"`
Before KlippeeAgentArtifact `json:"before" yaml:"before"`
After KlippeeAgentArtifact `json:"after" yaml:"after"`
Service string `json:"service" yaml:"service"`
Scope string `json:"scope" yaml:"scope"`
ObservedState string `json:"observed_state" yaml:"observed_state"`
BeforePID *int `json:"before_pid" yaml:"before_pid"`
AfterPID *int `json:"after_pid" yaml:"after_pid"`
UpgradeExit *int `json:"upgrade_exit" yaml:"upgrade_exit"`
StateExit *int `json:"state_exit" yaml:"state_exit"`
UpgradeReportedSuccess *bool `json:"upgrade_reported_success" yaml:"upgrade_reported_success"`
AgentRestartPerformed *bool `json:"agent_restart_performed" yaml:"agent_restart_performed"`
KlipperActionsPerformed *bool `json:"klipper_actions_performed" yaml:"klipper_actions_performed"`
ConfigDeploymentPerformed *bool `json:"config_deployment_performed" yaml:"config_deployment_performed"`
Error string `json:"error,omitempty" yaml:"error,omitempty"`
}
func ParseKlippeeAgentUpgrade ¶
func ParseKlippeeAgentUpgrade(raw []byte) (KlippeeAgentUpgradeResult, error)
ParseKlippeeAgentUpgrade consumes the exact bounded v1 proof emitted by the reviewed firmware operation. Unknown, duplicate, case-aliased, missing, or trailing fields fail closed before any lifecycle claim is trusted.
func (KlippeeAgentUpgradeResult) DiagnosticSummary ¶
func (result KlippeeAgentUpgradeResult) DiagnosticSummary() string
func (KlippeeAgentUpgradeResult) DidChange ¶
func (result KlippeeAgentUpgradeResult) DidChange() bool
func (KlippeeAgentUpgradeResult) Succeeded ¶
func (result KlippeeAgentUpgradeResult) Succeeded() bool
type KlippeeVariableSetResult ¶
type KlippeeVariableSetResult struct {
Schema string `json:"schema" yaml:"schema"`
OK *bool `json:"ok" yaml:"ok"`
Account string `json:"account" yaml:"account"`
CLIPath string `json:"cli_path" yaml:"cli_path"`
Name string `json:"name" yaml:"name"`
ValueSHA256 string `json:"value_sha256" yaml:"value_sha256"`
SetReturnCode int `json:"set_return_code" yaml:"set_return_code"`
DoctorReturnCode *int `json:"doctor_return_code" yaml:"doctor_return_code"`
Verified *bool `json:"verified" yaml:"verified"`
ConfigDeployed *bool `json:"config_deployed" yaml:"config_deployed"`
KlipperAction string `json:"klipper_action" yaml:"klipper_action"`
Error string `json:"error" yaml:"error"`
}
func ParseKlippeeVariableSet ¶
func ParseKlippeeVariableSet(raw []byte) (KlippeeVariableSetResult, error)
func (KlippeeVariableSetResult) Succeeded ¶
func (result KlippeeVariableSetResult) Succeeded() bool
type KlipperServiceRestartResult ¶
type KlipperServiceRestartResult struct {
Schema string `json:"schema" yaml:"schema"`
Service string `json:"service" yaml:"service"`
State string `json:"state" yaml:"state"`
PreviousPID int `json:"previous_pid" yaml:"previous_pid"`
CurrentPID int `json:"current_pid" yaml:"current_pid"`
}
func ParseKlipperServiceRestart ¶
func ParseKlipperServiceRestart(raw []byte) (KlipperServiceRestartResult, error)
func (KlipperServiceRestartResult) Validate ¶
func (result KlipperServiceRestartResult) Validate() error
type KlipperUpdateResult ¶
type KlipperUpdateResult struct {
Schema int `json:"schema" yaml:"schema"`
OK bool `json:"ok" yaml:"ok"`
Status string `json:"status" yaml:"status"`
Account string `json:"account" yaml:"account"`
CheckOnly bool `json:"check_only" yaml:"check_only"`
Before string `json:"before" yaml:"before"`
Target string `json:"target" yaml:"target"`
After string `json:"after" yaml:"after"`
Version string `json:"version" yaml:"version"`
Backup string `json:"backup" yaml:"backup"`
Error string `json:"error" yaml:"error"`
RollbackError string `json:"rollback_error" yaml:"rollback_error"`
}
KlipperUpdateResult describes a host-only update and its startup verification.
func ParseKlipperUpdate ¶
func ParseKlipperUpdate(raw []byte) (KlipperUpdateResult, error)
type PLROperationResult ¶
type PLROperationResult struct {
Schema string `json:"schema" yaml:"schema"`
OK *bool `json:"ok" yaml:"ok"`
Account string `json:"account,omitempty" yaml:"account,omitempty"`
Paths PLRPaths `json:"paths,omitempty" yaml:"paths,omitempty"`
TransactionState string `json:"transaction_state,omitempty" yaml:"transaction_state,omitempty"`
Changed *bool `json:"changed,omitempty" yaml:"changed,omitempty"`
Applied *bool `json:"applied,omitempty" yaml:"applied,omitempty"`
Verified *bool `json:"verified,omitempty" yaml:"verified,omitempty"`
KlipperLeftStopped *bool `json:"klipper_left_stopped,omitempty" yaml:"klipper_left_stopped,omitempty"`
BackupManifest string `json:"backup_manifest,omitempty" yaml:"backup_manifest,omitempty"`
SafetyManifest string `json:"safety_manifest,omitempty" yaml:"safety_manifest,omitempty"`
RollbackManifest string `json:"rollback_manifest,omitempty" yaml:"rollback_manifest,omitempty"`
Service string `json:"service,omitempty" yaml:"service,omitempty"`
ObservedState string `json:"observed_state,omitempty" yaml:"observed_state,omitempty"`
Phase string `json:"phase,omitempty" yaml:"phase,omitempty"`
Error string `json:"error,omitempty" yaml:"error,omitempty"`
NextCommand string `json:"next_command,omitempty" yaml:"next_command,omitempty"`
StartExit *int `json:"start_exit,omitempty" yaml:"start_exit,omitempty"`
StateExit *int `json:"state_exit,omitempty" yaml:"state_exit,omitempty"`
StabilityChecks int `json:"stability_checks_required,omitempty" yaml:"stability_checks_required,omitempty"`
StabilityInterval float64 `json:"stability_interval_seconds,omitempty" yaml:"stability_interval_seconds,omitempty"`
StabilitySamples []PLRStabilitySample `json:"stability_samples,omitempty" yaml:"stability_samples,omitempty"`
Plan plrNestedResult `json:"plan,omitempty" yaml:"-"`
Installation plrNestedResult `json:"installation,omitempty" yaml:"-"`
Rollback plrNestedResult `json:"rollback,omitempty" yaml:"-"`
Verification plrNestedResult `json:"verification,omitempty" yaml:"-"`
// contains filtered or unexported fields
}
PLROperationResult contains lifecycle status, recovery handles, and diagnostics. Detailed installer results are retained in the utility's JSON output.
func ParsePLROperation ¶
func ParsePLROperation(raw []byte, expectedSchema string) (PLROperationResult, error)
ParsePLROperation accepts exactly one JSON document and validates its schema. It never searches printer files or guesses a backup path.
func (PLROperationResult) DiagnosticSummary ¶
func (result PLROperationResult) DiagnosticSummary() string
DiagnosticSummary combines and deduplicates wrapper and remote installer errors.
func (PLROperationResult) DidChange ¶
func (result PLROperationResult) DidChange() bool
func (PLROperationResult) Succeeded ¶
func (result PLROperationResult) Succeeded() bool
func (*PLROperationResult) UnmarshalJSON ¶
func (result *PLROperationResult) UnmarshalJSON(raw []byte) error
type PLRPaths ¶
type PLRPaths struct {
Home string `json:"home" yaml:"home"`
KlipperDir string `json:"klipper_dir" yaml:"klipper_dir"`
PrinterData string `json:"printer_data" yaml:"printer_data"`
ScriptsDir string `json:"scripts_dir" yaml:"scripts_dir"`
Python string `json:"python" yaml:"python"`
GCodeRoot string `json:"gcode_root" yaml:"gcode_root"`
Checkpoint string `json:"checkpoint" yaml:"checkpoint"`
Record string `json:"record" yaml:"record"`
Output string `json:"output" yaml:"output"`
}
PLRPaths identifies the Klipper account and paths for a recovery operation. The v1 result requires the complete field set.
func CanonicalPLRPaths ¶
CanonicalPLRPaths returns the only remote layout accepted by the reviewed QIDI PLR wrapper. It validates the account before constructing any path.
func (*PLRPaths) UnmarshalJSON ¶
type PLRStabilitySample ¶
type QIDIArtifact ¶ added in v0.2.0
type QIDIFixesResult ¶ added in v0.2.0
type QIDIFixesResult struct {
Schema int `json:"schema" yaml:"schema"`
OK bool `json:"ok" yaml:"ok"`
Status string `json:"status" yaml:"status"`
Model string `json:"model" yaml:"model"`
Version string `json:"version" yaml:"version"`
CheckOnly bool `json:"check_only" yaml:"check_only"`
Polling bool `json:"polling" yaml:"polling"`
Backup string `json:"backup" yaml:"backup"`
BackupSHA256 string `json:"backup_sha256" yaml:"backup_sha256"`
LocalBackup string `json:"local_backup" yaml:"local_backup"`
StartupVerified bool `json:"startup_verified" yaml:"startup_verified"`
Changes []string `json:"changes" yaml:"changes"`
Notes []string `json:"notes" yaml:"notes"`
Error string `json:"error" yaml:"error"`
}
func ParseQIDIFixes ¶ added in v0.2.0
func ParseQIDIFixes(raw []byte) (QIDIFixesResult, error)
type QIDIRelease ¶ added in v0.2.0
type QIDIRelease struct {
Model string `json:"model" yaml:"model"`
Version string `json:"version" yaml:"version"`
DeviceMarker string `json:"device_marker" yaml:"device_marker"`
Account string `json:"account" yaml:"account"`
Architecture string `json:"architecture" yaml:"architecture"`
PackageName string `json:"package_name" yaml:"package_name"`
PackageArch string `json:"package_arch" yaml:"package_arch"`
VersionFile string `json:"version_file" yaml:"version_file"`
ScreenDevice string `json:"screen_device" yaml:"screen_device"`
ScreenVersion string `json:"screen_version" yaml:"screen_version"`
MinimumVersion string `json:"minimum_version" yaml:"minimum_version"`
Source string `json:"source" yaml:"source"`
Host QIDIArtifact `json:"host" yaml:"host"`
Screen QIDIArtifact `json:"screen" yaml:"screen"`
PreservePaths []string `json:"preserve_paths" yaml:"preserve_paths"`
RemovedGlobs []string `json:"removed_globs" yaml:"removed_globs"`
}
QIDIRelease is a reviewed installation profile, not a general-purpose package URL. Add models/releases only after inspecting their installer and hardware layout.
func QIDIReleaseFor ¶ added in v0.2.0
func QIDIReleaseFor(model, version string) (QIDIRelease, error)
func QIDIReleases ¶ added in v0.2.0
func QIDIReleases() ([]QIDIRelease, error)
func SelectQIDIRelease ¶ added in v0.2.0
func SelectQIDIRelease(model, version string) (QIDIRelease, error)
SelectQIDIRelease resolves standalone CLI defaults only from the reviewed catalogue. Ambiguous models require an explicit selection; live preflight still verifies the printer's actual device marker against this profile.
type QIDIUpdateResult ¶ added in v0.2.0
type QIDIUpdateResult struct {
Schema int `json:"schema" yaml:"schema"`
OK bool `json:"ok" yaml:"ok"`
Status string `json:"status" yaml:"status"`
Model string `json:"model" yaml:"model"`
Target string `json:"target" yaml:"target"`
Before string `json:"before" yaml:"before"`
After string `json:"after" yaml:"after"`
CheckOnly bool `json:"check_only" yaml:"check_only"`
HostOnly bool `json:"host_only" yaml:"host_only"`
ConfigPolicy string `json:"config_policy" yaml:"config_policy"`
ScreenStatus string `json:"screen_status" yaml:"screen_status"`
Backup string `json:"backup" yaml:"backup"`
BackupSHA256 string `json:"backup_sha256" yaml:"backup_sha256"`
LocalBackup string `json:"local_backup" yaml:"local_backup"`
ConfigVerified bool `json:"config_verified" yaml:"config_verified"`
StartupVerified bool `json:"startup_verified" yaml:"startup_verified"`
Error string `json:"error" yaml:"error"`
}
func ParseQIDIUpdate ¶ added in v0.2.0
func ParseQIDIUpdate(raw []byte) (QIDIUpdateResult, error)
type Runner ¶
type Runner struct {
Repo string
Home string
Out io.Writer
ErrOut io.Writer
BootstrapPasswordEnvironments []string
// contains filtered or unexported fields
}
func (Runner) KlippeeDiagnosticsSSHOutput ¶
func (r Runner) KlippeeDiagnosticsSSHOutput( ctx context.Context, printer inventory.Printer, connectTimeout time.Duration, ) ([]byte, error)
KlippeeDiagnosticsSSHOutput runs the printer's upload-diagnostics command through SSH. It returns bounded output.
func (Runner) KlippeeDiffSSHOutput ¶
func (r Runner) KlippeeDiffSSHOutput( ctx context.Context, printer inventory.Printer, connectTimeout time.Duration, ) ([]byte, error)
KlippeeDiffSSHOutput runs only the installed physical printer account's read-only Klippee check --diff command and returns bounded output.
func (Runner) KlippeeForceApplySSHOutput ¶
func (r Runner) KlippeeForceApplySSHOutput( ctx context.Context, printer inventory.Printer, connectTimeout time.Duration, ) ([]byte, error)
KlippeeForceApplySSHOutput is the explicit fallback for a physical workspace whose reviewed local changes have already been merged into desired state. The remote operation is fixed to `klippee pull --force`.
func (Runner) KlippeePreviousDiagnosticsSSHOutput ¶
func (r Runner) KlippeePreviousDiagnosticsSSHOutput( ctx context.Context, printer inventory.Printer, connectTimeout time.Duration, ) ([]byte, error)
KlippeePreviousDiagnosticsSSHOutput uploads the newest rotated klippy.log through the installed Klippee client. The remote command is fixed: callers cannot supply a path, glob, or shell fragment, and Printerlab never receives the log contents.
func (Runner) KlipperServiceRestartSSHOutput ¶
Source Files
¶
- askpass.go
- box_clock_guard.go
- box_motion_guard.go
- emmc_other.go
- klippee_agent.go
- klippee_agent_upgrade.go
- klippee_command.go
- klippee_diagnostics.go
- klippee_diff.go
- klippee_force_apply.go
- klippee_variable.go
- klipper_service_restart.go
- klipper_update.go
- native.go
- native_agent.go
- native_backup.go
- native_download.go
- native_emmc.go
- native_emmc_write.go
- native_firmware.go
- native_install.go
- native_plr.go
- native_prepare.go
- native_probe.go
- native_render.go
- native_ssh.go
- plr.go
- qidi_fixes.go
- qidi_payloads.go
- qidi_update.go
- runner.go