Re: [meta-oe][scarthgap][PATCH 1/1] image-oci-unmoci: preserve file modes

Bruce Ashfield <[email protected]>
Newsgroups org.yoctoproject.lists.meta-virtualization
Message-ID <[email protected]>
merged.

Bruce

In message: [meta-oe][scarthgap][PATCH 1/1] image-oci-unmoci: preserve file modes
on 26/02/2026 AdrianF wrote:

> From: Bruce Ashfield <[email protected]>
> 
> Based on the following patch:
> 
>    Subject: [meta-virtualization][PATCH] image-oci-umoci: preserve file modes in rootfs
>    From: "Florian Wickert via lists.yoctoproject.org" <[email protected]>
> 
>    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 <[email protected]>
> 
> Signed-off-by: Bruce Ashfield <[email protected]>
> Signed-off-by: Adrian Freihofer <[email protected]>
> ---
>  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
> -- 
> 2.53.0
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.