meta-virtualization.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
From: Joshua Watt <jpewhacker@gmail.com>
To: meta-virtualization@lists.yoctoproject.org
Cc: Joshua Watt <JPEWhacker@gmail.com>
Subject: [meta-virtualization][PATCH] classes/image-oci: Add OCI_IMAGE_ENTRYPOINT_ARG_LIST
Date: Thu, 12 Oct 2023 10:51:56 -0600	[thread overview]
Message-ID: <20231012165156.357269-1-JPEWhacker@gmail.com> (raw)

The "entrypoint arguments" (command) is allowed to be a list of
arguments to pass to the entrypoint. However, the current
OCI_IMAGE_ENTRYPOINT_ARGS variables doesn't support however. In order to
maintain backward compatibility, a new variable has to be introduced to
that can be split into the multiple arguments required

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 classes/image-oci-umoci.inc | 3 +++
 classes/image-oci.bbclass   | 1 +
 2 files changed, 4 insertions(+)

diff --git a/classes/image-oci-umoci.inc b/classes/image-oci-umoci.inc
index 6c7f244..da93570 100644
--- a/classes/image-oci-umoci.inc
+++ b/classes/image-oci-umoci.inc
@@ -103,6 +103,9 @@ IMAGE_CMD:oci() {
     if [ -n "${OCI_IMAGE_ENTRYPOINT_ARGS}" ]; then
 	umoci config --image $image_name:${OCI_IMAGE_TAG} --config.cmd "${OCI_IMAGE_ENTRYPOINT_ARGS}"
     fi
+    if [ -n "${OCI_IMAGE_ENTRYPOINT_ARG_LIST}" ]; then
+	umoci config --image $image_name:${OCI_IMAGE_TAG} ${@" ".join("--config.cmd %s" % s for s in d.getVar("OCI_IMAGE_ENTRYPOINT_ARG_LIST").split())}
+    fi
     umoci config --image $image_name:${OCI_IMAGE_TAG} --author ${OCI_IMAGE_AUTHOR_EMAIL}
 
     # make a tar version of the image direcotry
diff --git a/classes/image-oci.bbclass b/classes/image-oci.bbclass
index 9ddb88b..68045ad 100644
--- a/classes/image-oci.bbclass
+++ b/classes/image-oci.bbclass
@@ -57,6 +57,7 @@ OCI_IMAGE_SUBARCH ?= "${@oci_map_subarch(d.getVar('TARGET_ARCH'), d.getVar('TUNE
 
 OCI_IMAGE_ENTRYPOINT ?= "sh"
 OCI_IMAGE_ENTRYPOINT_ARGS ?= ""
+OCI_IMAGE_ENTRYPOINT_ARG_LIST ?=""
 OCI_IMAGE_WORKINGDIR ?= ""
 OCI_IMAGE_STOPSIGNAL ?= ""
 
-- 
2.34.1



             reply	other threads:[~2023-10-12 16:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-12 16:51 Joshua Watt [this message]
2023-10-12 17:22 ` [meta-virtualization][PATCH] classes/image-oci: Add OCI_IMAGE_ENTRYPOINT_ARG_LIST Bruce Ashfield
     [not found] ` <178D6BFFDDF3349D.29357@lists.yoctoproject.org>
2023-10-12 17:25   ` Bruce Ashfield
2023-10-12 22:08     ` Joshua Watt
2023-10-12 22:39       ` Bruce Ashfield
2023-10-12 23:01         ` Joshua Watt
2023-10-13  3:05           ` Bruce Ashfield
     [not found]           ` <178D8BCB6046F019.14388@lists.yoctoproject.org>
2023-10-13  3:39             ` Bruce Ashfield
2023-10-13 14:03               ` Joshua Watt

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=20231012165156.357269-1-JPEWhacker@gmail.com \
    --to=jpewhacker@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 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 read-only IMAP folder(s) and NNTP newsgroup(s).