~fboudra/linaro-image-tools/initial-arndale-bl1-support

« back to all changes in this revision

Viewing changes to linaro_image_tools/media_create/boards.py

  • Committer: Milo Casagrande
  • Date: 2012-10-24 13:34:59 UTC
  • mfrom: (584.1.2 bug1059579)
  • Revision ID: milo@ubuntu.com-20121024133459-ku3i2kr1tgmz5hr9
Re-enabled use of common logging infrastructure, fixed error with global variable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
    partition_mounted, SECTOR_SIZE, register_loopback)
48
48
from StringIO import StringIO
49
49
 
 
50
logger = logging.getLogger(__name__)
 
51
 
50
52
KERNEL_GLOB = 'vmlinuz-*-%(kernel_flavor)s'
51
53
INITRD_GLOB = 'initrd.img-*-%(kernel_flavor)s'
52
54
DTB_GLOB = 'dt-*-%(kernel_flavor)s/%(dtb_name)s'
457
459
 
458
460
    hardwarepack_handler = None
459
461
 
460
 
    @staticmethod
461
 
    def _get_logger():
462
 
        """
463
 
        Gets the logger instance.
464
 
        :return: The logger instance
465
 
        """
466
 
        return logging.getLogger('linaro_image_tools')
467
 
 
468
462
    @classmethod
469
463
    def get_metadata_field(cls, field_name):
470
464
        """ Return the metadata value for field_name if it can be found.
877
871
        :param dest_dir: The directory where to copy each dtb file.
878
872
        :param search_dir: The directory where to search for the real file.
879
873
        """
880
 
        logger = logging.getLogger("linaro_image_tools")
881
874
        logger.info("Copying dtb files")
882
875
        for dtb_file in dtb_files:
883
876
            if dtb_file:
922
915
        if max_size is not None:
923
916
            assert os.path.getsize(from_file) <= max_size, (
924
917
                    "'%s' is larger than %s" % (from_file, max_size))
925
 
        logger = logging.getLogger("linaro_image_tools")
926
918
        logger.info("Writing '%s' to '%s' at %s." % (from_file, to_file, seek))
927
919
        _dd(from_file, to_file, seek=seek)
928
920
 
945
937
            if cls.spl_in_boot_part:
946
938
                assert spl_file is not None, (
947
939
                    "SPL binary could not be found")
948
 
                logger = logging.getLogger("linaro_image_tools")
949
940
                logger.info(
950
941
                    "Copying spl '%s' to boot partition." % spl_file)
951
942
                cmd_runner.run(["cp", "-v", spl_file, boot_dir],
1105
1096
    @classmethod
1106
1097
    def _get_kflavor_files_v2(cls, path):
1107
1098
        kernel = initrd = dtb = None
1108
 
        logger = logging.getLogger("linaro_image_tools")
1109
1099
 
1110
1100
        if cls.vmlinuz:
1111
1101
            kernel = _get_file_matching(os.path.join(path, cls.vmlinuz))