From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mail.openembedded.org (Postfix) with ESMTP id DAF4478267 for ; Thu, 8 Jun 2017 16:15:29 +0000 (UTC) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP; 08 Jun 2017 09:15:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,315,1493708400"; d="scan'208";a="112530311" Received: from linux.intel.com ([10.54.29.200]) by fmsmga006.fm.intel.com with ESMTP; 08 Jun 2017 09:15:30 -0700 Received: from vmed.fi.intel.com (vmed.fi.intel.com [10.237.72.38]) by linux.intel.com (Postfix) with ESMTP id 9E97E58029B for ; Thu, 8 Jun 2017 09:15:29 -0700 (PDT) From: Ed Bartosh To: openembedded-core@lists.openembedded.org Date: Thu, 8 Jun 2017 19:12:59 +0300 Message-Id: <8b401f961091841f46df56a2c82f0c3dcf084e4a.1496938139.git.ed.bartosh@linux.intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [PATCH 17/25] wic: add Disk._put_part_image method X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jun 2017 16:15:30 -0000 This method copies partition image into the wic image. It will be used in 'wic cp' and 'wic rm' subcommands to copy changed partition back into wic image. Signed-off-by: Ed Bartosh --- scripts/lib/wic/engine.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py index f24fb9a..6a4f55f 100644 --- a/scripts/lib/wic/engine.py +++ b/scripts/lib/wic/engine.py @@ -300,6 +300,11 @@ class Disk: return self._partimages[pnum] + def _put_part_image(self, pnum): + """Put partition image into partitioned image.""" + sparse_copy(self._partimages[pnum], self.imagepath, + seek=self.partitions[pnum].start) + def dir(self, pnum, path): return exec_cmd("{} -i {} ::{}".format(self.mdir, self._get_part_image(pnum), -- 2.1.4