Get BOOTLOADER environment variable to specify the bootloader to l-m-c

Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
diff --git a/build_images.py b/build_images.py
index 4c35cc5..9b71278 100755
--- a/build_images.py
+++ b/build_images.py
@@ -208,10 +208,18 @@
     if hwpi.pre_inst_script is not None:
         sdir = os.path.abspath(os.path.dirname(__file__))
         script = "%s/%s" % (sdir, hwpi.pre_inst_script)
-        print "using presintall script: %s" % script
+        print "INFO: using preinstall script: %s" % script
         args.append('--preinstall-script')
         args.append(script)
 
+    bootloader = os.environ.get("BOOTLOADER")
+    if bootloader is None:
+        print 'INFO: Use default bootloader (u_boot)'
+    else:
+        print 'INFO: Use specified bootlooader (%s)' % bootloader
+        args.append('--bootloader')
+        args.append(bootloader)
+
     print "INFO: running l-m-c:", " ".join([str(arg) for arg in args])
 
     hwpi.do_eula(imgfile)