diff --git a/Makefile b/Makefile index 271ca7d..9d9c2b5 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,6 @@ AUTHORS ?= Louis S. PUSH ?= false ARTIFACTS_FOLDER ?= ./out -SATA ?= no - HACK ?= ./hack TAG ?= $(shell git describe --tag --always --dirty) @@ -39,17 +37,10 @@ INSTALLER_OUTPUT_TAG ?= $(TAG) INSTALLER_OUTPUT_IMAGE ?= $(REGISTRY_AND_USERNAME)/$(INSTALLER_OUTPUT_NAME):$(INSTALLER_OUTPUT_TAG) IMAGE_INSTALLER_NAME ?= $(NAME) -ifeq ($(SATA),yes) - IMAGE_INSTALLER_NAME := $(IMAGE_INSTALLER_NAME)-sata -endif IMAGE_INSTALLER_TAG ?= $(TAG) IMAGE_INSTALLER_IMAGE ?= $(REGISTRY_AND_USERNAME)/$(IMAGE_INSTALLER_NAME):$(IMAGE_INSTALLER_TAG) - IMAGE_FILENAME ?= $(NAME) -ifeq ($(SATA),yes) - IMAGE_FILENAME := $(IMAGE_FILENAME)-sata -endif IMAGE_OUTPUT_KIND ?= IMAGE_KIND ?= metal @@ -60,7 +51,6 @@ IMAGER_ARGS += --overlay-name=orangepi-5 IMAGER_ARGS += --overlay-image=$(INSTALLER_OUTPUT_IMAGE) IMAGER_ARGS += --output-kind=$(IMAGE_OUTPUT_KIND) IMAGER_ARGS += $(forach IMAGE_EXTENSION,$(IMAGE_EXTENSIONS),--system-extension-image=$(IMAGE_EXTENSION)) -IMAGER_ARGS += --overlay-option="sata=$(SATA)" INITIAL_COMMIT_SHA := $(shell git rev-list --max-parents=0 HEAD) SOURCE_DATE_EPOCH ?= $(shell git log $(INITIAL_COMMIT_SHA) --pretty=%ct) @@ -191,18 +181,13 @@ image: $(ARTIFACTS_FOLDER) $(IMAGER_ARGS) .PHONY: images-metal -images-metal: image-metal image-metal-sata +images-metal: image-metal .PHONY: image-metal image-metal: @$(MAKE) image && \ mv "$(ARTIFACTS_FOLDER)/metal-arm64.raw.zst" "$(ARTIFACTS_FOLDER)/$(strip $(IMAGE_FILENAME)).raw.zst" -.PHONY: image-metal-sata -image-metal-sata: - @$(MAKE) image-metal \ - SATA=yes - .PHONY: image-pxe image-pxe: image-kernel image-initramfs @@ -219,7 +204,7 @@ image-initramfs: IMAGE_OUTPUT_KIND="initramfs" .PHONY: images-installer -images-installer: image-installer image-installer-sata +images-installer: image-installer .PHONY: image-installer image-installer: @@ -230,11 +215,6 @@ image-installer: crane push $(ARTIFACTS_FOLDER)/installer-arm64.tar $(IMAGE_INSTALLER_IMAGE); \ fi -.PHONY: image-installer-sata -image-installer-sata: - $(MAKE) image-installer \ - SATA=yes - ###### Clean ###### .PHONY: clean diff --git a/README.md b/README.md index a673fc0..23a90e1 100644 --- a/README.md +++ b/README.md @@ -37,29 +37,25 @@ The device tree are included in the image at the paths required by U-Boot and ED #### Install on a drive -The Talos image can be flashed on an SD card, a NVMe drive, or a SATA drive. +The Talos image can be flashed on an SD card or a NVMe drive. You can download the latest image from the [releases page](https://github.com/si0ls/talos-orangepi5/releases). -You can choose between the following images: -- `talos-orangepi5.raw.zst`: the base image for **Orange Pi 5 (Plus)**, flashable on a **SD card, eMMC, M.2 NVMe drive, USB drive, or USB-connected SATA drive** -- `talos-orangepi5-sata.raw.zst`: the base image for **Orange Pi 5 (Plus)** with SATA overlay applied, flashable on a **M.2 SATA drive** - The image can be flashed using [Etcher](https://www.balena.io/etcher/) on Windows, macOS, or Linux or using `dd` on Linux: ```bash -# Extract the image for the variant you want to flash -zstd -d talos-orangepi5[-sata].raw.zst +# Extract the image +zstd -d talos-orangepi5.raw.zst # Flash the image -# Replace /dev/sdX with the device of the SD card, NVMe drive, or SATA drive +# Replace /dev/sdX with the destination device # You can find the device with `lsblk` or `fdisk -l` -dd if=talos-orangepi5[-sata].raw of=/dev/sdX bs=4M status=progress +dd if=talos-orangepi5.raw of=/dev/sdX bs=4M status=progress ``` #### PXE Boot -**This repository does not provide a PXE server**, it is up to you to set up the PXE server. +**This repository does not provide a PXE server**, it is up to you to set up the PXE environment. The [release page](https://github.com/si0ls/talos-orangepi5/releases) provides the following files needed for PXE boot: @@ -69,13 +65,13 @@ The [release page](https://github.com/si0ls/talos-orangepi5/releases) provides t ## Machine configuration -Use the `ghcr.io/si0ls/talos-orangepi5` images instead of the upstream Talos Linux images. It also available with the SATA overlay with the `ghcr.io/si0ls/talos-orangepi5-sata` image. +Use the `ghcr.io/si0ls/talos-orangepi5` image instead of the upstream Talos Linux one. ```yaml machine: install: disk: /dev/sda # replace with the device you want to install Talos on - image: ghcr.io/si0ls/talos-orangepi5[-sata]:v1.1 + image: ghcr.io/si0ls/talos-orangepi5:v1.1 wipe: false ``` @@ -83,7 +79,7 @@ To upgrade you machine to the latest version with `talosctl`, you can use the fo ```bash talosctl upgrade --nodes \ - --image ghcr.io/si0ls/talos-orangepi5[-sata]: + --image ghcr.io/si0ls/talos-orangepi5: ``` ## Build @@ -102,12 +98,13 @@ _The detail of all the build steps and parameters can be found in the [Makefile] ## License -This project is not affiliated with Xunlong, Orange Pi, Armbian, or Sidero Labs. +This project is not affiliated with Xunlong, Orange Pi, Armbian, Collabora or Sidero Labs. The code in this repository is licensed under the Mozilla Public License Version 2.0 to respect the Talos project license. ## Special thanks - [Sidero Labs](https://www.siderolabs.com/) for the Talos project +- [Armbian](https://www.armbian.com/) for the initial work on the Orange Pi 5 - [Collabora](https://www.collabora.com/) for the kernel -- [@nberlee](https://github.com/nberlee) and [@pl4nty](https://github.com/pl4nty) for the initial work on other rk3588 devices and their help ❤️ +- [@nberlee](https://github.com/nberlee) and [@pl4nty](https://github.com/pl4nty) for the initial work on other rk3588 devices for Talos and their help ❤️ diff --git a/installer/main.go b/installer/main.go index 63f3039..a3d2503 100644 --- a/installer/main.go +++ b/installer/main.go @@ -47,9 +47,7 @@ func main() { type OrangePi5Installer struct{} -type orangePi5ExtraOptions struct { - Sata bool `json:"sata"` -} +type orangePi5ExtraOptions struct{} func (i *OrangePi5Installer) GetOptions(extra orangePi5ExtraOptions) (overlay.Options, error) { return overlay.Options{ @@ -59,14 +57,9 @@ func (i *OrangePi5Installer) GetOptions(extra orangePi5ExtraOptions) (overlay.Op } func (i *OrangePi5Installer) Install(options overlay.InstallOptions[orangePi5ExtraOptions]) error { - sataSuffix := "" - if options.ExtraOptions.Sata { - sataSuffix = "-sata" - } - for board := range boardDTBNames { if err := copyFiles( - filepath.Join(options.ArtifactsPath, "/dtb/", boardDTBNames[board]+sataSuffix+".dtb"), + filepath.Join(options.ArtifactsPath, "/dtb/", boardDTBNames[board]+".dtb"), filepath.Join(options.MountPrefix, uBootDTBDest, boardDTBNames[board]+".dtb"), filepath.Join(options.MountPrefix, edk2DTBDest, boardDTBNames[board]+".dtb")); err != nil { return err diff --git a/kernel/Dockerfile b/kernel/Dockerfile index 1622e13..74ef88a 100644 --- a/kernel/Dockerfile +++ b/kernel/Dockerfile @@ -12,18 +12,11 @@ RUN apk --no-cache add \ ARG KERNEL_VERSION=6.10 ARG KERNEL_SOURCE=https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.10.tar.gz -ARG KERNEL_PATCHES_DIR=./patches RUN mkdir -p /kernel/src && \ mkdir -p /kernel/patches && \ curl -L $KERNEL_SOURCE | tar -xz -C /kernel/src --strip-components=1 -COPY $KERNEL_PATCHES_DIR/* /kernel/patches/ - -RUN for patch in /kernel/patches/*.patch; do \ - patch -d /kernel/src -p1 < $patch; \ - done - FROM ubuntu:22.04 AS builder ARG SOURCE_DATE_EPOCH @@ -80,14 +73,6 @@ RUN --mount=type=cache,target=/kernel/build \ make -j$(nproc) modules && \ make -j$(nproc) dtbs - RUN --mount=type=cache,target=/kernel/build \ - fdtoverlay -o /kernel/build/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5-sata.dtb \ - -i /kernel/build/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtb \ - /kernel/build/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3588-sata.dtbo && \ - fdtoverlay -o /kernel/build/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus-sata.dtb \ - -i /kernel/build/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dtb \ - /kernel/build/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3588-sata.dtbo - RUN --mount=type=cache,target=/kernel/build \ mkdir -p /kernel/out/boot && \ mkdir -p /kernel/out/dtb/rockchip/overlay && \ @@ -95,10 +80,7 @@ RUN --mount=type=cache,target=/kernel/build \ cp -r /kernel/build/certs/signing_key.x509 /kernel/out/certs/signing_key.x509 && \ cp -r /kernel/build/arch/arm64/boot/Image /kernel/out/boot/vmlinuz && \ cp -r /kernel/build/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtb /kernel/out/dtb/rockchip/ && \ - cp -r /kernel/build/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5-sata.dtb /kernel/out/dtb/rockchip/ && \ cp -r /kernel/build/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dtb /kernel/out/dtb/rockchip/ && \ - cp -r /kernel/build/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus-sata.dtb /kernel/out/dtb/rockchip/ && \ - cp -r /kernel/build/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3588-sata.dtbo /kernel/out/dtb/rockchip/overlay && \ export KERNEL_RELEASE=$(cat /kernel/build/include/config/kernel.release) && \ make -j$(nproc) modules_install INSTALL_MOD_PATH=/kernel/out INSTALL_MOD_STRIP=1 && \ depmod -b /kernel/out $KERNEL_RELEASE && \ diff --git a/kernel/patches/0000-add-rockchip-overlay-subdir.patch b/kernel/patches/0000-add-rockchip-overlay-subdir.patch deleted file mode 100644 index f314077..0000000 --- a/kernel/patches/0000-add-rockchip-overlay-subdir.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile -index f42fa62b4..871e070d0 100644 ---- a/arch/arm64/boot/dts/rockchip/Makefile -+++ b/arch/arm64/boot/dts/rockchip/Makefile -@@ -134,3 +134,6 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-nanopi-r6s.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-nanopi-r6c.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-rock-5a.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-orangepi-5.dtb -+ -+subdir-y := $(dts-dirs) overlay -+ diff --git a/kernel/patches/0001-general-add-overlay-support.patch b/kernel/patches/0001-general-add-overlay-support.patch deleted file mode 100644 index e7d5768..0000000 --- a/kernel/patches/0001-general-add-overlay-support.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Paolo Sabatino -Date: Sun, 2 Jun 2024 21:53:01 +0200 -Subject: compile .scr and install overlays in right path - ---- - scripts/Makefile.dtbinst | 13 +++++++++- - scripts/Makefile.lib | 8 +++++- - 2 files changed, 19 insertions(+), 2 deletions(-) - -diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst -index 111111111111..222222222222 100644 ---- a/scripts/Makefile.dtbinst -+++ b/scripts/Makefile.dtbinst -@@ -33,7 +33,18 @@ endef - - $(foreach d, $(sort $(dir $(dtbs))), $(eval $(call gen_install_rules,$(d)))) - --dtbs := $(notdir $(dtbs)) -+# Very convoluted way to flatten all the device tree -+# directories, but keep the "/overlay/" directory -+ -+# topmost directory (ie: from rockchip/overlay/rk322x-emmc.dtbo extracts rockchip) -+topmost_dir = $(firstword $(subst /, ,$(dtbs))) -+# collect dtbs entries which starts with "$topmost_dir/overlay/", then remove "$topmost_dir" -+dtbs_overlays = $(subst $(topmost_dir)/,,$(filter $(topmost_dir)/overlay/%, $(dtbs))) -+# collect the non-overlay dtbs -+dtbs_regular = $(filter-out $(topmost_dir)/overlay/%, $(dtbs)) -+# compose the dtbs variable flattening all the non-overlays entries -+# and appending the overlays entries -+dtbs := $(notdir $(dtbs_regular)) $(dtbs_overlays) - - endif # CONFIG_ARCH_WANT_FLAT_DTB_INSTALL - -diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib -index 111111111111..222222222222 100644 ---- a/scripts/Makefile.lib -+++ b/scripts/Makefile.lib -@@ -402,7 +402,7 @@ $(obj)/%.dtbo.S: $(obj)/%.dtbo FORCE - - quiet_cmd_dtc = DTC $@ - cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ -- $(DTC) -o $@ -b 0 \ -+ $(DTC) -@ -o $@ -b 0 \ - $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \ - -d $(depfile).dtc.tmp $(dtc-tmp) ; \ - cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) -@@ -427,12 +427,18 @@ quiet_cmd_dtb = $(quiet_cmd_dtc) - cmd_dtb = $(cmd_dtc) - endif - -+quiet_cmd_scr = MKIMAGE $@ -+cmd_scr = mkimage -C none -A $(ARCH) -T script -d $< $@ -+ - $(obj)/%.dtb: $(obj)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE - $(call if_changed_dep,dtb) - - $(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE - $(call if_changed_dep,dtc) - -+$(obj)/%.scr: $(src)/%.scr-cmd FORCE -+ $(call if_changed,scr) -+ - dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) - - # Bzip2 --- -Armbian - diff --git a/kernel/patches/9999-add-rk3588-sata-overlay.patch b/kernel/patches/9999-add-rk3588-sata-overlay.patch deleted file mode 100644 index 3178d49..0000000 --- a/kernel/patches/9999-add-rk3588-sata-overlay.patch +++ /dev/null @@ -1,55 +0,0 @@ -diff --git a/arch/arm64/boot/dts/rockchip/overlay/Makefile b/arch/arm64/boot/dts/rockchip/overlay/Makefile -new file mode 100644 -index 000000000..5bc873521 ---- /dev/null -+++ b/arch/arm64/boot/dts/rockchip/overlay/Makefile -@@ -0,0 +1,7 @@ -+# SPDX-License-Identifier: GPL-2.0 -+dtbo-$(CONFIG_ARCH_ROCKCHIP) += \ -+ rockchip-rk3588-sata.dtbo -+ -+dtb-y += $(dtbo-y) -+ -+clean-files := *.dtbo -diff --git a/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3588-sata.dtso b/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3588-sata.dtso -new file mode 100644 -index 000000000..2759ab9cf ---- /dev/null -+++ b/arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3588-sata.dtso -@@ -0,0 +1,36 @@ -+/dts-v1/; -+/plugin/; -+ -+/ { -+ fragment@0 { -+ target = <&pcie2x1l1>; -+ -+ __overlay__ { -+ status = "disabled"; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&pcie2x1l2>; -+ -+ __overlay__ { -+ status = "disabled"; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&sata0>; -+ -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@3 { -+ target = <&sata2>; -+ -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+};