aboutsummaryrefslogtreecommitdiff
path: root/linaro_image_tools/media_create/boards.py
diff options
context:
space:
mode:
authorMilo Casagrande <milo@ubuntu.com>2012-10-01 14:49:58 +0200
committerMilo Casagrande <milo@ubuntu.com>2012-10-01 14:49:58 +0200
commitf9f1dd46542a90d74082088f307a4fd2d8b11ed7 (patch)
tree52b3b9536ddb2c33c4a75d56beff240c20a503b1 /linaro_image_tools/media_create/boards.py
parent653d4015851c9005435fb718a92c361ab50283d7 (diff)
Default to u_boot when no bootloader is specified.
Diffstat (limited to 'linaro_image_tools/media_create/boards.py')
-rw-r--r--linaro_image_tools/media_create/boards.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/linaro_image_tools/media_create/boards.py b/linaro_image_tools/media_create/boards.py
index dffe5f3..92e3faf 100644
--- a/linaro_image_tools/media_create/boards.py
+++ b/linaro_image_tools/media_create/boards.py
@@ -47,6 +47,10 @@ from linaro_image_tools.media_create.partitions import (
partition_mounted, SECTOR_SIZE, register_loopback)
from StringIO import StringIO
+from linaro_image_tools.hwpack.hwpack_fields import (
+ DEFAULT_BOOTLOADER,
+)
+
KERNEL_GLOB = 'vmlinuz-*-%(kernel_flavor)s'
INITRD_GLOB = 'initrd.img-*-%(kernel_flavor)s'
DTB_GLOB = 'dt-*-%(kernel_flavor)s/%(dtb_name)s'
@@ -438,6 +442,14 @@ class BoardConfig(object):
hardwarepack_handler = None
+ @staticmethod
+ def _get_logger():
+ """
+ Gets the logger instance.
+ :return: The logger instance
+ """
+ return logging.getLogger('linaro_image_tools')
+
@classmethod
def get_metadata_field(cls, field_name):
""" Return the metadata value for field_name if it can be found.
@@ -451,6 +463,14 @@ class BoardConfig(object):
@classmethod
def set_metadata(cls, hwpacks, bootloader=None, board=None):
+ # If not bootloader is specified, we use the default one.
+ logger = cls._get_logger()
+ if not bootloader:
+ logger.warning('WARNING: no bootloader specified on the command '
+ 'line. Defaulting to \'%s\'.' % DEFAULT_BOOTLOADER)
+ logger.warning('WARNING:specify another bootloader if this is not '
+ 'the correct one to use.')
+ bootloader = DEFAULT_BOOTLOADER
cls.hardwarepack_handler = HardwarepackHandler(hwpacks, bootloader,
board)
with cls.hardwarepack_handler: