7 toolbox rm -f $RELEASE || true
8 podman pull docker.io/$DISTRO:$RELEASE
9 toolbox -y create -c $RELEASE --image docker.io/$DISTRO:$RELEASE
11 # hack for ubuntu: need to remove existing home dir
12 if [ "$DISTRO" = "ubuntu" ]; then
13 podman unshare sh -exc "H=\$(podman mount $RELEASE); rm -r \$H/home/ubuntu; sed -i '/^ubuntu/d' \$H/etc/passwd \$H/etc/shadow"
16 # can't do that with toolbox run yet, as we need to install sudo first
18 podman exec -it $RELEASE sh -exc '
20 echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/unsafe-io
22 # otherwise installing systemd fails
23 umount /var/log/journal
26 if [ -e /etc/apt/sources.list.d/debian.sources ]; then
27 sed -i "/^Types:/ s/deb$/deb deb-src/" /etc/apt/sources.list.d/debian.sources
31 apt-get install -y libnss-myhostname sudo eatmydata libcap2-bin
33 # allow sudo with empty password
34 sed -i "s/nullok_secure/nullok/" /etc/pam.d/common-auth
36 # unbreak slow host name resolution
37 sed -i "/^hosts:/ s/files dns myhostname/files myhostname dns/" /etc/nsswitch.conf
40 toolbox run --container $RELEASE sh -exc '
43 echo "${ID}-${VERSION_ID:-sid}" | sudo tee /etc/hostname
44 sudo hostname -F /etc/hostname
46 sudo DEBIAN_FRONTEND=noninteractive eatmydata apt-get -y dist-upgrade
49 sudo eatmydata apt-get install -y --no-install-recommends build-essential git-buildpackage libwww-perl less vim lintian debhelper manpages-dev git dput pristine-tar bash-completion wget gnupg ubuntu-dev-tools python3-debian fakeroot libdistro-info-perl openssh-client flatpak-xdg-utils
52 sudo eatmydata apt-get install -y --no-install-recommends autopkgtest qemu-system-x86 qemu-utils genisoimage uidmap
54 # commands to forward to the host
55 for cmd in podman buildah toolbox; do
56 printf "#!/bin/sh\n/usr/libexec/flatpak-xdg-utils/flatpak-spawn --host $cmd \42\$@\42\n" | sudo tee /usr/local/bin/$cmd >/dev/null
57 sudo chmod a+x /usr/local/bin/$cmd
61 toolbox enter --container $RELEASE