1*517393d9SAndrew Geissler.. SPDX-License-Identifier: CC-BY-SA-2.0-UK 2*517393d9SAndrew Geissler 3*517393d9SAndrew GeisslerFlashing Images Using ``bmaptool`` 4*517393d9SAndrew Geissler********************************** 5*517393d9SAndrew Geissler 6*517393d9SAndrew GeisslerA fast and easy way to flash an image to a bootable device is to use 7*517393d9SAndrew GeisslerBmaptool, which is integrated into the OpenEmbedded build system. 8*517393d9SAndrew GeisslerBmaptool is a generic tool that creates a file's block map (bmap) and 9*517393d9SAndrew Geisslerthen uses that map to copy the file. As compared to traditional tools 10*517393d9SAndrew Geisslersuch as dd or cp, Bmaptool can copy (or flash) large files like raw 11*517393d9SAndrew Geisslersystem image files much faster. 12*517393d9SAndrew Geissler 13*517393d9SAndrew Geissler.. note:: 14*517393d9SAndrew Geissler 15*517393d9SAndrew Geissler - If you are using Ubuntu or Debian distributions, you can install 16*517393d9SAndrew Geissler the ``bmap-tools`` package using the following command and then 17*517393d9SAndrew Geissler use the tool without specifying ``PATH`` even from the root 18*517393d9SAndrew Geissler account:: 19*517393d9SAndrew Geissler 20*517393d9SAndrew Geissler $ sudo apt install bmap-tools 21*517393d9SAndrew Geissler 22*517393d9SAndrew Geissler - If you are unable to install the ``bmap-tools`` package, you will 23*517393d9SAndrew Geissler need to build Bmaptool before using it. Use the following command:: 24*517393d9SAndrew Geissler 25*517393d9SAndrew Geissler $ bitbake bmap-tools-native 26*517393d9SAndrew Geissler 27*517393d9SAndrew GeisslerFollowing, is an example that shows how to flash a Wic image. Realize 28*517393d9SAndrew Geisslerthat while this example uses a Wic image, you can use Bmaptool to flash 29*517393d9SAndrew Geisslerany type of image. Use these steps to flash an image using Bmaptool: 30*517393d9SAndrew Geissler 31*517393d9SAndrew Geissler#. *Update your local.conf File:* You need to have the following set 32*517393d9SAndrew Geissler in your ``local.conf`` file before building your image:: 33*517393d9SAndrew Geissler 34*517393d9SAndrew Geissler IMAGE_FSTYPES += "wic wic.bmap" 35*517393d9SAndrew Geissler 36*517393d9SAndrew Geissler#. *Get Your Image:* Either have your image ready (pre-built with the 37*517393d9SAndrew Geissler :term:`IMAGE_FSTYPES` 38*517393d9SAndrew Geissler setting previously mentioned) or take the step to build the image:: 39*517393d9SAndrew Geissler 40*517393d9SAndrew Geissler $ bitbake image 41*517393d9SAndrew Geissler 42*517393d9SAndrew Geissler#. *Flash the Device:* Flash the device with the image by using Bmaptool 43*517393d9SAndrew Geissler depending on your particular setup. The following commands assume the 44*517393d9SAndrew Geissler image resides in the :term:`Build Directory`'s ``deploy/images/`` area: 45*517393d9SAndrew Geissler 46*517393d9SAndrew Geissler - If you have write access to the media, use this command form:: 47*517393d9SAndrew Geissler 48*517393d9SAndrew Geissler $ oe-run-native bmap-tools-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX 49*517393d9SAndrew Geissler 50*517393d9SAndrew Geissler - If you do not have write access to the media, set your permissions 51*517393d9SAndrew Geissler first and then use the same command form:: 52*517393d9SAndrew Geissler 53*517393d9SAndrew Geissler $ sudo chmod 666 /dev/sdX 54*517393d9SAndrew Geissler $ oe-run-native bmap-tools-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX 55*517393d9SAndrew Geissler 56*517393d9SAndrew GeisslerFor help on the ``bmaptool`` command, use the following command:: 57*517393d9SAndrew Geissler 58*517393d9SAndrew Geissler $ bmaptool --help 59*517393d9SAndrew Geissler 60