From 7cea3939bf88fba20051c84d0bc121805af021d2 Mon Sep 17 00:00:00 2001 From: Jo Date: Sat, 30 Mar 2024 06:34:15 +0100 Subject: [PATCH] Applied libsml changes adding Raspian build --- .github/workflows/debuild.yml | 51 +++++++++++++++++++++++++---------- README.md | 18 ++++++++----- debian/changelog | 8 ++++++ 3 files changed, 57 insertions(+), 20 deletions(-) diff --git a/.github/workflows/debuild.yml b/.github/workflows/debuild.yml index f401736c..a3d99e09 100644 --- a/.github/workflows/debuild.yml +++ b/.github/workflows/debuild.yml @@ -14,7 +14,7 @@ env: KEYSERVER: keyserver.ubuntu.com # Cloudsmith package repository KEYFILE: /usr/share/keyrings/volkszaehler-volkszaehler-org-project-archive-keyring.gpg - CLOUDURL: https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-project/deb/debian + CLOUDURL: https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-project/deb CLOUD_KEY_ID: 21DBDAC56DF44DA1 REPO: volkszaehler/volkszaehler-org-project @@ -29,7 +29,7 @@ jobs: run: echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV - name: add cloudsmith repo run: | - LISTENTRY="deb [signed-by=$KEYFILE] $CLOUDURL trixie main" + LISTENTRY="deb [signed-by=$KEYFILE] $CLOUDURL/debian trixie main" echo "$LISTENTRY" | sudo tee -a /etc/apt/sources.list gpg --keyserver $KEYSERVER --recv-key $CLOUD_KEY_ID sudo -E gpg -v --output "$KEYFILE" --export $CLOUD_KEY_ID @@ -85,19 +85,41 @@ jobs: needs: debuild strategy: matrix: - architecture: [armel, armhf, arm64, amd64] + os: [debian, raspbian] distribution: [trixie, bookworm, bullseye] - runs-on: ubuntu-latest + architecture: [armhf, arm64, amd64] + exclude: + - os: raspbian + architecture: arm64 + - os: raspbian + architecture: amd64 + - os: raspbian + distribution: trixie + include: + - mirrorsite: http://ftp2.de.debian.org/debian/ + - mirrorsite: http://mirror.netcologne.de/raspbian/raspbian/ + os: raspbian + - keyring: debian-archive-keyring + - keyring: raspbian-archive-keyring + os: raspbian + runs-on: ubuntu-latest environment: main env: PBRT: /var/cache/pbuilder steps: - name: update repo information run: sudo apt-get update + - name: install archive keyring + run: | + if [[ ${{ matrix.os }} == raspbian ]]; then + wget http://raspbian.raspberrypi.org/raspbian/pool/main/r/raspbian-archive-keyring/raspbian-archive-keyring_20120528.2_all.deb + sudo apt-get install ./raspbian-archive-keyring_20120528.2_all.deb + else + sudo apt-get install debian-archive-keyring + fi - name: install pbuilder run: | - sudo apt-get install pbuilder qemu-user-static \ - debian-archive-keyring hub + sudo apt-get install pbuilder mmdebstrap qemu-user-static pipx hub # Needed for the release download - uses: actions/checkout@v4 - name: Set env @@ -110,18 +132,18 @@ jobs: ls -l - name: configure pbuilder run: | - echo "MIRRORSITE=http://ftp2.de.debian.org/debian/ + echo "MIRRORSITE=${{ matrix.mirrorsite }} HOOKDIR=$PBRT/hooks" | \ sudo tee /root/.pbuilderrc sudo mkdir -p $PBRT/hooks echo "#!/bin/sh - apt-get -y install gnupg debian-archive-keyring ca-certificates + apt-get -y install gnupg ${{ matrix.keyring }} ca-certificates apt-key adv --keyserver $KEYSERVER --recv-keys $SIGNING_KEY_ID" | \ sudo tee $PBRT/hooks/G70Keys sudo chmod a+x $PBRT/hooks/G70Keys # OTHERMIRRORS can't do signed-by echo "#!/bin/sh - LISTENTRY=\"deb [signed-by=$KEYFILE] $CLOUDURL ${{ matrix.distribution }} main\" + LISTENTRY=\"deb [signed-by=$KEYFILE] $CLOUDURL/${{ matrix.os }} ${{ matrix.distribution }} main\" gpg --keyserver $KEYSERVER --recv-key $CLOUD_KEY_ID gpg -v --output '$KEYFILE' --export $CLOUD_KEY_ID echo \"\$LISTENTRY\" >> /etc/apt/sources.list @@ -136,10 +158,11 @@ jobs: run: | sudo pbuilder create --architecture ${{ matrix.architecture }} \ --distribution ${{ matrix.distribution }} \ - --debootstrap qemu-debootstrap \ --basetgz $PBRT/current.tgz \ - --debootstrapopts --keyring=/usr/share/keyrings/debian-archive-keyring.gpg - - name: pbuild ${{ matrix.architecture }} ${{ matrix.distribution }} + --debootstrap mmdebstrap \ + --debootstrapopts \ + --keyring=/usr/share/keyrings/${{ matrix.keyring }}.gpg + - name: pbuild ${{ matrix.os }} ${{ matrix.architecture }} ${{ matrix.distribution }} # https://stackoverflow.com/questions/70435286/resource-not-accessible-by-integration-on-github-post-repos-owner-repo-ac run: | VERSION="${GITHUB_REF##*/v}" @@ -166,7 +189,7 @@ jobs: CHANGES_FILE="$PBRT/result/${PKG}_${VERSION}_${{ matrix.architecture }}.changes" for DEB in $(dcmd --deb $CHANGES_FILE); do cloudsmith push deb \ - ${REPO}/debian/${{ matrix.distribution }} "$DEB" - done + ${REPO}/${{ matrix.os }}/${{ matrix.distribution }} "$DEB" + done env: CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} diff --git a/README.md b/README.md index 4afd1a4d..0dcd8e46 100644 --- a/README.md +++ b/README.md @@ -43,15 +43,19 @@ You can start it: where /home/pi/projects/vzlogger-docker is the path to the directory containing the vzlogger.conf file and /dev/serial/by-id/usb-FTDI_FT230X_Basic_UART_D30A8U6N-if00-port0 is your device. You can pass several devices if you have them. -Debian Packages +Debian and Raspbian Packages ------------- [![Hosted By: Cloudsmith](https://img.shields.io/badge/OSS%20hosting%20by-cloudsmith-blue?logo=cloudsmith&style=flat-square)](https://cloudsmith.com) -We now build debian packages for amd64, armhf and arm64 as part of our releases. -The ones attached to the release are meant for trixie. These and packages for -bookworm and bullseye are also provided through a repository graciously provided by -[Cloudsmith](https://cloudsmith.com). +We now build Debian packages for amd64, armhf and arm64 and Raspbian packages +for armhf as part of our releases. Unfortunately Debian armhf packages do not +run on Raspberry Pi 1 although the architecture on the RPi is named armhf. +Using Raspian armhf packages fixes that. + +The ones attached to the release are meant for debian trixie. These and +packages for bookworm and bullseye are also provided through a repository +graciously provided by [Cloudsmith](https://cloudsmith.com). Those debian packages are built with MQTT support. @@ -62,7 +66,9 @@ This boils down to adding a file to /etc/apt/sources.list.d/ containing deb [signed-by=/usr/share/keyrings/volkszaehler-volkszaehler-org-project-archive-keyring.gpg] https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-project/deb/debian bookworm main deb-src [signed-by=/usr/share/keyrings/volkszaehler-volkszaehler-org-project-archive-keyring.gpg] https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-project/deb/debian bookworm main ``` -(replace bookworm with your current distro) and retrieving the key as a trusted one +You need to replace bookworm with your distro and debian with raspbian in case +you are using an RPi 1. You also need to retrieve our repository key as a +trusted one. ``` curl -1sLf "https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-project/gpg.21DBDAC56DF44DA1.key" | \ gpg --dearmor > /usr/share/keyrings/volkszaehler-volkszaehler-org-project-archive-keyring.gpg diff --git a/debian/changelog b/debian/changelog index e661b387..83aa5ba4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +vzlogger (0.8.4) unstable; urgency=medium + + * Added build for Raspbian. + * Removed armel architecture. + * Renamed service user to _vzlogger + + -- Joachim Zobel Sat, 30 Mar 2024 06:24:25 +0100 + vzlogger (0.8.3) unstable; urgency=medium * Added armel as release architecture