diff options
author | Greg Frost <gregfrost1@bigpond.com> | 2010-04-18 05:55:06 (GMT) |
---|---|---|
committer | Greg Frost <gregfrost1@bigpond.com> | 2010-04-18 05:55:06 (GMT) |
commit | d4589eee8998a168eaa79af7a04d82faac1a738d (patch) | |
tree | 731625204f3902bb9b5f7a8a492c6b8fcc09c915 /abs/core-testing/LinHES-config | |
parent | 5106977528d3d26919263bf62d504035a7720633 (diff) | |
parent | 787f13cd63c75c9c5090c10c0e888f48a59c0e49 (diff) | |
download | linhes_pkgbuild-d4589eee8998a168eaa79af7a04d82faac1a738d.zip linhes_pkgbuild-d4589eee8998a168eaa79af7a04d82faac1a738d.tar.gz linhes_pkgbuild-d4589eee8998a168eaa79af7a04d82faac1a738d.tar.bz2 |
Merge branch 'master' of ssh://gregfrost@knoppmyth.net/mount/repository/LinHES-PKGBUILD
Diffstat (limited to 'abs/core-testing/LinHES-config')
-rw-r--r-- | abs/core-testing/LinHES-config/LinHES-release | 2 | ||||
-rw-r--r-- | abs/core-testing/LinHES-config/PKGBUILD | 137 | ||||
-rwxr-xr-x | abs/core-testing/LinHES-config/mv_advanced.py | 3 | ||||
-rwxr-xr-x | abs/core-testing/LinHES-config/mv_common.py | 25 | ||||
-rwxr-xr-x | abs/core-testing/LinHES-config/mv_ddns.py | 5 | ||||
-rwxr-xr-x | abs/core-testing/LinHES-config/mv_hostype.py | 5 | ||||
-rwxr-xr-x | abs/core-testing/LinHES-config/mv_ir.py | 21 | ||||
-rwxr-xr-x | abs/core-testing/LinHES-config/mv_network.py | 11 | ||||
-rwxr-xr-x | abs/core-testing/LinHES-config/mv_screensaver.py | 3 | ||||
-rwxr-xr-x | abs/core-testing/LinHES-config/mv_smolt.py | 3 | ||||
-rwxr-xr-x | abs/core-testing/LinHES-config/mv_software.py | 4 | ||||
-rwxr-xr-x | abs/core-testing/LinHES-config/mv_webuser.py | 4 | ||||
-rw-r--r-- | abs/core-testing/LinHES-config/mythvantage.cfg | 21 | ||||
-rwxr-xr-x | abs/core-testing/LinHES-config/restore_default_settings.sh | 160 | ||||
-rwxr-xr-x | abs/core-testing/LinHES-config/systemconfig.py | 45 |
15 files changed, 300 insertions, 149 deletions
diff --git a/abs/core-testing/LinHES-config/LinHES-release b/abs/core-testing/LinHES-config/LinHES-release index 79e2144..4f1b8f1 100644 --- a/abs/core-testing/LinHES-config/LinHES-release +++ b/abs/core-testing/LinHES-config/LinHES-release @@ -1 +1 @@ -LinHES R6.02.01 (hot nanners) +LinHES R6.02.02 (hot nanners) diff --git a/abs/core-testing/LinHES-config/PKGBUILD b/abs/core-testing/LinHES-config/PKGBUILD index 60c6b07..61a9148 100644 --- a/abs/core-testing/LinHES-config/PKGBUILD +++ b/abs/core-testing/LinHES-config/PKGBUILD @@ -1,49 +1,51 @@ pkgname=LinHES-config pkgver=2.1 -pkgrel=27 +pkgrel=37 conflicts=(MythVantage-config MythVantage-config-dev LinHES-config-dev LinHes-config ) pkgdesc="Install and configure your system" -depends=('bc' 'libstatgrab' 'mysql-python' 'expect' 'curl' 'dnsutils' 'parted' - 'sg3_utils' 'nmbscan' 'system-templates' 'rsync' 'python-parted' - 'ddcxinfo' 'python-pexpect' 'python-netifaces' 'LinHES-timezone' +depends=('bc' 'libstatgrab' 'mysql-python' 'expect' 'curl' 'dnsutils' 'parted' + 'sg3_utils' 'nmbscan' 'system-templates' 'rsync' 'python-parted' + 'ddcxinfo' 'python-pexpect' 'python-netifaces' 'LinHES-timezone' 'python-iplib' 'mythinstall>=2-10') arch=('i686') -source=(mv_install.py - mv_config.py - myth_user_call - file_time_offset.py - install_proxy.sh - install_functions.sh - systemconfig.sh - install_db_chroot.sh - restore_default_settings.sh - xconfig.sh - timezip.py - soundconfig.sh - LinHES-release - issue - MythVantage.sh - create_master.sh - build_diskless.sh - networkconfig.sh - autocard.py - restore_km_db_chroot.sh - README - mv_advanced.py - mv_common.py - mv_ddns.py - mv_ir.py - mv_misc.py - mv_network.py - mv_screensaver.py - mv_smolt.py - mv_software.py - mv_webuser.py - mv_hostype.py - systemconfig.py - myth_user_call.py) +source=(mv_install.py + mv_config.py + myth_user_call + file_time_offset.py + install_proxy.sh + install_functions.sh + systemconfig.sh + install_db_chroot.sh + restore_default_settings.sh + xconfig.sh + timezip.py + soundconfig.sh + LinHES-release + issue + MythVantage.sh + create_master.sh + build_diskless.sh + networkconfig.sh + autocard.py + restore_km_db_chroot.sh + README + mv_advanced.py + mv_common.py + mv_ddns.py + mv_ir.py + mv_misc.py + mv_network.py + mv_screensaver.py + mv_smolt.py + mv_software.py + mv_webuser.py + mv_hostype.py + systemconfig.py + myth_user_call.py + mythvantage.cfg) +backup=(etc/mythvantage.cfg) install=LinHES.install build() { @@ -75,17 +77,18 @@ build() { install -m 0755 mv_config.py $MVDIR/bin/mv_config.py install -m 0755 mv_install.py $MVDIR/bin/mv_install.py install -m 0755 mv_advanced.py $MVDIR/bin/ - install -m 0755 mv_common.py $MVDIR/bin/ - install -m 0755 mv_ddns.py $MVDIR/bin/ - install -m 0755 mv_ir.py $MVDIR/bin/ - install -m 0755 mv_misc.py $MVDIR/bin/ - install -m 0755 mv_network.py $MVDIR/bin/ - install -m 0755 mv_screensaver.py $MVDIR/bin/ - install -m 0755 mv_smolt.py $MVDIR/bin/ - install -m 0755 mv_software.py $MVDIR/bin/ - install -m 0755 mv_webuser.py $MVDIR/bin/ - install -m 0755 mv_hostype.py $MVDIR/bin/ - install -m 0755 systemconfig.py $MVDIR/bin/ + install -m 0755 mv_common.py $MVDIR/bin/ + install -m 0755 mv_ddns.py $MVDIR/bin/ + install -m 0755 mv_ir.py $MVDIR/bin/ + install -m 0755 mv_misc.py $MVDIR/bin/ + install -m 0755 mv_network.py $MVDIR/bin/ + install -m 0755 mv_screensaver.py $MVDIR/bin/ + install -m 0755 mv_smolt.py $MVDIR/bin/ + install -m 0755 mv_software.py $MVDIR/bin/ + install -m 0755 mv_webuser.py $MVDIR/bin/ + install -m 0755 mv_hostype.py $MVDIR/bin/ + install -m 0755 systemconfig.py $MVDIR/bin/ + install -m 0755 mythvantage.cfg $startdir/pkg/etc/ #README file displayed on install install -m 0755 README $MVDIR/README @@ -98,3 +101,39 @@ build() { install -m 0755 issue $startdir/pkg/etc/issue } + +md5sums=('297441b8d85820698c19e7c0ad5a3dfe' + '1a4694fcd694b362c339bda781ed0f3e' + 'e36da536dd651ef182e7642337889e77' + '3baa23764e1b6bcb2d66d7d859096940' + 'd7a8cd4a0060399ae22e69f74e04eb07' + '7a45287a07145fde5aa664583d4f6fba' + 'f88d2fb88339a4bf8ec9217a3fbcdef7' + '8ac1cfd2eca0f641737da0d0aca416a7' + '9ae8d79f620c6d19973c55c32a921874' + '4620f6f498ef4523398635cb0bd59425' + '06188493e5ed79cb501d3c5694dee8ca' + 'e459ed069317bccb20351f037a9df3d2' + '5115da23daa4d57c2fce89b36e08bd3a' + '6aff504ed5e860adc1b7317cd0780900' + '55fccb1da0417a896b724f7cfc32dd5a' + 'ab2aa42c2947148c2b1cac0ade6d1d55' + 'd429b59d3cfb37b0624c6a4a71a7c2c0' + 'a225143e3df6f56d451c2875e54ddbae' + '687555968d4ca688d8f95c8f13e1d8d4' + '3d1e4a119f38cff0498bf8a67e94e4b3' + '37401edf67296d3a4467ad178958d177' + 'ee7c8e1f025ce1527ecfffabafb26806' + '41b03fb1e0a9d9ae7588e3b813212772' + 'a9ffe72c3ede99d505fdc97572a7c256' + 'df43bce1712320508d4eef8449c5d223' + '65d93f15ac85adf8299552581789a731' + '4badc3c664c55f87396a473e6c14d4bc' + 'e2aa772fe0bf366e26eaaf663f9257bd' + 'fe5e31b833cc6707209e9d656b6eb53c' + 'd328d63eaa4252f3d4888476c79bbff6' + '23d0e12b7ca1cc6ea6b993c1d7ff20b9' + '857a831e8627727306208f0e776b1b98' + 'cf35353141b70145f3ee8b0bd852c9f1' + 'cf60e7ba4cf3467bb5539d5c51da61b6' + 'a63ff9ef5250965aeabc74bfa8e43981') diff --git a/abs/core-testing/LinHES-config/mv_advanced.py b/abs/core-testing/LinHES-config/mv_advanced.py index d07b7cb..bc0d19e 100755 --- a/abs/core-testing/LinHES-config/mv_advanced.py +++ b/abs/core-testing/LinHES-config/mv_advanced.py @@ -349,6 +349,9 @@ def setup_dyndns(DDnsEnable): def setup_advanced(systemconfig,data_config): + if mv_common.read_config(mv_common.module_config,"advanced") == False : + logging.info("____Skipping of Advanced, config disabled____") + return logging.info("____Start of advanced configuration____") create_link = False if systemconfig["SystemType"] == "Master_backend": diff --git a/abs/core-testing/LinHES-config/mv_common.py b/abs/core-testing/LinHES-config/mv_common.py index 28b53d7..0272809 100755 --- a/abs/core-testing/LinHES-config/mv_common.py +++ b/abs/core-testing/LinHES-config/mv_common.py @@ -1,9 +1,34 @@ # -*- coding: utf-8 -*- import logging, os, time import commands +import ConfigParser config_file = "mv_config" data_config = __import__(config_file, globals(), locals(), []) +module_config = ConfigParser.RawConfigParser() +try: + module_config.read('/etc/mythvantage.cfg') +except: + logging.info("couldn't read mythvantage.cfg") + + +def read_config(module_config,data): + rvalue = True + section = "mythvantage" + try: + rvalue = module_config.get(section, data) + if rvalue == "False": + rvalue = False + if rvalue == "no": + rvalue = False + + + except: + logging.debug("Couldn't read mythvantage.cfg") + rvalue = True + + return rvalue + def runcmd(cmd): if data_config.NOOPDEBUG=="FALSE": pass diff --git a/abs/core-testing/LinHES-config/mv_ddns.py b/abs/core-testing/LinHES-config/mv_ddns.py index 7ac7d3a..9695f76 100755 --- a/abs/core-testing/LinHES-config/mv_ddns.py +++ b/abs/core-testing/LinHES-config/mv_ddns.py @@ -5,12 +5,15 @@ import os, re config_file = "mv_config" def setup_ddns(systemconfig): + if mv_common.read_config(mv_common.module_config,"ddns") == False : + logging.info("____Skipping of DDNS, config disabled____") + return logging.info("____Start of setup_ddns____") if systemconfig["DDnsEnable"] == "1": logging.debug(" Enabling DDNS") mv_common.pacinstall("ddclient") - mv_common.cp_and_log("/etc/ddclient/ddclient.conf.dynamic.dyndns.sample", + mv_common.cp_and_log("/etc/ddclient/ddclient.conf.dynamic.dyndns.sample", "/etc/ddclient/ddclient.conf") cmd = ''' sed -i -e "s/your-dynamic-dyndns-login/%s/g" /etc/ddclient/ddclient.conf''' %(systemconfig["DDnslogin"]) mv_common.runcmd(cmd) diff --git a/abs/core-testing/LinHES-config/mv_hostype.py b/abs/core-testing/LinHES-config/mv_hostype.py index d6ec0ed..4eade73 100755 --- a/abs/core-testing/LinHES-config/mv_hostype.py +++ b/abs/core-testing/LinHES-config/mv_hostype.py @@ -124,6 +124,9 @@ def setup_syslog(dbhost): return def hostypeprint(systemconfig): + if mv_common.read_config(mv_common.module_config,"hostype") == False : + logging.info("____Skipping of hostype, config disabled____") + return logging.info("______Start of hostype config_____") mv_common.services(systemconfig) install_list='' @@ -212,7 +215,7 @@ def hostypeprint(systemconfig): else: logging.debug(" Will NOT run the frontend") mv_common.remove_service("frontend") - mv_common.remove_service("hal") + mv_common.add_service("hal") if data_config.SYSTEMTYPE == "MythVantage": mv_common.remove_service("ghosd") diff --git a/abs/core-testing/LinHES-config/mv_ir.py b/abs/core-testing/LinHES-config/mv_ir.py index bc1ae37..a5e3f3b 100755 --- a/abs/core-testing/LinHES-config/mv_ir.py +++ b/abs/core-testing/LinHES-config/mv_ir.py @@ -113,7 +113,7 @@ def setup_ir_remote(Remotetype,templates): mv_common.add_service("lircd") -def setup_ir_receiver(ReceiverType,TEMPLATES): +def setup_ir_receiver(ReceiverType,TEMPLATES,HDHRlirc_device,myip): logging.info(" Configuring receiver %s", ReceiverType) if ReceiverType == "Serial": scrub_modules("/etc/modules.mythvantage","lirc") @@ -153,6 +153,7 @@ def setup_ir_receiver(ReceiverType,TEMPLATES): mv_common.runcmd(cmd) mv_common.remove_service("igdaemon") mv_common.remove_service("tatir") + elif ReceiverType == "iguanaIR-usb": scrub_modules("/etc/modules.mythvantage","lirc") mv_common.add_service("igdaemon") @@ -162,6 +163,12 @@ def setup_ir_receiver(ReceiverType,TEMPLATES): scrub_modules("/etc/modules.mythvantage","lirc") mv_common.add_service("tatir") mv_common.remove_service("igdaemon") + elif ReceiverType == "SiliconDust_HDHR": + mv_common.remove_service("igdaemon") + mv_common.remove_service("tatir") + cmd = '''hdhomerun_config %s set /ir/target %s:5000 store''' %(HDHRlirc_device,myip) + print cmd + mv_common.runcmd(cmd) else: logging.debug(" didn't match receiver, using genric case") @@ -281,7 +288,11 @@ def setup_lcd(LCDtype, TEMPLATES, Remotetype): logging.debug("__End of setup_lcd") def setup_ir(systemconfig, data_config): - rc = False + rc = [ False , False ] + if mv_common.read_config(mv_common.module_config,"ir") == False : + logging.info("____Skipping of IR, config disabled____") + return rc + logging.info("____Start of IR____") if systemconfig["Remotetype"] == "tinker": logging.info(" Tinker mode detected") @@ -304,9 +315,11 @@ def setup_ir(systemconfig, data_config): if systemconfig["ReceiverType"]: setup_ir_receiver(systemconfig["ReceiverType"], - systemconfig["TEMPLATES"]) + systemconfig["TEMPLATES"], + systemconfig["HDHRlirc_device"], + systemconfig["mythip"]) else: - setup_ir_receiver("unknown", systemconfig["TEMPLATES"]) + setup_ir_receiver("unknown", systemconfig["TEMPLATES"],'','127.0.0.1') unload_all_lirc() setup_blaster_proto(HostBlasterType, Hostnumblaster, diff --git a/abs/core-testing/LinHES-config/mv_network.py b/abs/core-testing/LinHES-config/mv_network.py index b80e4cc..f256785 100755 --- a/abs/core-testing/LinHES-config/mv_network.py +++ b/abs/core-testing/LinHES-config/mv_network.py @@ -50,7 +50,7 @@ def get_ip(ifname): )[20:24]) def get_default_route(iface): - rcroute = "127.0.0.1" + rcroute = "127.0.0.1" f = open ('/proc/net/route', 'r') for line in f: words = string.split (line) @@ -107,7 +107,7 @@ def setup_MTYH_DNS(): for line in f: if line.startswith("nameserver"): print line - returndns = line.split()[1] + returndns = line.split()[1] break except: logging.debug(" Couldn't open /etc/resolv.conf for myth_dns") @@ -158,7 +158,7 @@ def setup_hostname(systemconfig): except: logging.critical(" *Hostname could not be set") logging.info(" Using default value of me") - hostname = "me" + hostname = "diamonds" logging.info(" Setting the hostname to %s", hostname) cmd = ''' echo %s > /etc/hostname ''' %hostname mv_common.runcmd(cmd) @@ -168,7 +168,7 @@ def setup_hostname(systemconfig): logging.debug(" not using dhcp") cmd = ''' echo 127.0.0.1 localhost > /etc/hosts ''' mv_common.runcmd(cmd) - cmd = ''' echo %s %s > /etc/hosts ''' %(systemconfig["mythip"], systemconfig["hostname"]) + cmd = ''' echo %s %s >> /etc/hosts ''' %(systemconfig["mythip"], systemconfig["hostname"]) mv_common.runcmd(cmd) else: cmd = ''' echo 127.0.0.1 %s localhost > /etc/hosts ''' %systemconfig["hostname"] @@ -482,6 +482,9 @@ def hostname_change_check(systemconfig): def setup_network (systemconfig,this_is_install): + if mv_common.read_config(mv_common.module_config,"network") == False : + logging.info("____Skipping of network, config disabled____") + return False logging.info("____Start of network____") logging.info(" Setting up the network") restartfe = hostname_change_check(systemconfig) diff --git a/abs/core-testing/LinHES-config/mv_screensaver.py b/abs/core-testing/LinHES-config/mv_screensaver.py index 2da970c..4068832 100755 --- a/abs/core-testing/LinHES-config/mv_screensaver.py +++ b/abs/core-testing/LinHES-config/mv_screensaver.py @@ -163,6 +163,9 @@ def setup_gnome_screensaver(theme,idletime): def setup_screensaver (systemconfig,data_config): + if mv_common.read_config(mv_common.module_config,"screensaver") == False : + logging.info("____Skipping of Screensaver, config disabled____") + return logging.info("____Start of screensaver configuration____") screensavertype = systemconfig["Screensavertype"] theme = systemconfig["Screensavertheme"] diff --git a/abs/core-testing/LinHES-config/mv_smolt.py b/abs/core-testing/LinHES-config/mv_smolt.py index 5fd3722..cfc697e 100755 --- a/abs/core-testing/LinHES-config/mv_smolt.py +++ b/abs/core-testing/LinHES-config/mv_smolt.py @@ -20,6 +20,9 @@ def read_release(stype): def setup_smolt_type(SystemType,Remotetype,RunFrontend,mythhome,stype): + if mv_common.read_config(mv_common.module_config,"smolt") == False : + logging.info("____Skipping of smolt, config disabled____") + return logging.debug("____Start of setup_smolt_type____") releasename = read_release(stype) diff --git a/abs/core-testing/LinHES-config/mv_software.py b/abs/core-testing/LinHES-config/mv_software.py index 4ee2e4d..c0f5a5b 100755 --- a/abs/core-testing/LinHES-config/mv_software.py +++ b/abs/core-testing/LinHES-config/mv_software.py @@ -3,6 +3,10 @@ import logging, mv_common import os, re def setup_software(systemconfig, data_config): + if mv_common.read_config(mv_common.module_config,"software") == False : + logging.info("____Skipping of software, config disabled____") + return + logging.info("____Start of Software install____") postfix='' if data_config.SYSTEMTYPE == "MythVantage": diff --git a/abs/core-testing/LinHES-config/mv_webuser.py b/abs/core-testing/LinHES-config/mv_webuser.py index a8517a8..3e383f2 100755 --- a/abs/core-testing/LinHES-config/mv_webuser.py +++ b/abs/core-testing/LinHES-config/mv_webuser.py @@ -3,6 +3,10 @@ import logging, mv_common #import os def setup_web_auth(UseMythWEB_auth): + if mv_common.read_config(mv_common.module_config,"webuser") == False : + logging.info("____Skipping of webuser, config disabled____") + return + logging.info("____Start of setup_web_auth____") if UseMythWEB_auth == str(1): #enable auth diff --git a/abs/core-testing/LinHES-config/mythvantage.cfg b/abs/core-testing/LinHES-config/mythvantage.cfg new file mode 100644 index 0000000..eaa4865 --- /dev/null +++ b/abs/core-testing/LinHES-config/mythvantage.cfg @@ -0,0 +1,21 @@ +[mythvantage] +#change any of the following to False or True +# True will allow systemconfig to run that module +# False will skip the module +misc = True +sleep = True +hostype = True +advanced = True +audio = True +network = True +xorg = True +webuser = True +restartfe = True +reloadfe = True +ddns = True +screensaver = True +ir = True +user = True +software = True +smolt = True + diff --git a/abs/core-testing/LinHES-config/restore_default_settings.sh b/abs/core-testing/LinHES-config/restore_default_settings.sh index dcf5e23..ffd4b0d 100755 --- a/abs/core-testing/LinHES-config/restore_default_settings.sh +++ b/abs/core-testing/LinHES-config/restore_default_settings.sh @@ -5,7 +5,7 @@ shopt -s -o nounset echo $@ >> /tmp/restore.out #TEMPLATES="/usr/share/templates/settings" TEMPLATES="$TEMPLATES/settings" -TABLES="settings keybindings" +TABLES="settings keybindings jumppoints" MYTHDBUSER=mythtv MYTHTVPASSWD=mythtv declare -r OPTSTRING="c:e:t:d:h:s:a:z:Ho" @@ -15,12 +15,12 @@ declare -i EVERYTHING=0 function CMD_DEFINE () { - #add override check + #add override check if [ x$Thistemplate = xsyssettings -a $OVERRIDE -eq 1 ] then - MYSQLCMD="mysql --local-infile -s -u$MYTHDBUSER -p$MYTHTVPASSWD -h$ovdbhost mythconverg -B --exec" - MYSQLCMD_C="mysql -u$MYTHDBUSER -p$MYTHTVPASSWD -h$ovdbhost mythconverg -B --exec" - MYSQLCMD_UPDATE_HOST="UPDATE settings set data='$oldhostname' where value='HostMyhostname' and hostname=\"$hostname\";" + MYSQLCMD="mysql --local-infile -s -u$MYTHDBUSER -p$MYTHTVPASSWD -h$ovdbhost mythconverg -B --exec" + MYSQLCMD_C="mysql -u$MYTHDBUSER -p$MYTHTVPASSWD -h$ovdbhost mythconverg -B --exec" + MYSQLCMD_UPDATE_HOST="UPDATE settings set data='$oldhostname' where value='HostMyhostname' and hostname=\"$hostname\";" else MYSQLCMD="mysql --local-infile -s -u$MYTHDBUSER -p$MYTHTVPASSWD -h$dbhost mythconverg -B --exec" MYSQLCMD_C="mysql -u$MYTHDBUSER -p$MYTHTVPASSWD -h$dbhost mythconverg -B --exec" @@ -32,21 +32,21 @@ function SQL_DEFINE () { thostname=`echo ${hostname}|tr -C [:alpha:] _` echo "Using $thostname for temp table postfix" - #$1 is the table name - if [ $1 = "settings" ] - then - ALTERSQL="Alter table temp_${1}_${thostname} add unique ( value )" - else - ALTERSQL=";" - fi + #$1 is the table name + if [ $1 = "settings" ] + then + ALTERSQL="Alter table temp_${1}_${thostname} add unique ( value )" + else + ALTERSQL=";" + fi CREATESQL="create table temp_${1}_${thostname} like $1;" - COPY_TMP_SQL="replace into temp_${1}_${thostname} (select * from $1 where hostname=\"$hostname\");" - INSERTSQL="LOAD DATA local INFILE '/tmp/$1.txt' REPLACE INTO TABLE temp_${1}_${thostname} FIELDS TERMINATED BY '\t';" + COPY_TMP_SQL="replace into temp_${1}_${thostname} (select * from $1 where hostname=\"$hostname\");" + INSERTSQL="LOAD DATA local INFILE '/tmp/$1.txt' REPLACE INTO TABLE temp_${1}_${thostname} FIELDS TERMINATED BY '\t';" #INSERTSQL="LOAD DATA local INFILE '$TEMPLATES/$Thistemplate/$1.txt' REPLACE INTO TABLE temp_${1}_${hostname} FIELDS TERMINATED BY '\t';" - DROPSQL="delete from $1 where hostname=\"$hostname\";" - COPY_BCK_SQL="replace into $1 (select * from temp_${1}_${thostname} where hostname=\"$hostname\");" - DROP_TABLE="Drop table temp_${1}_${thostname}" + DROPSQL="delete from $1 where hostname=\"$hostname\";" + COPY_BCK_SQL="replace into $1 (select * from temp_${1}_${thostname} where hostname=\"$hostname\");" + DROP_TABLE="Drop table temp_${1}_${thostname}" } function ARG_ERR() { @@ -101,8 +101,8 @@ do ARG_ERR Thistemplate=$OPTARG - if [ x$Thistemplate = x"syssettings" ] - then + if [ x$Thistemplate = x"syssettings" ] + then echo "template is syssettings" loadhost=false elif [ x$Thistemplate = x"hostsettings" ] @@ -128,13 +128,13 @@ do ARG_ERR if [ $OVERRIDE = 1 ] then - oldhostname=$hostname + oldhostname=$hostname hostname=$OPTARG else hostname=$OPTARG - fi + fi - ;; + ;; s) echo "$SWITCH" "$OPTARG" ARG_ERR SYSTEMTYPE=$OPTARG @@ -144,11 +144,11 @@ do IP_ADDRESS=$OPTARG ;; z) echo "$SWITCH" "$OPTARG" - ARG_ERR - ZIPCODE=$OPTARG + ARG_ERR + ZIPCODE=$OPTARG ;; - o) OVERRIDE=1 - ;; + o) OVERRIDE=1 + ;; esac done @@ -175,10 +175,10 @@ fi case $OPERATION in - restore) - #used to restore settings from syssettings - if [ -d $TEMPLATES/$Thistemplate ] - then + restore) + #used to restore settings from syssettings + if [ -d $TEMPLATES/$Thistemplate ] + then cd $TEMPLATES/$Thistemplate if [ $loadhost = false ] then @@ -213,38 +213,42 @@ case $OPERATION in $MYSQLCMD "$COPY_BCK_SQL" $MYSQLCMD "$DROP_TABLE " fi - else - echo "couldn't find $TEMPLATES/$Thistemplate" - fi - ;; + else + echo "couldn't find $TEMPLATES/$Thistemplate" + fi + ;; - save) + save) + if [ ! -d $TEMPLATES/$Thistemplate ] + then + mkdir -p $TEMPLATES/$Thistemplate + fi - if [ ! -d $TEMPLATES/$Thistemplate ] - then - mkdir -p $TEMPLATES/$Thistemplate - fi + cd $TEMPLATES/$Thistemplate + for i in $TABLES + do + EXTRACLAUSE="" + case $i in + settings) + EXTRACLAUSE="and not (value like \"BackendServerIP\") and not (value like \"locale\") order by value" + SQL="select value,data,'REPLACEME' as hostname from $i where hostname=\"$hostname\" "$EXTRACLAUSE" ;" + # SQL="select * from $i where hostname=\"$hostname\" "$EXTRACLAUSE" ;" + $MYSQLCMD_C "$SQL" > $TEMPLATES/$Thistemplate/$i.txt + ;; + keybindings) + SQL="select context,action,description,keylist,'REPLACEME' as hostname from $i where hostname=\"$hostname\" "$EXTRACLAUSE" ;" + $MYSQLCMD_C "$SQL" > $TEMPLATES/$Thistemplate/$i.txt + ;; + jumppoints) + SQL="select destination,description,keylist,'REPLACEME' as hostname from $i where hostname=\"$hostname\" "$EXTRACLAUSE" ;" + $MYSQLCMD_C "$SQL" > $TEMPLATES/$Thistemplate/$i.txt - cd $TEMPLATES/$Thistemplate - for i in $TABLES - do - EXTRACLAUSE="" - case $i in - settings) - EXTRACLAUSE="and not (value like \"BackendServerIP\") and not (value like \"locale\") order by value" - SQL="select value,data,'REPLACEME' as hostname from $i where hostname=\"$hostname\" "$EXTRACLAUSE" ;" - # SQL="select * from $i where hostname=\"$hostname\" "$EXTRACLAUSE" ;" - $MYSQLCMD_C "$SQL" > $TEMPLATES/$Thistemplate/$i.txt - ;; - keybindings) - SQL="select context,action,description,keylist,'REPLACEME' as hostname from $i where hostname=\"$hostname\" "$EXTRACLAUSE" ;" - $MYSQLCMD_C "$SQL" > $TEMPLATES/$Thistemplate/$i.txt - ;; - esac - # sed -e "s/$hostname/REPLACEME/g" $i > $i.txt && rm $i + ;; + esac + # sed -e "s/$hostname/REPLACEME/g" $i > $i.txt && rm $i - done - ;; + done + ;; load) @@ -253,22 +257,22 @@ case $OPERATION in do if [ -f $TEMPLATES/$i/settings.txt ] then - echo $i - for tablename in $TABLES + echo $i + for tablename in $TABLES do - #create table + #create table CREATESQL="create table IF NOT EXISTS ${tablename}_${i} like $tablename;" $MYSQLCMD_C "$CREATESQL" - #truncate table + #truncate table TRUNCATESQL="truncate ${tablename}_${i} " $MYSQLCMD_C "$TRUNCATESQL" - #load table - INSERTSQL="LOAD DATA local INFILE '$TEMPLATES/$i/$tablename.txt' REPLACE INTO TABLE ${tablename}_${i} FIELDS TERMINATED BY '\t';" + #load table + INSERTSQL="LOAD DATA local INFILE '$TEMPLATES/$i/$tablename.txt' REPLACE INTO TABLE ${tablename}_${i} FIELDS TERMINATED BY '\t';" $MYSQLCMD_C "$INSERTSQL" - #update_hostname - UPDATEHOSTNAMESQL="update ${tablename}_${i} set hostname='$i' ; " + #update_hostname + UPDATEHOSTNAMESQL="update ${tablename}_${i} set hostname='$i' ; " $MYSQLCMD_C "$UPDATEHOSTNAMESQL" - done + done else echo "couldn't find $TEMPLATES/$i/settings.txt template to load" @@ -286,6 +290,14 @@ case $OPERATION in $MYSQLCMD_C "$CREATESQL" CREATESQL="create table IF NOT EXISTS keybindings_user3 like keybindings;" $MYSQLCMD_C "$CREATESQL" + + CREATESQL="create table IF NOT EXISTS jumppoints_user1 like jumppoints;" + $MYSQLCMD_C "$CREATESQL" + CREATESQL="create table IF NOT EXISTS jumppoints_user2 like jumppoints;" + $MYSQLCMD_C "$CREATESQL" + CREATESQL="create table IF NOT EXISTS jumppoints_user3 like jumppoints;" + $MYSQLCMD_C "$CREATESQL" + done ;; @@ -302,14 +314,14 @@ case $OPERATION in if [ $SYSTEMTYPE = "slave" ] then $MYSQLCMD_C "delete from settings where value='BackendServerIP' and hostname=\"$hostname\";" - $MYSQLCMD_C "REPLACE INTO settings set data='${IP_ADDRESS}' , value='BackendServerIP' , hostname=\"$hostname\";" + $MYSQLCMD_C "REPLACE INTO settings set data='${IP_ADDRESS}' , value='BackendServerIP' , hostname=\"$hostname\";" fi ;; ZIP) - $MYSQLCMD_C "delete from settings where value='locale' and hostname=\"$hostname\";" - $MYSQLCMD_C "REPLACE INTO settings set data='$ZIPCODE' , value='locale' , hostname=\"$hostname\";" - $MYSQLCMD_C "delete from settings where value='MythMovies.ZipCode' and hostname=\"$hostname\";" - $MYSQLCMD_C "REPLACE INTO settings set data='$ZIPCODE', value='MythMovies.ZipCode' , hostname=\"$hostname\";" + $MYSQLCMD_C "delete from settings where value='locale' and hostname=\"$hostname\";" + $MYSQLCMD_C "REPLACE INTO settings set data='$ZIPCODE' , value='locale' , hostname=\"$hostname\";" + $MYSQLCMD_C "delete from settings where value='MythMovies.ZipCode' and hostname=\"$hostname\";" + $MYSQLCMD_C "REPLACE INTO settings set data='$ZIPCODE', value='MythMovies.ZipCode' , hostname=\"$hostname\";" ;; MUSICFRONT) ALSADEVICE @@ -325,7 +337,7 @@ case $OPERATION in $MYSQLCMD_C "delete from settings where value='MusicAudioDevice' and hostname=\"$hostname\";" $MYSQLCMD_C "REPLACE INTO settings set data='$SoundDevice', value='MusicAudioDevice' , hostname=\"$hostname\";" ;; - uhostname) + uhostname) #used when the hostname is changed. TABLES="settings capturecard keybindings storagegroup recorded" for i in $TABLES @@ -353,7 +365,7 @@ case $OPERATION in SQL="update settings set data='0' where value='Hostaccessuser' and hostname=\"$hostname\" ;" $MYSQLCMD_C "$SQL" ;; - esac + esac #SELECT * INTO OUTFILE 'data.txt' # FIELDS TERMINATED BY ',' diff --git a/abs/core-testing/LinHES-config/systemconfig.py b/abs/core-testing/LinHES-config/systemconfig.py index 28e2e7a..2e07b2f 100755 --- a/abs/core-testing/LinHES-config/systemconfig.py +++ b/abs/core-testing/LinHES-config/systemconfig.py @@ -36,8 +36,11 @@ def usage(): logging.info("tell people how to use this") def setup_x(systemconfig): - cmd = "%s/bin/xconfig.sh" %systemconfig["MVROOT"] - mv_common.runcmd(cmd) + if mv_common.read_config(mv_common.module_config,"xorg") == False : + logging.info("____Skipping of Xorg, config disabled____") + else: + cmd = "%s/bin/xconfig.sh" %systemconfig["MVROOT"] + mv_common.runcmd(cmd) def main(argv): try: @@ -124,23 +127,32 @@ def main(argv): if cmdmodule["audio"] == True: - logging.debug("______Start of Audio Configuration______") - if not systemconfig["Audiotype"] == "tinker": - cmd="%s/bin/soundconfig.sh -t real -i %s -d %s" %(MVROOT,systemconfig["Audiotype"],systemconfig["SoundDevice"]) - mv_common.runcmd(cmd) + if mv_common.read_config(mv_common.module_config,"audio") == False : + logging.info("____Skipping of Audio, config disabled____") else: - logging.debug(" Tinker mode(audio), not changing configuration") - logging.debug("__End of audio") + logging.debug("______Start of Audio Configuration______") + if not systemconfig["Audiotype"] == "tinker": + cmd="%s/bin/soundconfig.sh -t real -i %s -d %s" %(MVROOT,systemconfig["Audiotype"],systemconfig["SoundDevice"]) + mv_common.runcmd(cmd) + else: + logging.debug(" Tinker mode(audio), not changing configuration") + logging.debug("__End of audio") if cmdmodule["misc"]: - import mv_misc - mv_misc.setup_zip(MVROOT,systemconfig["zipcode"]) - mv_misc.setup_tz(systemconfig["timezone"],systemconfig["TEMPLATES"]) - mv_misc.setup_nfs(systemconfig) + if mv_common.read_config(mv_common.module_config,"misc") == False : + logging.info("____Skipping of misc, config disabled____") + else: + import mv_misc + mv_misc.setup_zip(MVROOT,systemconfig["zipcode"]) + mv_misc.setup_tz(systemconfig["timezone"],systemconfig["TEMPLATES"]) + mv_misc.setup_nfs(systemconfig) if cmdmodule["sleep"]: - import mv_misc - mv_misc.setup_sleep(systemconfig) + if mv_common.read_config(mv_common.module_config,"sleep") == False : + logging.info("____Skipping of sleep, config disabled____") + else: + import mv_misc + mv_misc.setup_sleep(systemconfig) if cmdmodule["webuser"]: import mv_webuser @@ -163,7 +175,10 @@ def main(argv): mv_software.setup_software(systemconfig, data_config) if cmdmodule["advancedX"]: - setup_x(systemconfig) + if mv_common.read_config(mv_common.module_config,"xorg") == False : + logging.info("____Skipping of advancedX, config disabled____") + else: + setup_x(systemconfig) if cmdmodule["restartfe"]: mv_common.restartfe(restartlcd) |