Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CCB8FC433F5 for ; Mon, 10 Oct 2022 11:07:24 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E5CDA84EE4; Mon, 10 Oct 2022 13:07:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="S5I7+wdF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 809AC84882; Mon, 10 Oct 2022 13:07:20 +0200 (CEST) Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1CF8C84882 for ; Mon, 10 Oct 2022 13:07:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=n-francis@ti.com Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 29AB77TF068304; Mon, 10 Oct 2022 06:07:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1665400027; bh=M0RnlYUp6EI6o3lb0Ck/N2skMNh0u/NEdV+xOjZApYQ=; h=From:To:CC:Subject:Date; b=S5I7+wdFeGcMXIUpqyNl9Ke+HTpdH8hzq67o3ja5E95YxX+D1o4v2dl28xi068spa xGDQSFmo7gjmQsulwpPUxzOf/xfvV1zoJ472QT87P+sTqnWi02Q21evDRyI8THJIjm lC94Jq6mgotZRlR1wHZX052YDxYny6ksONVjBXYA= Received: from DFLE108.ent.ti.com (dfle108.ent.ti.com [10.64.6.29]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 29AB772t029148 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 10 Oct 2022 06:07:07 -0500 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Mon, 10 Oct 2022 06:07:07 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Mon, 10 Oct 2022 06:07:06 -0500 Received: from ula0497641.dhcp.ti.com (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 29AB7390008436; Mon, 10 Oct 2022 06:07:04 -0500 From: Neha Malcom Francis To: , , , , CC: , Subject: [PATCH] binman: Add support for symlinking images Date: Mon, 10 Oct 2022 16:37:02 +0530 Message-ID: <20221010110702.17110-1-n-francis@ti.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Adding support to symlink an image packaged using binman. Signed-off-by: Neha Malcom Francis --- tools/binman/image.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/binman/image.py b/tools/binman/image.py index afc4b4d643..191d121d88 100644 --- a/tools/binman/image.py +++ b/tools/binman/image.py @@ -38,6 +38,7 @@ class Image(section.Entry_section): repacked later test_section_timeout: Use a zero timeout for section multi-threading (for testing) + symlink: Name of symlink to image Args: copy_to_orig: Copy offset/size to orig_offset/orig_size after reading @@ -97,6 +98,7 @@ class Image(section.Entry_section): if filename: self._filename = filename self.allow_repack = fdt_util.GetBool(self._node, 'allow-repack') + self._symlink = fdt_util.GetString(self._node, 'symlink') @classmethod def FromFile(cls, fname): @@ -181,6 +183,10 @@ class Image(section.Entry_section): fd.write(data) tout.info("Wrote %#x bytes" % len(data)) + # Create symlink to file if symlink given + if self._symlink is not None: + tools.Run('ln', '-sf', self._filename, self._symlink) + def WriteMap(self): """Write a map of the image to a .map file -- 2.34.1