Skip to contentSkip to conversation

Improvements to "bmaptool" usage documentation

PATCH Applied [email protected] 2 participants 6 messages Dec 18, 2024 – Dec 23, 2024

lore
Share & tools
lore
#0 lore raw

v3 cover Improvements to "bmaptool" usage documentation

From: Michael Opdenacker <[email protected]>

- Changes in V3:

- Use "chmod a+w" instead of "chmod o+w", and put this right before calling "oe-run-native" (thanks to Antonin Godard)

- Changes in V2:

- Fix typo in "sudo" (thanks to Ulrich Ölmann)

- Remove "bitbake bmaptool-native" as
"bitbake bmaptool-native -caddto_recipe_sysroot" is enough (thanks to Antonin Godard)

Michael Opdenacker (3):
dev-manual: fix styling of references to bmaptool dev-manual/bmaptool.rst: correct command for bmaptool-native dev-manual/bmaptool.rst: simplify and fix instructions

 documentation/dev-manual/bmaptool.rst | 29 +++++++++++++--------------
 documentation/dev-manual/wic.rst      |  4 ++--
 2 files changed, 16 insertions(+), 17 deletions(-)
#1 lore raw

PATCH v3 1/3 dev-manual: fix styling of references to bmaptool

From: Michael Opdenacker <[email protected]>

To follow the styling conventions when we are refering to the name of a tool instead of the command itself (documentation/standards.md).

This also improves the HTML rendering of the bmaptools subsection.

---
 documentation/dev-manual/bmaptool.rst | 18 +++++++++---------
 documentation/dev-manual/wic.rst      |  4 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)
documentation/dev-manual/bmaptool.rst +9 -9
index f6f0e6afaf..493abf7607 100644
@@ -1,13 +1,13 @@
 .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
 
-Flashing Images Using ``bmaptool``
-**********************************
+Flashing Images Using `bmaptool`
+********************************
 
 A fast and easy way to flash an image to a bootable device is to use
-bmaptool, which is integrated into the OpenEmbedded build system.
-bmaptool is a generic tool that creates a file's block map (bmap) and
+`bmaptool`, which is integrated into the OpenEmbedded build system.
+`bmaptool` is a generic tool that creates a file's block map (bmap) and
 then uses that map to copy the file. As compared to traditional tools
-such as dd or cp, bmaptool can copy (or flash) large files like raw
+such as `dd` or `cp`, `bmaptool` can copy (or flash) large files like raw
 system image files much faster.
 
 .. note::
@@ -20,13 +20,13 @@ system image files much faster.
          $ sudo apt install bmap-tools
 
    -  If you are unable to install the ``bmap-tools`` package, you will
-      need to build bmaptool before using it. Use the following command::
+      need to build `bmaptool` before using it. Use the following command::
 
          $ bitbake bmaptool-native
 
 Following, is an example that shows how to flash a Wic image. Realize
-that while this example uses a Wic image, you can use bmaptool to flash
-any type of image. Use these steps to flash an image using bmaptool:
+that while this example uses a Wic image, you can use `bmaptool` to flash
+any type of image. Use these steps to flash an image using `bmaptool`:
 
 #. *Update your local.conf File:* You need to have the following set
    in your ``local.conf`` file before building your image::
@@ -39,7 +39,7 @@ any type of image. Use these steps to flash an image using bmaptool:
 
       $ bitbake image
 
-#. *Flash the Device:* Flash the device with the image by using bmaptool
+#. *Flash the Device:* Flash the device with the image by using `bmaptool`
    depending on your particular setup. The following commands assume the
    image resides in the :term:`Build Directory`'s ``deploy/images/`` area:
 
documentation/dev-manual/wic.rst +2 -2
index a3880f3a1c..fced0e170c 100644
@@ -513,7 +513,7 @@ or ::
 
    For more information on how to use the ``bmaptool``
    to flash a device with an image, see the
-   ":ref:`dev-manual/bmaptool:flashing images using \`\`bmaptool\`\``"
+   ":ref:`dev-manual/bmaptool:flashing images using \`bmaptool\``"
    section.
 
 Using a Modified Kickstart File
@@ -721,7 +721,7 @@ the existing kernel, and then inserts a new kernel:
 
    Once the new kernel is added back into the image, you can use the
    ``dd`` command or :ref:`bmaptool
-   <dev-manual/bmaptool:flashing images using \`\`bmaptool\`\`>`
+   <dev-manual/bmaptool:flashing images using \`bmaptool\`>` commands
    to flash your wic image onto an SD card or USB stick and test your
    target.
 
#2 lore raw

PATCH v3 2/3 dev-manual/bmaptool.rst: correct command for bmaptool-native

