Resending bmap patch

15 views
Skip to first unread message

Daniel Sangorrin

unread,
Jun 5, 2019, 3:17:16 AM6/5/19
to isar-...@googlegroups.com, cip...@lists.cip-project.org
Hi Jan,

I put bmap-tools into WIC_IMAGER_INSTALL, good catch.

[PATCH v2] bmap: generate bmap for wic images

This patch was created against the next branch.
Actuall, I couldn't test it on the next branch
using CIP core (modified kas.yaml) because the build
failed for other reasons.

Thanks,
Daniel


Daniel Sangorrin

unread,
Jun 5, 2019, 3:17:16 AM6/5/19
to isar-...@googlegroups.com, cip...@lists.cip-project.org
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 <daniel.s...@toshiba.co.jp>
---
meta/classes/wic-img.bbclass | 2 ++
meta/conf/distro/debian-common.conf | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass
index 86a918d..09fdfec 100644
--- a/meta/classes/wic-img.bbclass
+++ b/meta/classes/wic-img.bbclass
@@ -147,9 +147,11 @@ 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}
+ cp -f $(ls -t -1 ${BUILDCHROOT_DIR}/tmp/${IMAGE_FULLNAME}.wic/*.direct.bmap | head -1) ${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"
--
2.17.1

Jan Kiszka

unread,
Jun 5, 2019, 3:23:18 AM6/5/19
to Daniel Sangorrin, isar-...@googlegroups.com, cip...@lists.cip-project.org
Missed in round #1, sorry: Let's factor out the "ls | head -1" thing into a
variable (WIC_DIRECT or so) to avoid duplicating this logic.

Jan

> }
>
> 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"
>

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

Daniel Sangorrin

unread,
Jun 5, 2019, 4:14:32 AM6/5/19
to isar-...@googlegroups.com, cip...@lists.cip-project.org
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 <daniel.s...@toshiba.co.jp>
---
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"
--
2.17.1

daniel.s...@toshiba.co.jp

unread,
Jun 13, 2019, 1:09:03 AM6/13/19
to isar-...@googlegroups.com
Hi all,

It seems the patch below didn't get into ISAR.
#Probably because I posted other patches for the isar-cip-core layer, and that created confusion. Sorry^^.

Thanks,
Daniel
> --
> You received this message because you are subscribed to the Google Groups "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> isar-users+...@googlegroups.com.
> To post to this group, send email to isar-...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/isar-users/20190605081428.7596-1-daniel.sangorrin%40toshiba.co.jp.
> For more options, visit https://groups.google.com/d/optout.

Baurzhan Ismagulov

unread,
Jun 13, 2019, 4:56:45 AM6/13/19
to isar-...@googlegroups.com
On Thu, Jun 13, 2019 at 05:08:55AM +0000, daniel.s...@toshiba.co.jp wrote:
> It seems the patch below didn't get into ISAR.
> #Probably because I posted other patches for the isar-cip-core layer, and that created confusion. Sorry^^.

Seems we missed it indeed, thanks for pinging. Let us have a look.

With kind regards,
Baurzhan.

Baurzhan Ismagulov

unread,
Jun 19, 2019, 7:24:55 AM6/19/19
to isar-...@googlegroups.com
On Wed, Jun 05, 2019 at 05:14:28PM +0900, Daniel Sangorrin wrote:
> 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.

Applied to next, thanks.

Would you like to add a brief section on motivation and usage to the user
manual?

With kind regards,
Baurzhan.

daniel.s...@toshiba.co.jp

unread,
Jun 20, 2019, 10:48:46 PM6/20/19
to i...@radix50.net, isar-...@googlegroups.com
Hello Baurzhan,
OK, I will. Just give me a bit of time.

Thanks,
Daniel

>
> With kind regards,
> Baurzhan.
>
> --
> You received this message because you are subscribed to the Google Groups "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> isar-users+...@googlegroups.com.
> To post to this group, send email to isar-...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/isar-users/20190619112452.GY3977%40yssyq.m.ilbers.de.
Reply all
Reply to author
Forward
0 new messages