]> piware.de Git - bin.git/commitdiff
Add toolbox-sid
authorMartin Pitt <martin@piware.de>
Tue, 25 Feb 2020 21:40:25 +0000 (22:40 +0100)
committerMartin Pitt <martin@piware.de>
Wed, 26 Feb 2020 22:48:47 +0000 (23:48 +0100)
Wrap toolbox to use it with a sid container. This requires some hacks,
so first create an intermediate container image that is palatable to
toolbox.

build-sid-toolbox [new file with mode: 0755]

diff --git a/build-sid-toolbox b/build-sid-toolbox
new file mode 100755 (executable)
index 0000000..a31b0b1
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/sh
+set -eux
+
+toolbox rm -f sid || true
+podman rm build-toolbox-sid || true
+podman rmi -f toolbox-sid || true
+
+podman run -i --name build-toolbox-sid debian:unstable <<EOF
+# toolbox hashbang is /usr/bin/sh
+ln -s /bin/sh /usr/bin/sh
+# https://bugzilla.redhat.com/show_bug.cgi?id=1785244
+if [ ! -e /etc/resolv.conf ]; then
+    ln -sfn /run/host/monitor/resolv.conf /etc/resolv.conf
+fi
+
+# go-faster apt/dpkg
+echo 'force-unsafe-io' > /etc/dpkg/dpkg.cfg.d/unsafe-io
+
+apt-get update
+apt-get install -y libnss-myhostname sudo eatmydata
+EOF
+podman commit build-toolbox-sid toolbox-sid
+podman rm build-toolbox-sid
+
+toolbox create -c sid --image localhost/toolbox-sid
+# again https://bugzilla.redhat.com/show_bug.cgi?id=1785244
+toolbox run --container sid sh -exc '
+# https://bugzilla.redhat.com/show_bug.cgi?id=1785244
+if [ ! -e /etc/resolv.conf ]; then
+    sudo ln -sfn /run/host/monitor/resolv.conf /etc/resolv.conf
+fi
+# otherwise installing systemd fails
+sudo umount /var/log/journal
+
+sudo eatmydata apt-get -y dist-upgrade
+
+# development tools
+sudo eatmydata apt-get install -y --no-install-recommends git-buildpackage libwww-perl less vim lintian debhelper manpages-dev git dput pristine-tar bash-completion python-keyrings.alt wget gnupg ubuntu-dev-tools python3-debian
+'
+
+toolbox enter --container sid