diff options
Diffstat (limited to 'abs/core/LinHES-config/mv_ir.py')
-rwxr-xr-x | abs/core/LinHES-config/mv_ir.py | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/abs/core/LinHES-config/mv_ir.py b/abs/core/LinHES-config/mv_ir.py index 40e5fee..d77f64f 100755 --- a/abs/core/LinHES-config/mv_ir.py +++ b/abs/core/LinHES-config/mv_ir.py @@ -56,18 +56,19 @@ def add_module(filename,module): cmd = ''' echo "%s" >> %s ''' %(module,filename) mv_common.runcmd(cmd) -def unload_all_lirc(Remotetype): - logging.debug(" Unloading all remote modules") - #ati bucket specific - if "snapstream_firefly" in Remotetype : - cmd = "rmmod ati_remote" +def unload_all_lirc(Remotetype, this_is_install): + if this_is_install == False: + logging.debug(" Unloading all remote modules") + #ati bucket specific + if "snapstream_firefly" in Remotetype : + cmd = "rmmod ati_remote" + mv_common.runcmd(cmd) + cmd = "sv stop remotes" + mv_common.runcmd(cmd) + cmd = "killall -9 lircd" + mv_common.runcmd(cmd) + cmd = '''modprobe -r $(lsmod |grep ^lirc |awk '{print $1}') ''' mv_common.runcmd(cmd) - cmd = "sv stop remotes" - mv_common.runcmd(cmd) - cmd = "killall -9 lircd" - mv_common.runcmd(cmd) - cmd = '''modprobe -r $(lsmod |grep ^lirc |awk '{print $1}') ''' - mv_common.runcmd(cmd) @@ -273,7 +274,7 @@ def setup_blaster_transmiter(HostBlasterType): else: scrub_modules("/etc/modules.mythvantage","blaster") -def setup_lcd(LCDtype, TEMPLATES, Remotetype): +def setup_lcd(LCDtype, TEMPLATES, Remotetype, this_is_install): logging.debug("____Start of setup_lcd____") logging.debug(" LCDType: %s", LCDtype) logging.debug(" Remotetype: %s", Remotetype) @@ -286,8 +287,9 @@ def setup_lcd(LCDtype, TEMPLATES, Remotetype): cmd = "sv stop lcdd" mv_common.runcmd(cmd) #sometimes it doesn't want to die - cmd = "killall -9 LCDd" - mv_common.runcmd(cmd) + if this_is_install == False: + cmd = "killall -9 LCDd" + mv_common.runcmd(cmd) cmd = "load-modules-mythvantage.sh UNLOAD LCD" mv_common.runcmd(cmd) scrub_modules("/etc/modules.mythvantage", "LCD") @@ -336,7 +338,7 @@ def setup_lcd(LCDtype, TEMPLATES, Remotetype): mv_common.restart_service("lcdd") logging.debug("__End of setup_lcd") -def setup_ir(systemconfig, data_config): +def setup_ir(systemconfig, data_config, this_is_install): rc = [ False , False ] if mv_common.read_config(mv_common.module_config,"ir") == False : logging.info("____Skipping of IR, config disabled____") @@ -372,7 +374,7 @@ def setup_ir(systemconfig, data_config): systemconfig.get("mythip")) else: setup_ir_receiver("unknown", systemconfig.get("TEMPLATES"),'','127.0.0.1') - unload_all_lirc(remotetype) + unload_all_lirc(remotetype, this_is_install) setup_blaster_proto(HostBlasterType, Hostnumblaster, systemconfig.get("TEMPLATES"), @@ -388,7 +390,8 @@ def setup_ir(systemconfig, data_config): if systemconfig.get("LCDtype"): setup_lcd(systemconfig.get("LCDtype"), systemconfig.get("TEMPLATES"), - systemconfig.get("Remotetype")) + systemconfig.get("Remotetype"), + this_is_install) else: logging.debug(" LCD not defined") logging.info("__End IR\n") |