Skip to content

Commit

Permalink
feat: adds board Turing RK1
Browse files Browse the repository at this point in the history
Adds board Turing RK1 (rk3588) board support
Add kernel module check for 6.6
Temporary alternative u-boot & kernel image

Signed-off-by: Nico Berlee <nico.berlee@on2it.net>
  • Loading branch information
nberlee committed Mar 6, 2024
1 parent 7dceba0 commit 3945bda
Show file tree
Hide file tree
Showing 13 changed files with 380 additions and 36 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Talos Image

on:
push:
branches: [ 'turingrk1', 'release-*' ]
tags:
- "v*"

jobs:
talos-image:
runs-on: buildjet-4vcpu-ubuntu-2204-arm

permissions:
actions: read
contents: write
issues: read
packages: write
pull-requests: read

steps:
- uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout
uses: actions/checkout@v4
with:
# need history for `git describe` to work for Talos `Makefile`
fetch-depth: 0
fetch-tags: true

- name: Build and push Talos installer image
run: make installer
env:
PUSH: '1'
USERNAME: ${{ github.actor }}
PLATFORM: linux/arm64
PROGRESS: plain
CI_ARGS: "--cache-from=ghcr.io/${{ github.actor }}/installer:cache --cache-to=ghcr.io/${{ github.actor }}/installer:cache"

- name: Build and push Talos imager image
run: make imager
env:
PUSH: '1'
USERNAME: ${{ github.actor }}
PLATFORM: linux/arm64
INSTALLER_ARCH: arm64
PROGRESS: plain
CI_ARGS: "--cache-from=ghcr.io/${{ github.actor }}/imager:cache --cache-to=ghcr.io/${{ github.actor }}/imager:cache"

- name: release-notes
if: startsWith(github.ref, 'refs/tags/')
run: |
mkdir -p _out
make release-notes
- name: Build an turing-rk1 flashable image
run: make sbc-turing_rk1
env:
USERNAME: ${{ github.actor }}
PLATFORM: linux/arm64
PROGRESS: plain
IMAGER_ARGS: "--system-extension-image ghcr.io/nberlee/rk3588:v1.6.6"

- name: Build an turing-rk1 installer
run: |
make sbc-installer
curl -sL "https://github.com/google/go-containerregistry/releases/download/v0.19.0/go-containerregistry_Linux_arm64.tar.gz" | tar -zxv -C /usr/local/bin/ crane
IMAGETAG=$(git describe --tag --always --dirty --match v[0-9]\*)
crane push _out/installer-arm64.tar ghcr.io/nberlee/installer:$IMAGETAG-rk3588
env:
USERNAME: ${{ github.actor }}
PLATFORM: linux/arm64
PROGRESS: plain
IMAGER_ARGS: "--system-extension-image ghcr.io/nberlee/rk3588:v1.6.6"

