From 0732783d35a1dd9474fae2b6881f2cfcb31fa76b Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 19 May 2020 07:58:30 +0200 Subject: [PATCH] Drop obsolete scripts I have not used mock and schroot for a while, toolbox works well enough. --- autopkgtest-sid-update.exp | 20 ------------- build-devmock | 44 ---------------------------- mockboot | 10 ------- mockspec | 8 ------ schrootbd | 14 --------- vmdebdev | 59 -------------------------------------- 6 files changed, 155 deletions(-) delete mode 100755 autopkgtest-sid-update.exp delete mode 100755 build-devmock delete mode 100755 mockboot delete mode 100755 mockspec delete mode 100755 schrootbd delete mode 100755 vmdebdev diff --git a/autopkgtest-sid-update.exp b/autopkgtest-sid-update.exp deleted file mode 100755 index 0d1cf94..0000000 --- a/autopkgtest-sid-update.exp +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/expect -f - -set timeout -1 - -#Start the guest VM -spawn vm /srv/vm/autopkgtest-sid.img -nographic - -expect "login: " -send "root\r" - -expect "# " -send "apt update && DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::=--force-confnew dist-upgrade\r" - -expect "# " -send "apt-get --purge -y autoremove && apt-get clean\r" - -expect "# " -send "poweroff\r" - -expect "# " diff --git a/build-devmock b/build-devmock deleted file mode 100755 index 03f2f3c..0000000 --- a/build-devmock +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -set -eux -MOCK="mock -r ${OS:-default}" - -$MOCK --clean - -# install cockpit's build deps and other development tools -$MOCK -i $(sed -n '/^BuildRequires:/ {s/^.*: //; s/>=.*$//; s/%{.*}//; p}' ~/upstream/cockpit/tools/cockpit.spec) \ - npm fontconfig git valgrind chromium-headless \ - libvirt-daemon-kvm libvirt-client python3-libvirt \ - virt-viewer libappstream-glib \ - expect python3-pycodestyle python3-pyflakes \ - fedpkg /usr/bin/oc /usr/bin/genisoimage \ - man-pages socat wget genisoimage vim-enhanced \ - ansible standard-test-roles rsync waiverdb-cli - -# interactive shell sessions work as user martin, not builder -$MOCK --unpriv --copyin /dev/stdin /builddir/.bashrc <> /etc/dnf/dnf.conf; curl --location https://download.devel.redhat.com/rel-eng/RCMTOOLS/rcm-tools-fedora.repo >> /etc/dnf/dnf.conf; dnf install -y rhpkg' - -# set up waiverdb -mock --chroot -- 'printf "[waiverdb]\nauth_method=Kerberos\nresultsdb_api_url=https://resultsdb-api.engineering.redhat.com/api/v2.0\napi_url=https://waiverdb.engineering.redhat.com/api/v1.0\nkrb_principal=HTTP/waiverdb.engineering.redhat.com@REDHAT.COM\n" > /etc/waiverdb/client.conf' -mock --chroot -- 'sed -i "/\[libdefaults\]/ s/$/\n dns_canonicalize_hostname = false/" /etc/krb5.conf' - -# ssh looks at passwd, not $HOME -$MOCK --chroot --unpriv -- rm -rf /builddir/.ssh -$MOCK --chroot --unpriv -- ln -s /home/martin/.ssh /builddir/.ssh -$MOCK --chroot --unpriv -- ln -s /home/martin/upstream /builddir/upstream diff --git a/mockboot b/mockboot deleted file mode 100755 index 830427d..0000000 --- a/mockboot +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# initialize a mock tree (if not already) and nspawn it -set -eu -ROOT=$(mock --print-root-path) -[ -d "$ROOT" ] || mock --quiet --init - -mock --offline --install dnf less sudo -mock --quiet --chroot -- sh -ec 'echo root:root | chpasswd; echo mockbuild:a | chpasswd; usermod -aG wheel mockbuild' - -sudo systemd-nspawn --boot --directory="$ROOT" --bind-ro="$HOME" --bind=/tmp diff --git a/mockspec b/mockspec deleted file mode 100755 index 6f32dbc..0000000 --- a/mockspec +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# start mock session with build deps from given .spec file -OS="${OS:-default}" -set -eu -[ -d "$(mock -r $OS --print-root-path)" ] || mock -r $OS --init -specfile="$1" -shift -mock -r $OS -i $(sed -n '/^BuildRequires:/ {s/^.*: //; s/>=.*$//; s/%{.*}//; p}' "$specfile") $@ diff --git a/schrootbd b/schrootbd deleted file mode 100755 index b280797..0000000 --- a/schrootbd +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -set -e -schroot="$1" -pkg="$2" - -if [ -z "$pkg" ]; then - echo "Usage: $0 " >&2 - exit 1 -fi - -SESSID=$(schroot -b -c "$schroot" -n "schroot-$schroot-$pkg") -schroot -r -c session:$SESSID -u root -- apt-get -o Dpkg::Options::="--force-confnew" -y build-dep "$pkg" -echo "You will now be put into the schroot. It will NOT be cleaned up when you exit this shell!" -schroot -r -c session:$SESSID diff --git a/vmdebdev b/vmdebdev deleted file mode 100755 index 615e88f..0000000 --- a/vmdebdev +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/expect -f -# create a Debian/Ubuntu development VM based on a standard autopkgtest VM - -set timeout -1 - -set prompt "(%|#|\\$) $" -set sshkey [read [open "~/.ssh/id_rsa.pub"]] -set timeout 60 - -# Start the guest VM -set img [lrange $argv 0 0] -if { $img == "" } { set img "/srv/vm/autopkgtest-sid.img" } -spawn vm $img -nographic -snapshot -cpu host -smp 3 \ - -virtfs local,id=srv,path=/srv,security_model=none,mount_tag=srv,readonly \ - -virtfs local,id=etcschroot,path=/etc/schroot,security_model=none,mount_tag=etcschroot,readonly - -# Login, and get root shell -expect { - # autopkgtest Debian machine only has a root login - "Debian GNU" { set user "root"; set sudo ""; set getroot "" } - "Ubuntu" { set user "ubuntu"; set password "ubuntu"; set getroot "sudo -n -i" } -} - -expect "login: " -send "$user\r" - -expect { - "Password" { send "$password\r"; exp_continue } - -re $prompt -} - -send "export TERM=xterm; $getroot\r" -expect -re $prompt - -# install wanted packages; openssh postinst does funny things to the terminal, so only give it pipes -send "DEBIAN_FRONTEND=noninteractive apt-get install -o Dpkg::Options::=--force-confnew -y git-buildpackage libwww-perl less vim lintian build-essential debhelper manpages-dev git dput pristine-tar bash-completion libnss-myhostname lptools python-keyrings.alt wget gnupg2 ubuntu-dev-tools python3-debian qemu-kvm qemu-utils schroot sbuild locales openssh-server &1 | cat\r" -expect -re $prompt - -# set up user -send "deluser --remove-home test; adduser --disabled-password --gecos 'Martin Pitt' martin; echo 'martin:a' | chpasswd; adduser martin sbuild\r" -expect -re $prompt - -send "echo 'martin ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/martin; update-locale LANG=C.UTF-8; touch /var/lib/sudo/lectured/martin\r" -expect -re $prompt -send "mkdir /home/martin/.ssh; echo '$sshkey' > /home/martin/.ssh/authorized_keys; chown -R martin:martin /home/martin/.ssh\r" -expect -re $prompt - -# mount home, /srv, and schroot config from host; TODO: move to NFS? -send "mkdir /home/martin/h; printf 'home /home/martin/h 9p trans=virtio,access=any,nofail,ro 0 0\nsrv /srv 9p trans=virtio,access=any,nofail,ro 0 0\netcschroot /etc/schroot 9p trans=virtio,access=any,nofail,ro 0 0\n' >> /etc/fstab; mount /home/martin/h; mount /srv; mount /etc/schroot\r" -expect -re $prompt -send "(cd /home/martin; ln -s h/.gbp.conf; ln -s h/.vimrc)\r" -expect -re $prompt - -# -## install lxd if available (on Ubuntu) -send "(apt-get install -y lxd &1 | cat\r" -expect -re $prompt - -interact -- 2.39.2