summaryrefslogtreecommitdiffstats
path: root/abs/core-testing
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core-testing')
-rwxr-xr-xabs/core-testing/LinHES-config/PKGBUILD10
-rwxr-xr-xabs/core-testing/LinHES-config/mv_common.py10
-rwxr-xr-xabs/core-testing/LinHES-config/mv_install.py7
-rwxr-xr-xabs/core-testing/LinHES-config/myth_user_call.py159
-rwxr-xr-xabs/core-testing/LinHES-config/timezip.py3
-rw-r--r--abs/core-testing/udev/PKGBUILD4
6 files changed, 185 insertions, 8 deletions
diff --git a/abs/core-testing/LinHES-config/PKGBUILD b/abs/core-testing/LinHES-config/PKGBUILD
index 9d3a5d1..37beb99 100755
--- a/abs/core-testing/LinHES-config/PKGBUILD
+++ b/abs/core-testing/LinHES-config/PKGBUILD
@@ -1,13 +1,12 @@
pkgname=LinHES-config
pkgver=2.0
-pkgrel=32
+pkgrel=43
conflicts=(MythVantage-config MythVantage-config-dev LinHES-config-dev )
pkgdesc="Install and configure your system"
-depends=(linhes-timezone bc libstatgrab mysql-python expect curl dnsutils parted sg3_utils nmbscan system-templates rsync python-parted ddcxinfo)
+depends=(bc libstatgrab mysql-python expect curl dnsutils parted sg3_utils nmbscan system-templates rsync python-parted ddcxinfo python-pexpect)
arch=('i686')
-source=(mv_install.py mv_config.py mythinstall.bin myth_user_call file_time_offset.py install-ui.xml 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_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)
-
+source=(mv_install.py mv_config.py mythinstall.bin myth_user_call file_time_offset.py install-ui.xml 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_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)
install=LinHES.install
build() {
mkdir -p $startdir/pkg/etc
@@ -20,7 +19,8 @@ build() {
mkdir -p $MVDIR/etc
#copy in all the installer specific stuff
- install -m0700 myth_user_call $MVDIR/bin/myth_user_call
+# install -m0700 myth_user_call $MVDIR/bin/myth_user_call
+ install -m0700 myth_user_call.py $MVDIR/bin/myth_user_call
install -m 0755 install_proxy.sh $MVDIR/bin/install_proxy.sh
install -m 0755 install_functions.sh $MVDIR/bin/install_functions.sh
install -m 0755 systemconfig.sh $MVDIR/bin/systemconfig.sh
diff --git a/abs/core-testing/LinHES-config/mv_common.py b/abs/core-testing/LinHES-config/mv_common.py
index da3e25f..f18e02b 100755
--- a/abs/core-testing/LinHES-config/mv_common.py
+++ b/abs/core-testing/LinHES-config/mv_common.py
@@ -14,6 +14,16 @@ def runcmd(cmd):
logging.debug(" %s",cmdout)
return cmdout[0]
+def runcmd_output(cmd):
+ if data_config.NOOPDEBUG=="FALSE":
+ pass
+ else:
+ cmd = "echo "+cmd
+ logging.debug(" %s",cmd)
+ cmdout = commands.getstatusoutput(cmd)
+ logging.debug(" %s",cmdout)
+ return cmdout[1]
+
def services(systemconfig):
logging.debug("______Start of services______")
logging.debug("__End services")
diff --git a/abs/core-testing/LinHES-config/mv_install.py b/abs/core-testing/LinHES-config/mv_install.py
index e96dd56..9d2e284 100755
--- a/abs/core-testing/LinHES-config/mv_install.py
+++ b/abs/core-testing/LinHES-config/mv_install.py
@@ -204,13 +204,18 @@ def mount_bind_chroot():
logging.debug("Mounting dev/proc/sysfs for chroot")
cmd = " mount --bind /dev %s" %data_config.MOUNTPOINT+"/dev"
runcmd(cmd)
+ cmd = " mount --bind /dev/pts %s" %data_config.MOUNTPOINT+"/dev/pts"
+ runcmd(cmd)
cmd = " mount --bind /proc %s" %data_config.MOUNTPOINT+"/proc"
runcmd(cmd)
cmd = " mount -t sysfs none %s" %data_config.MOUNTPOINT+"/sys"
runcmd(cmd)
+
def umount_bind_chroot():
logging.debug("UnMounting dev/proc/sysfs for chroot")
+ cmd = " umount -l %s" %data_config.MOUNTPOINT+"/dev/pts"
+ runcmd(cmd)
cmd = " umount -l %s" %data_config.MOUNTPOINT+"/dev"
runcmd(cmd)
cmd = " umount -l %s" %data_config.MOUNTPOINT+"/proc"
@@ -936,7 +941,9 @@ def full_install(hostoptions):
#cp_and_log2(MVROOT+"/bin/", data_config.MOUNTPOINT+MVROOT+"/bin/", "*.sh")
#cp_and_log2(MVROOT+"/bin/", data_config.MOUNTPOINT+MVROOT+"/bin/", "*.py")
#fix_permissions()
+ mount_bind_chroot()
apply_new_auth()
+ umount_bind_chroot()
if ( systemconfig["SystemType"] == "Master_backend" or systemconfig["SystemType"] == "Standalone" ):
# This install will need a DB, so install it
logging.info("______Installing Database in CHROOT________")
diff --git a/abs/core-testing/LinHES-config/myth_user_call.py b/abs/core-testing/LinHES-config/myth_user_call.py
new file mode 100755
index 0000000..63915a4
--- /dev/null
+++ b/abs/core-testing/LinHES-config/myth_user_call.py
@@ -0,0 +1,159 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#Wrapper script to manage USERNAME accounts + web security
+# myth_USERNAME_all -c add -u USERNAME
+# myth_USERNAME_all -c delete -u USERNAME
+# myth_USERNAME_all -c pass -u USERNAME -p pass
+# myth_USERNAME_all -c web -u USERNAME -p pass
+
+import pexpect, sys, time
+import os, re, getopt
+import mv_common
+
+
+
+
+def chroot_check():
+ if not INIT_CHECK :
+ return False
+ cmd = '''ps -p 1 -o comm='''
+ init = mv_common.runcmd_output(cmd).strip()
+ if init == "runit":
+ return False
+ else:
+ return True
+
+
+def store_commands(full_call):
+ file_name = "/root/myth_user_call.out"
+ try:
+ f = open(file_name,'a')
+ except:
+ print "%s could not be opened" % file_name
+ sys.exit(1)
+ f.write(full_call)
+ f.write("\n")
+ f.close()
+ try:
+ os.chmod(600,file_name)
+ except:
+ pass
+
+
+def add_user(username,full_call):
+ if chroot_check() :
+ print "calling myth_call_user in chroot to add user"
+ store_commands(full_call)
+ else:
+ print "Adding user %s" %username
+ cmd = '''useradd -m -s /bin/bash %s -G audio,video,optical,storage,users''' %username
+ mv_common.runcmd(cmd)
+ cmd = ''' usermod -a -G mythtv %s ''' %username
+
+
+def del_user(username,full_call):
+ if chroot_check() :
+ print "calling myth_call_user in chroot to del user"
+ store_commands(full_call)
+ else:
+ print "Removing user %s" %username
+ cmd = '''userdel %s ''' %username
+ mv_common.runcmd(cmd)
+
+
+def pass_change(username,password,full_call) :
+ if chroot_check() :
+ print "calling myth_call_user in chroot to change password"
+ store_commands(full_call)
+ else:
+ print "changing password for %s" %username
+ passwd = pexpect.spawn("/usr/bin/passwd %s" % username)
+
+ for repeat in (1, 2):
+ passwd.expect("password: ")
+ passwd.sendline(password)
+ time.sleep(0.1)
+
+def web_security(username,password) :
+ file_name = "/etc/lighttpd/lighttpd.user"
+ file_contents = ''
+ if os.path.exists(file_name):
+ try:
+ f = open(file_name,'r')
+ file_contents = f.readlines()
+ except:
+ print " couldn't read %s" % file_name
+ try:
+ f = open(file_name,'w')
+ except:
+ print "%s could not be opened for writing" % file_name
+ return
+
+ for line in file_contents:
+ if not re.search(username, line):
+ f.write(line)
+ line = "%s:%s" %(username, password)
+ f.write(line)
+ f.write("\n")
+ f.close()
+
+
+def usage ():
+ print "Valid options are:"
+ print " -c (add|delete|pass|web)"
+ print " -u USERNAME"
+ print " -p password"
+ sys.exit(0)
+
+def main(argv):
+ global INIT_CHECK
+ full_call = ""
+ INIT_CHECK = True
+ try:
+ opts, args = getopt.getopt(argv, 'c:u:p:ih' )
+ except getopt.GetoptError, why:
+ print why
+ usage()
+ print "exception happened"
+ sys.exit(2)
+
+ for opt, arg in opts:
+ if opt in ("-h", "--help"):
+ usage()
+ sys.exit(0)
+ elif opt in ("-c") :
+ module = arg
+ full_call += ''' -c %s ''' %re.escape(arg)
+ elif opt in ("-u") :
+ username = arg
+ full_call += ''' -u %s ''' %re.escape(arg)
+ elif opt in ("-p") :
+ password = arg
+ full_call += ''' -p %s ''' %re.escape(arg)
+ elif opt in ("-i") :
+ INIT_CHECK = False
+ full_call += ''' -i '''
+ try:
+ username
+ except:
+ usage()
+
+ if module == "add":
+ add_user(username,full_call)
+ elif module == "delete":
+ del_user(username,full_call)
+ elif module == "pass":
+ try:
+ password
+ except:
+ print "needs a password"
+ usage()
+ pass_change(username,password,full_call)
+ elif module == "web":
+ web_security(username,password)
+ else:
+ usage()
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
+
diff --git a/abs/core-testing/LinHES-config/timezip.py b/abs/core-testing/LinHES-config/timezip.py
index 31acd67..bf6b389 100755
--- a/abs/core-testing/LinHES-config/timezip.py
+++ b/abs/core-testing/LinHES-config/timezip.py
@@ -1,4 +1,5 @@
#!/usr/bin/python
+# -*- coding: utf-8 -*-
# import MySQL module
#used to import the zipcode/timezone/nfs info fromMBE
import MySQLdb
@@ -90,7 +91,7 @@ def selectvars():
try:
tz_region=result[0]
except TypeError:
- tz=""
+ tz_region=""
tempsubregion="HostTimeZoneRegion_" + tz_region
cursor.execute("select data from settings where value=%s and hostname=(%s)",(tempsubregion,BEhostname))
diff --git a/abs/core-testing/udev/PKGBUILD b/abs/core-testing/udev/PKGBUILD
index 18b1763..cd1a312 100644
--- a/abs/core-testing/udev/PKGBUILD
+++ b/abs/core-testing/udev/PKGBUILD
@@ -4,7 +4,7 @@
# Maintainer: Thomas Bächler <thomas@archlinux.org>
pkgname=udev
pkgver=135
-pkgrel=4
+pkgrel=5
pkgdesc="The userspace dev tools (udev)"
arch=(i686 x86_64)
url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
@@ -48,7 +48,7 @@ build() {
# Non-stock rules still go in /etc
install -D -m644 $srcdir/81-arch.rules $pkgdir/etc/udev/rules.d/81-arch.rules
- install -D -m644 $srcdir/usb-storage.rules $pkgdir/etc/udev/rules.d/usb-storage.rules
+# install -D -m644 $srcdir/usb-storage.rules $pkgdir/etc/udev/rules.d/usb-storage.rules
# install our module loading subsystem
install -D -m755 $srcdir/load-modules.sh $pkgdir/lib/udev/load-modules.sh