コード例 #1
0
ファイル: thomson.py プロジェクト: Eyepea/xivo-gallifrey
}


def thomson_install(firmware):
    try:
        fw_src_path = FW_PATHS[firmware.model][firmware.version]
    except KeyError:
        fetchfw.die("unsupported model/version (%s/%s)" % (firmware.model, firmware.version))

    assert len(firmware.remote_files) == 1
    zip_path = fetchfw.zip_extract_all(firmware.name, firmware.remote_files[0].path)
    fw_zip_path = os.path.join(zip_path, fw_src_path)
    fw_dst_dir = os.path.join(fetchfw.TFTP_PATH, "Thomson", "binary")

    fetchfw.makedirs(fw_dst_dir)

    if firmware.model == 'TB30':
        pre_dsp_file = "%sS_V" % firmware.model
        pre_fw_file = "%sS." % firmware.model
    else:
        modelnum = firmware.model[2:]
        pre_dsp_file = "v%s_dsp_" % modelnum
        pre_fw_file = "v%sSG." % modelnum

    for fw_file in os.listdir(fw_zip_path):
        if fw_file.startswith(pre_dsp_file) or fw_file.startswith(pre_fw_file):
            shutil.copy2(os.path.join(fw_zip_path, fw_file),
                         os.path.join(fw_dst_dir, fw_file))

fetchfw.register_install_fn("Thomson", None, thomson_install)
コード例 #2
0
ファイル: yealink.py プロジェクト: Eyepea/xivo-gallifrey
FW_PATHS = {
    'T28': {
        '2.50.0.50': ('Yealink SIP-T28(P) V50 Firmware-2.50.0.50.rom', '2.50.0.50.rom')
    },

    'T26': {
        '6.50.0.50': ('Yealink SIP-T26(P) V50 Firmware-6.50.0.50.rom', '6.50.0.50.rom')
    },

    'T22': {
        '7.50.0.50': ('Yealink SIP-T22(P) V50 Firmware-7.50.0.50.rom', '7.50.0.50.rom')
    },

    'T20': {
        '9.50.0.50': ('Yealink SIP-T20(P) V50 Firmware-9.50.0.50.rom', '9.50.0.50.rom')
    }
}


def yealink_install(firmware):
    zip_path = fetchfw.zip_extract_all(firmware.name, firmware.remote_files[0].path)
    fw_src_name, fw_dst_name = FW_PATHS[firmware.model][firmware.version]
    fw_src_path = os.path.join(zip_path, fw_src_name)
    fw_dst_path = os.path.join(fetchfw.TFTP_PATH, 'Yealink', fw_dst_name)
    
    fetchfw.makedirs(os.path.dirname(fw_dst_path))
    shutil.copy2(fw_src_path, fw_dst_path)


fetchfw.register_install_fn('Yealink', None, yealink_install)
コード例 #3
0
ファイル: polycom.py プロジェクト: Eyepea/xivo-gallifrey
        fw_dst_path = os.path.join(fw_dst_dir, fw_file)
        shutil.copy2(fw_src_path, fw_dst_path)


def polycom_install_app(xfile):
    zip_path = fetchfw.zip_extract_all("polycom_app", xfile.path)
    fw_dst_dir = os.path.join(fetchfw.TFTP_PATH, "Polycom")
    
    fetchfw.makedirs(fw_dst_dir)
    
    for fw_file in APP_FILES:
        fw_src_path = os.path.join(zip_path, fw_file)
        fw_dst_path = os.path.join(fw_dst_dir, fw_file)
        shutil.copy2(fw_src_path, fw_dst_path)
    
    fw_src_path = os.path.join(zip_path, "SoundPointIPLocalization")
    fw_dst_path = os.path.join(fw_dst_dir, "SoundPointIPLocalization")
    shutil.rmtree(fw_dst_path, True)
    shutil.copytree(fw_src_path, fw_dst_path)


def polycom_install(firmware):
    for xfile in firmware.remote_files:
        if xfile.filename.lower().find("bootrom") > -1:
            polycom_install_bootrom(xfile)
        else:
            polycom_install_app(xfile)


fetchfw.register_install_fn("Polycom", None, polycom_install)
コード例 #4
0
ファイル: siemens.py プロジェクト: Eyepea/xivo-gallifrey
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""

import os
import shutil
from xivo_fetchfw import fetchfw


def siemens_install(firmware):
    assert len(firmware.remote_files) == 1
    xfile = firmware.remote_files[0]
    fw_dst_dir = os.path.join(fetchfw.TFTP_PATH, 'Siemens', 'firmware', firmware.model.lower())

    fetchfw.makedirs(fw_dst_dir)

    shutil.copy2(xfile.path, fw_dst_dir)


