diff --git a/elements/fedora/root.d/10-fedora-cloud-image b/elements/fedora/root.d/10-fedora-cloud-image index 089c1458..29f0f255 100755 --- a/elements/fedora/root.d/10-fedora-cloud-image +++ b/elements/fedora/root.d/10-fedora-cloud-image @@ -58,6 +58,7 @@ else mv $WORKING/tmp.tar $DIB_IMAGE_CACHE/$BASE_IMAGE_TAR fi fi -# Extract the base image -sudo tar -C $TARGET_ROOT -xzf $DIB_IMAGE_CACHE/$BASE_IMAGE_TAR +# Extract the base image (use --numeric-owner to avoid UID/GID mismatch between +# image tarball and host OS e.g. when building Fedora image on an openSUSE host) +sudo tar -C $TARGET_ROOT --numeric-owner -xzf $DIB_IMAGE_CACHE/$BASE_IMAGE_TAR sudo rmdir $TARGET_ROOT/lost+found diff --git a/elements/rhel/root.d/10-rhel-cloud-image b/elements/rhel/root.d/10-rhel-cloud-image index b50494ea..724dd113 100755 --- a/elements/rhel/root.d/10-rhel-cloud-image +++ b/elements/rhel/root.d/10-rhel-cloud-image @@ -51,6 +51,7 @@ else mv $WORKING/tmp.tar $DIB_IMAGE_CACHE/$BASE_IMAGE_TAR fi fi -# Extract the base image -sudo tar -C $TARGET_ROOT -xzf $DIB_IMAGE_CACHE/$BASE_IMAGE_TAR +# Extract the base image (use --numeric-owner to avoid UID/GID mismatch between +# image tarball and host OS e.g. when building RHEL image on an openSUSE host) +sudo tar -C $TARGET_ROOT --numeric-owner -xzf $DIB_IMAGE_CACHE/$BASE_IMAGE_TAR sudo rmdir $TARGET_ROOT/lost+found diff --git a/elements/ubuntu/root.d/10-cache-ubuntu-tarball b/elements/ubuntu/root.d/10-cache-ubuntu-tarball index 23593d4d..400e57f0 100755 --- a/elements/ubuntu/root.d/10-cache-ubuntu-tarball +++ b/elements/ubuntu/root.d/10-cache-ubuntu-tarball @@ -24,6 +24,7 @@ else grep "$BASE_IMAGE_FILE" SHA256SUMS.ubuntu.$DIB_RELEASE.$ARCH | sha256sum --check - popd fi -# Extract the base image -sudo tar -C $TARGET_ROOT -xzf $DIB_IMAGE_CACHE/$BASE_IMAGE_FILE +# Extract the base image (use --numeric-owner to avoid UID/GID mismatch between +# image tarball and host OS e.g. when building Ubuntu image on an openSUSE host) +sudo tar -C $TARGET_ROOT --numeric-owner -xzf $DIB_IMAGE_CACHE/$BASE_IMAGE_FILE sudo rmdir $TARGET_ROOT/lost+found