image-info: don't use rpm --verify with --root

RPM uses the host's passwd instead of that in the target to get uid
and gid mappings.

Run it in a chroot to work around this bug.
This commit is contained in:
Lars Karlitski 2019-10-04 01:05:29 +02:00 committed by Tom Gundersen
parent cefea2d387
commit 2854b2938e

View file

@ -98,7 +98,10 @@ def read_boot_entries(boot_dir):
def rpm_verify(tree):
rpm = subprocess.Popen(["rpm", "--root", tree, "--verify", "--all"],
# cannot use `rpm --root` here, because rpm uses passwd from the host to
# verify user and group ownership:
# https://github.com/rpm-software-management/rpm/issues/882
rpm = subprocess.Popen(["chroot", tree, "rpm", "--verify", "--all"],
stdout=subprocess.PIPE, encoding="utf-8")
changed = {}