From 57fe8d036440625153bf26258248adcdd20855c6 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Fri, 17 Jan 2025 19:09:57 +0000 Subject: [PATCH] image-oci-unmoci: preserve file modes Based on the following patch: Subject: [meta-virtualization][PATCH] image-oci-umoci: preserve file modes in rootfs From: "Florian Wickert via lists.yoctoproject.org" cp does not preserve file modes by default. This will break sudo (among others) which needs the suid flag to do its work. This patch adds the --preserve=mode flag to the cp call to fix this. Signed-off-by: Florian Wickert Signed-off-by: Bruce Ashfield --- classes/image-oci-umoci.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/image-oci-umoci.inc b/classes/image-oci-umoci.inc index c77750fb..9bd154fb 100644 --- a/classes/image-oci-umoci.inc +++ b/classes/image-oci-umoci.inc @@ -50,7 +50,7 @@ IMAGE_CMD:oci() { bbdebug 1 "OCI: populating rootfs" bbdebug 1 "OCI: cp -r ${IMAGE_ROOTFS}/* $image_bundle_name/rootfs/" - cp -r ${IMAGE_ROOTFS}/* $image_bundle_name/rootfs + cp -r -a --no-preserve=ownership ${IMAGE_ROOTFS}/* $image_bundle_name/rootfs bbdebug 1 "OCI: umoci repack --image $image_name:${OCI_IMAGE_TAG} $image_bundle_name" umoci repack --image $image_name:${OCI_IMAGE_TAG} $image_bundle_name