fetchfw.register_install_fn('Siemens', None, siemens_install)
コード例 #5
0
ファイル: digium.py プロジェクト: Eyepea/xivo-gallifrey
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""

import os
import shutil
from xivo_fetchfw import fetchfw


def digium_install(firmware):
    xfile = firmware.remote_files[0]
    tgz_path = fetchfw.tgz_extract_all("digium_fw", xfile.path)
    fw_dst_dir = fetchfw.KFW_PATH
    
    for fw_file in os.listdir(tgz_path):
        fw_src_path = os.path.join(tgz_path, fw_file)
        fw_dst_path = os.path.join(fw_dst_dir, fw_file)
        shutil.copy2(fw_src_path, fw_dst_path)


fetchfw.register_install_fn("Digium", None, digium_install)
コード例 #6
0
ファイル: snom.py プロジェクト: Eyepea/xivo-gallifrey
    src_dir = fetchfw.zip_extract_all('snom-lang', xfile.path)
    dst_dir = os.path.join(fetchfw.TFTP_PATH, "Snom/i18n")
    distutils.dir_util.copy_tree(src_dir, dst_dir)


def snom_install_fw(xfile):
    fw_dst_dir = os.path.join(fetchfw.TFTP_PATH, "Snom", "firmware")
    fw_dst_path = os.path.join(fw_dst_dir, xfile.filename)
    
    fetchfw.makedirs(fw_dst_dir)
    shutil.copy2(xfile.path, fw_dst_path)
    
def snom_install(firmware):
    snom_install_fw(firmware.remote_files[0])
    if len(firmware.remote_files) > 1:
        snom3xx_install_lang(firmware.remote_files[1])


def snom_m3_install(firmware):
    fw_dst_dir = os.path.join(fetchfw.TFTP_PATH, "Snom", "firmware")
    
    fetchfw.makedirs(fw_dst_dir)
    
    for xfile in firmware.remote_files:
        fw_dst_path = os.path.join(fw_dst_dir, xfile.filename)
        shutil.copy2(xfile.path, fw_dst_path)


fetchfw.register_install_fn("Snom", None, snom_install)
fetchfw.register_install_fn("Snom", "m3", snom_m3_install)
コード例 #7
0
ファイル: linksys.py プロジェクト: Eyepea/xivo-gallifrey
        linksys_zip_metainstall_fw('spa901-5-1-5.bin'),
    'lspap2t_516':
        linksys_zip_metainstall_fw('pap2t-5-1-6.bin'),
    'lsspa8000_613':
        linksys_zip_metainstall_fw('spa8000-6-1-3.bin'),
    'lsspa3102_5110':
        linksys_zip_metainstall_fw('spa3102-5-1-10-GW.bin'),
    'lsspa2102_5210':
        linksys_zip_metainstall_fw('spa2102-5-2-10.bin'),
    'lsspa400_01010202':
        linksys_zip_metainstall_fw('spa400-01-01-02-02.bin'),
    'lsspa9xx_locale_de':
        linksys_metainstall_locale('deS_v615.xml', 'deS.xml'),
    'lsspa9xx_locale_en':
        linksys_metainstall_locale('enS_US_v615.xml', 'enS.xml'),
    'lsspa9xx_locale_es':
        linksys_metainstall_locale('esS_ES_v615.xml', 'esS.xml'),
    'lsspa9xx_locale_fr':
        linksys_metainstall_locale('frS_FR_v615.xml', 'frS.xml'),
}


def linksys_install_entry_point(firmware):
    if firmware.name in linksys_install_map:
        linksys_install_map[firmware.name](firmware)
    else:
        raise fetchfw.FirmwareInstallationError()


fetchfw.register_install_fn('Linksys', None, linksys_install_entry_point)
コード例 #8
0
ファイル: nortel.py プロジェクト: Eyepea/xivo-gallifrey
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""

import os.path
import shutil

from xivo_fetchfw import fetchfw


def nortel_install_fw(xfile):
    fw_dst_dir = os.path.join(fetchfw.TFTP_PATH, 'Nortel', 'firmware')
    fw_dst_path = os.path.join(fw_dst_dir, xfile.filename)
    fetchfw.makedirs(fw_dst_dir)
    shutil.copy2(xfile.path, fw_dst_path)
    

def nortel_install(firmware):
    nortel_install_fw(firmware.remote_files[0])


fetchfw.register_install_fn('Nortel', None, nortel_install)
コード例 #9
0
ファイル: aastra.py プロジェクト: Eyepea/xivo-gallifrey
        fw_dst_path = os.path.join(fw_dst_dir, fw_file)
        shutil.copy2(fw_src_path, fw_dst_path)


