diff options
author | Britney Fransen <brfransen@gmail.com> | 2013-07-02 14:40:58 (GMT) |
---|---|---|
committer | Britney Fransen <brfransen@gmail.com> | 2013-07-02 14:40:58 (GMT) |
commit | 6df05bf800839e95f4b03f67207e7fdba3a4c90b (patch) | |
tree | 6d98eb6a8eb3ed5c16f8b8a1a2ad8c8ac5083d3b /abs/core/LinHES-config/mv_ir.py | |
parent | 5d810f391b2071415598c8d29dd96d4c1c38ae1d (diff) | |
parent | c9041c8753b14ad9616c8dc3deb0e0426d94fd5f (diff) | |
download | linhes_pkgbuild-6df05bf800839e95f4b03f67207e7fdba3a4c90b.zip linhes_pkgbuild-6df05bf800839e95f4b03f67207e7fdba3a4c90b.tar.gz linhes_pkgbuild-6df05bf800839e95f4b03f67207e7fdba3a4c90b.tar.bz2 |
Merge branch 'testing' of linhes.org:linhes_pkgbuild into testing
Diffstat (limited to 'abs/core/LinHES-config/mv_ir.py')
-rwxr-xr-x | abs/core/LinHES-config/mv_ir.py | 79 |
1 files changed, 62 insertions, 17 deletions
diff --git a/abs/core/LinHES-config/mv_ir.py b/abs/core/LinHES-config/mv_ir.py index 40e5fee..f481fa4 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) @@ -135,6 +136,48 @@ def setup_ir_remote(Remotetype,templates,mythhome,HostBlasterType,remotebucket): cmd = "cp %s /etc/remote.run" %filename mv_common.runcmd(cmd) + #if remote has a special xbmc file, use it. + xbmcfile= remote_path + "/xbmc.xml" + userxmbcfile = mythhome+"/.xbmc/userdata/Lircmap.xml" + + if os.path.exists(xbmcfile): + logging.debug(" XBMC lirc file present") + logging.info(" Setting up lirc for xbmc") + if not os.path.exists(mythhome+"/.xbmc/userdata"): + logging.debug(" Creating %s/.xbmc",mythhome) + try: + os.mkdir(mythhome+"/.xbmc") + except: + logging.debug(" Couldn't create .xbmc/ ") + try: + os.mkdir(mythhome+"/.xbmc/userdata/") + except: + logging.debug(" Couldn't create .xbmc/userdata ") + + try: + cmd = ''' chown -R mythtv %s/.xbmc''' %mythhome + mv_common.runcmd(cmd) + cmd = ''' chgrp -R mythtv %s/.xbmc/userdata''' %mythhome + mv_common.runcmd(cmd) + except: + logging.debug(" Couldn't change permissions for .xbmc") + pass + try: + cmd = ''' rm -f %s''' %(userxmbcfile) + mv_common.runcmd(cmd) + logging.debug(" Creating symlink for xmbc lircrc") + os.symlink(xbmcfile, mythhome+"/.xbmc/userdata/Lircmap.xml") + except: + pass + else: + logging.debug(" XBMC lirc file %s not present" %xbmcfile) + + + + + + + #remote has it's own modprobe.d/conf filename cmd = "rm -f /etc/modprobe.d/mv_ir.conf" mv_common.runcmd(cmd) @@ -273,7 +316,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 +329,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 +380,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 +416,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 +432,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") |