firmwaremanager

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FirmwareEntry

type FirmwareEntry struct {
	// contains filtered or unexported fields
}

FirmwareEntry identifies a firmware artifact by name and embedded FS path.

type FirmwareFetcher

type FirmwareFetcher struct {
	// contains filtered or unexported fields
}

FirmwareFetcher provides read-only access to embedded firmware assets organized as firmware/<vendor>/pmc.

type FirmwareRepo

type FirmwareRepo struct {
	// contains filtered or unexported fields
}

FirmwareRepo holds parsed firmware upgrade edges and the supported starting-version range for a vendor.

type FirmwareUpdater

type FirmwareUpdater struct {
	// contains filtered or unexported fields
}

FirmwareUpdater encapsulates a vendor’s FirmwareRepo and UpgradeRule to select and execute upgrades.

func (*FirmwareUpdater) Summary

func (updater *FirmwareUpdater) Summary() (string, error)

Summary returns the repo and rule summaries for the vendor.

type FirmwareUpgrade

type FirmwareUpgrade struct {
	// contains filtered or unexported fields
}

FirmwareUpgrade represents a single directed edge from a source firmware version to a target version, with the artifact path.

func (*FirmwareUpgrade) UpgradeTo

func (upgrade *FirmwareUpgrade) UpgradeTo() firmwareVersion

type LiteonUpgradeRule

type LiteonUpgradeRule struct{}

LiteonUpgradeRule allows only direct upgrades where the device’s current version equals the edge’s source.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager aggregates per-vendor FirmwareUpdater instances and exposes a vendor-agnostic API for firmware operations.

func New

func New(ctx context.Context, c cdb.Config, pmcManager *pmcmanager.PmcManager, dryRun bool) (*Manager, error)

New constructs a Manager by creating updaters for all supported vendors.

func (*Manager) CanUpdate

func (manager *Manager) CanUpdate(ctx context.Context, pmc *pmc.PMC, component powershelf.Component, targetVersion string) (bool, error)

CanUpdate returns whether a PMC’s current firmware is within the supported range.

func (*Manager) GetFirmwareUpdate

func (manager *Manager) GetFirmwareUpdate(ctx context.Context, mac net.HardwareAddr, component powershelf.Component) (*powershelf.FirmwareUpdate, error)

GetFirmwareUpdate returns the status of a firmware update for the specified PMC MAC and component.

func (*Manager) ListAvailableFirmware

func (manager *Manager) ListAvailableFirmware(ctx context.Context, pmc *pmc.PMC) ([]FirmwareUpgrade, error)

CanUpdate returns whether a PMC’s current firmware is within the supported range.

func (*Manager) SetDryRun

func (manager *Manager) SetDryRun(dryRun bool)

func (*Manager) SetUpdateState

func (manager *Manager) SetUpdateState(ctx context.Context, update model.FirmwareUpdate, newState powershelf.FirmwareState, errMsg string) error

func (*Manager) Summary

func (manager *Manager) Summary() (string, error)

Summary returns a human-readable summary of supported ranges and rules for all vendors.

func (*Manager) Upgrade

func (manager *Manager) Upgrade(ctx context.Context, pmc *pmc.PMC, component powershelf.Component, targetVersion string) error

Upgrade upgrades firmware for a PMC, honoring vendor rules and dry-run.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func (*Registry) GetFwUpdate

func (ps *Registry) GetFwUpdate(
	ctx context.Context,
	mac net.HardwareAddr,
	component powershelf.Component,
) (*powershelf.FirmwareUpdate, error)

func (*Registry) QueueFwUpdate

func (ps *Registry) QueueFwUpdate(ctx context.Context, fwUpdate *powershelf.FirmwareUpdate) error

QueueFwUpdate creates a FirmwareUpdate row, mapping domain → DAO.

func (*Registry) Start

func (ps *Registry) Start(ctx context.Context) error

Start starts the PostgresStore instance. Currently, it is no-op.

func (*Registry) Stop

func (ps *Registry) Stop(ctx context.Context) error

Stop stops the PostgresStore instance by closing the PostgresQL connection.

type UpgradeRule

type UpgradeRule interface {
	// contains filtered or unexported methods
}

UpgradeRule determines whether a given upgrade edge is permissible from a current firmware version.

Jump to

Keyboard shortcuts

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