]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
CI: Fix CONTAINER_UID0=1 scripts/containerize
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 8 Jul 2024 17:00:49 +0000 (18:00 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 11 Jul 2024 16:45:57 +0000 (17:45 +0100)
Right now, most build containers use root.  Archlinux, Fedora and Yocto set up
a regular user called `user`.

For those containers, trying to containerize as root fails, because
CONTAINER_UID0=1 does nothing, whereas CONTAINER_UID0=0 forces the user away
from root.

To make CONTAINER_UID0=1 work reliably, force to root if requested.

Fixes: 17fbe6504dfd ("automation: introduce a new variable to control container user")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
automation/scripts/containerize

index acdef1b5481304753299802e646dd9b69f48a6d4..03bc4837350ce2b840362b70c8af4cb37306c653 100755 (executable)
@@ -51,7 +51,7 @@ esac
 
 # Use this variable to control whether root should be used
 case "_${CONTAINER_UID0}" in
-    _1)   userarg= ;;
+    _1)   userarg="-u 0" ;;
     _0|_) userarg="-u $(id -u) $userns_podman" ;;
 esac