From 0560f702742c999eb56e4248175601e3bcfdc04d Mon Sep 17 00:00:00 2001 From: CodeChenL <2540735020@qq.com> Date: Wed, 27 Dec 2023 14:26:49 +0800 Subject: [PATCH] Add debian packaging files --- .github/dependabot.yml | 7 +++ .github/workflows/build.yml | 79 ------------------------- .github/workflows/new_version.yml | 34 +++++++++++ .github/workflows/release.yml | 98 +++++++++++++++++++++++++++++++ Makefile | 12 ++++ SOURCE | 2 + debian/.gitignore | 7 +++ debian/changelog | 5 ++ debian/compat | 1 + debian/control | 17 ++++++ debian/copyright | 26 ++++++++ debian/dkms | 7 +++ debian/docs | 1 + debian/lintian-overrides | 2 + debian/rules | 24 ++++++++ debian/source/format | 1 + debian/source/lintian-overrides | 4 ++ radxa-overlays-dkms.ko | 0 18 files changed, 248 insertions(+), 79 deletions(-) create mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/new_version.yml create mode 100644 .github/workflows/release.yml create mode 100644 SOURCE create mode 100644 debian/.gitignore create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/dkms create mode 100644 debian/docs create mode 100644 debian/lintian-overrides create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/source/lintian-overrides create mode 100644 radxa-overlays-dkms.ko diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..583decfd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 250e8293..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: build -on: - workflow_dispatch: - push: - paths: - - '**.dts' - - '**Makefile' - pull_request: - paths: - - '**.dts' - - '**Makefile' - merge_group: - -defaults: - run: - shell: bash - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - version: [linux-rockchip, linux-rk356x, linux-stable] - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Check if there is missing files - shell: bash - run: | - MISSING=0 - for VENDOR in amlogic rockchip - do - OVERLAY_PATH="arch/arm64/boot/dts/$VENDOR/overlays" - for i in "$OVERLAY_PATH"/*.dts - do - OVERLAY_NAME="$(basename "$i")" - OVERLAY_NAME="${OVERLAY_NAME/.dts}.dtbo" - if ! grep "$OVERLAY_NAME" "${OVERLAY_PATH}/Makefile" >/dev/null 2>/dev/null - then - echo "$OVERLAY_NAME is not included in $VENDOR Makefile!" - MISSING=1 - fi - done - done - exit $MISSING - - name: Install dependencies - run: | - sudo apt update - sudo apt install -y --no-install-recommends device-tree-compiler - sudo dpkg --add-architecture arm64 - case "${{ matrix.version }}" in - linux-rockchip) - wget https://github.com/radxa-pkg/linux-rockchip/releases/download/5.10.110-11/linux-headers-5.10.110-11-rockchip_5.10.110-11-8c4e8d205_arm64.deb - sudo apt install ./linux-headers-5.10.110-11-rockchip_5.10.110-11-8c4e8d205_arm64.deb - ;; - linux-rk356x) - wget https://github.com/radxa-pkg/linux-rk356x/releases/download/5.10.160-7/linux-headers-5.10.160-7-rk356x_5.10.160-7-fc20e0bcd_arm64.deb - sudo apt install ./linux-headers-5.10.160-7-rk356x_5.10.160-7-fc20e0bcd_arm64.deb - ;; - esac - - name: Build - run: | - case "${{ matrix.version }}" in - linux-stable) - make -j$(nproc) - ;; - linux-rockchip) - make -j$(nproc) KERNEL_HEADER_VERSION=5.10.110-11-rockchip CONFIG_ARCH_MESON=n CONFIG_CPU_RK3399=rockchip CONFIG_CPU_RK3568=rockchip CONFIG_CPU_RK3588=rockchip - ;; - linux-rk356x) - make -j$(nproc) KERNEL_HEADER_VERSION=5.10.160-7-rk356x CONFIG_ARCH_MESON=n CONFIG_CPU_RK3399=rockchip CONFIG_CPU_RK3568=rockchip CONFIG_CPU_RK3588=rockchip - ;; - esac - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: ${{ matrix.version }} - path: | - arch/**/*.dtbo \ No newline at end of file diff --git a/.github/workflows/new_version.yml b/.github/workflows/new_version.yml new file mode 100644 index 00000000..5860d0a7 --- /dev/null +++ b/.github/workflows/new_version.yml @@ -0,0 +1,34 @@ +name: Create release +on: + workflow_dispatch: + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + token: ${{secrets.GIT_PUSH_TOKEN}} + - name: Create release commit + run: | + sudo apt-get update + sudo apt-get install --no-install-recommends -y git-buildpackage + export DEBEMAIL="dev@radxa.com" + export DEBFULLNAME='"Radxa Computer Co., Ltd"' + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + make dch + - name: Test + run: | + sudo apt-get update + sudo apt-get build-dep --no-install-recommends -y . + make deb + - name: Push + run: | + git push diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..80dae5cb --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,98 @@ +name: Build & Release +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + - name: Test + run: | + make deb + - name: Build + run: | + sudo apt-get update + sudo apt-get build-dep --no-install-recommends -y . + make deb + - name: Workaround actions/upload-artifact#176 + run: | + echo "artifacts_path=$(realpath ..)" >> $GITHUB_ENV + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ github.event.repository.name }} + path: | + ${{ env.artifacts_path }}/*.deb + release: + runs-on: ubuntu-latest + needs: build + if: ${{ github.event_name == 'workflow_dispatch' && github.ref_name == 'main' }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + - uses: actions/download-artifact@v3 + with: + name: ${{ github.event.repository.name }} + - name: Check if the latest version is releasable + run: | + version="$(dpkg-parsechangelog -S Version)" + echo "version=$version" >> $GITHUB_ENV + echo "changes<> $GITHUB_ENV + echo '```' >> $GITHUB_ENV + echo "$(dpkg-parsechangelog -S Changes)" >> $GITHUB_ENV + echo '```' >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + if [[ -n "$(git tag -l "$version")" ]] + then + echo "distro=UNRELEASED" >> $GITHUB_ENV + else + echo "distro=$(dpkg-parsechangelog -S Distribution)" >> $GITHUB_ENV + fi + echo "$version" > VERSION + if [[ -f pkg.conf.template ]] + then + sed "s/VERSION/$(dpkg-parsechangelog -S Version)/g" pkg.conf.template > pkg.conf + fi + - name: Release + if: env.distro != 'UNRELEASED' + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ env.version }} + body_path: README.md + token: ${{ secrets.GITHUB_TOKEN }} + target_commitish: master + draft: false + fail_on_unmatched_files: true + files: | + *.deb + VERSION + - name: Append changelog + if: env.distro != 'UNRELEASED' + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ env.version }} + body: | + ## Changelog for ${{ env.version }} + ${{ env.changes }} + append_body: true + - name: Update Test repos + if: env.distro != 'UNRELEASED' + uses: radxa-repo/update-repo-action@main + with: + test-repo: true + token: ${{ secrets.RADXA_APT_TEST_REPO_TOKEN }} diff --git a/Makefile b/Makefile index 8efc4b8d..a10ef0eb 100644 --- a/Makefile +++ b/Makefile @@ -34,3 +34,15 @@ distclean: clean .PHONY: clean clean: rm -rf $(DTBO) $(TMP) + +# +# Release +# +.PHONY: dch +dch: debian/changelog + gbp dch --debian-branch=main + + +.PHONY: deb +deb: debian + debuild --no-lintian --lintian-hook "lintian --fail-on error,warning --suppress-tags bad-distribution-in-changes-file -- %p_%v_*.changes" --no-sign -b diff --git a/SOURCE b/SOURCE new file mode 100644 index 00000000..ee5a6ad5 --- /dev/null +++ b/SOURCE @@ -0,0 +1,2 @@ +git clone https://github.com/radxa/overlays.git +git checkout 491532d1cb65b7fa4c398e53a679e0784ffb347b diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 00000000..b6841b61 --- /dev/null +++ b/debian/.gitignore @@ -0,0 +1,7 @@ +/.debhelper +/debhelper-build-stamp +/files +/radxa-overlays-dkms +/*.debhelper.log +/*.debhelper +/*.substvars diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..ac686dd5 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +radxa-overlays-dkms (1.0.0-1) UNRELEASED; urgency=medium + + * Initial release + + -- "Radxa Computer Co., Ltd" Wed, 27 Dec 2023 14:08:37 +0800 diff --git a/debian/compat b/debian/compat new file mode 100644 index 00000000..f599e28b --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +10 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..18c8c8eb --- /dev/null +++ b/debian/control @@ -0,0 +1,17 @@ +Source: radxa-overlays-dkms +Maintainer: "Radxa Computer Co., Ltd" +Section: misc +Priority: optional +Standards-Version: 4.6.0 +Build-Depends: debhelper (>=12~), + devscripts, + dh-sequence-dkms, + lintian, + +Package: radxa-overlays-dkms +Architecture: all +Section: misc +Priority: optional +Depends: ${misc:Depends}, +Description: dkms sources for radxa/overlay + This package provides the dkms source code for radxa/overlay. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..d0f1454a --- /dev/null +++ b/debian/copyright @@ -0,0 +1,26 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: overlay +Source: https://github.com/radxa-pkg/overlay + +Files: * +Copyright: © 2022 Radxa Computer Co., Ltd +License: GPL-3+ + +License: GPL-3+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + . + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301, USA. + . + On Debian systems, the complete text of the GNU General Public License + can be found in /usr/share/common-licenses/GPL-3. diff --git a/debian/dkms b/debian/dkms new file mode 100644 index 00000000..a23b67fa --- /dev/null +++ b/debian/dkms @@ -0,0 +1,7 @@ +PACKAGE_NAME="radxa-overlays-dkms" +PACKAGE_VERSION="#MODULE_VERSION#" +DEST_MODULE_LOCATION[0]="/kernel" +MAKE="make all" +CLEAN="make clean" +AUTOINSTALL="yes" +FORCE=true \ No newline at end of file diff --git a/debian/docs b/debian/docs new file mode 100644 index 00000000..11b531f9 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +SOURCE diff --git a/debian/lintian-overrides b/debian/lintian-overrides new file mode 100644 index 00000000..b27114f8 --- /dev/null +++ b/debian/lintian-overrides @@ -0,0 +1,2 @@ +# We do not track this on GitHub +radxa-overlays-dkms: initial-upload-closes-no-bugs diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..0a390847 --- /dev/null +++ b/debian/rules @@ -0,0 +1,24 @@ +#!/usr/bin/make -f + +include /usr/share/dpkg/pkg-info.mk +include /usr/share/dpkg/architecture.mk + +%: + dh $@ + +override_dh_install: + dh_install -p radxa-overlays-dkms arch usr/src/radxa-overlays-dkms-$(DEB_VERSION) + dh_install -p radxa-overlays-dkms radxa-overlays-dkms.ko usr/src/radxa-overlays-dkms-$(DEB_VERSION) + dh_install -p radxa-overlays-dkms Makefile usr/src/radxa-overlays-dkms-$(DEB_VERSION) + +override_dh_dkms: + dh_dkms -V $(DEB_VERSION) + +override_dh_builddeb: + dh_builddeb -- -Zxz + +override_dh_lintian: + dh_lintian +override_dh_auto_build: + echo "disable dh_auto_build" + diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides new file mode 100644 index 00000000..7d998616 --- /dev/null +++ b/debian/source/lintian-overrides @@ -0,0 +1,4 @@ +# Our package is built on GitHub-hosted runner, +# which uses Ubuntu, and will default to zstd compression. +# This is currently not supported in Debian. +radxa-overlays-dkms source: custom-compression-in-debian-rules diff --git a/radxa-overlays-dkms.ko b/radxa-overlays-dkms.ko new file mode 100644 index 00000000..e69de29b