def get_default_bsp_dev_path():
    if get_switch_model() == constants.bf2556x_1t:
        return get_path_relative_to_user_home(
            '/bsp/bf-reference-bsp-9.2.0-BF2556')
    elif get_switch_model() == constants.bf6064x_t:
        return get_path_relative_to_user_home(
            '/bsp/bf-reference-bsp-9.2.0-BF6064')
    else:
        print('Development BSp can\'t be retrieved for switch model'.format(
            get_switch_model()))
Exemple #2
0
def install_switch_bsp():
    set_sde_env()
    bsp_installation_file = get_path_relative_to_user_home(
        get_from_setting_dict('BSP', 'bsp_pkg'))

    if zipfile.is_zipfile(bsp_installation_file):
        print("Installing {}".format(bsp_installation_file))
        zip_ref = zipfile.ZipFile(bsp_installation_file)
        zip_ref.extractall()
        extracted_dir_name = zip_ref.namelist()[0]
        zip_ref.close()
        os.chdir(extracted_dir_name)
        os.environ['BSP'] = os.getcwd()
        print("BSP home directory set to {}".format(os.environ['BSP']))
        os.environ['BSP_INSTALL'] = get_env_var('SDE_INSTALL')
        print("BSP_INSTALL directory set to {}".format(
            os.environ['BSP_INSTALL']))
        for pltfm in glob.glob('./bf-platforms*'):
            os.chdir(pltfm)
        pltfm_dir = os.getcwd()
        os.system("autoreconf && autoconf")
        os.system("chmod +x ./autogen.sh")
        os.system("chmod +x ./configure")
        os.system(
            "./configure --prefix={} --enable-thrift --with-tof-brgup-plat".
            format(os.environ['BSP_INSTALL']))
        os.system("make")
        os.system("sudo make install")
        shutil.rmtree(os.environ['BSP'])
    else:
        print("You choose not to install BSP.")
def get_bsp_dev_abs_path():
    path_from_adv_setting = get_from_advance_setting_dict(
        constants.BSP_node, constants.bsp_dev_node_name)
    if path_from_adv_setting is None:
        return get_default_bsp_dev_path()
    else:
        return get_path_relative_to_user_home(path_from_adv_setting)
def get_stratum_config_dir_absolute():
    stratum_config_dir = get_stratum_profile_details_dict().get(
        'stratum_config')
    if stratum_config_dir is None:
        return common.dname + '/stratum_config/'
    else:
        return get_path_relative_to_user_home(
            get_stratum_profile_details_dict().get('stratum_config'))
Exemple #5
0
def get_sal_home_absolute():
    return get_path_relative_to_user_home(get_sal_home_from_config())
Exemple #6
0
def get_stratum_config_dir_absolute():
    return get_path_relative_to_user_home(
        get_stratum_profile_details_dict().get('stratum_config'))
Exemple #7
0
def get_tp_install_path_absolute():
    return get_path_relative_to_user_home(
        get_from_advance_setting_dict(constants.sal_sw_attr_node,
                                      constants.tp_install_node_name))