* Add bmap support for wic images in ISAR
@ 2019-06-05 6:30 Daniel Sangorrin
2019-06-05 6:30 ` [ISAR] bmap: generate bmap for wic images Daniel Sangorrin
2019-06-05 6:35 ` Add bmap support for wic images in ISAR Jan Kiszka
0 siblings, 2 replies; 4+ messages in thread
From: Daniel Sangorrin @ 2019-06-05 6:30 UTC (permalink / raw)
To: isar-users; +Cc: cip-dev
Hi,
There are methods to enlarge partitions on first boot, but if you prefer
to have an image of fixed size (e.g. 4GB) the bmap tool is quite useful.
It dramatically reduces the time required to flash your microSDCard.
This small patch adds that functionality to ISAR. Please consider it.
[ISAR] bmap: generate bmap for wic images
[Note] I created the patch on top of the isar used in CIP, if it doesn't
apply on latest branch please let me know.
Thanks,
Daniel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [ISAR] bmap: generate bmap for wic images
2019-06-05 6:30 Add bmap support for wic images in ISAR Daniel Sangorrin
@ 2019-06-05 6:30 ` Daniel Sangorrin
2019-06-05 6:37 ` Jan Kiszka
2019-06-05 6:35 ` Add bmap support for wic images in ISAR Jan Kiszka
1 sibling, 1 reply; 4+ messages in thread
From: Daniel Sangorrin @ 2019-06-05 6:30 UTC (permalink / raw)
To: isar-users; +Cc: cip-dev
bmap shortens the time required to flash an image because
it skips areas with zeros.
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.sangorrin@toshiba.co.jp>
---
meta/classes/wic-img.bbclass | 2 ++
meta/recipes-devtools/buildchroot/buildchroot-target.bb | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass
index 09d9f2e..8fd2ff8 100644
--- a/meta/classes/wic-img.bbclass
+++ b/meta/classes/wic-img.bbclass
@@ -151,9 +151,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/recipes-devtools/buildchroot/buildchroot-target.bb b/meta/recipes-devtools/buildchroot/buildchroot-target.bb
index ce6bd93..15b4be0 100644
--- a/meta/recipes-devtools/buildchroot/buildchroot-target.bb
+++ b/meta/recipes-devtools/buildchroot/buildchroot-target.bb
@@ -19,6 +19,7 @@ BUILDCHROOT_PREINSTALL ?= "gcc \
automake \
devscripts \
equivs \
- adduser"
+ adduser \
+ bmap-tools"
do_build[depends] = "isar-apt:do_cache_config isar-bootstrap-target:do_bootstrap"
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ISAR] bmap: generate bmap for wic images
2019-06-05 6:30 ` [ISAR] bmap: generate bmap for wic images Daniel Sangorrin
@ 2019-06-05 6:37 ` Jan Kiszka
0 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2019-06-05 6:37 UTC (permalink / raw)
To: Daniel Sangorrin, isar-users; +Cc: cip-dev
On 05.06.19 08:30, Daniel Sangorrin wrote:
> bmap shortens the time required to flash an image because
> it skips areas with zeros.
>
> 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.sangorrin@toshiba.co.jp>
> ---
> meta/classes/wic-img.bbclass | 2 ++
> meta/recipes-devtools/buildchroot/buildchroot-target.bb | 3 ++-
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass
> index 09d9f2e..8fd2ff8 100644
> --- a/meta/classes/wic-img.bbclass
> +++ b/meta/classes/wic-img.bbclass
> @@ -151,9 +151,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/recipes-devtools/buildchroot/buildchroot-target.bb b/meta/recipes-devtools/buildchroot/buildchroot-target.bb
> index ce6bd93..15b4be0 100644
> --- a/meta/recipes-devtools/buildchroot/buildchroot-target.bb
> +++ b/meta/recipes-devtools/buildchroot/buildchroot-target.bb
> @@ -19,6 +19,7 @@ BUILDCHROOT_PREINSTALL ?= "gcc \
> automake \
> devscripts \
> equivs \
> - adduser"
> + adduser \
> + bmap-tools"
This should go to WIC_IMAGER_INSTALL.
>
> do_build[depends] = "isar-apt:do_cache_config isar-bootstrap-target:do_bootstrap"
>
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Add bmap support for wic images in ISAR
2019-06-05 6:30 Add bmap support for wic images in ISAR Daniel Sangorrin
2019-06-05 6:30 ` [ISAR] bmap: generate bmap for wic images Daniel Sangorrin
@ 2019-06-05 6:35 ` Jan Kiszka
1 sibling, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2019-06-05 6:35 UTC (permalink / raw)
To: Daniel Sangorrin, isar-users; +Cc: cip-dev
On 05.06.19 08:30, Daniel Sangorrin wrote:
> Hi,
>
> There are methods to enlarge partitions on first boot, but if you prefer
> to have an image of fixed size (e.g. 4GB) the bmap tool is quite useful.
> It dramatically reduces the time required to flash your microSDCard.
There is indeed a concrete use case for that: swupdate images where you need to
set static sizes for the updatable partitions. Probably worth mentioning.
>
> This small patch adds that functionality to ISAR. Please consider it.
>
> [ISAR] bmap: generate bmap for wic images
>
> [Note] I created the patch on top of the isar used in CIP, if it doesn't
> apply on latest branch please let me know.
Always base on next. We can update downstream once it's merged here or carry a
backport there. So, please rebase.
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-06-05 6:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-05 6:30 Add bmap support for wic images in ISAR Daniel Sangorrin
2019-06-05 6:30 ` [ISAR] bmap: generate bmap for wic images Daniel Sangorrin
2019-06-05 6:37 ` Jan Kiszka
2019-06-05 6:35 ` Add bmap support for wic images in ISAR Jan Kiszka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox