installerinject: Use root:root instead of +0:+0 as owner

Commit c6b5f22fa6 started passing the --owner argument to
cpio when injecting files into the initrd to comply with the
more strict requirements introduced by systemd starting with
Fedora 30.

However, cpio only started accepting the +uid:+gid syntax in
version 2.12, which means that the fix actually broke the
initrd inject functionality completely in RHEL 7 and other
distros that don't include a recent enough cpio.

Use the user:group syntax instead, which is understood by
all versions of cpio, including non-GNU ones.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
Andrea Bolognani 2021-12-02 12:10:14 +01:00 committed by Daniel Berrangé
parent b8aa69477f
commit 2e2d3b84bc

View File

@ -20,7 +20,7 @@ def _run_initrd_commands(initrd, tempdir):
stderr=subprocess.PIPE,
cwd=tempdir)
cpio_proc = subprocess.Popen(['cpio', '--create', '--null', '--quiet',
'--format=newc', '--owner=+0:+0'],
'--format=newc', '--owner=root:root'],
stdin=find_proc.stdout,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,