bmaptool.rst 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 bmap-tools-native
  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. 1. *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. 2. *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. 3. *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 have write access to the media, use this command form::
  33. $ oe-run-native bmap-tools-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
  34. - If you do not have write access to the media, set your permissions
  35. first and then use the same command form::
  36. $ sudo chmod 666 /dev/sdX
  37. $ oe-run-native bmap-tools-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
  38. For help on the ``bmaptool`` command, use the following command::
  39. $ bmaptool --help