diff mbox series

[01/12] CI: Fix CONTAINER_UID0=1 scripts/containerize

Message ID 20240711111517.3064810-2-andrew.cooper3@citrix.com (mailing list archive)
State New
Headers show
Series CI: part 3 (slimline, and PPC/RISCV fixes) | expand

Commit Message

Andrew Cooper July 11, 2024, 11:15 a.m. UTC
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>
---
CC: Anthony PERARD <anthony.perard@vates.tech>
CC: Juergen Gross <jgross@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Jan Beulich <JBeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>

v2:
 * Add fixes tag
---
 automation/scripts/containerize | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Anthony PERARD July 11, 2024, 12:54 p.m. UTC | #1
On Thu, Jul 11, 2024 at 12:15:06PM +0100, Andrew Cooper wrote:
> 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>

Thanks,
diff mbox series

Patch

diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index acdef1b54813..03bc4837350c 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -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