]> piware.de Git - bin.git/commitdiff
build-debian-toolbox: Fix for Ubuntu containers master
authorMartin Pitt <martin@piware.de>
Sun, 29 Jun 2025 08:24:46 +0000 (10:24 +0200)
committerMartin Pitt <martin@piware.de>
Sun, 29 Jun 2025 08:24:46 +0000 (10:24 +0200)
toolbox trips over the existing ubuntu home dir and its uid 1000.

build-debian-toolbox

index cac95ec0790bc993fa5fe7b6680eca79f07299c8..df36cd0cfb7b30b42fa5d96d7ad1b3eed8e1cbbe 100755 (executable)
@@ -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 '