In reply to [email protected]

From: Michael Opdenacker <[email protected]>

Using only "bitbake bmaptool-native", running "oe-run-native bmaptool-native bmaptool ..." fails as follows:

Error: Have you run 'bitbake bmaptool-native -caddto_recipe_sysroot'?

Running the "bitbake bmaptool-native -caddto_recipe_sysroot" target is actually sufficient.

---
 documentation/dev-manual/bmaptool.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
documentation/dev-manual/bmaptool.rst +1 -1
index 493abf7607..37083c9c64 100644
@@ -22,7 +22,7 @@ system image files much faster.
    -  If you are unable to install the ``bmap-tools`` package, you will
       need to build `bmaptool` before using it. Use the following command::
 
-         $ bitbake bmaptool-native
+         $ bitbake bmaptool-native -caddto_recipe_sysroot
 
 Following, is an example that shows how to flash a Wic image. Realize
 that while this example uses a Wic image, you can use `bmaptool` to flash
#3 lore raw

PATCH v3 3/3 dev-manual/bmaptool.rst: simplify and fix instructions

In reply to [email protected]

From: Michael Opdenacker <[email protected]>

- Remove duplicate instructions

- Detail how to run bmaptool directly if you installed it on your host instead of building it through the ``bmaptool-native`` recipe, as running "oe-run-native bmaptool-native bmaptool ..." won't work in this case.

- Use "chmod a+w" instead of "chmod 666", better advice, and only run "chmod" in the option that runs "oe-run-native"

---
 documentation/dev-manual/bmaptool.rst | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
documentation/dev-manual/bmaptool.rst +4 -5
index 37083c9c64..87162a49c9 100644
@@ -43,14 +43,13 @@ any type of image. Use these steps to flash an image using `bmaptool`:
    depending on your particular setup. The following commands assume the
    image resides in the :term:`Build Directory`'s ``deploy/images/`` area:
 
-   -  If you have write access to the media, use this command form::
+   -  If you installed the package for `bmaptool`, you can directly run::
 
-         $ oe-run-native bmaptool-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
+         $ sudo bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
 
-   -  If you do not have write access to the media, set your permissions
-      first and then use the same command form::
+   -  Otherwise, if you built `bmaptool` with BitBake, run::
 
-         $ sudo chmod 666 /dev/sdX
+         $ sudo chmod a+w /dev/sdX       # get write access to the media, needed only once after booting
          $ oe-run-native bmaptool-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
 
 For help on the ``bmaptool`` command, use the following command::
Reviewed-by on the v3 series
#4 lore raw
In reply to [email protected]

Hi Michael,

Quoted 16 lines · Michael Opdenacker via lists.yoctoproject.org

From: Michael Opdenacker <[email protected]>

- Changes in V3:

- Use "chmod a+w" instead of "chmod o+w", and put this right before calling "oe-run-native" (thanks to Antonin Godard)

- Changes in V2:

- Fix typo in "sudo" (thanks to Ulrich Ölmann)

- Remove "bitbake bmaptool-native" as
"bitbake bmaptool-native -caddto_recipe_sysroot" is enough (thanks to Antonin Godard)

Quoted 8 lines

Michael Opdenacker (3):
dev-manual: fix styling of references to bmaptool dev-manual/bmaptool.rst: correct command for bmaptool-native dev-manual/bmaptool.rst: simplify and fix instructions

 documentation/dev-manual/bmaptool.rst | 29 +++++++++++++--------------
 documentation/dev-manual/wic.rst      |  4 ++--
 2 files changed, 16 insertions(+), 17 deletions(-)

For the series:

Thank you!
Antonin

Signature · 3 lines
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw
In reply to [email protected]

From: Antonin Godard <[email protected]>

Quoted 9 lines · On Wed, 18 Dec 2024 14:46:58 +0000, [email protected] wrote:

From: Michael Opdenacker <[email protected]>

- Changes in V3:

- Use "chmod a+w" instead of "chmod o+w", and put this right before calling "oe-run-native" (thanks to Antonin Godard)

[...]

Applied, thanks!

[1/3] dev-manual: fix styling of references to bmaptool

      commit: c569d840c4b6f43e10629b6f1ff45189211e27a9
[2/3] dev-manual/bmaptool.rst: correct command for bmaptool-native
      commit: 72fe904a3bbb5e2c7279ab1f119c2beca200dcf2
[3/3] dev-manual/bmaptool.rst: simplify and fix instructions
      commit: 4afa71ef6e5bf1db126c80e6d987f588d0b5a086

Best regards,

Signature · 1 line
Antonin Godard <[email protected]>