def aastra_install_fw(firmware, xfile):
    zip_path = fetchfw.zip_extract_all(firmware.name, xfile.path)
    fw_src_path = os.path.join(zip_path, "%s.st" % firmware.model)
    fw_dst_dir = os.path.join(fetchfw.TFTP_PATH, "Aastra")

    if not (os.access(fw_src_path, os.R_OK) and os.path.isfile(fw_src_path)) \
       and AASTRA_MODEL_STANDARDIZE.has_key(firmware.model):
        fw_src_path = os.path.join(zip_path, "%s.st" % AASTRA_MODEL_STANDARDIZE.get(firmware.model))

    fetchfw.makedirs(fw_dst_dir)
    
    shutil.copy2(fw_src_path, fw_dst_dir)


def aastra_install(firmware):
    for xfile in firmware.remote_files:
        if xfile.filename.startswith('Lang'):
            if firmware.model == '6739i':
                aastra_install_langs(firmware, xfile, 'i18n-3')
            else:
                aastra_install_langs(firmware, xfile, 'i18n-2')
        else:
            aastra_install_fw(firmware, xfile)


fetchfw.register_install_fn("Aastra", None, aastra_install)
コード例 #10
0
ファイル: zenitel.py プロジェクト: Eyepea/xivo-gallifrey
__version__ = "$Revision$ $Date$"
__license__ = """
    Copyright (C) 2010  Proformatique <*****@*****.**>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""

import os.path
from xivo_fetchfw import fetchfw


def zenitel_install(firmware):
    fw_dst_dir = os.path.join(fetchfw.TFTP_PATH)
    fetchfw.makedirs(fw_dst_dir)
    fetchfw.zip_extract_files(firmware.remote_files[0].path, ('A100G80200.01_11_3_2.bin',), fw_dst_dir)


fetchfw.register_install_fn('Zenitel', None, zenitel_install)
コード例 #11
0
ファイル: sangoma.py プロジェクト: Eyepea/xivo-gallifrey
import os
import shutil
from xivo_fetchfw import fetchfw

SANGOMA_FW_PATH = "/etc/wanpipe/firmware"
SANGOMA_ECHOCAN_PATH = "/etc/wanpipe/wan_ec"

def sangoma_install(firmware):
    xfile = firmware.remote_files[0]
    
    fetchfw.makedirs(SANGOMA_FW_PATH)
    
    shutil.copy2(xfile.path, SANGOMA_FW_PATH)

def sangoma_echocan_install(firmware):
    xfile = firmware.remote_files[0]
    tgz_path = fetchfw.tgz_extract_all("sangoma_echocan", xfile.path)
    
    fetchfw.makedirs(SANGOMA_ECHOCAN_PATH)
    
    for root, dirs, files, in os.walk(tgz_path):
        for fw_file in files:
            if fw_file[-4:] == ".ima":
                fw_src_path = os.path.join(tgz_path, root, fw_file)
                shutil.copy2(fw_src_path, SANGOMA_ECHOCAN_PATH)


fetchfw.register_install_fn("Sangoma", 'Echo Canceller for all cards', sangoma_echocan_install)
fetchfw.register_install_fn("Sangoma", None, sangoma_install)
コード例 #12
0
ファイル: cisco.py プロジェクト: Eyepea/xivo-gallifrey
        ciscospa5xx_metainstall_locale('spa525_de_v748.xml',
                                       'spa525_de.xml',
                                       'spa50x_30x_de_v748.xml',
                                       'spa50x_30x_de.xml'),
    'ciscospa5xx_locale_en':
        ciscospa5xx_metainstall_locale('spa525_en_v748.xml',
                                       'spa525_en.xml',
                                       'spa50x_30x_en_v748.xml',
                                       'spa50x_30x_en.xml'),
    'ciscospa5xx_locale_es':
        ciscospa5xx_metainstall_locale('spa525_es_v748.xml',
                                       'spa525_es.xml',
                                       'spa50x_30x_es_v748.xml',
                                       'spa50x_30x_es.xml'),
    'ciscospa5xx_locale_fr':
        ciscospa5xx_metainstall_locale('spa525_fr_v748.xml',
                                       'spa525_fr.xml',
                                       'spa50x_30x_fr_v748.xml',
                                       'spa50x_30x_fr.xml'),
}


def cisco_install_entry_point(firmware):
    if firmware.name in cisco_install_map:
        cisco_install_map[firmware.name](firmware)
    else:
        raise fetchfw.FirmwareInstallationError()


fetchfw.register_install_fn('Cisco', None, cisco_install_entry_point)
fetchfw.register_install_fn('CiscoSMB', None, cisco_install_entry_point)