Build separate Red Hat toolbox for rhpkg/1minutetip
authorMartin Pitt <martin@piware.de>
Sun, 6 Sep 2020 05:34:42 +0000 (07:34 +0200)
committerMartin Pitt <martin@piware.de>
Sun, 6 Sep 2020 05:35:32 +0000 (07:35 +0200)
This avoids requiring the redhat bits for Fedora development releases,
as that is often not available early.

The redhat toolbox can use the stable Fedora release, and does not need
to be updated every week.

build-devtoolbox
build-rhtoolbox [new file with mode: 0755]

index ff11b23215d6e63e5374504e2f45f6416b6fa8fd..8395461bc9f7007289ddb9e95b4a332f0ed6e593 100755 (executable)
@@ -41,23 +41,8 @@ sudo dnf install -y make npm fontconfig git valgrind chromium \
 
 sudo dnf debuginfo-install -y glib2 glibc libssh gnutls
 
-# HACK: rcmtools not available for F33 yet
-if [ "$VERSION_ID" != 33 ]; then
-    (cd /etc/yum.repos.d; sudo curl -O --location https://download.devel.redhat.com/rel-eng/RCMTOOLS/rcm-tools-fedora.repo)
-    sudo dnf install -y rhpkg
-fi
-
 type gh >/dev/null 2>&1 || sudo dnf install -y $(curl -s https://api.github.com/repos/cli/cli/releases/latest | grep -o https:.*_linux_amd64.rpm)
 
-# 1minutetip
-# HACK: not available for F33 yet
-if [ "$VERSION_ID" != 33 ]; then
-    sudo umount /mnt  # HACK: rhts-test-env-5.0-2.fc32eng.noarch wants to fiddle with it
-    sudo wget -O /etc/yum.repos.d/qa-tools.repo http://liver.brq.redhat.com/repo/qa-tools.repo
-    sudo wget -O /etc/yum.repos.d/beaker-client.repo http://download.lab.bos.redhat.com/beakerrepos/beaker-client-Fedora.repo
-    sudo dnf install -y qa-tools-workstation-1minutetip
-fi
-
 sudo dnf clean packages
 
 # unbreak kerberos; https://github.com/debarshiray/toolbox/issues/235
diff --git a/build-rhtoolbox b/build-rhtoolbox
new file mode 100755 (executable)
index 0000000..c569ff3
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/sh
+set -eux
+NAME=redhat
+RELEASE=32
+
+toolbox rm --force $NAME || true
+yes | toolbox create --release $RELEASE -c $NAME
+
+# install cockpit's build deps and other development tools
+toolbox run -c "$NAME" sh -exc '
+# useful hostname
+echo "redhat" | sudo tee /etc/hostname
+sudo hostname -F /etc/hostname
+
+sudo dnf update -y
+
+# this just refuses to rpm -i normally
+sudo dnf install -y cpio
+rpm2cpio ~martin/Dokumente/Arbeit/RedHat/redhat-internal-cert-install-0.1-7.el7.csb.noarch.rpm | sudo cpio -id --directory=/ --verbose "./etc/pki/*"
+sudo update-ca-trust
+
+(cd /etc/yum.repos.d; sudo curl -O --location https://download.devel.redhat.com/rel-eng/RCMTOOLS/rcm-tools-fedora.repo)
+sudo dnf install -y rhpkg
+
+# 1minutetip
+sudo umount /mnt  # HACK: rhts-test-env-5.0-2.fc32eng.noarch wants to fiddle with it
+sudo wget -O /etc/yum.repos.d/qa-tools.repo http://liver.brq.redhat.com/repo/qa-tools.repo
+sudo wget -O /etc/yum.repos.d/beaker-client.repo http://download.lab.bos.redhat.com/beakerrepos/beaker-client-Fedora.repo
+sudo dnf install -y qa-tools-workstation-1minutetip
+
+sudo dnf clean packages
+
+# unbreak kerberos; https://github.com/debarshiray/toolbox/issues/235
+cat <<EOF | sudo tee /etc/krb5.conf.d/0_file_ccache
+[libdefaults]
+    default_ccache_name = FILE:/tmp/krb5.ccache
+EOF
+'