All of lore.kernel.org
 help / color / mirror / Atom feed
From: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
To: Sumit Garg <sumit.garg@kernel.org>,
	u-boot-qcom@groups.io, u-boot@lists.u-boot-project.org
Cc: Casey Connolly <casey.connolly@linaro.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Tom Rini <trini@konsulko.com>,
	Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>,
	Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Subject: [PATCH v2 4/4] tools: qcom: mkmbn: Add support to create multi-elf
Date: Thu, 10 Sep 2026 15:59:42 +0530	[thread overview]
Message-ID: <20260910-ipq5210-v2-4-d209f7dc0fc5@oss.qualcomm.com> (raw)
In-Reply-To: <20260910-ipq5210-v2-0-d209f7dc0fc5@oss.qualcomm.com>

Add a command line argument to take a list of files to be combined to create a
multi-elf expected by the boot rom.

Signed-off-by: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
---
 tools/qcom/mkmbn/mkmbn.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/tools/qcom/mkmbn/mkmbn.py b/tools/qcom/mkmbn/mkmbn.py
index 6fe66fc4e55..6b0ea3a4239 100755
--- a/tools/qcom/mkmbn/mkmbn.py
+++ b/tools/qcom/mkmbn/mkmbn.py
@@ -104,6 +104,9 @@ parser.register("type", "hex", lambda s: int(s, 16))
 parser.add_argument(
     "-l", "--load", type=lambda x: int(x, 0), default=0, help="Load address"
 )
+parser.add_argument(
+    "-m", "--melfs", nargs='+', default=[], help="List of ELFs to include in multi-elf"
+)
 parser.add_argument(
     "-o", "--output", type=Path, default="u-boot.mbn", help="Output file"
 )
@@ -116,6 +119,18 @@ parser.add_argument(
 args = parser.parse_args()
 verbose = args.verbose
 
+if (len(args.melfs)):
+    try:
+        with open(args.output, "wb") as f:
+            for path in args.melfs:
+                with open(path, 'rb') as tmp:
+                    f.write(tmp.read())
+    except Exception as e:
+        print(f"Error: {e}")
+        sys.exit(1)
+
+    sys.exit(0)
+
 elf = Elf()
 
 data: bytes = args.bin.read()

-- 
2.34.1


  parent reply	other threads:[~2026-09-10 10:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10 10:29 [PATCH v2 0/4] tools: qcom: mkmbn: Updates to support ipq5210 Varadarajan Narayanan
2026-09-10 10:29 ` [PATCH v2 1/4] tools: qcom: mkmbn: Fix ipq5424 MBN version Varadarajan Narayanan
2026-09-10 10:29 ` [PATCH v2 2/4] configs: add qcom_sm8550_defconfig and debug fragment Varadarajan Narayanan
2026-09-10 13:17   ` Casey Connolly
2026-09-10 10:29 ` [PATCH v2 3/4] tools: qcom: mkmbn: Add support for ipq5210 Varadarajan Narayanan
2026-09-11  4:59   ` Balaji Selvanathan
2026-09-10 10:29 ` Varadarajan Narayanan [this message]
2026-09-11  5:37   ` [PATCH v2 4/4] tools: qcom: mkmbn: Add support to create multi-elf Balaji Selvanathan

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=20260910-ipq5210-v2-4-d209f7dc0fc5@oss.qualcomm.com \
    --to=varadarajan.narayanan@oss.qualcomm.com \
    --cc=balaji.selvanathan@oss.qualcomm.com \
    --cc=casey.connolly@linaro.org \
    --cc=neil.armstrong@linaro.org \
    --cc=sumit.garg@kernel.org \
    --cc=trini@konsulko.com \
    --cc=u-boot-qcom@groups.io \
    --cc=u-boot@lists.u-boot-project.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.