示例#1
0
SKALES_tools = mi.get_tool_build('skales')

if not options.non_hlos and not options.hlos and FIT_tool is None:
    options.non_hlos = True
    options.hlos = True

#---------------------------------------------------------#
# Get bearings                                            #
#---------------------------------------------------------#

on_linux = sys.platform.startswith("linux")

#---------------------------------------------------------#
# Print some diagnostic info                              #
#---------------------------------------------------------#
lg = lg.Logger('update_common')
lg.log("update_common_info:Platform is:" + sys.platform, verbose=0)
lg.log("update_common_info:Python Version is:" + sys.version, verbose=0)
lg.log("update_common_info:Current directory is:" + os.getcwd(), verbose=0)

#---------------------------------------------------------#
# Load the Meta-Info file                                 #
#---------------------------------------------------------#
lg.log("update_common_info:Loading the Meta-Info file", verbose=0)
mi = ml.meta_info(logger=lg)

#---------------------------------------------------------#
# Get flavor information                                  #
#---------------------------------------------------------#
flavors = mi.get_product_flavors()
示例#2
0
        not os.path.isdir(dst_path)):
    print "Can't find destination directory:", dst_path
    print __doc__
    sys.exit(1)
logfile = os.path.join(dst_path, 'gen_cmm_data2')

#delete EXCEPTION_gen_cmm_data2.txt and SUCCESS_gen_cmm_data2.txt, if they exists
exception_file_path = os.path.join(dst_path, 'EXCEPTION_gen_cmm_data2.txt')
if os.path.exists(exception_file_path):
    os.remove(exception_file_path)

success_file_path = os.path.join(dst_path, 'SUCCESS.txt')
if os.path.exists(success_file_path):
    os.remove(success_file_path)

lg = lg.Logger(logfile, save_old_log_file=False)

lg.log("Platform is:" + sys.platform)
lg.log("Python Version is:" + sys.version)
lg.log("Current directory is:" + os.getcwd())
lg.log("Args are:" + str(sys.argv))

cmm_script_header = ''
cmm_tag_template = '''GLOBAL &%s
&%s="%s"
'''
cmm_script_trailer = '''ENDDO'''
exception = False
sys.path.append(os.path.dirname(__file__))
import meta_lib as ml
示例#3
0
                      type="string",
                      dest="secsize",
                      help="sectorsize")
    (options, args) = parser.parse_args()

    if not (options.attr or options.container or options.flav or options.fatgen
            or options.fatadd or options.partsize):
        print "Error: Invalid Syntax."
        print __doc__
        sys.exit(1)
    # Initialize log file
    logfile = 'fat_creation'
    fcname = os.path.splitext(os.path.basename(options.container))[0]
    if len(fcname) > 0:
        logfile += '_' + fcname.lower()
    lg = lg.Logger(logfile)
    mi = ml.meta_info(logger=lg)
    on_linux = sys.platform.startswith("linux")
    # Create fat container
    #---------------------
    lg.log("fat_creation.py: Specified container location:")
    lg.log("                 " + options.container)
    # fatgen can't take float partition size, consider only int part
    lg.log("fat_creation.py: Specified partition size: " + options.partsize)
    options.partsize = options.partsize.split('.')[0]
    lg.log(
        "fat_creation.py: Float partition can't be used for fat creation, hence truncating it. New partition size : "
        + options.partsize)
    if os.path.exists(options.container):  # check and delete existing file
        lg.log("                 Deleting existing file")
        os.remove(options.container)
示例#4
0
                      help="fatadd.py path")
    parser.add_option("--ps",
                      action="store",
                      type="string",
                      dest="partsize",
                      help="partition size")
    parser.add_option("--ss",
                      action="store",
                      type="string",
                      dest="secsize",
                      help="sectorsize")
    (options, args) = parser.parse_args()

    mi = ml.meta_info(logger=lg)
    on_linux = sys.platform.startswith("linux")
    lg = lg.Logger('fat_creation')

    if not (options.attr or options.container or options.flav or options.fatgen
            or options.fatadd or options.partsize):
        print "Error: Invalid Syntax."
        print __doc__
        sys.exit(1)

    # Create fat container
    #---------------------
    lg.log("fat_creation.py: Specified container location:")
    lg.log("                 " + options.container)
    lg.log("fat_creation.py: Specified partition size: " + options.partsize)
    if os.path.exists(options.container):  # check and delete existing file
        lg.log("                 Deleting existing file")
        os.remove(options.container)
示例#5
0
                os.path.join(os.path.dirname(sys.argv[0]),
                             '../../../../contents.xml')):
        # current working directory should be <root>/common/build/app/<folder>
        sys.path.append(
            os.path.abspath(
                os.path.join(os.path.dirname(sys.argv[0]), '../../lib')))
        contents_xml_rel_path = '../../../../contents.xml'
    else:
        print >> sys.stderr, "Failed locating contents.xml"
        sys.exit(0)

import meta_lib as ml
import meta_log as lg

# Create log and meta interface
lg = lg.Logger(log_to_stdout=options.debug_msg, save_old_log_file=False)
mi = ml.meta_info(file_pfn=os.path.join(os.path.dirname(sys.argv[0]),
                                        contents_xml_rel_path),
                  logger=lg,
                  fb_nearest=options.fb_nearest)

if options.debug_msg:
    lg.log("meta_cli : meta_info object created with " + contents_xml_rel_path)

if len(sys.argv[1:]) < 1:
    parser.error("invalid usage. \nFor help , please try: \nmeta_cli.py -h")

if options.print_doc:
    input_string.remove('--doc')
if options.print_dir:
    input_string.remove('--dir')
import sys
import os
import subprocess
import pprint
from ctypes import *
import struct
from optparse import OptionParser

sys.path.append('../tools/meta')
import meta_lib as ml
import meta_log as lg

logfilename = os.path.join("gen_bootloader_image")
print logfilename

lg = lg.Logger(logfilename)
lg.log("Current working directory" + os.getcwd())

# Log the OS environment
lg.log("OS Environment:")
for var in os.environ:
    lg.log("   " + var + ' = ' + os.environ[var])

mi = ml.meta_info(logger=lg)

var_list = {}
var_list_1 = mi.get_file_vars(attr="bootloader_image")
for dict in [var_list_1]:
    for k, v in dict.iteritems():
        var_list.setdefault(k, list())
        var_list[k] += v