From patchwork Wed Jun 5 08:14:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Sangorrin X-Patchwork-Id: 10976457 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E22B176 for ; Wed, 5 Jun 2019 08:14:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D50E1205FC for ; Wed, 5 Jun 2019 08:14:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6E4D283AD; Wed, 5 Jun 2019 08:14:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C6FAE205FC for ; Wed, 5 Jun 2019 08:14:35 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 765ADC21; Wed, 5 Jun 2019 08:14:35 +0000 (UTC) X-Original-To: cip-dev@lists.cip-project.org Delivered-To: cip-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 9F836C21 for ; Wed, 5 Jun 2019 08:14:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mo-csw.securemx.jp (mo-csw1514.securemx.jp [210.130.202.153]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id DB90734F for ; Wed, 5 Jun 2019 08:14:33 +0000 (UTC) Received: by mo-csw.securemx.jp (mx-mo-csw1514) id x558EULV031363; Wed, 5 Jun 2019 17:14:30 +0900 X-Iguazu-Qid: 34trdEsBZS5e1yYAFd X-Iguazu-QSIG: v=2; s=0; t=1559722470; q=34trdEsBZS5e1yYAFd; m=ozM73AZJnPV+5ZK3VFwtz7aXSh7DZkYy0Wqp84B+LTA= Received: from imx12.toshiba.co.jp (imx12.toshiba.co.jp [61.202.160.132]) by relay.securemx.jp (mx-mr1513) id x558ETEk002281; Wed, 5 Jun 2019 17:14:29 +0900 Received: from enc02.toshiba.co.jp ([61.202.160.51]) by imx12.toshiba.co.jp with ESMTP id x558ETqg013382; Wed, 5 Jun 2019 17:14:29 +0900 (JST) Received: from hop101.toshiba.co.jp ([133.199.85.107]) by enc02.toshiba.co.jp with ESMTP id x558ETh9021199; Wed, 5 Jun 2019 17:14:29 +0900 From: Daniel Sangorrin To: isar-users@googlegroups.com Date: Wed, 5 Jun 2019 17:14:28 +0900 X-TSB-HOP: ON Message-Id: <20190605081428.7596-1-daniel.sangorrin@toshiba.co.jp> X-Mailer: git-send-email 2.17.1 Cc: cip-dev@lists.cip-project.org Subject: [cip-dev] [PATCH v3] bmap: generate bmap for wic images X-BeenThere: cip-dev@lists.cip-project.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: cip-dev-bounces@lists.cip-project.org Errors-To: cip-dev-bounces@lists.cip-project.org X-Virus-Scanned: ClamAV using ClamSMTP bmap shortens the time required to flash an image. This can be useful when you need a fixed-size image, for example to update partitions with swupdate. Example usage: sudo bmaptool copy --bmap \ build/tmp/deploy/images/iwg20m/cip-core-image-cip-core-iwg20m.wic.img.bmap \ build/tmp/deploy/images/iwg20m/cip-core-image-cip-core-iwg20m.wic.img \ /dev/sdf Signed-off-by: Daniel Sangorrin --- meta/classes/wic-img.bbclass | 5 ++++- meta/conf/distro/debian-common.conf | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass index 86a918d..94f0b02 100644 --- a/meta/classes/wic-img.bbclass +++ b/meta/classes/wic-img.bbclass @@ -147,9 +147,12 @@ EOSUDO ${ISARROOT}/scripts/wic create ${WKS_FULL_PATH} \ --vars "${STAGING_DIR}/${MACHINE}/imgdata/" \ -o /tmp/${IMAGE_FULLNAME}.wic/ \ + --bmap \ -e ${IMAGE_BASENAME} ${WIC_CREATE_EXTRA_ARGS} sudo chown -R $(stat -c "%U" ${ISARROOT}) ${ISARROOT}/meta ${ISARROOT}/meta-isar ${ISARROOT}/scripts || true - cp -f $(ls -t -1 ${BUILDCHROOT_DIR}/tmp/${IMAGE_FULLNAME}.wic/*.direct | head -1) ${WIC_IMAGE_FILE} + WIC_DIRECT=$(ls -t -1 ${BUILDCHROOT_DIR}/tmp/${IMAGE_FULLNAME}.wic/*.direct | head -1) + cp -f ${WIC_DIRECT} ${WIC_IMAGE_FILE} + cp -f ${WIC_DIRECT}.bmap ${WIC_IMAGE_FILE}.bmap } do_wic_image[file-checksums] += "${WKS_FILE_CHECKSUM}" diff --git a/meta/conf/distro/debian-common.conf b/meta/conf/distro/debian-common.conf index 5a47483..b845c73 100644 --- a/meta/conf/distro/debian-common.conf +++ b/meta/conf/distro/debian-common.conf @@ -11,7 +11,8 @@ WIC_IMAGER_INSTALL = "parted \ dosfstools \ mtools \ e2fsprogs \ - python3" + python3 \ + bmap-tools" GRUB_BOOTLOADER_INSTALL_amd64 = "grub-efi-amd64-bin" GRUB_BOOTLOADER_INSTALL_i386 = "grub-efi-ia32-bin"