2.4. 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. Add the following to your local.conf file:

         IMAGE_FSTYPES += "wic wic.bmap"
                    

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

         $ bitbake image
                    

  3. Flash the image to the media by using bmaptool depending on your particular setup:

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

           $ oe-run-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 bash
           $ PATH=tmp/sysroots/x86_64-linux/usr/bin/ 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 either of the following commands:

     $ bmaptool --help
     $ oe-run-native bmaptool --help