summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-config/mv_advanced.py
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2013-02-19 21:10:18 (GMT)
committerJames Meyer <james.meyer@operamail.com>2013-02-19 21:10:18 (GMT)
commit2648e999d277eac5c3d331a3609bcc73fafbea71 (patch)
tree40951fb8e7fdbe28a0baa324ae615055203f1e2e /abs/core/LinHES-config/mv_advanced.py
parentc759b5e0c4aa6fc37412b4dee2cf9ad993fd376d (diff)
parent7e6f7ca174e1af67178dc5293a312a4a733eb095 (diff)
downloadlinhes_pkgbuild-2648e999d277eac5c3d331a3609bcc73fafbea71.zip
linhes_pkgbuild-2648e999d277eac5c3d331a3609bcc73fafbea71.tar.gz
linhes_pkgbuild-2648e999d277eac5c3d331a3609bcc73fafbea71.tar.bz2
Merge branch 'testing'
# By James Meyer (1091) and others # Via James Meyer (5) and others * testing: (1148 commits) LinHES-config: during install don't kill off lirc. This keeps the remote active all the way to the finish Change version numbers to 8.0 to match the release number. LinHES-conifg LinHES-system mythdb-initial runit-scripts supplemental-web LinHES-conifig: mv_install.py for the last partition don't go all the way to the end. Gotta leave room for gpt tables. xf86-video-ati: xorg ati driver. LinHES-config: timezip.py add syncing up of parental lvl passwords and starting level with MBE. LinHES-system: correct the logic for breaking out of the wmctrl loop. As written it would break out of the inner loop..but not the 60 iteration loop. e16_theme_settings: remove slide-in prop for new windows. For whatever reason this was preventing mplayer from being positioned correctly for appletrailers. LinHES-config, mythinstall: change case of hd_pvr and serial to all lower refs #902 zilog-firmware: firmware for TX support of the hdpvr and pvr-150 In general I can't recommend anybody using these transmitters but including the firmware just in case someone really wants to linhes-udev-rules: added hdprv_lirc rule. All of these lirc rules are limited to exactly one device. If more then one device is present then only the last device in init will get the symlink runit-scripts: fix logging for igdeamon, add support to remote init script so that the blaster is always the first device in the chain. added support specificly for hd_pvr LinHES-system: add lh_system_restore and lh_system_backup. These scripts are called from the mythmenu. refs #900 iguanair: rebuild with python 2.7 LinHES-system: msg_daemon.py fix init and nasty bug related to timeout. In a nutshell timeout wouldn't work unless a msg without a timeout was called first. linhes-udev-rules: add rules for mce,streamzap,serial lirc devices. mythinstall: recompile for matching libs mythtv: latest .25-fixes and change mythbackup/restore call lh_system_$op to replace mythbackup/mythrestore. mythbackup no longer works correctly with the new windowmanager linhes-scripts: myth2mp3, myth2x264, myth2xvid: use mythutil to get cutlist LinHES-config, supplimental-web: Fix proxy numbering for Ceton infiniTV linhes-system: add additional stuff to the system backup and also introduced an exclude file. The exclude/include files are locate in /home/mythtv/backup_config/ ...
Diffstat (limited to 'abs/core/LinHES-config/mv_advanced.py')
-rwxr-xr-xabs/core/LinHES-config/mv_advanced.py181
1 files changed, 26 insertions, 155 deletions
diff --git a/abs/core/LinHES-config/mv_advanced.py b/abs/core/LinHES-config/mv_advanced.py
index fdcd1e2..de10d78 100755
--- a/abs/core/LinHES-config/mv_advanced.py
+++ b/abs/core/LinHES-config/mv_advanced.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import logging, os, re
import mv_common
+import glob
def setup_pacman(create_link):
if create_link:
@@ -84,20 +85,27 @@ def setup_ncid_daemon(Runncidd):
def setup_splash(Usebootsplash):
if Usebootsplash == "1":
logging.info(" Enabling splash")
- cmd = ''' sed -i "s/^default.*0/default 1/g" /boot/grub/menu.lst'''
+ cmd = ''' sed -i "s/^set default.*$/set default="0"/g" /boot/grub/grub.cfg'''
+ mv_common.runcmd(cmd)
+ #this is needed in case grub-mkconfig is run
+ cmd = ''' sed -i "s/^GRUB_DEFAULT.*$/GRUB_DEFAULT="0"/g" /etc/default/grub'''
mv_common.runcmd(cmd)
else:
logging.info(" Disabling splash")
- cmd = ''' sed -i "s/^default.*1/default 0/g" /boot/grub/menu.lst'''
+ cmd = ''' sed -i "s/^set default.*$/set default="1"/g" /boot/grub/grub.cfg'''
+ mv_common.runcmd(cmd)
+ #this is needed in case grub-mkconfig is run
+ cmd = ''' sed -i "s/^GRUB_DEFAULT.*$/GRUB_DEFAULT="1"/g" /etc/default/grub'''
mv_common.runcmd(cmd)
return
-def setup_rrd(UseRRD):
- if UseRRD == "1":
- logging.info(" Enabling rrd_stats")
- mv_common.pacinstall("rrd_stats")
- else:
- logging.info(" Disabling rrd_stats")
- mv_common.pacremove("rrd_stats")
+
+#def setup_rrd(UseRRD):
+ #if UseRRD == "1":
+ #logging.info(" Enabling rrd_stats")
+ #mv_common.pacinstall("rrd_stats")
+ #else:
+ #logging.info(" Disabling rrd_stats")
+ #mv_common.pacremove("rrd_stats")
def setup_hobbit(UseHobbit,SystemType,dbhost):
@@ -227,141 +235,7 @@ def setup_mythweb(UseMythWEB):
logging.info(" Removing mythweb")
# mv_common.pacremove("lighttpd")
mv_common.pacremove("mythweb")
- # mv_common.remove_service("lighttpd")
- return
-
-def setup_samba(systemconfig,data_config):
- mythhome = data_config.MYTHHOME
- if systemconfig.get("UseSamba") == "1":
- logging.info(" Activating windows file sharing")
- usersamba=mythhome+"/templates/smb.conf"
- mv_common.pacinstall("samba")
- if not os.path.exists("/etc/samba"):
- logging.debug(" Creating directory /etc/samba")
- try:
- os.makedirs("/etc/samba")
- except:
- pass
-
- if os.path.exists(usersamba):
- logging.debug(" Using user provided config file %s",usersamba)
- cmd = "install -D -m755 %s /etc/samba/smb.conf" %usersamba
- mv_common.runcmd(cmd)
- else:
- Samba_media = systemconfig.get("Samba_media")
- Samba_home = systemconfig.get("Samba_home")
- if systemconfig.get("Samba_mediareadonly") == "0":
- smreadonly = "yes"
- else:
- smreadonly = "no"
-
- if systemconfig.get("Samba_homereadonly") == "0":
- shreadonly = "yes"
- else:
- shreadonly = "no"
- domain = systemconfig.get("Samba_domain")
- servername = systemconfig.get("hostname")
-
- try:
- f = open(systemconfig.get("TEMPLATES")+"/samba/smb.conf.template",'r')
- t_smbconf = f.readlines()
- f.close()
- except:
- logging.info(" Couldn't open samba template file")
- return
-
- try:
- f = open("/etc/samba/smb.conf",'w')
- except:
- logging.info(" Couldn't open samba file")
- return
-
- for line in t_smbconf:
- outline = line
- if re.match("^.*workgroup", line):
- logging.debug(" Setting workgroup to %s",domain)
- outline="workgroup = %s\n" %domain
- logging.debug(" %s",outline)
- if re.match("^.* server string",line):
- logging.debug(" Setting server name to %s",servername)
- outline="server string = %s\n" %servername
- logging.debug(" %s",outline)
- f.write(outline)
- outline="include = %s/templates/user.shares \n" %mythhome
- f.write(outline)
- if Samba_media == "1":
- outline="include = /etc/samba/smb.conf.media\n"
- f.write(outline)
- if Samba_home == "1":
- outline="include = /etc/samba/smb.conf.home\n"
- f.write(outline)
- f.close()
- logging.info(" Writing smb.conf.media")
- try:
- f = open("/etc/samba/smb.conf.media","w")
- except:
- logging.info(" Couldn't open smb.conf.media")
- return
- medialines='''
-[%s]
-path = %s
-public = yes
-only guest = yes
-writeable = %s
-printable = no
-force user = mythtv
-force group = mythtv
-create mask = 0755''' %(data_config.SMEDIA,data_config.DATAMOUNT,smreadonly)
- f.write(medialines)
- f.close
- logging.debug(" %s",medialines)
- logging.info(" Writing smb.conf.home")
- try:
- f = open("/etc/samba/smb.conf.home","w")
- except:
- logging.info(" Couldn't open smb.conf.home")
- return
- homelines='''
-[home]
-path = %s
-public = yes
-only guest = yes
-writeable = %s
-printable = no
-force user = mythtv
-force group = mythtv
-create mask = 0755 ''' %(data_config.MYTHHOME,shreadonly)
- f.write(homelines)
- f.close
- logging.debug(" %s",homelines)
-
-
- mv_common.add_service("nmbd")
- mv_common.add_service("smbd")
- mv_common.restart_service("nmbd")
- mv_common.restart_service("smbd")
-
- else:
- logging.info(" Removing windows file sharing")
- mv_common.remove_service("smbd")
- mv_common.remove_service("nmbd")
- mv_common.pacremove("samba")
- mv_common.pacinstall("smbclient")
- return
-
-def setup_NFSshares(UseNFS,templatefile):
- if UseNFS == "1":
- logging.info(" Activating NFS server")
- mv_common.pacinstall("nfs-utils")
- mv_common.pacinstall("rpcbind")
- cmd = '''sed -e "s/REPLACEME/*/g" %s >/etc/exports''' %templatefile
- mv_common.runcmd(cmd)
- mv_common.add_service("nfsd")
- mv_common.add_service("nfs-common")
- mv_common.add_service("rpcbind")
- else:
- logging.info(" Removing NFS server")
- mv_common.remove_service("nfsd")
+# mv_common.remove_service("lighttpd")
return
def setup_dyndns(DDnsEnable):
@@ -398,22 +272,19 @@ def setup_advanced(systemconfig,data_config):
setup_hobbit(systemconfig.get("UseHobbit"),
systemconfig.get("SystemType"),
systemconfig.get("dbhost"))
- if data_config.SYSTEMTYPE == "LinHES":
- setup_rrd(systemconfig.get("UseRRD"))
+ #if data_config.SYSTEMTYPE == "LinHES":
+ #setup_rrd(systemconfig.get("UseRRD"))
- setup_evrouter(systemconfig.get("UseEvrouter"),
- systemconfig.get("EvrouterConfig"),
- systemconfig.get("TEMPLATES"))
+ #setup_evrouter(systemconfig.get("UseEvrouter"),
+ #systemconfig.get("EvrouterConfig"),
+ #systemconfig.get("TEMPLATES"))
setup_DNSmasq(systemconfig.get("RunDHCP"),
- systemconfig.get("mythip"),
- systemconfig.get("mythgw"),
- systemconfig.get("mythdns"))
+ systemconfig.get("mythip"),
+ systemconfig.get("mythgw"),
+ systemconfig.get("mythdns"))
setup_mythweb(systemconfig.get("UseMythWEB"))
- setup_samba(systemconfig,data_config)
- setup_NFSshares(systemconfig.get("UseNFS"),
- systemconfig.get("TEMPLATES")+"/exports.template")
setup_dyndns(systemconfig.get("DDnsEnable"))
logging.info("__End of advanced configuration\n")