-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: generate overlay info by extracting board kernel args
This is compatibility code for SBCs running Talos < 1.7.x. With this change it's possible to do seamless upgrade of SBCs running without overlays. Fixes: #145 Signed-off-by: Artem Chernyshev <[email protected]>
- Loading branch information
Showing
5 changed files
with
122 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
internal/backend/runtime/omni/controllers/omni/internal/boards/boards.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Copyright (c) 2024 Sidero Labs, Inc. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the LICENSE file. | ||
|
||
// Package boards contains helpers for mapping board types to the overlays. | ||
package boards | ||
|
||
import ( | ||
"github.com/siderolabs/image-factory/pkg/schematic" | ||
"github.com/siderolabs/talos/pkg/machinery/constants" | ||
) | ||
|
||
// GetOverlay converts board constant to it's overlay. | ||
func GetOverlay(board string) *schematic.Overlay { | ||
switch board { | ||
case constants.BoardBananaPiM64: | ||
return &schematic.Overlay{ | ||
Name: "bananapi_m64", | ||
Image: "siderolabs/sbc-allwinner", | ||
} | ||
case constants.BoardJetsonNano: | ||
return &schematic.Overlay{ | ||
Name: "jetson_nano", | ||
Image: "siderolabs/sbc-jetson", | ||
} | ||
case constants.BoardLibretechAllH3CCH5: | ||
return &schematic.Overlay{ | ||
Name: "libretech_all_h3_cc_h5", | ||
Image: "siderolabs/sbc-allwinner", | ||
} | ||
case constants.BoardPine64: | ||
return &schematic.Overlay{ | ||
Name: "pine64", | ||
Image: "siderolabs/sbc-allwinner", | ||
} | ||
case constants.BoardRock64: | ||
return &schematic.Overlay{ | ||
Name: "bananapi_m64", | ||
Image: "siderolabs/sbc-allwinner", | ||
} | ||
case constants.BoardRockpi4: | ||
return &schematic.Overlay{ | ||
Name: "rockpi4", | ||
Image: "siderolabs/sbc-rockchip", | ||
} | ||
case constants.BoardRockpi4c: | ||
return &schematic.Overlay{ | ||
Name: "rockpi4c", | ||
Image: "siderolabs/sbc-rockchip", | ||
} | ||
case constants.BoardNanoPiR4S: | ||
return &schematic.Overlay{ | ||
Name: "nanopi-r4s", | ||
Image: "siderolabs/sbc-rockchip", | ||
} | ||
case constants.BoardRPiGeneric: | ||
return &schematic.Overlay{ | ||
Name: "rpi_generic", | ||
Image: "siderolabs/sbc-raspberrypi", | ||
} | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters