From: Martin Pitt Date: Sun, 29 Jun 2025 08:24:46 +0000 (+0200) Subject: build-debian-toolbox: Fix for Ubuntu containers X-Git-Url: https://piware.de/gitweb/?a=commitdiff_plain;h=bde2ff3b090877d03c53ccb10e9fb5f14306bdfb;p=bin.git build-debian-toolbox: Fix for Ubuntu containers toolbox trips over the existing ubuntu home dir and its uid 1000. --- diff --git a/build-debian-toolbox b/build-debian-toolbox index cac95ec..df36cd0 100755 --- a/build-debian-toolbox +++ b/build-debian-toolbox @@ -8,6 +8,11 @@ toolbox rm -f $RELEASE || true podman pull docker.io/$DISTRO:$RELEASE toolbox -y create -c $RELEASE --image docker.io/$DISTRO:$RELEASE +# hack for ubuntu: need to remove existing home dir +if [ "$DISTRO" = "ubuntu" ]; then + podman unshare sh -exc "H=\$(podman mount $RELEASE); rm -r \$H/home/ubuntu; sed -i '/^ubuntu/d' \$H/etc/passwd \$H/etc/shadow" +fi + # can't do that with toolbox run yet, as we need to install sudo first podman start $RELEASE podman exec -it $RELEASE sh -exc '