- uses: actions/upload-artifact@v3
with:
name: image-turing-rk1
path: _out/*.raw.xz
if-no-files-found: error

- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: crazy-max/ghaction-github-release@v2
with:
body_path: _out/RELEASE_NOTES.md
draft: "true"
files: |
_out/metal-turing_rk1-arm64.raw.xz
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ FROM ${PKG_KERNEL} AS pkg-kernel
FROM --platform=amd64 ${PKG_KERNEL} AS pkg-kernel-amd64
FROM --platform=arm64 ${PKG_KERNEL} AS pkg-kernel-arm64

FROM --platform=arm64 ghcr.io/siderolabs/u-boot:${PKGS} AS pkg-u-boot-arm64
FROM --platform=arm64 ghcr.io/nberlee/u-boot:v1.6.0-28-gbee73fd-dirty AS pkg-u-boot-arm64
FROM --platform=arm64 ghcr.io/siderolabs/raspberrypi-firmware:${PKGS} AS pkg-raspberrypi-firmware-arm64

# Resolve package images using ${EXTRAS} to be used later in COPY --from=.
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CLOUD_IMAGES_EXTRA_ARGS ?= ""
ARTIFACTS := _out
TOOLS ?= ghcr.io/siderolabs/tools:v1.6.0-3-gae30965
PKGS ?= v1.6.0-26-g2961472
PKG_KERNEL ?= ghcr.io/siderolabs/kernel:$(PKGS)
PKG_KERNEL ?= ghcr.io/nberlee/kernel:v1.6.0-28-gbee73fd
EXTRAS ?= v1.6.0-2-g9234398
# renovate: datasource=github-tags depName=golang/go
GO_VERSION ?= 1.21
Expand Down Expand Up @@ -317,11 +317,11 @@ images-essential: image-aws image-gcp image-metal secureboot-installer ## Builds

images: image-aws image-azure image-digital-ocean image-exoscale image-gcp image-hcloud image-iso image-metal image-nocloud image-openstack image-oracle image-scaleway image-upcloud image-vmware image-vultr ## Builds all known images (AWS, Azure, DigitalOcean, Exoscale, GCP, HCloud, Metal, NoCloud, Openstack, Oracle, Scaleway, UpCloud, Vultr and VMware).

sbc-%: ## Builds the specified SBC image. Valid options are rpi_generic, rock64, bananapi_m64, libretech_all_h3_cc_h5, rockpi_4, rockpi_4c, pine64, jetson_nano and nanopi_r4s (e.g. sbc-rpi_generic)
sbc-%: ## Builds the specified SBC image. Valid options are rpi_generic, rock64, bananapi_m64, libretech_all_h3_cc_h5, rockpi_4, rockpi_4c, pine64, jetson_nano, nanopi_r4s and turing_rk1 (e.g. sbc-rpi_generic)
@docker pull $(REGISTRY_AND_USERNAME)/imager:$(IMAGE_TAG)
@docker run --rm -t -v /dev:/dev -v $(PWD)/$(ARTIFACTS):/out --network=host --privileged $(REGISTRY_AND_USERNAME)/imager:$(IMAGE_TAG) $* --arch arm64 $(IMAGER_ARGS)

sbcs: sbc-rpi_generic sbc-rock64 sbc-bananapi_m64 sbc-libretech_all_h3_cc_h5 sbc-rockpi_4 sbc-rockpi_4c sbc-pine64 sbc-jetson_nano sbc-nanopi_r4s ## Builds all known SBC images (Raspberry Pi 4, Rock64, Banana Pi M64, Radxa ROCK Pi 4, Radxa ROCK Pi 4c, Pine64, Libre Computer Board ALL-H3-CC, Jetson Nano and Nano Pi R4S).
sbcs: sbc-rpi_generic sbc-rock64 sbc-bananapi_m64 sbc-libretech_all_h3_cc_h5 sbc-rockpi_4 sbc-rockpi_4c sbc-pine64 sbc-jetson_nano sbc-nanopi_r4s sbc-turing_rk1 ## Builds all known SBC images (Raspberry Pi 4, Rock64, Banana Pi M64, Radxa ROCK Pi 4, Radxa ROCK Pi 4c, Pine64, Libre Computer Board ALL-H3-CC, Jetson Nano and Nano Pi R4S).

.PHONY: iso
iso: image-iso ## Builds the ISO and outputs it to the artifact directory.
Expand Down
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,48 @@
</p>

---
# Friendly fork
This is a friendly fork of [siderolabs/talos](siderolabs/talos). It is only here to support [SBC Turing RK1](https://turingpi.com/product/turing-rk1/). And it will be integrated in some way using [community managed SBCs](https://github.com/siderolabs/talos/issues/8065) in Talos 1.7.

## Using this fork
[![asciicast](https://asciinema.org/a/635709.svg)](https://asciinema.org/a/635709)

### Download the latest release on the right

This describes the CLI commands, you may use the Turing PI webgui. Always first unpack the image yourself. Version 2.06 supports xz images, but it is slower.
```sh
xz -d metal-turing_rk1-arm64.raw.xz
tpi flash -n <NODENUMBER> -i metal-turing_rk1-arm64.raw
tpi power on -n <NODENUMBER>
```

To check bootmessages:
```sh
tpi uart -n <NODENUMBER> get
```

Make sure when you use talosctl apply-config to have in this config:
```yaml
machine:
kernel:
modules:
- name: rockchip-cpufreq
```
for an extended installation guide with cilium see issue #1
### Updating
Updating can also be done faster using the `talosctl upgrade` command.

```sh
talosctl upgrade -i ghcr.io/nberlee/installer:v1.6.x-rk3588
```
when adding the `-rk3588` to the tag, the rk3588 extension is no longer needed in the machine-config.
For example the `ghcr.io/nberlee/installer:v1.6.4-rk3588` installer image has the rk3588 talos extension included


# Talos
**Talos** is a modern OS for running Kubernetes: secure, immutable, and minimal.
Talos is fully open source, production-ready, and supported by the people at [Sidero Labs](https://www.SideroLabs.com/)
All system management is done via an API - there is no shell or interactive console.
Expand Down
18 changes: 3 additions & 15 deletions hack/modules-amd64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@ kernel/drivers/md/persistent-data/dm-persistent-data.ko
kernel/drivers/md/raid456.ko
kernel/drivers/net/ethernet/aquantia/atlantic/atlantic.ko
kernel/drivers/net/ethernet/atheros/alx/alx.ko
kernel/drivers/net/ethernet/broadcom/bnx2.ko
kernel/drivers/net/ethernet/broadcom/bnx2x/bnx2x.ko
kernel/drivers/net/ethernet/broadcom/bnxt/bnxt_en.ko
kernel/drivers/net/ethernet/cisco/enic/enic.ko
kernel/drivers/net/ethernet/emulex/benet/be2net.ko
kernel/drivers/net/ethernet/google/gve/gve.ko
kernel/drivers/net/ethernet/intel/e100.ko
kernel/drivers/net/ethernet/intel/e1000/e1000.ko
kernel/drivers/net/ethernet/intel/e1000e/e1000e.ko
Expand All @@ -35,19 +31,9 @@ kernel/drivers/net/ethernet/intel/ice/ice.ko
kernel/drivers/net/ethernet/intel/igb/igb.ko
kernel/drivers/net/ethernet/intel/igbvf/igbvf.ko
kernel/drivers/net/ethernet/intel/igc/igc.ko
kernel/drivers/net/ethernet/intel/ixgb/ixgb.ko
kernel/drivers/net/ethernet/intel/ixgbe/ixgbe.ko
kernel/drivers/net/ethernet/intel/ixgbevf/ixgbevf.ko
kernel/drivers/net/ethernet/marvell/sky2.ko
kernel/drivers/net/ethernet/mellanox/mlx4/mlx4_core.ko
kernel/drivers/net/ethernet/mellanox/mlx4/mlx4_en.ko
kernel/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko
kernel/drivers/net/ethernet/mellanox/mlxfw/mlxfw.ko
kernel/drivers/net/ethernet/mellanox/mlxsw/mlxsw_core.ko
kernel/drivers/net/ethernet/mellanox/mlxsw/mlxsw_i2c.ko
kernel/drivers/net/ethernet/mellanox/mlxsw/mlxsw_minimal.ko
kernel/drivers/net/ethernet/mellanox/mlxsw/mlxsw_pci.ko
kernel/drivers/net/ethernet/mellanox/mlxsw/mlxsw_spectrum.ko
kernel/drivers/net/ethernet/qlogic/qed/qed.ko
kernel/drivers/net/ethernet/qlogic/qede/qede.ko
kernel/drivers/net/ethernet/qlogic/qlcnic/qlcnic.ko
Expand All @@ -56,6 +42,8 @@ kernel/drivers/net/ethernet/realtek/r8169.ko
kernel/drivers/net/ethernet/sfc/sfc.ko
kernel/drivers/net/ethernet/sfc/siena/sfc-siena.ko
kernel/drivers/net/mdio.ko
kernel/drivers/net/phy/ax88796b.ko
kernel/drivers/net/phy/smsc.ko
kernel/drivers/net/vmxnet3/vmxnet3.ko
kernel/drivers/net/vrf.ko
kernel/drivers/scsi/aacraid/aacraid.ko
Expand All @@ -67,9 +55,9 @@ kernel/drivers/scsi/vmw_pvscsi.ko
kernel/drivers/virtio/virtio_balloon.ko
kernel/drivers/virtio/virtio_input.ko
kernel/drivers/virtio/virtio_mmio.ko
kernel/drivers/virtio/virtio_pci.ko
kernel/drivers/virtio/virtio_pci_legacy_dev.ko
kernel/drivers/virtio/virtio_pci_modern_dev.ko
kernel/drivers/virtio/virtio_pci.ko
kernel/lib/objagg.ko
kernel/lib/parman.ko
kernel/lib/raid6/raid6_pq.ko
Expand Down
14 changes: 4 additions & 10 deletions hack/modules-arm64.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
kernel/arch/arm64/lib/xor-neon.ko
kernel/crypto/async_tx/async_memcpy.ko
kernel/crypto/async_tx/async_pq.ko
kernel/crypto/async_tx/async_raid6_recov.ko
kernel/crypto/async_tx/async_tx.ko
kernel/crypto/async_tx/async_xor.ko
kernel/crypto/xor.ko
kernel/drivers/block/nbd.ko
kernel/drivers/dma/bcm-sba-raid.ko
kernel/drivers/hwmon/i5k_amb.ko
kernel/drivers/infiniband/sw/rxe/rdma_rxe.ko
kernel/drivers/irqchip/irq-imx-mu-msi.ko
Expand All @@ -17,19 +19,11 @@ kernel/drivers/md/dm-thin-pool.ko
kernel/drivers/md/persistent-data/dm-persistent-data.ko
kernel/drivers/md/raid456.ko
kernel/drivers/net/ethernet/atheros/alx/alx.ko
kernel/drivers/net/ethernet/google/gve/gve.ko
kernel/drivers/net/ethernet/mellanox/mlx4/mlx4_core.ko
kernel/drivers/net/ethernet/mellanox/mlx4/mlx4_en.ko
kernel/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko
kernel/drivers/net/ethernet/mellanox/mlxfw/mlxfw.ko
kernel/drivers/net/ethernet/mellanox/mlxsw/mlxsw_core.ko
kernel/drivers/net/ethernet/mellanox/mlxsw/mlxsw_i2c.ko
kernel/drivers/net/ethernet/mellanox/mlxsw/mlxsw_minimal.ko
kernel/drivers/net/ethernet/mellanox/mlxsw/mlxsw_pci.ko
kernel/drivers/net/ethernet/mellanox/mlxsw/mlxsw_spectrum.ko
kernel/drivers/net/ethernet/sfc/sfc.ko
kernel/drivers/net/ethernet/sfc/siena/sfc-siena.ko
kernel/drivers/net/vrf.ko
kernel/drivers/net/ethernet/sfc/siena/sfc-siena.ko
kernel/drivers/net/mdio/mdio-mux-meson-gxl.ko
kernel/lib/objagg.ko
kernel/lib/parman.ko
kernel/lib/raid6/raid6_pq.ko
Expand Down
6 changes: 1 addition & 5 deletions hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

RELEASE_TOOL_IMAGE="ghcr.io/siderolabs/release-tool:latest"
RELEASE_TOOL_IMAGE="ghcr.io/nberlee/release-tool:09b5b10-dirty"

function release-tool {
docker pull "${RELEASE_TOOL_IMAGE}" >/dev/null
Expand All @@ -20,10 +20,6 @@ function changelog {

function release-notes {
release-tool "${2}" --gfm > "${1}"

echo -e '\n## Images\n\n```' >> ${1}
${ARTIFACTS}/talosctl-linux-amd64 image default >> ${1}
echo -e '```\n' >> ${1}
}

function cherry-pick {
Expand Down
4 changes: 3 additions & 1 deletion hack/release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ preface = """\
[notes]
[notes.updates]
title = "Component Updates"


description = """\
* Linux: 6.1.80
* Linux: 6.6.21
Talos is built with Go 1.21.8.
"""
Expand Down
3 changes: 3 additions & 0 deletions internal/app/machined/pkg/runtime/v1alpha1/board/board.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
rockpi4 "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/board/rockpi4"
rockpi4c "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/board/rockpi4c"
rpigeneric "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/board/rpi_generic"
turingrk1 "github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/board/turing_rk1"
"github.com/siderolabs/talos/pkg/machinery/constants"
)

Expand Down Expand Up @@ -70,6 +71,8 @@ func newBoard(board string) (b runtime.Board, err error) {
b = &jetsonnano.JetsonNano{}
case constants.BoardNanoPiR4S:
b = &nanopir4s.NanoPiR4S{}
case constants.BoardTuringRK1:
b = &turingrk1.TuringRK1{}
default:
return nil, fmt.Errorf("unsupported board: %q", board)
}
Expand Down
Loading

0 comments on commit 3945bda

Please sign in to comment.