From 86dd3fc6574deff1873fc26a4ed4c7c13d2afe70 Mon Sep 17 00:00:00 2001 From: Noel Georgi Date: Sun, 17 Mar 2024 18:17:38 +0530 Subject: [PATCH] feat: add allwinner SBC's Add AllWinner SBC's. Signed-off-by: Noel Georgi --- .conform.yaml | 48 ++++++ .dockerignore | 7 + .github/workflows/ci.yaml | 39 +++++ .github/workflows/slack-notify.yaml | 92 +++++++++++ .gitignore | 6 +- .kres.yaml | 2 +- Makefile | 156 ++++++++++++++++++ Pkgfile | 5 + README.md | 23 +-- .../arm-trusted-firmware/sun50i_a64/pkg.yaml | 36 ++++ artifacts/bananapi_m64/u-boot/pkg.yaml | 39 +++++ .../libretech_all_h3_cc_h5/u-boot/pkg.yaml | 39 +++++ artifacts/{ => pine64}/u-boot/pkg.yaml | 16 +- go.work | 6 +- hack/release.sh | 66 ++++++++ hack/release.toml | 11 ++ installers/bananapi_m64/pkg.yaml | 25 +++ installers/bananapi_m64/src/go.mod | 11 ++ installers/{board => bananapi_m64}/src/go.sum | 2 + installers/bananapi_m64/src/main.go | 87 ++++++++++ installers/board/src/main.go | 60 ------- installers/libretech_all_h3_cc_h5/pkg.yaml | 25 +++ installers/libretech_all_h3_cc_h5/src/go.mod | 11 ++ installers/libretech_all_h3_cc_h5/src/go.sum | 10 ++ installers/libretech_all_h3_cc_h5/src/main.go | 85 ++++++++++ installers/{board => pine64}/pkg.yaml | 6 +- installers/{board => pine64}/src/go.mod | 3 +- installers/pine64/src/go.sum | 10 ++ installers/pine64/src/main.go | 85 ++++++++++ installers/pkg.yaml | 26 ++- .../bananapi_m64.yaml} | 0 .../libretech_all_h3_cc_h5.yaml | 9 + profiles/pine64/pine64.yaml | 9 + profiles/pkg.yaml | 6 +- 34 files changed, 967 insertions(+), 94 deletions(-) create mode 100644 .conform.yaml create mode 100644 .dockerignore create mode 100644 .github/workflows/slack-notify.yaml create mode 100644 artifacts/arm-trusted-firmware/sun50i_a64/pkg.yaml create mode 100644 artifacts/bananapi_m64/u-boot/pkg.yaml create mode 100644 artifacts/libretech_all_h3_cc_h5/u-boot/pkg.yaml rename artifacts/{ => pine64}/u-boot/pkg.yaml (65%) create mode 100755 hack/release.sh create mode 100644 hack/release.toml create mode 100644 installers/bananapi_m64/pkg.yaml create mode 100644 installers/bananapi_m64/src/go.mod rename installers/{board => bananapi_m64}/src/go.sum (83%) create mode 100644 installers/bananapi_m64/src/main.go delete mode 100644 installers/board/src/main.go create mode 100644 installers/libretech_all_h3_cc_h5/pkg.yaml create mode 100644 installers/libretech_all_h3_cc_h5/src/go.mod create mode 100644 installers/libretech_all_h3_cc_h5/src/go.sum create mode 100644 installers/libretech_all_h3_cc_h5/src/main.go rename installers/{board => pine64}/pkg.yaml (75%) rename installers/{board => pine64}/src/go.mod (80%) create mode 100644 installers/pine64/src/go.sum create mode 100644 installers/pine64/src/main.go rename profiles/{board/board.yaml => bananapi_m64/bananapi_m64.yaml} (100%) create mode 100644 profiles/libretech_all_h3_cc_h5/libretech_all_h3_cc_h5.yaml create mode 100644 profiles/pine64/pine64.yaml diff --git a/.conform.yaml b/.conform.yaml new file mode 100644 index 0000000..269f48f --- /dev/null +++ b/.conform.yaml @@ -0,0 +1,48 @@ +# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. +# +# Generated on 2024-03-17T12:47:28Z by kres c2d361c. + +policies: + - type: commit + spec: + dco: true + gpg: + required: true + identity: + gitHubOrganization: siderolabs + spellcheck: + locale: US + maximumOfOneCommit: true + header: + length: 89 + imperative: true + case: lower + invalidLastCharacters: . + body: + required: true + conventional: + types: + - chore + - docs + - perf + - refactor + - style + - test + - release + scopes: + - .* + - type: license + spec: + root: . + skipPaths: + - .git/ + - testdata/ + includeSuffixes: + - .go + excludeSuffixes: + - .pb.go + - .pb.gw.go + header: | + // This Source Code Form is subject to the terms of the Mozilla Public + // License, v. 2.0. If a copy of the MPL was not distributed with this + // file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3f3f4ee --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. +# +# Generated on 2024-03-17T12:47:10Z by kres latest. + +* +!README.md +!pkg.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 23e242e..10e497c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,3 +1,7 @@ +# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. +# +# Generated on 2024-03-17T12:47:10Z by kres latest. + name: default concurrency: group: ${{ github.head_ref || github.run_id }} @@ -37,3 +41,38 @@ jobs: steps: - name: checkout uses: actions/checkout@v4 + - name: Unshallow + run: | + git fetch --prune --unshallow + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + append: | + - endpoint: tcp://buildkit-arm64.ci.svc.cluster.local:1234 + platforms: linux/arm64 + driver: remote + endpoint: tcp://127.0.0.1:1234 + - name: Build + run: | + make + - name: Login to registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + password: ${{ secrets.GITHUB_TOKEN }} + registry: ghcr.io + username: ${{ github.repository_owner }} + - name: Push to registry + if: github.event_name != 'pull_request' + run: | + make PUSH=true + - name: release-notes + if: startsWith(github.ref, 'refs/tags/') + run: | + make release-notes + - name: Release + if: startsWith(github.ref, 'refs/tags/') + uses: crazy-max/ghaction-github-release@v2 + with: + body_path: _out/RELEASE_NOTES.md + draft: "true" diff --git a/.github/workflows/slack-notify.yaml b/.github/workflows/slack-notify.yaml new file mode 100644 index 0000000..b8d5845 --- /dev/null +++ b/.github/workflows/slack-notify.yaml @@ -0,0 +1,92 @@ +# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. +# +# Generated on 2024-03-17T12:47:10Z by kres latest. + +name: slack-notify +"on": + workflow_run: + workflows: + - default + types: + - completed +jobs: + slack-notify: + runs-on: + - self-hosted + - generic + if: github.event.workflow_run.conclusion != 'skipped' + steps: + - name: Get PR number + id: get-pr-number + if: github.event.workflow_run.event == 'pull_request' + env: + GH_TOKEN: ${{ github.token }} + run: | + echo pull_request_number=$(gh pr view -R ${{ github.repository }} ${{ github.event.workflow_run.head_repository.owner.login }}:${{ github.event.workflow_run.head_branch }} --json number --jq .number) >> $GITHUB_OUTPUT + - name: Slack Notify + uses: slackapi/slack-github-action@v1 + with: + channel-id: proj-talos-maintainers + payload: | + { + "attachments": [ + { + "color": "${{ github.event.workflow_run.conclusion == 'success' && '#2EB886' || github.event.workflow_run.conclusion == 'failure' && '#A30002' || '#FFCC00' }}", + "fallback": "test", + "blocks": [ + { + "type": "section", + "fields": [ + { + "type": "mrkdwn", + "text": "${{ github.event.workflow_run.event == 'pull_request' && format('*Pull Request:* {0} (`{1}`)\n<{2}/pull/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, steps.get-pr-number.outputs.pull_request_number, github.event.workflow_run.display_title) || format('*Build:* {0} (`{1}`)\n<{2}/commit/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, github.sha, github.event.workflow_run.display_title) }}" + }, + { + "type": "mrkdwn", + "text": "*Status:*\n`${{ github.event.workflow_run.conclusion }}`" + } + ] + }, + { + "type": "section", + "fields": [ + { + "type": "mrkdwn", + "text": "*Author:*\n`${{ github.actor }}`" + }, + { + "type": "mrkdwn", + "text": "*Event:*\n`${{ github.event.workflow_run.event }}`" + } + ] + }, + { + "type": "divider" + }, + { + "type": "actions", + "elements": [ + { + "type": "button", + "text": { + "type": "plain_text", + "text": "Logs" + }, + "url": "${{ github.event.workflow_run.html_url }}" + }, + { + "type": "button", + "text": { + "type": "plain_text", + "text": "Commit" + }, + "url": "${{ github.event.repository.html_url }}/commit/${{ github.sha }}" + } + ] + } + ] + } + ] + } + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} diff --git a/.gitignore b/.gitignore index 2cf20a6..7429d06 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ -go.work.sum +# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. +# +# Generated on 2024-03-17T12:47:10Z by kres latest. + _out +go.work.sum diff --git a/.kres.yaml b/.kres.yaml index f602815..d163913 100644 --- a/.kres.yaml +++ b/.kres.yaml @@ -2,7 +2,7 @@ kind: pkgfile.Build spec: targets: - - sbc-board + - sbc-allwinner extraBuildArgs: - PKGS_PREFIX - PKGS diff --git a/Makefile b/Makefile index 38a3f9b..38d5e61 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,162 @@ +# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. +# +# Generated on 2024-03-17T12:47:10Z by kres latest. + +# common variables + +SHA := $(shell git describe --match=none --always --abbrev=8 --dirty) +TAG := $(shell git describe --tag --always --dirty --match v[0-9]\*) +ABBREV_TAG := $(shell git describe --tags >/dev/null 2>/dev/null && git describe --tag --always --match v[0-9]\* --abbrev=0 || echo 'undefined') +BRANCH := $(shell git rev-parse --abbrev-ref HEAD) +ARTIFACTS := _out +OPERATING_SYSTEM := $(shell uname -s | tr '[:upper:]' '[:lower:]') +GOARCH := $(shell uname -m | tr '[:upper:]' '[:lower:]') + +ifeq ($(GOARCH),x86_64) + GOARCH := amd64 +endif +REGISTRY ?= ghcr.io +USERNAME ?= siderolabs +REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME) KRES_IMAGE ?= ghcr.io/siderolabs/kres:latest +CONFORMANCE_IMAGE ?= ghcr.io/siderolabs/conform:latest + +# source date epoch of first commit + +INITIAL_COMMIT_SHA := $(shell git rev-list --max-parents=0 HEAD) +SOURCE_DATE_EPOCH := $(shell git log $(INITIAL_COMMIT_SHA) --pretty=%ct) + +# sync bldr image with pkgfile + +BLDR_RELEASE := v0.3.0 +BLDR_IMAGE := ghcr.io/siderolabs/bldr:$(BLDR_RELEASE) +BLDR := docker run --rm --user $(shell id -u):$(shell id -g) --volume $(PWD):/src --entrypoint=/bldr $(BLDR_IMAGE) --root=/src + +# docker build settings + +BUILD := docker buildx build +PLATFORM ?= linux/amd64,linux/arm64 +PROGRESS ?= auto +PUSH ?= false +CI_ARGS ?= +COMMON_ARGS = --file=Pkgfile +COMMON_ARGS += --provenance=false +COMMON_ARGS += --progress=$(PROGRESS) +COMMON_ARGS += --platform=$(PLATFORM) +COMMON_ARGS += --build-arg=SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) +COMMON_ARGS += --build-arg=PKGS_PREFIX="$(PKGS_PREFIX)" +COMMON_ARGS += --build-arg=PKGS="$(PKGS)" + +# extra variables + +PKGS_PREFIX ?= ghcr.io/siderolabs +PKGS ?= v1.7.0-alpha.0-33-g3aacf03 + +# targets defines all the available targets + +TARGETS = sbc-allwinner + +# help menu + +export define HELP_MENU_HEADER +# Getting Started + +To build this project, you must have the following installed: + +- git +- make +- docker (19.03 or higher) + +## Creating a Builder Instance + +The build process makes use of experimental Docker features (buildx). +To enable experimental features, add 'experimental: "true"' to '/etc/docker/daemon.json' on +Linux or enable experimental features in Docker GUI for Windows or Mac. + +To create a builder instance, run: + + docker buildx create --name local --use + +If running builds that needs to be cached aggresively create a builder instance with the following: + + docker buildx create --name local --use --config=config.toml + +config.toml contents: + +[worker.oci] + gc = true + gckeepstorage = 50000 + + [[worker.oci.gcpolicy]] + keepBytes = 10737418240 + keepDuration = 604800 + filters = [ "type==source.local", "type==exec.cachemount", "type==source.git.checkout"] + [[worker.oci.gcpolicy]] + all = true + keepBytes = 53687091200 + +If you already have a compatible builder instance, you may use that instead. + +## Artifacts + +All artifacts will be output to ./$(ARTIFACTS). Images will be tagged with the +registry "$(REGISTRY)", username "$(USERNAME)", and a dynamic tag (e.g. $(IMAGE):$(TAG)). +The registry and username can be overridden by exporting REGISTRY, and USERNAME +respectively. + +endef + +all: $(TARGETS) ## Builds all targets defined. + +.PHONY: clean +clean: ## Cleans up all artifacts. + @rm -rf $(ARTIFACTS) + +$(ARTIFACTS): ## Creates artifacts directory. + @mkdir -p $(ARTIFACTS) + +target-%: ## Builds the specified target defined in the Pkgfile. The build result will only remain in the build cache. + @$(BUILD) --target=$* $(COMMON_ARGS) $(TARGET_ARGS) $(CI_ARGS) . + +local-%: ## Builds the specified target defined in the Pkgfile using the local output type. The build result will be output to the specified local destination. + @$(MAKE) target-$* TARGET_ARGS="--output=type=local,dest=$(DEST) $(TARGET_ARGS)" + +docker-%: ## Builds the specified target defined in the Pkgfile using the docker output type. The build result will be loaded into Docker. + @$(MAKE) target-$* TARGET_ARGS="$(TARGET_ARGS)" + +reproducibility-test-local-%: ## Builds the specified target defined in the Pkgfile using the local output type with and without cahce. The build result will be output to the specified local destination + @rm -rf $(ARTIFACTS)/build-a $(ARTIFACTS)/build-b + @$(MAKE) local-$* DEST=$(ARTIFACTS)/build-a + @$(MAKE) local-$* DEST=$(ARTIFACTS)/build-b TARGET_ARGS="--no-cache" + @touch -ch -t $$(date -d @$(SOURCE_DATE_EPOCH) +%Y%m%d0000) $(ARTIFACTS)/build-a $(ARTIFACTS)/build-b + @diffoscope $(ARTIFACTS)/build-a $(ARTIFACTS)/build-b + @rm -rf $(ARTIFACTS)/build-a $(ARTIFACTS)/build-b + +.PHONY: $(TARGETS) +$(TARGETS): + @$(MAKE) docker-$@ TARGET_ARGS="--tag=$(REGISTRY_AND_USERNAME)/$@:$(TAG) --push=$(PUSH)" + +.PHONY: deps.png +deps.png: ## Generates a dependency graph of the Pkgfile. + @$(BLDR) graph | dot -Tpng -o deps.png .PHONY: rekres rekres: @docker pull $(KRES_IMAGE) @docker run --rm --net=host --user $(shell id -u):$(shell id -g) -v $(PWD):/src -w /src -e GITHUB_TOKEN $(KRES_IMAGE) + +.PHONY: help +help: ## This help menu. + @echo "$$HELP_MENU_HEADER" + @grep -E '^[a-zA-Z%_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +.PHONY: release-notes +release-notes: + mkdir -p $(ARTIFACTS) + @ARTIFACTS=$(ARTIFACTS) ./hack/release.sh $@ $(ARTIFACTS)/RELEASE_NOTES.md $(TAG) + +.PHONY: conformance +conformance: + @docker pull $(CONFORMANCE_IMAGE) + @docker run --rm -it -v $(PWD):/src -w /src $(CONFORMANCE_IMAGE) enforce + diff --git a/Pkgfile b/Pkgfile index 848c09c..64953ee 100644 --- a/Pkgfile +++ b/Pkgfile @@ -3,6 +3,11 @@ format: v1alpha2 vars: + # renovate: datasource=github-tags extractVersion=^v(?.*)$ depName=ARM-software/arm-trusted-firmware + arm_trusted_firmware_version: 2.8.0 + arm_trusted_firmware_sha256: 60fad60eeb6840097f8e64f16093c06ddb2ef269c7a22affed02beaa6cefe466 + arm_trusted_firmware_sha512: 958cf8f9e258638e59d0fbd8b053fce7d8a9ea2fc922686c9d20ea16f79f55219ac18a12ab240c528ee98e49c2e0eef4c963fdb255cc14b92437a5b3cffc8640 + # renovate: datasource=github-tags extractVersion=^v(?.*)$ depName=u-boot/u-boot uboot_version: 2023.01 uboot_sha256: 69423bad380f89a0916636e89e6dcbd2e4512d584308d922d1039d1e4331950f diff --git a/README.md b/README.md index c185e90..d60b411 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,11 @@ -# sbc-template +# sbc-allwinner -This is a template repository to generate a new project for the SBC. +This repo provides the overlay for Allwinner based Talos image. -The template already contains an example of building and copying over `u-boot`. -This can be used as a starting point for your own project. +## Supported Overlay -## Requirements - -Using a sbc project templates assume docker is installed on your machine. - -## Usage - -* Create a new repository using this template. -* Start by replacing `board` to `` -* Update `installers//src/main.go` with your own logic. -* Run `make rekres` -* Now run `make help` on instructions on setting up `buildx` builder if one is not already setup. +| Overlay Name | Board | Description | +| ---------------------- | ------------------ | ---------------------------------- | +| bananapi_m64 | BananaPi M64 | Overlay for BananaPi M64 | +| libretech_all_h3_cc_h5 | LibreTech H3 CC H5 | Overlay for LibreTech H3 CC H5 | +| pine64 | Pine64 A64 | Overlay for Pine64 A64 | diff --git a/artifacts/arm-trusted-firmware/sun50i_a64/pkg.yaml b/artifacts/arm-trusted-firmware/sun50i_a64/pkg.yaml new file mode 100644 index 0000000..b27c498 --- /dev/null +++ b/artifacts/arm-trusted-firmware/sun50i_a64/pkg.yaml @@ -0,0 +1,36 @@ +name: arm-trusted-firmware-sun50i_a64 +variant: scratch +shell: /toolchain/bin/bash +dependencies: + - stage: base +steps: + - sources: + - url: https://github.com/ARM-software/arm-trusted-firmware/archive/v{{ .arm_trusted_firmware_version }}.tar.gz + destination: arm-trusted-firmware.tar.gz + sha256: "{{ .arm_trusted_firmware_sha256 }}" + sha512: "{{ .arm_trusted_firmware_sha512 }}" + env: + SOURCE_DATE_EPOCH: {{ .BUILD_ARG_SOURCE_DATE_EPOCH }} + prepare: + - | + mkdir -p /usr/bin \ + && ln -sf /toolchain/bin/env /usr/bin/env + + tar xf arm-trusted-firmware.tar.gz --strip-components=1 + # sun50i_a64 + build: + - | + make realclean + + # https://salsa.debian.org/debian/arm-trusted-firmware/-/commit/6424a59e08585af7f8a56f1e16ecc6a6b9e4ad7a + # https://salsa.debian.org/debian/arm-trusted-firmware/-/commit/6ed8f61df3b07bb22a68a0fc189ec3b3f7b00dbd + # https://developer.trustedfirmware.org/T996 + TF_LDFLAGS=--no-warn-rwx-segments CFLAGS=--param=min-pagesize=0 make -j $(nproc) PLAT=sun50i_a64 DEBUG=0 bl31 + install: + - | + mkdir -p /rootfs/arm-trusted-firmware/sun50i_a64 + + cp build/sun50i_a64/release/bl31/bl31.bin /rootfs/arm-trusted-firmware/sun50i_a64/bl31.bin +finalize: + - from: /rootfs + to: /libs diff --git a/artifacts/bananapi_m64/u-boot/pkg.yaml b/artifacts/bananapi_m64/u-boot/pkg.yaml new file mode 100644 index 0000000..e3e776b --- /dev/null +++ b/artifacts/bananapi_m64/u-boot/pkg.yaml @@ -0,0 +1,39 @@ +# References: +# U-Boot: +# - https://u-boot.readthedocs.io/en/latest +name: u-boot-bananapi_m64 +variant: scratch +shell: /toolchain/bin/bash +dependencies: + - stage: base + - stage: arm-trusted-firmware-sun50i_a64 +steps: + - sources: + - url: https://ftp.denx.de/pub/u-boot/u-boot-{{ .uboot_version }}.tar.bz2 + destination: u-boot.tar.bz2 + sha256: "{{ .uboot_sha256 }}" + sha512: "{{ .uboot_sha512 }}" + env: + SOURCE_DATE_EPOCH: {{ .BUILD_ARG_SOURCE_DATE_EPOCH }} + prepare: + # bananapi_m64 + - | + mkdir -p /usr/bin \ + && ln -sf /toolchain/bin/env /usr/bin/env + + tar xf u-boot.tar.bz2 --strip-components=1 + - | + make bananapi_m64_defconfig + sed -i "s/CONFIG_TOOLS_LIBCRYPTO=y/# CONFIG_TOOLS_LIBCRYPTO is not set/" .config + build: + - | + export SCP=/dev/null + + make -j $(nproc) HOSTLDLIBS_mkimage="-lssl -lcrypto" BL31=/libs/arm-trusted-firmware/sun50i_a64/bl31.bin + install: + - | + mkdir -p /rootfs/artifacts/arm64/u-boot/bananapi_m64 + cp u-boot-sunxi-with-spl.bin /rootfs/artifacts/arm64/u-boot/bananapi_m64 +finalize: + - from: /rootfs + to: /rootfs diff --git a/artifacts/libretech_all_h3_cc_h5/u-boot/pkg.yaml b/artifacts/libretech_all_h3_cc_h5/u-boot/pkg.yaml new file mode 100644 index 0000000..a569768 --- /dev/null +++ b/artifacts/libretech_all_h3_cc_h5/u-boot/pkg.yaml @@ -0,0 +1,39 @@ +# References: +# U-Boot: +# - https://u-boot.readthedocs.io/en/latest +name: u-boot-libretech_all_h3_cc_h5 +variant: scratch +shell: /toolchain/bin/bash +dependencies: + - stage: base + - stage: arm-trusted-firmware-sun50i_a64 +steps: + - sources: + - url: https://ftp.denx.de/pub/u-boot/u-boot-{{ .uboot_version }}.tar.bz2 + destination: u-boot.tar.bz2 + sha256: "{{ .uboot_sha256 }}" + sha512: "{{ .uboot_sha512 }}" + env: + SOURCE_DATE_EPOCH: {{ .BUILD_ARG_SOURCE_DATE_EPOCH }} + prepare: + # libretech_all_h3_cc_h5 + - | + mkdir -p /usr/bin \ + && ln -sf /toolchain/bin/env /usr/bin/env + + tar xf u-boot.tar.bz2 --strip-components=1 + - | + make libretech_all_h3_cc_h5_defconfig + sed -i "s/CONFIG_TOOLS_LIBCRYPTO=y/# CONFIG_TOOLS_LIBCRYPTO is not set/" .config + build: + - | + export SCP=/dev/null + + make -j $(nproc) HOSTLDLIBS_mkimage="-lssl -lcrypto" BL31=/libs/arm-trusted-firmware/sun50i_a64/bl31.bin + install: + - | + mkdir -p /rootfs/artifacts/arm64/u-boot/libretech_all_h3_cc_h5 + cp u-boot-sunxi-with-spl.bin /rootfs/artifacts/arm64/u-boot/libretech_all_h3_cc_h5 +finalize: + - from: /rootfs + to: /rootfs diff --git a/artifacts/u-boot/pkg.yaml b/artifacts/pine64/u-boot/pkg.yaml similarity index 65% rename from artifacts/u-boot/pkg.yaml rename to artifacts/pine64/u-boot/pkg.yaml index 868bd7b..d7b145f 100644 --- a/artifacts/u-boot/pkg.yaml +++ b/artifacts/pine64/u-boot/pkg.yaml @@ -1,13 +1,12 @@ # References: # U-Boot: # - https://u-boot.readthedocs.io/en/latest -# Broadcom/RaspberryPi -# - https://github.com/u-boot/u-boot/blob/master/doc/board/broadcom/raspberrypi.rst -name: u-boot +name: u-boot-pine64 variant: scratch shell: /toolchain/bin/bash dependencies: - stage: base + - stage: arm-trusted-firmware-sun50i_a64 steps: - sources: - url: https://ftp.denx.de/pub/u-boot/u-boot-{{ .uboot_version }}.tar.bz2 @@ -17,21 +16,24 @@ steps: env: SOURCE_DATE_EPOCH: {{ .BUILD_ARG_SOURCE_DATE_EPOCH }} prepare: + # pine64_plus_defconfig - | mkdir -p /usr/bin \ && ln -sf /toolchain/bin/env /usr/bin/env tar xf u-boot.tar.bz2 --strip-components=1 - | - make _defconfig + make pine64_plus_defconfig sed -i "s/CONFIG_TOOLS_LIBCRYPTO=y/# CONFIG_TOOLS_LIBCRYPTO is not set/" .config build: - | - make -j $(nproc) HOSTLDLIBS_mkimage="-lssl -lcrypto" + export SCP=/dev/null + + make -j $(nproc) HOSTLDLIBS_mkimage="-lssl -lcrypto" BL31=/libs/arm-trusted-firmware/sun50i_a64/bl31.bin install: - | - mkdir -p /rootfs/artifacts/arm64/u-boot/board - cp -v u-boot.bin /rootfs/artifacts/arm64/u-boot/board + mkdir -p /rootfs/artifacts/arm64/u-boot/pine64 + cp u-boot-sunxi-with-spl.bin /rootfs/artifacts/arm64/u-boot/pine64 finalize: - from: /rootfs to: /rootfs diff --git a/go.work b/go.work index c35cdff..80ff65b 100644 --- a/go.work +++ b/go.work @@ -1,3 +1,7 @@ go 1.22.1 -use ./installers/board/src +use ( + ./installers/bananapi_m64/src + ./installers/libretech_all_h3_cc_h5/src + ./installers/pine64/src +) diff --git a/hack/release.sh b/hack/release.sh new file mode 100755 index 0000000..d3cd7df --- /dev/null +++ b/hack/release.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. +# +# Generated on 2024-03-17T12:47:10Z by kres latest. + +set -e + +RELEASE_TOOL_IMAGE="ghcr.io/siderolabs/release-tool:latest" + +function release-tool { + docker pull "${RELEASE_TOOL_IMAGE}" >/dev/null + docker run --rm -w /src -v "${PWD}":/src:ro "${RELEASE_TOOL_IMAGE}" -l -d -n -t "${1}" ./hack/release.toml +} + +function changelog { + if [ "$#" -eq 1 ]; then + (release-tool ${1}; echo; cat CHANGELOG.md) > CHANGELOG.md- && mv CHANGELOG.md- CHANGELOG.md + else + echo 1>&2 "Usage: $0 changelog [tag]" + exit 1 + fi +} + +function release-notes { + release-tool "${2}" > "${1}" +} + +function cherry-pick { + if [ $# -ne 2 ]; then + echo 1>&2 "Usage: $0 cherry-pick " + exit 1 + fi + + git checkout $2 + git fetch + git rebase upstream/$2 + git cherry-pick -x $1 +} + +function commit { + if [ $# -ne 1 ]; then + echo 1>&2 "Usage: $0 commit " + exit 1 + fi + + git commit -s -m "release($1): prepare release" -m "This is the official $1 release." +} + +if declare -f "$1" > /dev/null +then + cmd="$1" + shift + $cmd "$@" +else + cat <