Skip to contentSkip to conversation

CI: Add GitHub Actions for ALT Linux

PATCH Superseded Vitaly Chikunov 2 participants 3 messages Jul 11, 2021 Keys-trusted

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 CI: Add GitHub Actions for ALT Linux

Build on Sisyphus branch which is bleeding edge repo. Package manager is apt-rpm (not APT as it may look from the scripts).

---
 .github/workflows/ci.yml | 13 ++++++++++++-
 ci/alt.sh                | 24 ++++++++++++++++++++++++
 tests/install-swtpm.sh   | 14 +++++++++++---
 3 files changed, 47 insertions(+), 4 deletions(-)
 create mode 100755 ci/alt.sh
workflows/ci.yml +12 -1
index f08733a..088c041 100644
@@ -92,6 +92,11 @@ jobs:
               CC: clang
               TSS: ibmtss
 
+          - container: "alt:sisyphus"
+            env:
+              CC: gcc
+              TSS: libtpm2-tss-devel
+
     container:
       image: ${{ matrix.container }}
       env: ${{ matrix.env }}
@@ -112,7 +117,13 @@ jobs:
         ARCH="$ARCH" CC="$CC" TSS="$TSS" ./ci/$INSTALL.sh
 
     - name: Build swtpm
-      run: if [ ! "$VARIANT" ]; then which tpm_server || which swtpm || ./tests/install-swtpm.sh; fi
+      run: |
+        if [ ! "$VARIANT" ]; then
+          which tpm_server || which swtpm || \
+            if which tssstartup; then
+              ./tests/install-swtpm.sh;
+            fi
+        fi
 
     - name: Compiler version
       run: $CC --version
alt.sh new file +24 -0
new file mode 100755
index 0000000..4996890
@@ -0,0 +1,24 @@
+#!/bin/sh -ex
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Build env install script for ALT Linux.
+
+apt-get update -y
+
+# rpm-build brings basic build envirenment with gcc, make, autotools, etc.
+apt-get install -y \
+	$CC \
+	$TSS \
+	asciidoc \
+	attr \
+	docbook-style-xsl \
+	libattr-devel \
+	libkeyutils-devel \
+	libssl-devel \
+	openssl \
+	openssl-gost-engine \
+	rpm-build \
+	wget \
+	xsltproc \
+	xxd
+
install-swtpm.sh +11 -3
index 2666748..b344a69 100755
@@ -1,5 +1,13 @@
-#!/bin/sh
-set -ex
+#!/bin/sh -ex
+
+# No need to run via sudo if we already have permissions, such as in Docker.
+# Some distros do not have sudo configured for root:
+#   `root is not in the sudoers file.  This incident will be reported.'
+if [ -w /usr/local/bin ]; then
+	SUDO=
+else
+	SUDO=sudo
+fi
 
 version=1637
 
@@ -9,5 +17,5 @@ cd ibmtpm$version
 tar --no-same-owner -xvzf ../download
 cd src
 make -j$(nproc)
-sudo cp tpm_server /usr/local/bin/
+$SUDO cp tpm_server /usr/local/bin/
 cd ../..
Signature · 1 line
2.29.3
#1 lore raw

Subject missing ima-evm-utils, I will resend.

Sorry,

Quoted 10 lines · Vitaly Chikunov

Build on Sisyphus branch which is bleeding edge repo. Package manager is apt-rpm (not APT as it may look from the scripts).

---
 .github/workflows/ci.yml | 13 ++++++++++++-
 ci/alt.sh                | 24 ++++++++++++++++++++++++
 tests/install-swtpm.sh   | 14 +++++++++++---
 3 files changed, 47 insertions(+), 4 deletions(-)
 create mode 100755 ci/alt.sh
maintainer
#2 lore raw
In reply to Vitaly Chikunov

Hi Vitaly,

For now Travis is still being supported. Perhaps the subject could be "CI: add support for ALT linux".

Quoted 29 lines · Vitaly Chikunov

Build on Sisyphus branch which is bleeding edge repo. Package manager is apt-rpm (not APT as it may look from the scripts).

---
 .github/workflows/ci.yml | 13 ++++++++++++-
 ci/alt.sh                | 24 ++++++++++++++++++++++++
 tests/install-swtpm.sh   | 14 +++++++++++---
 3 files changed, 47 insertions(+), 4 deletions(-)
 create mode 100755 ci/alt.sh
workflows/ci.yml +5 -0
index f08733a..088c041 100644
@@ -92,6 +92,11 @@ jobs:
               CC: clang
               TSS: ibmtss
 
+          - container: "alt:sisyphus"
+            env:
+              CC: gcc
+              TSS: libtpm2-tss-devel
+
     container:
       image: ${{ matrix.container }}
       env: ${{ matrix.env }}
@@ -112,7 +117,13 @@ jobs:
         ARCH="$ARCH" CC="$CC" TSS="$TSS" ./ci/$INSTALL.sh

workflows/ci.yml jobs: · line 126

Quoted 10 lines
workflows/ci.yml +7 -1
 
     - name: Build swtpm
-      run: if [ ! "$VARIANT" ]; then which tpm_server || which swtpm || ./tests/install-swtpm.sh; fi
+      run: |
+        if [ ! "$VARIANT" ]; then
+          which tpm_server || which swtpm || \
+            if which tssstartup; then
+              ./tests/install-swtpm.sh;
+            fi
+        fi

This change isn't specific to ALT Linus. Could you separate this out
please?

Quoted 41 lines
workflows/ci.yml +0 -0
     - name: Compiler version
       run: $CC --version
alt.sh new file +24 -0
new file mode 100755
index 0000000..4996890
@@ -0,0 +1,24 @@
+#!/bin/sh -ex
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Build env install script for ALT Linux.
+
+apt-get update -y
+
+# rpm-build brings basic build envirenment with gcc, make, autotools, etc.
+apt-get install -y \
+	$CC \
+	$TSS \
+	asciidoc \
+	attr \
+	docbook-style-xsl \
+	libattr-devel \
+	libkeyutils-devel \
+	libssl-devel \
+	openssl \
+	openssl-gost-engine \
+	rpm-build \
+	wget \
+	xsltproc \
+	xxd
+
install-swtpm.sh +1 -2
index 2666748..b344a69 100755
@@ -1,5 +1,13 @@
-#!/bin/sh
-set -ex
+#!/bin/sh -ex

install-swtpm.sh line 11

Quoted 10 lines
install-swtpm.sh +9 -0
+
+# No need to run via sudo if we already have permissions, such as in Docker.
+# Some distros do not have sudo configured for root:
+#   `root is not in the sudoers file.  This incident will be reported.'
+if [ -w /usr/local/bin ]; then
+	SUDO=
+else
+	SUDO=sudo
+fi
 

ditto

thanks,

Mimi

Quoted 9 lines
install-swtpm.sh +1 -1
 version=1637
 
@@ -9,5 +17,5 @@ cd ibmtpm$version
 tar --no-same-owner -xvzf ../download
 cd src
 make -j$(nproc)
-sudo cp tpm_server /usr/local/bin/
+$SUDO cp tpm_server /usr/local/bin/
 cd ../..