bmaptool.rst 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. Flashing Images Using `bmaptool`
  3. ********************************
  4. A fast and easy way to flash an image to a bootable device is to use
  5. `bmaptool`, which is integrated into the OpenEmbedded build system.
  6. `bmaptool` is a generic tool that creates a file's block map (bmap) and
  7. then uses that map to copy the file. As compared to traditional tools
  8. such as `dd` or `cp`, `bmaptool` can copy (or flash) large files like raw
  9. system image files much faster.
  10. .. note::
  11. - If you are using Ubuntu or Debian distributions, you can install
  12. the ``bmap-tools`` package using the following command and then
  13. use the tool without specifying ``PATH`` even from the root
  14. account::
  15. $ sudo apt install bmap-tools
  16. - If you are unable to install the ``bmap-tools`` package, you will
  17. need to build `bmaptool` before using it. Use the following command::
  18. $ bitbake bmaptool-native -caddto_recipe_sysroot
  19. Following, is an example that shows how to flash a Wic image. Realize
  20. that while this example uses a Wic image, you can use `bmaptool` to flash
  21. any type of image. Use these steps to flash an image using `bmaptool`:
  22. #. *Update your local.conf File:* You need to have the following set
  23. in your ``local.conf`` file before building your image::
  24. IMAGE_FSTYPES += "wic wic.bmap"
  25. #. *Get Your Image:* Either have your image ready (pre-built with the
  26. :term:`IMAGE_FSTYPES`
  27. setting previously mentioned) or take the step to build the image::
  28. $ bitbake image
  29. #. *Flash the Device:* Flash the device with the image by using `bmaptool`
  30. depending on your particular setup. The following commands assume the
  31. image resides in the :term:`Build Directory`'s ``deploy/images/`` area:
  32. - If you installed the package for `bmaptool`, you can directly run::
  33. $ sudo bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
  34. - Otherwise, if you built `bmaptool` with BitBake, run::
  35. $ sudo chmod a+w /dev/sdX # get write access to the media, needed only once after booting
  36. $ oe-run-native bmaptool-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
  37. For help on the ``bmaptool`` command, use the following command::
  38. $ bmaptool --help