From 41bded14baa18bf93500085503785cef1ba791e9 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 9 Mar 2020 19:27:52 +0100 Subject: [PATCH] Generalize build-debian-toolbox Supply the release/container tag as argument. Also avoid the "do you want to download?" question on create. --- build-sid-toolbox => build-debian-toolbox | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) rename build-sid-toolbox => build-debian-toolbox (67%) diff --git a/build-sid-toolbox b/build-debian-toolbox similarity index 67% rename from build-sid-toolbox rename to build-debian-toolbox index 386d394..1bb7781 100755 --- a/build-sid-toolbox +++ b/build-debian-toolbox @@ -1,12 +1,15 @@ #!/bin/sh set -eux -toolbox rm -f sid || true -toolbox create -c sid --image docker.io/debian:unstable +RELEASE=${1:-sid} +DISTRO=${2:-debian} + +toolbox rm -f $RELEASE || true +toolbox -y create -c $RELEASE --image docker.io/$DISTRO:$RELEASE # can't do that with toolbox run yet, as we need to install sudo first -podman start sid -podman exec -it sid sh -exc ' +podman start $RELEASE +podman exec -it $RELEASE sh -exc ' # 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 @@ -16,10 +19,10 @@ fi echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/unsafe-io apt-get update -apt-get install -y libnss-myhostname sudo eatmydata +apt-get install -y libnss-myhostname sudo eatmydata libcap2-bin ' -toolbox run --container sid sh -exc ' +toolbox run --container $RELEASE sh -exc ' # otherwise installing systemd fails sudo umount /var/log/journal @@ -29,4 +32,4 @@ sudo eatmydata apt-get -y dist-upgrade 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 +toolbox enter --container $RELEASE -- 2.39.5