meta-virtualization.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
From: Vasileios Anagnostopoulos <vasileios.anagnostopoulos@siemens.com>
To: <meta-virtualization@lists.yoctoproject.org>
Cc: Vasileios Anagnostopoulos <vasileios.anagnostopoulos@siemens.com>
Subject: [meta-virtualization][PATCH 3/3] image-oci-umoci: skip parent directory in tar
Date: Tue, 12 Jul 2022 14:26:47 +0200	[thread overview]
Message-ID: <20220712122647.12746-3-vasileios.anagnostopoulos@siemens.com> (raw)
In-Reply-To: <20220712122647.12746-1-vasileios.anagnostopoulos@siemens.com>

Skip the inclusion of the parent directory in the tar file.
Most tools expect a tar file without it. An example of this
use case is skopeo, where the skopeo copy oci-archive command
will not work with the generate tar file.

Signed-off-by: Vasileios Anagnostopoulos <vasileios.anagnostopoulos@siemens.com>
---
 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 f941795..771f288 100644
--- a/classes/image-oci-umoci.inc
+++ b/classes/image-oci-umoci.inc
@@ -107,7 +107,7 @@ IMAGE_CMD:oci() {
 
     # make a tar version of the image direcotry
     if [ -n "${OCI_IMAGE_TAR_OUTPUT}" ]; then
-	tar -cf "$image_name.tar" "$image_name"
+	tar -cf "$image_name.tar" -C "$image_name" .
     fi
 
     # We could make this optional, since the bundle is directly runnable via runc
-- 
2.34.1



  parent reply	other threads:[~2022-07-12 12:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12 12:26 [meta-virtualization][PATCH 1/3] image-oci-umoci: properly handle tags other than latest Vasileios Anagnostopoulos
2022-07-12 12:26 ` [meta-virtualization][PATCH 2/3] image-oci-umoci: add parameter for stop signal Vasileios Anagnostopoulos
2022-07-12 12:26 ` Vasileios Anagnostopoulos [this message]
2022-07-12 21:16   ` [meta-virtualization][PATCH 3/3] image-oci-umoci: skip parent directory in tar Bruce Ashfield
2022-07-13  7:19     ` [PATCH " Vasileios Anagnostopoulos
2022-07-13 20:36       ` [meta-virtualization] " Bruce Ashfield
2022-07-14  6:49         ` Anagnostopoulos, Vasileios
     [not found]         ` <17019F65456D67C8.559@lists.yoctoproject.org>
2022-07-18 11:51           ` Anagnostopoulos, Vasileios
2022-07-18 12:43             ` 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=20220712122647.12746-3-vasileios.anagnostopoulos@siemens.com \
    --to=vasileios.anagnostopoulos@siemens.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).