From: Bruce Ashfield <bruce.ashfield@gmail.com>
To: FlorianWickert@gmail.com
Cc: meta-virtualization@lists.yoctoproject.org
Subject: Re: [meta-virtualization][PATCH] image-oci-umoci: preserve file modes in rootfs
Date: Tue, 7 Jan 2025 22:18:10 +0000 [thread overview]
Message-ID: <Z32oImpdKNsHV77n@gmail.com> (raw)
In-Reply-To: <20250107084020.2361279-1-FlorianWickert@gmail.com>
In message: [meta-virtualization][PATCH] image-oci-umoci: preserve file modes in rootfs
on 07/01/2025 Florian Wickert via lists.yoctoproject.org wrote:
> 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 <FlorianWickert@gmail.com>
> ---
> classes/image-oci-umoci.inc | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/classes/image-oci-umoci.inc b/classes/image-oci-umoci.inc
> index c77750fb..bbea2add 100644
> --- a/classes/image-oci-umoci.inc
> +++ b/classes/image-oci-umoci.inc
> @@ -49,8 +49,8 @@ IMAGE_CMD:oci() {
> fi
>
> bbdebug 1 "OCI: populating rootfs"
> - bbdebug 1 "OCI: cp -r ${IMAGE_ROOTFS}/* $image_bundle_name/rootfs/"
> - cp -r ${IMAGE_ROOTFS}/* $image_bundle_name/rootfs
> + bbdebug 1 "OCI: cp -r --preserve=mode ${IMAGE_ROOTFS}/* $image_bundle_name/rootfs/"
> + cp -r --preserve=mode ${IMAGE_ROOTFS}/* $image_bundle_name/rootfs
Is it just the mode that we are concerned with ? We could
either use install vs cp, or just use -a
I remember thinking that pseudo would fix this up when I
was writing the code, but clearly that is not the case.
Bruce
>
> 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.43.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#9073): https://lists.yoctoproject.org/g/meta-virtualization/message/9073
> Mute This Topic: https://lists.yoctoproject.org/mt/110474242/1050810
> Group Owner: meta-virtualization+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
next prev parent reply other threads:[~2025-01-07 22:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 8:40 [meta-virtualization][PATCH] image-oci-umoci: preserve file modes in rootfs Florian Wickert
2025-01-07 22:18 ` Bruce Ashfield [this message]
2025-01-08 8:59 ` [PATCH] " Florian Wickert
2025-01-17 19:09 ` [meta-virtualization] " Bruce Ashfield
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z32oImpdKNsHV77n@gmail.com \
--to=bruce.ashfield@gmail.com \
--cc=FlorianWickert@gmail.com \
--cc=meta-virtualization@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.