4.15. Flashing Images Using bmaptool

An easy way to flash an image to a bootable device is to use bmaptool, which is integrated into the OpenEmbedded build system.

Following, is an example that shows how to flash a Wic image.

Note

You can use bmaptool to flash any type of image.

Use these steps to flash an image using bmaptool:

Note

Unless you are able to install the bmap-tools package as mentioned in the note in the second bullet of step 3 further down, you will need to build bmaptool before using it. Build the tool using the following command:
     $ bitbake bmap-tools-native
                

  1. Update the local.conf File: Add the following to your local.conf file:

         IMAGE_FSTYPES += "wic wic.bmap"
                        

  2. Get Your Image: Either have your image ready (pre-built) or take the step build the image:

         $ bitbake image
                        

  3. Flash the Device: Flash the device with the image by using bmaptool depending on your particular setup:

    • If you have write access to the media, use this command form:

           $ oe-run-native bmap-tools-native bmaptool copy ./tmp/deploy/images/qemux86-64-core-image-minimal-machine.wic /dev/sdX
                                  

    • If you do not have write access to the media, use the following commands:

           $ sudo chmod 666 /dev/sdX
           $ oe-run-native bmap-tools-native bmaptool copy ./tmp/deploy/images/qemux86-64-core-image-minimal-machine.wic /dev/sdX
                                  

      Note

      If you are using Ubuntu or Debian distributions, you can install the bmap-tools package using the following command and then use the tool without specifying PATH even from the root account:
           $ sudo apt-get install bmap-tools
                                      

For help on the bmaptool command, use the following command:

     $ bmaptool --help