From 57db1dd2e66441eb8bdbba2c9aeb5360a3102e51 Mon Sep 17 00:00:00 2001 From: Nathan Harris Date: Mon, 9 Nov 2009 18:45:14 -0500 Subject: v4l-dvb: Updated for new kernel --- abs/core/v4l-dvb/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abs/core/v4l-dvb/PKGBUILD b/abs/core/v4l-dvb/PKGBUILD index 64286d7..90f6034 100644 --- a/abs/core/v4l-dvb/PKGBUILD +++ b/abs/core/v4l-dvb/PKGBUILD @@ -4,7 +4,7 @@ pkgname=v4l-dvb _kernver=2.6.28-LinHES pkgver=1 -pkgrel=12 +pkgrel=13 pkgdesc="V4L-DVB drivers from mercurial" arch=('i686' 'x86_64') license=('GPL2') -- cgit v0.12 From d50b9a8c38d5600187d3d2366a6838e94e3768c1 Mon Sep 17 00:00:00 2001 From: Nathan Harris Date: Mon, 9 Nov 2009 20:44:25 -0500 Subject: xbmc-svn: updated to svn 24428 --- abs/extra-testing/community/xbmc-svn/PKGBUILD | 87 ++++++---------------- .../community/xbmc-svn/libcurl-not-in-lib64.patch | 13 ---- 2 files changed, 24 insertions(+), 76 deletions(-) delete mode 100644 abs/extra-testing/community/xbmc-svn/libcurl-not-in-lib64.patch diff --git a/abs/extra-testing/community/xbmc-svn/PKGBUILD b/abs/extra-testing/community/xbmc-svn/PKGBUILD index 45d6671..b6f15af 100644 --- a/abs/extra-testing/community/xbmc-svn/PKGBUILD +++ b/abs/extra-testing/community/xbmc-svn/PKGBUILD @@ -1,45 +1,41 @@ -# Contributors : Richard Atkinson atkinsonr-at-gmail -# Ralf Barth +# Contributors : Ralf Barth +# Richard Atkinson atkinsonr-at-gmail # # Original credits go to Edgar Hucek # for his xbmc-vdpau-vdr PKGBUILD at https://archvdr.svn.sourceforge.net/svnroot/archvdr/trunk/archvdr/xbmc-vdpau-vdr/PKGBUILD pkgname=xbmc-svn -pkgver=21748 +pkgver=24428 pkgrel=1 -pkgdesc="XBMC Media Center from SVN (linuxport branch)" +pkgdesc="XBMC Media Center from SVN" provides=('xbmc') conflicts=('xbmc' 'xbmc-smoothvideo' 'xbmc-vdpau') arch=('i686' 'x86_64') url="http://xbmc.org" license=('GPL' 'LGPL') depends=('alsa-lib' 'curl' 'enca' 'faac' 'freetype2' 'fribidi' 'gawk' 'glew' - 'hal' 'jasper' 'libgl' 'libjpeg>=6b-5' 'libmad' 'libmysqlclient' + 'hal' 'jasper' 'libgl' 'libmad' 'libmysqlclient' 'libjpeg' 'libxinerama' 'libxrandr' 'lzo2' 'sdl_image' 'sdl_mixer' 'sqlite3' 'tre' 'unzip' 'libcdio' 'libsamplerate' 'python' 'avahi' 'libmad' 'a52dec' 'libdca' 'faad2' 'libmpeg2' 'libvorbis' 'libogg' 'libmms' - 'libmpcdec' 'flac' 'wavpack' 'xorg-utils') + 'libmpcdec' 'flac' 'wavpack' 'xorg-utils' 'smbclient') makedepends=('subversion' 'autoconf' 'automake' 'boost' 'cmake' 'gcc' 'gperf' 'libtool>=2.2.6a-1' 'make' 'nasm' 'patch' 'pkgconfig' 'zip' 'flex' 'bison') optdepends=('lirc: remote controller support' 'pmount: mount removable devices as normal user' - 'smbclient: access windows shares' 'unrar: access compressed files without unpacking them') install=("${pkgname}.install") -source=('libcurl-not-in-lib64.patch' - 'Lircmap.xml') -noextract=('libcurl-not-in-lib64.patch' - 'Lircmap.xml') -md5sums=('c5e808703d0c9e392e1c2837fea1a5ef' - '3f93186f1ea4aad73011d00754c7265a') +source=() +noextract=() +md5sums=() +options=(makeflags) -options=(!makeflags) +_svnmod=XBMC +_prefix=/usr build() { - _svntrunk=http://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/linuxport/XBMC - _svnmod=XBMC - _prefix=/usr + _svntrunk=http://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk cd ${srcdir}/ if [ -d $_svnmod/.svn ]; then @@ -50,65 +46,36 @@ build() { svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod || return 1 fi - # Apply patches - cd "$srcdir/$_svnmod" - - # Arch's libcurl lives in /usr/lib, not /usr/lib64 - fix the path: - msg "Patching with libcurl-not-in-lib64.patch" - patch -p0 < "$srcdir/libcurl-not-in-lib64.patch" || return 1 - - # Goom also needs a fixup due to newer autotools - cd "$srcdir/$_svnmod/xbmc/visualizations/Goom/goom2k4-0" - aclocal - libtoolize --copy --force - ./autogen.sh --enable-static --with-pic - - cd "$srcdir/$_svnmod" - # Configure XBMC # # Note on external-libs: # - We cannot use external python because Arch's python was built with # UCS2 unicode support, whereas xbmc expects UCS4 support - # - We cannot use external ffmpeg as we would loose VDPAU functionality - # because Arch's ffmpeg package does not support VDPAU - # - We don't want to rely on AUR packages, so we also don't use libass - # as long as it's in AUR + # - We cannot use Arch's libass because it's incompatible with XBMC's + # subtitle rendering + # - We cannot use external ffmpeg because we would loose VDPAU functionality + cd "$srcdir/$_svnmod" msg "Configuring XBMC" - make clean + ./bootstrap ./configure --prefix=${_prefix} \ - --enable-external-libmad \ --enable-external-liba52 \ --enable-external-libdts \ - --enable-external-libfaad \ --enable-external-libmpeg2 \ - --enable-external-libvorbis \ --enable-external-libogg \ - --enable-external-libmpcdec \ - --enable-external-libflac \ --enable-external-libwavpack \ --disable-external-libass \ - --disable-external-python \ --disable-external-ffmpeg \ - --disable-pulse \ + --disable-external-python \ --disable-debug || return 1 - # Fix false negative detections of realloc that happens some times - msg "Fixing false negative detections of realloc" - if grep -q 'HAVE_REALLOC 0' config.h; then - sed -e 's|#define HAVE_REALLOC 0|#define HAVE_REALLOC 1|' \ - -e 's|#define realloc rpl_realloc|/* #define realloc rpl_realloc */|' \ - -i config.h || return 1 - fi - - # XBMCTex will segfault on systems with nvidia installed if linked to OpenGL - msg "Fixing XBMCTex on systems using the nvidia driver blob" - sed -e 's/-lGLU -lGLEW -lGL//' \ - -i ${srcdir}/$_svnmod/tools/XBMCTex/Makefile - # Now (finally) build msg "Running make" make || return 1 +} + +package() { + + cd "$srcdir/$_svnmod" msg "Running make install" make prefix=${pkgdir}${_prefix} install || return 1 @@ -122,12 +89,6 @@ build() { install -Dm644 ${srcdir}/$_svnmod/tools/Linux/xbmc.png \ ${pkgdir}${_prefix}/share/pixmaps/xbmc.png || return 1 - install -Dm755 ${srcdir}/$_svnmod/tools/XBMCTex/XBMCTex \ - ${pkgdir}${_prefix}/share/xbmc/tools/xbmctex || return 1 - - # Skins often use build.sh that looks for /usr/bin/XBMCTex - ln -s "${_prefix}/share/xbmc/tools/xbmctex" "$pkgdir/usr/bin/XBMCTex" - install -dm755 ${pkgdir}${_prefix}/share/licenses/${pkgname} for licensef in LICENSE.GPL README.linux copying.txt; do mv ${pkgdir}${_prefix}/share/xbmc/${licensef} \ diff --git a/abs/extra-testing/community/xbmc-svn/libcurl-not-in-lib64.patch b/abs/extra-testing/community/xbmc-svn/libcurl-not-in-lib64.patch deleted file mode 100644 index 0bfbc4c..0000000 --- a/abs/extra-testing/community/xbmc-svn/libcurl-not-in-lib64.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: Makefile.include.in -=================================================================== ---- Makefile.include.in (revision 21447) -+++ Makefile.include.in (working copy) -@@ -25,7 +25,7 @@ - - ifeq (linux,$(findstring linux, $(ARCH))) - ifeq ($(ARCH), x86_64-linux) -- DEFINES+=-DDLL_PATH_LIBCURL="\"/usr/lib64/libcurl.so.4\"" -+ DEFINES+=-DDLL_PATH_LIBCURL="\"/usr/lib/libcurl.so.4\"" - else - DEFINES+=-DDLL_PATH_LIBCURL="\"/usr/lib/libcurl.so.4\"" - endif -- cgit v0.12 From 9c2a170ff71e556da1c40ad5d1162fc3fdb7de39 Mon Sep 17 00:00:00 2001 From: Nathan Harris Date: Tue, 10 Nov 2009 16:49:31 -0500 Subject: mythtv-svn: updated to 22783 --- abs/core-testing/mythtv/trunk/morethemes/PKGBUILD | 2 +- abs/core-testing/mythtv/trunk/mp_all.sh | 2 +- abs/core-testing/mythtv/trunk/mytharchive/PKGBUILD | 2 +- abs/core-testing/mythtv/trunk/mythbrowser/PKGBUILD | 2 +- abs/core-testing/mythtv/trunk/mythflix/PKGBUILD | 2 +- abs/core-testing/mythtv/trunk/mythgallery/PKGBUILD | 2 +- abs/core-testing/mythtv/trunk/mythgame/PKGBUILD | 2 +- abs/core-testing/mythtv/trunk/mythmovies/PKGBUILD | 2 +- abs/core-testing/mythtv/trunk/mythmusic/PKGBUILD | 2 +- abs/core-testing/mythtv/trunk/mythnews/PKGBUILD | 2 +- abs/core-testing/mythtv/trunk/myththemes/PKGBUILD | 2 +- abs/core-testing/mythtv/trunk/mythtv/PKGBUILD | 2 +- abs/core-testing/mythtv/trunk/mythvideo/PKGBUILD | 2 +- abs/core-testing/mythtv/trunk/mythweather/PKGBUILD | 2 +- abs/core-testing/mythtv/trunk/mythweb/PKGBUILD | 2 +- abs/core-testing/mythtv/trunk/mythzoneminder/PKGBUILD | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/abs/core-testing/mythtv/trunk/morethemes/PKGBUILD b/abs/core-testing/mythtv/trunk/morethemes/PKGBUILD index 66e8db6..96ea655 100644 --- a/abs/core-testing/mythtv/trunk/morethemes/PKGBUILD +++ b/abs/core-testing/mythtv/trunk/morethemes/PKGBUILD @@ -1,5 +1,5 @@ pkgname=morethemes-svn -pkgver=22676 +pkgver=22783 pkgrel=1 pkgdesc="Additional themes for MythTV" url="http://www.mythtv.org" diff --git a/abs/core-testing/mythtv/trunk/mp_all.sh b/abs/core-testing/mythtv/trunk/mp_all.sh index 263fb80..d06564a 100755 --- a/abs/core-testing/mythtv/trunk/mp_all.sh +++ b/abs/core-testing/mythtv/trunk/mp_all.sh @@ -1,5 +1,5 @@ #!/bin/sh -pkgver=22676 +pkgver=22783 pkgrel=1 # NOTE: Make sure to build and install mythtv first BEFORE building anything else diff --git a/abs/core-testing/mythtv/trunk/mytharchive/PKGBUILD b/abs/core-testing/mythtv/trunk/mytharchive/PKGBUILD index 2fb26da..6f1ecfe 100644 --- a/abs/core-testing/mythtv/trunk/mytharchive/PKGBUILD +++ b/abs/core-testing/mythtv/trunk/mytharchive/PKGBUILD @@ -1,5 +1,5 @@ pkgname=mytharchive-svn -pkgver=22676 +pkgver=22783 pkgrel=1 pkgdesc="MythTV plugin that lets you create DVDs from or archive your recorded shows." url="http://www.mythtv.org" diff --git a/abs/core-testing/mythtv/trunk/mythbrowser/PKGBUILD b/abs/core-testing/mythtv/trunk/mythbrowser/PKGBUILD index 06ba3c6..76b1513 100644 --- a/abs/core-testing/mythtv/trunk/mythbrowser/PKGBUILD +++ b/abs/core-testing/mythtv/trunk/mythbrowser/PKGBUILD @@ -1,5 +1,5 @@ pkgname=mythbrowser-svn -pkgver=22676 +pkgver=22783 pkgrel=1 pkgdesc="Mini web browser for MythTV" url="http://www.mythtv.org" diff --git a/abs/core-testing/mythtv/trunk/mythflix/PKGBUILD b/abs/core-testing/mythtv/trunk/mythflix/PKGBUILD index 8f2b376..11ff8a7 100644 --- a/abs/core-testing/mythtv/trunk/mythflix/PKGBUILD +++ b/abs/core-testing/mythtv/trunk/mythflix/PKGBUILD @@ -1,5 +1,5 @@ pkgname=mythflix-svn -pkgver=22676 +pkgver=22783 pkgrel=1 pkgdesc="Netflix access plugin for MythTV" url="http://www.mythtv.org" diff --git a/abs/core-testing/mythtv/trunk/mythgallery/PKGBUILD b/abs/core-testing/mythtv/trunk/mythgallery/PKGBUILD index 139d630..4583a5f 100644 --- a/abs/core-testing/mythtv/trunk/mythgallery/PKGBUILD +++ b/abs/core-testing/mythtv/trunk/mythgallery/PKGBUILD @@ -1,5 +1,5 @@ pkgname=mythgallery-svn -pkgver=22676 +pkgver=22783 pkgrel=1 pkgdesc="Image gallery plugin for MythTV" url="http://www.mythtv.org" diff --git a/abs/core-testing/mythtv/trunk/mythgame/PKGBUILD b/abs/core-testing/mythtv/trunk/mythgame/PKGBUILD index c600fc9..836dbdc 100644 --- a/abs/core-testing/mythtv/trunk/mythgame/PKGBUILD +++ b/abs/core-testing/mythtv/trunk/mythgame/PKGBUILD @@ -1,5 +1,5 @@ pkgname=mythgame-svn -pkgver=22676 +pkgver=22783 pkgrel=1 pkgdesc="Emulation plugin for MythTV" url="http://www.mythtv.org" diff --git a/abs/core-testing/mythtv/trunk/mythmovies/PKGBUILD b/abs/core-testing/mythtv/trunk/mythmovies/PKGBUILD index daf06a6..4e30a09 100644 --- a/abs/core-testing/mythtv/trunk/mythmovies/PKGBUILD +++ b/abs/core-testing/mythtv/trunk/mythmovies/PKGBUILD @@ -1,5 +1,5 @@ pkgname=mythmovies-svn -pkgver=22676 +pkgver=22783 pkgrel=1 pkgdesc="Displays information about movies playing in the area." url="http://www.mythtv.org" diff --git a/abs/core-testing/mythtv/trunk/mythmusic/PKGBUILD b/abs/core-testing/mythtv/trunk/mythmusic/PKGBUILD index c49ef7d..d4faa59 100644 --- a/abs/core-testing/mythtv/trunk/mythmusic/PKGBUILD +++ b/abs/core-testing/mythtv/trunk/mythmusic/PKGBUILD @@ -1,5 +1,5 @@ pkgname=mythmusic-svn -pkgver=22676 +pkgver=22783 pkgrel=1 pkgdesc="Music playing plugin for MythTV" url="http://www.mythtv.org" diff --git a/abs/core-testing/mythtv/trunk/mythnews/PKGBUILD b/abs/core-testing/mythtv/trunk/mythnews/PKGBUILD index 14e5823..1bcb3f0 100644 --- a/abs/core-testing/mythtv/trunk/mythnews/PKGBUILD +++ b/abs/core-testing/mythtv/trunk/mythnews/PKGBUILD @@ -1,5 +1,5 @@ pkgname=mythnews-svn -pkgver=22676 +pkgver=22783 pkgrel=1 pkgdesc="News checking plugin for MythTV" url="http://www.mythtv.org" diff --git a/abs/core-testing/mythtv/trunk/myththemes/PKGBUILD b/abs/core-testing/mythtv/trunk/myththemes/PKGBUILD index 113e031..d69526f 100755 --- a/abs/core-testing/mythtv/trunk/myththemes/PKGBUILD +++ b/abs/core-testing/mythtv/trunk/myththemes/PKGBUILD @@ -1,5 +1,5 @@ pkgname=myththemes-svn -pkgver=22676 +pkgver=22783 pkgrel=1 pkgdesc="Themes for MythTV" url="http://www.mythtv.org" diff --git a/abs/core-testing/mythtv/trunk/mythtv/PKGBUILD b/abs/core-testing/mythtv/trunk/mythtv/PKGBUILD index 5e56bc2..74a5ffe 100755 --- a/abs/core-testing/mythtv/trunk/mythtv/PKGBUILD +++ b/abs/core-testing/mythtv/trunk/mythtv/PKGBUILD @@ -1,5 +1,5 @@ pkgname=mythtv-svn -pkgver=22676 +pkgver=22783 pkgrel=1 pkgdesc="A personal video recorder for Linux" url="http://www.mythtv.org" diff --git a/abs/core-testing/mythtv/trunk/mythvideo/PKGBUILD b/abs/core-testing/mythtv/trunk/mythvideo/PKGBUILD index 1c031ed..04b1021 100644 --- a/abs/core-testing/mythtv/trunk/mythvideo/PKGBUILD +++ b/abs/core-testing/mythtv/trunk/mythvideo/PKGBUILD @@ -1,5 +1,5 @@ pkgname=mythvideo-svn -pkgver=22676 +pkgver=22783 pkgrel=1 pkgdesc="Video playback and browsing plugin for MythTV" url="http://www.mythtv.org" diff --git a/abs/core-testing/mythtv/trunk/mythweather/PKGBUILD b/abs/core-testing/mythtv/trunk/mythweather/PKGBUILD index 167bf37..f3a45e5 100644 --- a/abs/core-testing/mythtv/trunk/mythweather/PKGBUILD +++ b/abs/core-testing/mythtv/trunk/mythweather/PKGBUILD @@ -1,5 +1,5 @@ pkgname=mythweather-svn -pkgver=22676 +pkgver=22783 pkgrel=1 pkgdesc="Weather checking plugin for MythTV" url="http://www.mythtv.org" diff --git a/abs/core-testing/mythtv/trunk/mythweb/PKGBUILD b/abs/core-testing/mythtv/trunk/mythweb/PKGBUILD index c67afae..edd6681 100644 --- a/abs/core-testing/mythtv/trunk/mythweb/PKGBUILD +++ b/abs/core-testing/mythtv/trunk/mythweb/PKGBUILD @@ -1,5 +1,5 @@ pkgname=mythweb-svn -pkgver=22676 +pkgver=22783 pkgrel=1 pkgdesc="Web interface for MythTV's backend" url="http://www.mythtv.org" diff --git a/abs/core-testing/mythtv/trunk/mythzoneminder/PKGBUILD b/abs/core-testing/mythtv/trunk/mythzoneminder/PKGBUILD index 0c4313c..1ccfd05 100644 --- a/abs/core-testing/mythtv/trunk/mythzoneminder/PKGBUILD +++ b/abs/core-testing/mythtv/trunk/mythzoneminder/PKGBUILD @@ -1,5 +1,5 @@ pkgname=mythzoneminder-svn -pkgver=22676 +pkgver=22783 pkgrel=1 pkgdesc="Integrates ZoneMinder into MythTV" url="http://www.mythtv.org" -- cgit v0.12 From 8c91f3da4388f832a841e4a86bd53273ca45ead8 Mon Sep 17 00:00:00 2001 From: James Meyer Date: Fri, 13 Nov 2009 00:38:57 -0600 Subject: mythtv.22: copy svn pkgbuilds to stable.22. This is to prepare .22 packages so -svn can continue tracking trunk. As of right now their only purpose is to have something to build mythvantage against. --- abs/core-testing/mythtv/stable.22/clean_all.sh | 22 + .../mythtv/stable.22/morethemes/PKGBUILD | 50 ++ abs/core-testing/mythtv/stable.22/mp_all.sh | 30 ++ .../mythtv/stable.22/mytharchive/PKGBUILD | 51 ++ .../mythtv/stable.22/mythbrowser/PKGBUILD | 51 ++ .../mythtv/stable.22/mythflix/PKGBUILD | 51 ++ .../mythtv/stable.22/mythgallery/PKGBUILD | 51 ++ .../mythtv/stable.22/mythgame/PKGBUILD | 51 ++ .../mythtv/stable.22/mythmovies/PKGBUILD | 51 ++ .../mythtv/stable.22/mythmusic/PKGBUILD | 54 ++ .../mythtv/stable.22/mythnews/PKGBUILD | 51 ++ .../mythtv/stable.22/myththemes/PKGBUILD | 50 ++ abs/core-testing/mythtv/stable.22/mythtv/PKGBUILD | 92 ++++ .../stable.22/mythtv/menu-xml/HOST_SETTINGS.xml | 94 ++++ .../mythtv/stable.22/mythtv/menu-xml/is.xml | 3 + .../stable.22/mythtv/menu-xml/library.xml.patch | 12 + .../mythtv/stable.22/mythtv/menu-xml/linhes.xml | 59 +++ .../stable.22/mythtv/menu-xml/mainmenu.xml.patch | 39 ++ .../stable.22/mythtv/menu-xml/mythbackup.xml | 20 + .../stable.22/mythtv/menu-xml/mythrestore.xml | 20 + .../mythtv/menu-xml/optical_menu.xml.patch | 16 + .../mythtv/menu-xml/original/create_patch.sh | 5 + .../mythtv/stable.22/mythtv/menu-xml/setup.xml | 111 ++++ .../stable.22/mythtv/menu-xml/siriusmenu.xml | 419 +++++++++++++++ .../mythtv/stable.22/mythtv/menu-xml/update.xml | 20 + .../mythtv/stable.22/mythtv/menu-xml/update2.xml | 26 + .../stable.22/mythtv/menu-xml/util_menu.xml.patch | 16 + .../mythtv/stable.22/mythtv/menu-xml/xmmenu.xml | 574 +++++++++++++++++++++ abs/core-testing/mythtv/stable.22/mythtv/myth.sh | 4 + .../mythtv/stable.22/mythtv/mythbackend | 38 ++ .../mythtv/stable.22/mythtv/mythbackend.lr | 9 + .../mythtv/stable.22/mythtv/mythbackend.sh | 117 +++++ .../mythtv/stable.22/mythtv/mythfrontend.lr | 9 + .../mythtv/stable.22/mythtv/mythtv.install | 30 ++ abs/core-testing/mythtv/stable.22/mythtv/pretty | 2 + .../mythtv/stable.22/mythtv/smolt_jump.patch | 30 ++ .../mythtv/stable.22/mythvideo/PKGBUILD | 51 ++ .../mythtv/stable.22/mythweather/PKGBUILD | 51 ++ abs/core-testing/mythtv/stable.22/mythweb/PKGBUILD | 49 ++ .../mythtv/stable.22/mythweb/mythweb.install | 10 + .../mythtv/stable.22/mythzoneminder/PKGBUILD | 51 ++ 41 files changed, 2540 insertions(+) create mode 100755 abs/core-testing/mythtv/stable.22/clean_all.sh create mode 100644 abs/core-testing/mythtv/stable.22/morethemes/PKGBUILD create mode 100755 abs/core-testing/mythtv/stable.22/mp_all.sh create mode 100644 abs/core-testing/mythtv/stable.22/mytharchive/PKGBUILD create mode 100644 abs/core-testing/mythtv/stable.22/mythbrowser/PKGBUILD create mode 100644 abs/core-testing/mythtv/stable.22/mythflix/PKGBUILD create mode 100644 abs/core-testing/mythtv/stable.22/mythgallery/PKGBUILD create mode 100644 abs/core-testing/mythtv/stable.22/mythgame/PKGBUILD create mode 100644 abs/core-testing/mythtv/stable.22/mythmovies/PKGBUILD create mode 100644 abs/core-testing/mythtv/stable.22/mythmusic/PKGBUILD create mode 100644 abs/core-testing/mythtv/stable.22/mythnews/PKGBUILD create mode 100755 abs/core-testing/mythtv/stable.22/myththemes/PKGBUILD create mode 100755 abs/core-testing/mythtv/stable.22/mythtv/PKGBUILD create mode 100644 abs/core-testing/mythtv/stable.22/mythtv/menu-xml/HOST_SETTINGS.xml create mode 100644 abs/core-testing/mythtv/stable.22/mythtv/menu-xml/is.xml create mode 100644 abs/core-testing/mythtv/stable.22/mythtv/menu-xml/library.xml.patch create mode 100644 abs/core-testing/mythtv/stable.22/mythtv/menu-xml/linhes.xml create mode 100644 abs/core-testing/mythtv/stable.22/mythtv/menu-xml/mainmenu.xml.patch create mode 100644 abs/core-testing/mythtv/stable.22/mythtv/menu-xml/mythbackup.xml create mode 100644 abs/core-testing/mythtv/stable.22/mythtv/menu-xml/mythrestore.xml create mode 100644 abs/core-testing/mythtv/stable.22/mythtv/menu-xml/optical_menu.xml.patch create mode 100755 abs/core-testing/mythtv/stable.22/mythtv/menu-xml/original/create_patch.sh create mode 100644 abs/core-testing/mythtv/stable.22/mythtv/menu-xml/setup.xml create mode 100644 abs/core-testing/mythtv/stable.22/mythtv/menu-xml/siriusmenu.xml create mode 100644 abs/core-testing/mythtv/stable.22/mythtv/menu-xml/update.xml create mode 100644 abs/core-testing/mythtv/stable.22/mythtv/menu-xml/update2.xml create mode 100644 abs/core-testing/mythtv/stable.22/mythtv/menu-xml/util_menu.xml.patch create mode 100644 abs/core-testing/mythtv/stable.22/mythtv/menu-xml/xmmenu.xml create mode 100755 abs/core-testing/mythtv/stable.22/mythtv/myth.sh create mode 100755 abs/core-testing/mythtv/stable.22/mythtv/mythbackend create mode 100644 abs/core-testing/mythtv/stable.22/mythtv/mythbackend.lr create mode 100755 abs/core-testing/mythtv/stable.22/mythtv/mythbackend.sh create mode 100644 abs/core-testing/mythtv/stable.22/mythtv/mythfrontend.lr create mode 100755 abs/core-testing/mythtv/stable.22/mythtv/mythtv.install create mode 100755 abs/core-testing/mythtv/stable.22/mythtv/pretty create mode 100644 abs/core-testing/mythtv/stable.22/mythtv/smolt_jump.patch create mode 100644 abs/core-testing/mythtv/stable.22/mythvideo/PKGBUILD create mode 100644 abs/core-testing/mythtv/stable.22/mythweather/PKGBUILD create mode 100644 abs/core-testing/mythtv/stable.22/mythweb/PKGBUILD create mode 100644 abs/core-testing/mythtv/stable.22/mythweb/mythweb.install create mode 100644 abs/core-testing/mythtv/stable.22/mythzoneminder/PKGBUILD diff --git a/abs/core-testing/mythtv/stable.22/clean_all.sh b/abs/core-testing/mythtv/stable.22/clean_all.sh new file mode 100755 index 0000000..1ebdc43 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/clean_all.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +buildlist=('mythtv' 'mytharchive' 'mythbrowser' 'mythflix' 'mythgallery' 'mythgame' 'mythmovies' 'mythmusic' 'mythnews' 'mythvideo' 'mythweather' 'mythzoneminder' 'mythweb' 'myththemes' 'morethemes') + +# clean up current directory +rm -f *~ + +# clean up mythtv directories +for i in `echo ${buildlist[@]:0}` +do + echo "-- cleaning $i" + cd ./$i + + # clean up everything + rm -rf pkg src + rm -f *~ + + cd .. +done + +echo "DONE!" + diff --git a/abs/core-testing/mythtv/stable.22/morethemes/PKGBUILD b/abs/core-testing/mythtv/stable.22/morethemes/PKGBUILD new file mode 100644 index 0000000..96ea655 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/morethemes/PKGBUILD @@ -0,0 +1,50 @@ +pkgname=morethemes-svn +pkgver=22783 +pkgrel=1 +pkgdesc="Additional themes for MythTV" +url="http://www.mythtv.org" +license="GPL" +arch=('i686' 'x86_64') + +depends=('mythtv-svn') +conflicts=('morethemes') +groups=('mythtv-extras-svn') + +patches=() +source=(`echo ${patches[@]:0}`) +_svntrunk=http://cvs.mythtv.org/svn/branches/release-0-22-fixes/themes +#_svntrunk=http://cvs.mythtv.org/svn/trunk/themes +_svnmod=themes + + +build() { + + svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod + svn revert -R $_svnmod + + cd $startdir/src/$_svnmod + + echo "--------------------------applying patches----------------------------------------------------" + for i in `echo ${patches[@]:0} ` + do + echo applying $i + echo "-----------------------------" + patch -Np0 -i ${startdir}/src/$i || return 1 + done + echo "--------------------------done applying patches-----------------------------------------------" + + [ "$CARCH" = "i686" ] && ARCH="i686" + [ "$CARCH" = "x86_64" ] && ARCH="x86-64" + + # clean up + make distclean + + # configure + ./configure --prefix=/usr || return 1 + + # build and install + . /etc/profile + make || return 1 + make INSTALL_ROOT=$startdir/pkg install || return 1 + +} diff --git a/abs/core-testing/mythtv/stable.22/mp_all.sh b/abs/core-testing/mythtv/stable.22/mp_all.sh new file mode 100755 index 0000000..d06564a --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mp_all.sh @@ -0,0 +1,30 @@ +#!/bin/sh +pkgver=22783 +pkgrel=1 + +# NOTE: Make sure to build and install mythtv first BEFORE building anything else +buildlist=('mythtv' 'mytharchive' 'mythbrowser' 'mythflix' 'mythgallery' 'mythgame' 'mythmovies' 'mythmusic' 'mythnews' 'mythvideo' 'mythweather' 'mythzoneminder' 'mythweb' 'myththemes' 'morethemes') + +# build and install +for i in `echo ${buildlist[@]:0}` +do + echo "---------- building $i ----------" + cd ./$i + + # set svn version in the PKGBUILD + sed -i s/^pkgver=.*/pkgver=$pkgver/ PKGBUILD + sed -i s/^pkgrel=.*/pkgrel=$pkgrel/ PKGBUILD + + # make the package + mp -f -i --holdver || exit 1 + + # clean up afterwards + rm -rf pkg + rm -f *~ + + cd .. +done + +echo "" +echo "DONE!" + diff --git a/abs/core-testing/mythtv/stable.22/mytharchive/PKGBUILD b/abs/core-testing/mythtv/stable.22/mytharchive/PKGBUILD new file mode 100644 index 0000000..6f1ecfe --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mytharchive/PKGBUILD @@ -0,0 +1,51 @@ +pkgname=mytharchive-svn +pkgver=22783 +pkgrel=1 +pkgdesc="MythTV plugin that lets you create DVDs from or archive your recorded shows." +url="http://www.mythtv.org" +license="GPL" +arch=('i686' 'x86_64') + +depends=('mythtv-svn' 'libxmu' 'mysql-python' 'pil' 'dvdauthor' 'mjpegtools' 'transcode') +conflicts=('mytharchive') +groups=('mythtv-extras-svn') + +patches=() +source=(`echo ${patches[@]:0}`) +_svntrunk=http://cvs.mythtv.org/svn/branches/release-0-22-fixes/mythplugins +#_svntrunk=http://cvs.mythtv.org/svn/trunk/mythplugins +_svnmod=mythplugins + + +build() { + + svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod + svn revert -R $_svnmod + + cd $startdir/src/$_svnmod + + echo "--------------------------applying patches----------------------------------------------------" + for i in `echo ${patches[@]:0} ` + do + echo applying $i + echo "-----------------------------" + patch -Np0 -i ${startdir}/src/$i || return 1 + done + echo "--------------------------done applying patches-----------------------------------------------" + + [ "$CARCH" = "i686" ] && ARCH="i686" + [ "$CARCH" = "x86_64" ] && ARCH="x86-64" + + # clean up + make distclean + + # configure + ./configure --prefix=/usr --cpu=${ARCH} --disable-all --enable-opengl \ + --enable-mytharchive || return 1 + + # build and install + . /etc/profile + make || return 1 + make INSTALL_ROOT=$startdir/pkg install || return 1 + +} diff --git a/abs/core-testing/mythtv/stable.22/mythbrowser/PKGBUILD b/abs/core-testing/mythtv/stable.22/mythbrowser/PKGBUILD new file mode 100644 index 0000000..76b1513 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythbrowser/PKGBUILD @@ -0,0 +1,51 @@ +pkgname=mythbrowser-svn +pkgver=22783 +pkgrel=1 +pkgdesc="Mini web browser for MythTV" +url="http://www.mythtv.org" +license="GPL" +arch=('i686' 'x86_64') + +depends=('mythtv-svn' 'wget') +conflicts=('mythbrowser') +groups=('mythtv-extras-svn') + +patches=() +source=(`echo ${patches[@]:0}`) +_svntrunk=http://cvs.mythtv.org/svn/branches/release-0-22-fixes/mythplugins +#_svntrunk=http://cvs.mythtv.org/svn/trunk/mythplugins +_svnmod=mythplugins + + +build() { + + svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod + svn revert -R $_svnmod + + cd $startdir/src/$_svnmod + + echo "--------------------------applying patches----------------------------------------------------" + for i in `echo ${patches[@]:0} ` + do + echo applying $i + echo "-----------------------------" + patch -Np0 -i ${startdir}/src/$i || return 1 + done + echo "--------------------------done applying patches-----------------------------------------------" + + [ "$CARCH" = "i686" ] && ARCH="i686" + [ "$CARCH" = "x86_64" ] && ARCH="x86-64" + + # clean up + make distclean + + # configure + ./configure --prefix=/usr --cpu=${ARCH} --disable-all --enable-opengl \ + --enable-mythbrowser || return 1 + + # build and install + . /etc/profile + make || return 1 + make INSTALL_ROOT=$startdir/pkg install || return 1 + +} diff --git a/abs/core-testing/mythtv/stable.22/mythflix/PKGBUILD b/abs/core-testing/mythtv/stable.22/mythflix/PKGBUILD new file mode 100644 index 0000000..11ff8a7 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythflix/PKGBUILD @@ -0,0 +1,51 @@ +pkgname=mythflix-svn +pkgver=22783 +pkgrel=1 +pkgdesc="Netflix access plugin for MythTV" +url="http://www.mythtv.org" +license="GPL" +arch=('i686' 'x86_64') + +depends=('mythtv-svn') +conflicts=('mythflix') +groups=('mythtv-extras-svn') + +patches=() +source=(`echo ${patches[@]:0}`) +_svntrunk=http://cvs.mythtv.org/svn/branches/release-0-22-fixes/mythplugins +#_svntrunk=http://cvs.mythtv.org/svn/trunk/mythplugins +_svnmod=mythplugins + + +build() { + + svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod + svn revert -R $_svnmod + + cd $startdir/src/$_svnmod + + echo "--------------------------applying patches----------------------------------------------------" + for i in `echo ${patches[@]:0} ` + do + echo applying $i + echo "-----------------------------" + patch -Np0 -i ${startdir}/src/$i || return 1 + done + echo "--------------------------done applying patches-----------------------------------------------" + + [ "$CARCH" = "i686" ] && ARCH="i686" + [ "$CARCH" = "x86_64" ] && ARCH="x86-64" + + # clean up + make distclean + + # configure + ./configure --prefix=/usr --cpu=${ARCH} --disable-all --enable-opengl \ + --enable-mythflix || return 1 + + # build and install + . /etc/profile + make || return 1 + make INSTALL_ROOT=$startdir/pkg install || return 1 + +} diff --git a/abs/core-testing/mythtv/stable.22/mythgallery/PKGBUILD b/abs/core-testing/mythtv/stable.22/mythgallery/PKGBUILD new file mode 100644 index 0000000..4583a5f --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythgallery/PKGBUILD @@ -0,0 +1,51 @@ +pkgname=mythgallery-svn +pkgver=22783 +pkgrel=1 +pkgdesc="Image gallery plugin for MythTV" +url="http://www.mythtv.org" +license="GPL" +arch=('i686' 'x86_64') + +depends=('mythtv-svn' 'libexif' 'libtiff') +conflicts=('mythgallery') +groups=('mythtv-extras-svn') + +patches=() +source=(`echo ${patches[@]:0}`) +_svntrunk=http://cvs.mythtv.org/svn/branches/release-0-22-fixes/mythplugins +#_svntrunk=http://cvs.mythtv.org/svn/trunk/mythplugins +_svnmod=mythplugins + + +build() { + + svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod + svn revert -R $_svnmod + + cd $startdir/src/$_svnmod + + echo "--------------------------applying patches----------------------------------------------------" + for i in `echo ${patches[@]:0} ` + do + echo applying $i + echo "-----------------------------" + patch -Np0 -i ${startdir}/src/$i || return 1 + done + echo "--------------------------done applying patches-----------------------------------------------" + + [ "$CARCH" = "i686" ] && ARCH="i686" + [ "$CARCH" = "x86_64" ] && ARCH="x86-64" + + # clean up + make distclean + + # configure + ./configure --prefix=/usr --cpu=${ARCH} --disable-all --enable-opengl \ + --enable-mythgallery || return 1 + + # build and install + . /etc/profile + make || return 1 + make INSTALL_ROOT=$startdir/pkg install || return 1 + +} diff --git a/abs/core-testing/mythtv/stable.22/mythgame/PKGBUILD b/abs/core-testing/mythtv/stable.22/mythgame/PKGBUILD new file mode 100644 index 0000000..836dbdc --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythgame/PKGBUILD @@ -0,0 +1,51 @@ +pkgname=mythgame-svn +pkgver=22783 +pkgrel=1 +pkgdesc="Emulation plugin for MythTV" +url="http://www.mythtv.org" +license="GPL" +arch=('i686' 'x86_64') + +depends=('mythtv-svn' 'zlib') +conflicts=('mythgame') +groups=('mythtv-extras-svn') + +patches=() +source=(`echo ${patches[@]:0}`) +_svntrunk=http://cvs.mythtv.org/svn/branches/release-0-22-fixes/mythplugins +#_svntrunk=http://cvs.mythtv.org/svn/trunk/mythplugins +_svnmod=mythplugins + + +build() { + + svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod + svn revert -R $_svnmod + + cd $startdir/src/$_svnmod + + echo "--------------------------applying patches----------------------------------------------------" + for i in `echo ${patches[@]:0} ` + do + echo applying $i + echo "-----------------------------" + patch -Np0 -i ${startdir}/src/$i || return 1 + done + echo "--------------------------done applying patches-----------------------------------------------" + + [ "$CARCH" = "i686" ] && ARCH="i686" + [ "$CARCH" = "x86_64" ] && ARCH="x86-64" + + # clean up + make distclean + + # configure + ./configure --prefix=/usr --cpu=${ARCH} --disable-all --enable-opengl \ + --enable-mythgame || return 1 + + # build and install + . /etc/profile + make || return 1 + make INSTALL_ROOT=$startdir/pkg install || return 1 + +} diff --git a/abs/core-testing/mythtv/stable.22/mythmovies/PKGBUILD b/abs/core-testing/mythtv/stable.22/mythmovies/PKGBUILD new file mode 100644 index 0000000..4e30a09 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythmovies/PKGBUILD @@ -0,0 +1,51 @@ +pkgname=mythmovies-svn +pkgver=22783 +pkgrel=1 +pkgdesc="Displays information about movies playing in the area." +url="http://www.mythtv.org" +license="GPL" +arch=('i686' 'x86_64') + +depends=('mythtv-svn') +conflicts=('mythmovies') +groups=('mythtv-extras-svn') + +patches=() +source=(`echo ${patches[@]:0}`) +_svntrunk=http://cvs.mythtv.org/svn/branches/release-0-22-fixes/mythplugins +#_svntrunk=http://cvs.mythtv.org/svn/trunk/mythplugins +_svnmod=mythplugins + + +build() { + + svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod + svn revert -R $_svnmod + + cd $startdir/src/$_svnmod + + echo "--------------------------applying patches----------------------------------------------------" + for i in `echo ${patches[@]:0} ` + do + echo applying $i + echo "-----------------------------" + patch -Np0 -i ${startdir}/src/$i || return 1 + done + echo "--------------------------done applying patches-----------------------------------------------" + + [ "$CARCH" = "i686" ] && ARCH="i686" + [ "$CARCH" = "x86_64" ] && ARCH="x86-64" + + # clean up + make distclean + + # configure + ./configure --prefix=/usr --cpu=${ARCH} --disable-all --enable-opengl \ + --enable-mythmovies || return 1 + + # build and install + . /etc/profile + make || return 1 + make INSTALL_ROOT=$startdir/pkg install || return 1 + +} diff --git a/abs/core-testing/mythtv/stable.22/mythmusic/PKGBUILD b/abs/core-testing/mythtv/stable.22/mythmusic/PKGBUILD new file mode 100644 index 0000000..d4faa59 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythmusic/PKGBUILD @@ -0,0 +1,54 @@ +pkgname=mythmusic-svn +pkgver=22783 +pkgrel=1 +pkgdesc="Music playing plugin for MythTV" +url="http://www.mythtv.org" +license="GPL" +arch=('i686' 'x86_64') + +depends=('mythtv-svn' 'libid3tag' 'libmad' 'libvorbis' 'flac>=1.1.4' 'libcdaudio' \ + 'cdparanoia' 'fftw2' 'sdl' 'faad2>=2.6.1' 'lame' 'taglib' \ + 'libvisual-plugins' 'libvisual-projectm') +conflicts=('mythmusic') +groups=('mythtv-extras-svn') + +patches=() +source=(`echo ${patches[@]:0}`) +_svntrunk=http://cvs.mythtv.org/svn/branches/release-0-22-fixes/mythplugins +#_svntrunk=http://cvs.mythtv.org/svn/trunk/mythplugins +_svnmod=mythplugins + + +build() { + + svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod + svn revert -R $_svnmod + + cd $startdir/src/$_svnmod + + echo "--------------------------applying patches----------------------------------------------------" + for i in `echo ${patches[@]:0} ` + do + echo applying $i + echo "-----------------------------" + patch -Np0 -i ${startdir}/src/$i || return 1 + done + echo "--------------------------done applying patches-----------------------------------------------" + + [ "$CARCH" = "i686" ] && ARCH="i686" + [ "$CARCH" = "x86_64" ] && ARCH="x86-64" + + # clean up + make distclean + + # configure + ./configure --prefix=/usr --cpu=${ARCH} --disable-all --enable-opengl \ + --enable-mythmusic --enable-libvisual --enable-fftw --enable-sdl \ + --enable-aac || return 1 + + # build and install + . /etc/profile + make || return 1 + make INSTALL_ROOT=$startdir/pkg install || return 1 + +} diff --git a/abs/core-testing/mythtv/stable.22/mythnews/PKGBUILD b/abs/core-testing/mythtv/stable.22/mythnews/PKGBUILD new file mode 100644 index 0000000..1bcb3f0 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythnews/PKGBUILD @@ -0,0 +1,51 @@ +pkgname=mythnews-svn +pkgver=22783 +pkgrel=1 +pkgdesc="News checking plugin for MythTV" +url="http://www.mythtv.org" +license="GPL" +arch=('i686' 'x86_64') + +depends=('mythtv-svn') +conflicts=('mythnews') +groups=('mythtv-extras-svn') + +patches=() +source=(`echo ${patches[@]:0}`) +_svntrunk=http://cvs.mythtv.org/svn/branches/release-0-22-fixes/mythplugins +#_svntrunk=http://cvs.mythtv.org/svn/trunk/mythplugins +_svnmod=mythplugins + + +build() { + + svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod + svn revert -R $_svnmod + + cd $startdir/src/$_svnmod + + echo "--------------------------applying patches----------------------------------------------------" + for i in `echo ${patches[@]:0} ` + do + echo applying $i + echo "-----------------------------" + patch -Np0 -i ${startdir}/src/$i || return 1 + done + echo "--------------------------done applying patches-----------------------------------------------" + + [ "$CARCH" = "i686" ] && ARCH="i686" + [ "$CARCH" = "x86_64" ] && ARCH="x86-64" + + # clean up + make distclean + + # configure + ./configure --prefix=/usr --cpu=${ARCH} --disable-all --enable-opengl \ + --enable-mythnews || return 1 + + # build and install + . /etc/profile + make || return 1 + make INSTALL_ROOT=$startdir/pkg install || return 1 + +} diff --git a/abs/core-testing/mythtv/stable.22/myththemes/PKGBUILD b/abs/core-testing/mythtv/stable.22/myththemes/PKGBUILD new file mode 100755 index 0000000..d69526f --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/myththemes/PKGBUILD @@ -0,0 +1,50 @@ +pkgname=myththemes-svn +pkgver=22783 +pkgrel=1 +pkgdesc="Themes for MythTV" +url="http://www.mythtv.org" +license="GPL" +arch=('i686' 'x86_64') + +depends=('mythtv-svn') +conflicts=('myththemes') +groups=('mythtv-extras-svn') + +patches=() +source=(`echo ${patches[@]:0}`) +_svntrunk=http://cvs.mythtv.org/svn/branches/release-0-22-fixes/myththemes +#_svntrunk=http://cvs.mythtv.org/svn/trunk/myththemes +_svnmod=myththemes + + +build() { + + svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod + svn revert -R $_svnmod + + cd $startdir/src/$_svnmod + + echo "--------------------------applying patches----------------------------------------------------" + for i in `echo ${patches[@]:0} ` + do + echo applying $i + echo "-----------------------------" + patch -Np0 -i ${startdir}/src/$i || return 1 + done + echo "--------------------------done applying patches-----------------------------------------------" + + [ "$CARCH" = "i686" ] && ARCH="i686" + [ "$CARCH" = "x86_64" ] && ARCH="x86-64" + + # clean up + make distclean + + # configure + ./configure --prefix=/usr || return 1 + + # build and install + . /etc/profile + make || return 1 + make INSTALL_ROOT=$startdir/pkg install || return 1 + +} diff --git a/abs/core-testing/mythtv/stable.22/mythtv/PKGBUILD b/abs/core-testing/mythtv/stable.22/mythtv/PKGBUILD new file mode 100755 index 0000000..3a8ef52 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythtv/PKGBUILD @@ -0,0 +1,92 @@ +pkgname=mythtv-release-fixes-22 +pkgver=22783 +pkgrel=1 +pkgdesc="A personal video recorder for Linux" +url="http://www.mythtv.org" +license="GPL" +depends=('bash' 'mysql-clients>=5.0' 'qt' 'lame' 'lirc-utils' 'ffmpeg' \ + 'faad2' 'libxv' 'libxvmc' 'libavc1394' 'libdc1394' 'libiec61883' \ + 'perl-net-upnp') +makedepends=('libgl' 'subversion') +conflicts=('mythtv') +replaces=() +groups=('pvr') +#backup=() +#options=(!strip) +#MAKEFLAGS="-j6" +install='mythtv.install' + +patchs=() +#patchs=('smolt_jump.patch') +source=('mythbackend' 'myth.sh' `echo ${patchs[@]:0}` 'mythbackend.lr' 'mythfrontend.lr' 'pretty') +arch=('i686' 'x86_64') +#md5sums=() + +_svntrunk=http://cvs.mythtv.org/svn/branches/release-0-22-fixes/mythtv +#_svntrunk=http://cvs.mythtv.org/svn/trunk/mythtv +_svnmod=mythtv + +build() { + + # get clean copy from SVN repo + svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod + svn revert -R $_svnmod + + cd $startdir/src/mythtv + + # apply patches + echo "--------------------------applying patches----------------------------------------------------" + for i in `echo ${patchs[@]:0} ` + do + echo applying $i + echo "-----------------------------" + patch -Np0 -i ${startdir}/src/$i || return 1 + done + echo "--------------------------done applying patches-----------------------------------------------" + + sed -i -e "s/\`(svnversion \$\${SVNTREEDIR} 2>\/dev\/null) || echo Unknown\`/$pkgver/" version.pro + + [ "$CARCH" = "i686" ] && ARCH="i686" + [ "$CARCH" = "x86_64" ] && ARCH="x86-64" + + # clean up from last build + make distclean + + # configure + ./configure --prefix=/usr --arch=${ARCH} \ + --disable-vdpau --disable-xvmc --disable-xvmc-pro \ + --enable-opengl-vsync --enable-libfaad --enable-dvb --enable-firewire \ + --compile-type=release --with-bindings=perl,python \ + --enable-audio-alsa --disable-audio-jack --disable-audio-arts || return 1 + + # build and install + . /etc/profile + make || return 1 + make INSTALL_ROOT=$startdir/pkg install || return 1 + + # install db schema, scripts and docs + install -m0644 database/mc.sql $startdir/pkg/usr/share/mythtv/ || return 1 + install -D -m0755 ../mythbackend $startdir/pkg/etc/rc.d/mythbackend || return 1 + cp -r docs $startdir/pkg/usr/share/mythtv/ || return 1 + # cp ../QUICKSTART.archlinux $startdir/pkg/usr/share/mythtv/ || return 1 + + # install contrib + cp -r contrib $startdir/pkg/usr/share/mythtv/ || return 1 + + # patch the xml LinHES style + cp -r $startdir/menu-xml/*.xml $startdir/pkg/usr/share/mythtv/themes/defaultmenu/ + cd $startdir/pkg/usr/share/mythtv/themes/defaultmenu + patch -p0 < $startdir/menu-xml/mainmenu.xml.patch || return 1 + patch -p0 < $startdir/menu-xml/optical_menu.xml.patch || return 1 + patch -p0 < $startdir/menu-xml/library.xml.patch || return 1 + patch -p0 < $startdir/menu-xml/util_menu.xml.patch || return 1 + + # make log dir + mkdir -p $startdir/pkg/var/log/mythtv + chown 1000.1000 $startdir/pkg/var/log/mythtv + mkdir -p $startdir/pkg/etc/logrotate.d + cp $startdir/src/*.lr $startdir/pkg/etc/logrotate.d + mkdir -p $startdir/pkg/etc/cron.hourly/ + install -m0755 $startdir/src/pretty $startdir/pkg/etc/cron.hourly/ +} + diff --git a/abs/core-testing/mythtv/stable.22/mythtv/menu-xml/HOST_SETTINGS.xml b/abs/core-testing/mythtv/stable.22/mythtv/menu-xml/HOST_SETTINGS.xml new file mode 100644 index 0000000..ac52497 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythtv/menu-xml/HOST_SETTINGS.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/abs/core-testing/mythtv/stable.22/mythtv/menu-xml/is.xml b/abs/core-testing/mythtv/stable.22/mythtv/menu-xml/is.xml new file mode 100644 index 0000000..88b7e6b --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythtv/menu-xml/is.xml @@ -0,0 +1,3 @@ + + + diff --git a/abs/core-testing/mythtv/stable.22/mythtv/menu-xml/library.xml.patch b/abs/core-testing/mythtv/stable.22/mythtv/menu-xml/library.xml.patch new file mode 100644 index 0000000..81ea604 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythtv/menu-xml/library.xml.patch @@ -0,0 +1,12 @@ +--- library.xml.orig 2009-10-16 12:45:44.000000000 +0000 ++++ library.xml 2009-10-16 17:21:44.000000000 +0000 +@@ -123,8 +123,7 @@ + Online folyam lejátszása + + +- PLUGIN mythstream +- mythstream ++ MENU is.xml + + + + + + + + + + + + + + diff --git a/abs/core-testing/mythtv/stable.22/mythtv/menu-xml/mainmenu.xml.patch b/abs/core-testing/mythtv/stable.22/mythtv/menu-xml/mainmenu.xml.patch new file mode 100644 index 0000000..ed5dc72 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythtv/menu-xml/mainmenu.xml.patch @@ -0,0 +1,39 @@ +--- mainmenu.xml.orig 2009-10-16 12:45:44.000000000 +0000 ++++ mainmenu.xml 2009-10-16 14:30:57.000000000 +0000 +@@ -157,33 +157,9 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/abs/core-testing/mythtv/stable.22/mythtv/myth.sh b/abs/core-testing/mythtv/stable.22/mythtv/myth.sh new file mode 100755 index 0000000..fb7122c --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythtv/myth.sh @@ -0,0 +1,4 @@ +export PATH=$PATH:/usr/local/bin +# set core file size to 0 +ulimit -c 0 +export MALLOC_CHECK_=0 \ No newline at end of file diff --git a/abs/core-testing/mythtv/stable.22/mythtv/mythbackend b/abs/core-testing/mythtv/stable.22/mythtv/mythbackend new file mode 100755 index 0000000..93773a2 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythtv/mythbackend @@ -0,0 +1,38 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`pidof -o %PPID /usr/bin/mythbackend` +case "$1" in + start) + stat_busy "Starting MythTV Backend" + [ ! -e /var/run/mysqld.pid ] && echo -n "mysqld not started" && stat_fail && exit + [ -z "$PID" ] && /usr/bin/mythbackend -d -l /var/log/mythbackend.log -v important + if [ $? -gt 0 ]; then + stat_fail + else + echo $PID > /var/run/mythbackend.pid + add_daemon mythbackend + stat_done + fi + ;; + stop) + stat_busy "Stopping MythTV Backend" + [ ! -z "$PID" ] && kill $PID &>/dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon mythbackend + stat_done + fi + ;; + restart) + $0 stop + sleep 1s + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/abs/core-testing/mythtv/stable.22/mythtv/mythbackend.lr b/abs/core-testing/mythtv/stable.22/mythtv/mythbackend.lr new file mode 100644 index 0000000..4f218bc --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythtv/mythbackend.lr @@ -0,0 +1,9 @@ +/var/log/mythtv/mythbackend.log { + copytruncate + daily + size 10M + missingok + rotate 7 + compress + notifempty +} diff --git a/abs/core-testing/mythtv/stable.22/mythtv/mythbackend.sh b/abs/core-testing/mythtv/stable.22/mythtv/mythbackend.sh new file mode 100755 index 0000000..e7a7b70 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythtv/mythbackend.sh @@ -0,0 +1,117 @@ +#!/bin/bash +# +# /etc/rc.d/init.d/mythbackend +# +# Starts the mythbackend as a daemon +# +# chkconfig: 345 90 10 +# description: Starts the mythbackend process as a daemon after the XWindows \ +# system is started, in runlevel 5. This allows scheduled \ +# recordings to occur without manual intervention. +# processname: mythbackend + +# Copyright (c) by Michael Thomson +# With thanks to Stu Tomlinson +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Default values to use if none are supplied in the config file. +# User who should start the mythbackend processes +MBE_USER="root" +# Directory holding the mythbackend binary +MBE_LOCATION="/usr/local/bin/" +# Name of mythbackend binary +MBE_PROG="mythbackend" +# Full path to mythbackend log file +MBE_LOGFILE="/var/log/mythtv/mythbackend.log" + +# Source function library. +. /etc/init.d/functions + +# Source config file if available +if [ -f "/etc/sysconfig/mythbackend" ]; then + . /etc/sysconfig/mythbackend +fi + +test -x ${MBE_LOCATION}${MBE_PROG} || exit 0 + +RETVAL=0 + +# +# See how we were called. +# + +start() { + # Check if mythbackend is already running + if [ ! -f /var/lock/subsys/${MBE_PROG} ]; then + echo -n "Starting ${MBE_PROG}: " + # /usr/local/bin/mythbackend -d -l /some/log/file + #daemon --user ${MBE_USER} ${MBE_LOCATION}${MBE_PROG} -d -l ${MBE_LOGFILE} + ${MBE_LOCATION}${MBE_PROG} -d -l ${MBE_LOGFILE} + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/${MBE_PROG} + echo + fi + return $RETVAL +} + +stop() { + echo -n "Stopping ${MBE_PROG}: " + killproc ${MBE_LOCATION}${MBE_PROG} + RETVAL=$? + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/${MBE_PROG} + echo + return $RETVAL +} + + +restart() { + stop + start +} + +reload() { + restart +} + +status_at() { + status ${MBE_LOCATION}${MBE_PROG} +} + +case "$1" in +start) + start + ;; +stop) + stop + ;; +reload|restart) + restart + ;; +condrestart) + if [ -f /var/lock/subsys/${MBE_PROG} ]; then + restart + fi + ;; +status) + status_at + ;; +*) + echo "Usage: $0 {start|stop|restart|condrestart|status}" + exit 1 +esac + +exit $? +exit $RETVAL diff --git a/abs/core-testing/mythtv/stable.22/mythtv/mythfrontend.lr b/abs/core-testing/mythtv/stable.22/mythtv/mythfrontend.lr new file mode 100644 index 0000000..1580533 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythtv/mythfrontend.lr @@ -0,0 +1,9 @@ +/var/log/mythtv/mythfrontend.log { + copytruncate + daily + size 10M + missingok + rotate 7 + compress + notifempty +} diff --git a/abs/core-testing/mythtv/stable.22/mythtv/mythtv.install b/abs/core-testing/mythtv/stable.22/mythtv/mythtv.install new file mode 100755 index 0000000..87507a5 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythtv/mythtv.install @@ -0,0 +1,30 @@ +# arg 1: the new package version +post_install() { + if [ ! -d /var/log/mythtv ] + then + mkdir -p /var/log/mythv + chown -R mythtv /var/log/mythtv + echo "---" > /var/log/mythtv/mythbackend.log + chown mythtv /var/log/mythtv/mythbackend.log + + fi +} + +post_upgrade() { + if [ ! -d /var/log/mythtv ] + then + mkdir -p /var/log/mythv + chown -R mythtv /var/log/mythtv + fi +} + + +# arg 1: the old package version +post_remove() { + /bin/true + +} + +op=$1 +shift +$op $* diff --git a/abs/core-testing/mythtv/stable.22/mythtv/pretty b/abs/core-testing/mythtv/stable.22/mythtv/pretty new file mode 100755 index 0000000..1cfc57b --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythtv/pretty @@ -0,0 +1,2 @@ +#!/bin/bash +su - mythtv -c "perl /usr/share/mythtv/contrib/user_jobs/mythrename.pl --link /myth/pretty" diff --git a/abs/core-testing/mythtv/stable.22/mythtv/smolt_jump.patch b/abs/core-testing/mythtv/stable.22/mythtv/smolt_jump.patch new file mode 100644 index 0000000..0fc452a --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythtv/smolt_jump.patch @@ -0,0 +1,30 @@ +Index: programs/mythfrontend/networkcontrol.cpp +=================================================================== +--- programs/mythfrontend/networkcontrol.cpp (revision 19291) ++++ programs/mythfrontend/networkcontrol.cpp (working copy) +@@ -83,6 +83,7 @@ + jumpMap["zoneminderliveview"] = "ZoneMinder Live View"; + jumpMap["zoneminderevents"] = "ZoneMinder Events"; + jumpMap["snapshot"] = "ScreenShot"; ++ jumpMap["mythsmolt"] = "MythSmolt"; + + // These jump point names match the (lowercased) locations from gContext + jumpMap["channelrecpriority"] = "Channel Recording Priorities"; +@@ -191,7 +192,7 @@ + pthread_create(&command_thread, NULL, CommandThread, this); + + gContext->addListener(this); +- ++ + connect(this, SIGNAL(newConnection()), this, SLOT(newConnection())); + } + +@@ -307,7 +308,7 @@ + cs = new QTextStream(s); + cs->setCodec("UTF-8"); + } +- ++ + if (client) + { + closedOldConn = true; diff --git a/abs/core-testing/mythtv/stable.22/mythvideo/PKGBUILD b/abs/core-testing/mythtv/stable.22/mythvideo/PKGBUILD new file mode 100644 index 0000000..04b1021 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythvideo/PKGBUILD @@ -0,0 +1,51 @@ +pkgname=mythvideo-svn +pkgver=22783 +pkgrel=1 +pkgdesc="Video playback and browsing plugin for MythTV" +url="http://www.mythtv.org" +license="GPL" +arch=('i686' 'x86_64') + +depends=('mythtv-svn' 'mplayer' 'perlxml' 'perl-libwww' 'perl-uri' 'perl-xml-simple' 'ffmpeg') +conflicts=('mythvideo') +groups=('mythtv-extras-svn') + +patches=() +source=(`echo ${patches[@]:0}`) +_svntrunk=http://cvs.mythtv.org/svn/branches/release-0-22-fixes/mythplugins +#_svntrunk=http://cvs.mythtv.org/svn/trunk/mythplugins +_svnmod=mythplugins + + +build() { + + svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod + svn revert -R $_svnmod + + cd $startdir/src/$_svnmod + + echo "--------------------------applying patches----------------------------------------------------" + for i in `echo ${patches[@]:0} ` + do + echo applying $i + echo "-----------------------------" + patch -Np0 -i ${startdir}/src/$i || return 1 + done + echo "--------------------------done applying patches-----------------------------------------------" + + [ "$CARCH" = "i686" ] && ARCH="i686" + [ "$CARCH" = "x86_64" ] && ARCH="x86-64" + + # clean up + make distclean + + # configure + ./configure --prefix=/usr --cpu=${ARCH} --disable-all --enable-opengl \ + --enable-mythvideo || return 1 + + # build and install + . /etc/profile + make || return 1 + make INSTALL_ROOT=$startdir/pkg install || return 1 + +} diff --git a/abs/core-testing/mythtv/stable.22/mythweather/PKGBUILD b/abs/core-testing/mythtv/stable.22/mythweather/PKGBUILD new file mode 100644 index 0000000..f3a45e5 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythweather/PKGBUILD @@ -0,0 +1,51 @@ +pkgname=mythweather-svn +pkgver=22783 +pkgrel=1 +pkgdesc="Weather checking plugin for MythTV" +url="http://www.mythtv.org" +license="GPL" +arch=('i686' 'x86_64') + +depends=('mythtv-svn' 'wget') +conflicts=('mythweather') +groups=('mythtv-extras-svn') + +patches=() +source=(`echo ${patches[@]:0}`) +_svntrunk=http://cvs.mythtv.org/svn/branches/release-0-22-fixes/mythplugins +#_svntrunk=http://cvs.mythtv.org/svn/trunk/mythplugins +_svnmod=mythplugins + + +build() { + + svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod + svn revert -R $_svnmod + + cd $startdir/src/$_svnmod + + echo "--------------------------applying patches----------------------------------------------------" + for i in `echo ${patches[@]:0} ` + do + echo applying $i + echo "-----------------------------" + patch -Np0 -i ${startdir}/src/$i || return 1 + done + echo "--------------------------done applying patches-----------------------------------------------" + + [ "$CARCH" = "i686" ] && ARCH="i686" + [ "$CARCH" = "x86_64" ] && ARCH="x86-64" + + # clean up + make distclean + + # configure + ./configure --prefix=/usr --cpu=${ARCH} --disable-all --enable-opengl \ + --enable-mythweather || return 1 + + # build and install + . /etc/profile + make || return 1 + make INSTALL_ROOT=$startdir/pkg install || return 1 + +} diff --git a/abs/core-testing/mythtv/stable.22/mythweb/PKGBUILD b/abs/core-testing/mythtv/stable.22/mythweb/PKGBUILD new file mode 100644 index 0000000..edd6681 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythweb/PKGBUILD @@ -0,0 +1,49 @@ +pkgname=mythweb-svn +pkgver=22783 +pkgrel=1 +pkgdesc="Web interface for MythTV's backend" +url="http://www.mythtv.org" +license="GPL" +arch=('i686' 'x86_64') + +depends=('mythtv-svn' 'lighttpd' 'php' 'local-website') +conflicts=('mythweb') +groups=('mythtv-extras-svn') +install=mythweb.install + +patches=() +source=(`echo ${patches[@]:0}`) +_svntrunk=http://cvs.mythtv.org/svn/branches/release-0-22-fixes/mythplugins +#_svntrunk=http://cvs.mythtv.org/svn/trunk/mythplugins +_svnmod=mythplugins + +DOCROOT=/data/srv/httpd/htdocs/mythweb + +build() { + + svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod + svn revert -R $_svnmod + + cd $startdir/src/$_svnmod + + echo "--------------------------applying patches----------------------------------------------------" + for i in `echo ${patches[@]:0} ` + do + echo applying $i + echo "-----------------------------" + patch -Np0 -i ${startdir}/src/$i || return 1 + done + echo "--------------------------done applying patches-----------------------------------------------" + + [ "$CARCH" = "i686" ] && ARCH="i686" + [ "$CARCH" = "x86_64" ] && ARCH="x86-64" + + mkdir -p $startdir/pkg/$DOCROOT/{image_cache,php_sessions} + + cp -r $startdir/src/mythplugins/mythweb/* $startdir/pkg/$DOCROOT +# cp $startdir/src/mythplugins-$pkgver/mythweb/data/.htaccess $startdir/pkg/$DOCROOT + rm $startdir/pkg/srv/$DOCROOT/README + chown -R http:users $startdir/pkg/$DOCROOT + chmod g+rw $startdir/pkg/$DOCROOT/{image_cache,php_sessions,data} + +} diff --git a/abs/core-testing/mythtv/stable.22/mythweb/mythweb.install b/abs/core-testing/mythtv/stable.22/mythweb/mythweb.install new file mode 100644 index 0000000..470cbd1 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythweb/mythweb.install @@ -0,0 +1,10 @@ +post_install() { + echo "You must create a symlink from /home/httpd/html/mythweb/video_dir" + echo "to your MythTV recordings directory. Don't forget to change the" + echo "permissions so that the webserver can read those files and create" + echo "thumbnails." +} + +op=$1 +shift +$op $* diff --git a/abs/core-testing/mythtv/stable.22/mythzoneminder/PKGBUILD b/abs/core-testing/mythtv/stable.22/mythzoneminder/PKGBUILD new file mode 100644 index 0000000..1ccfd05 --- /dev/null +++ b/abs/core-testing/mythtv/stable.22/mythzoneminder/PKGBUILD @@ -0,0 +1,51 @@ +pkgname=mythzoneminder-svn +pkgver=22783 +pkgrel=1 +pkgdesc="Integrates ZoneMinder into MythTV" +url="http://www.mythtv.org" +license="GPL" +arch=('i686' 'x86_64') + +depends=('mythtv-svn' 'zoneminder=1.23.3') +conflicts=('mythzoneminder') +groups=('mythtv-extras-svn') + +patches=() +source=(`echo ${patches[@]:0}`) +_svntrunk=http://cvs.mythtv.org/svn/branches/release-0-22-fixes/mythplugins +#_svntrunk=http://cvs.mythtv.org/svn/trunk/mythplugins +_svnmod=mythplugins + + +build() { + + svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod + svn revert -R $_svnmod + + cd $startdir/src/$_svnmod + + echo "--------------------------applying patches----------------------------------------------------" + for i in `echo ${patches[@]:0} ` + do + echo applying $i + echo "-----------------------------" + patch -Np0 -i ${startdir}/src/$i || return 1 + done + echo "--------------------------done applying patches-----------------------------------------------" + + [ "$CARCH" = "i686" ] && ARCH="i686" + [ "$CARCH" = "x86_64" ] && ARCH="x86-64" + + # clean up + make distclean + + # configure + ./configure --prefix=/usr --cpu=${ARCH} --disable-all --enable-opengl \ + --enable-mythzoneminder || return 1 + + # build and install + . /etc/profile + make || return 1 + make INSTALL_ROOT=$startdir/pkg install || return 1 + +} -- cgit v0.12 From 6cd593470c94ffb4196fc1b5b29529035320bb2b Mon Sep 17 00:00:00 2001 From: James Meyer Date: Fri, 13 Nov 2009 00:40:19 -0600 Subject: runit-scripts: lirc fix type so that serial_port is used as a var instead of string. --- abs/core-testing/runit-scripts/PKGBUILD | 2 +- abs/core-testing/runit-scripts/runitscripts/services/lircd/run | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/abs/core-testing/runit-scripts/PKGBUILD b/abs/core-testing/runit-scripts/PKGBUILD index 3407502..60d78b5 100755 --- a/abs/core-testing/runit-scripts/PKGBUILD +++ b/abs/core-testing/runit-scripts/PKGBUILD @@ -1,6 +1,6 @@ pkgname=runit-scripts pkgver=1.8.0 -pkgrel=97 +pkgrel=101 pkgdesc="collection of startup scripts for runit" url="http://smarden.org/runit/" license="BSD" diff --git a/abs/core-testing/runit-scripts/runitscripts/services/lircd/run b/abs/core-testing/runit-scripts/runitscripts/services/lircd/run index 9498f02..07ec214 100755 --- a/abs/core-testing/runit-scripts/runitscripts/services/lircd/run +++ b/abs/core-testing/runit-scripts/runitscripts/services/lircd/run @@ -72,7 +72,7 @@ else FLAGS="io=0x2e8 irq=3" ;; esac - /usr/bin/setserial /dev/serial_port uart none + /usr/bin/setserial /dev/$serial_port uart none sleep 0.5 /sbin/modprobe lirc_serial $FLAGS sleep 0.5 -- cgit v0.12 From 3251e21005266863c1cbce4e7181c61dd7dda02e Mon Sep 17 00:00:00 2001 From: James Meyer Date: Fri, 13 Nov 2009 01:21:09 -0600 Subject: mythtv-22: pkgbump --- abs/core-testing/mythtv/stable.22/mythtv/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abs/core-testing/mythtv/stable.22/mythtv/PKGBUILD b/abs/core-testing/mythtv/stable.22/mythtv/PKGBUILD index 3a8ef52..d09bdf7 100755 --- a/abs/core-testing/mythtv/stable.22/mythtv/PKGBUILD +++ b/abs/core-testing/mythtv/stable.22/mythtv/PKGBUILD @@ -1,5 +1,5 @@ pkgname=mythtv-release-fixes-22 -pkgver=22783 +pkgver=22814 pkgrel=1 pkgdesc="A personal video recorder for Linux" url="http://www.mythtv.org" -- cgit v0.12 From 420f4c0c8157237d3b4b682a27db498b80c9e0f3 Mon Sep 17 00:00:00 2001 From: James Meyer Date: Fri, 13 Nov 2009 01:21:46 -0600 Subject: mythinstall.22: first check in of MythVantage against .22. --- abs/core-testing/mythinstall-22/PKGBUILD | 23 ++++++++++ .../mythinstall-22/checkout_MythVantage.sh | 49 ++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 abs/core-testing/mythinstall-22/PKGBUILD create mode 100755 abs/core-testing/mythinstall-22/checkout_MythVantage.sh diff --git a/abs/core-testing/mythinstall-22/PKGBUILD b/abs/core-testing/mythinstall-22/PKGBUILD new file mode 100644 index 0000000..89cca2f --- /dev/null +++ b/abs/core-testing/mythinstall-22/PKGBUILD @@ -0,0 +1,23 @@ +# Maintainer: Jams +pkgname=mythinstall-22 +pkgver=2 +pkgrel=1 +pkgdesc="LinHES installer/systemconfig GUI." +arch=i686 +depends=() +makedepends=(mythtv-release-fixes-22) + +source=(mythinstall.bin) + +build() { + +# It is assumed that you have built the mythtv package in the same +# LinHES-PKGBUILD area. + MVBINDIR=$startdir/pkg/usr/MythVantage/bin + mkdir -p $MVBINDIR + install -m 0755 mythinstall.bin $MVBINDIR/MythVantage + cd $MVBINDIR + ln -s MythVantage mythvantage + ln -s MythVantage mythinstall + cd - +} diff --git a/abs/core-testing/mythinstall-22/checkout_MythVantage.sh b/abs/core-testing/mythinstall-22/checkout_MythVantage.sh new file mode 100755 index 0000000..82002c8 --- /dev/null +++ b/abs/core-testing/mythinstall-22/checkout_MythVantage.sh @@ -0,0 +1,49 @@ +#!/bin/bash +MYDIR=`pwd` +MYTHPATH="\/data\/LinHES-PKGBUILD\/abs\/core-testing\/mythtv\/stable.22\/mythtv\/src\/mythtv" + +function setup_links { +rm mythinstall.bin +rm mythbeselect.bin +ln -s $MYDIR/src/MythVantage-app/mythinstall/mythinstall ./mythinstall.bin +ln -s $MYDIR/src/MythVantage-app/mythbeselect/mythbeselect ./mythbeselect.bin +} + +function dl_repo { +mkdir src +cd src +if [ ! -d MythVantage-app ] +then + git clone http://mythvantage.com/MythVantage-app.git/ + cd MythVantage-app + git checkout --track -b LinHES origin/LinHES + cd $MYDIR + setup_links + cd - +else + echo "updating exisiting tree" + cd MythVantage-app + git pull + git checkout master + git merge + cd - +fi + +cd MythVantage-app +git checkout master +#git checkout origin/LinHES + +} + +dl_repo +sed -i "s/^MYTHPATH.*$/MYTHPATH\=\"$MYTHPATH\"/g" $MYDIR/src/MythVantage-app/mythinstall/mythinstall.pro +sed -i "s/#define __MVAPP__/\/\/#define __MVAPP__/g" $MYDIR/src/MythVantage-app/mythinstall/mv_common.h +sed -i "s/mythvantage/LinHES/g" $MYDIR/src/MythVantage-app/mythinstall/mv_common.h + +echo "INCLUDEPATH += /usr/include/mythtv" >> $MYDIR/src/MythVantage-app/mythbeselect/mythberestart.pro +echo "INCLUDEPATH += /usr/include/mythtv" >> $MYDIR/src/MythVantage-app/mythinstall/mythinstall.pro +cd $MYDIR/src/MythVantage-app/mythinstall && qmake +make || exit 1 +#cd $MYDIR/src/MythVantage-app/mythbeselect && qmake +#make ||exit 1 + -- cgit v0.12 From f1e3c5f9132ab7fdf1e1d33f6020a82a9869096a Mon Sep 17 00:00:00 2001 From: James Meyer Date: Fri, 13 Nov 2009 01:22:22 -0600 Subject: LinHES-config-22: first check in of LinHES-config-22 --- abs/core-testing/LinHES-config-22/LinHES-release | 1 + abs/core-testing/LinHES-config-22/LinHES.install | 78 ++ abs/core-testing/LinHES-config-22/MythVantage.sh | 3 + abs/core-testing/LinHES-config-22/PKGBUILD | 103 ++ abs/core-testing/LinHES-config-22/README | 9 + abs/core-testing/LinHES-config-22/add_service.sh | 15 + abs/core-testing/LinHES-config-22/autocard.py | 307 +++++ abs/core-testing/LinHES-config-22/bpopup-ui.xml | 164 +++ .../LinHES-config-22/build_diskless.sh | 143 ++ .../LinHES-config-22/checkout_MythVantage.sh | 49 + abs/core-testing/LinHES-config-22/create_master.sh | 57 + .../LinHES-config-22/file_time_offset.py | 39 + abs/core-testing/LinHES-config-22/install-ui.xml | 175 +++ .../LinHES-config-22/install_db_chroot.sh | 63 + .../LinHES-config-22/install_functions.sh | 344 +++++ abs/core-testing/LinHES-config-22/install_proxy.sh | 234 ++++ abs/core-testing/LinHES-config-22/issue | 2 + abs/core-testing/LinHES-config-22/live-install.sh | 28 + abs/core-testing/LinHES-config-22/mv_advanced.py | 384 ++++++ abs/core-testing/LinHES-config-22/mv_common.py | 201 +++ abs/core-testing/LinHES-config-22/mv_config.py | 17 + abs/core-testing/LinHES-config-22/mv_ddns.py | 26 + abs/core-testing/LinHES-config-22/mv_hostype.py | 230 ++++ abs/core-testing/LinHES-config-22/mv_install.py | 1432 ++++++++++++++++++++ abs/core-testing/LinHES-config-22/mv_ir.py | 330 +++++ abs/core-testing/LinHES-config-22/mv_misc.py | 180 +++ abs/core-testing/LinHES-config-22/mv_network.py | 507 +++++++ .../LinHES-config-22/mv_screensaver.py | 199 +++ abs/core-testing/LinHES-config-22/mv_smolt.py | 59 + abs/core-testing/LinHES-config-22/mv_software.py | 61 + abs/core-testing/LinHES-config-22/mv_webuser.py | 21 + abs/core-testing/LinHES-config-22/myth_user_call | 174 +++ .../LinHES-config-22/myth_user_call.py | 159 +++ abs/core-testing/LinHES-config-22/networkconfig.sh | 341 +++++ .../LinHES-config-22/remove_service.sh | 8 + .../LinHES-config-22/restore_default_settings.sh | 362 +++++ .../LinHES-config-22/restore_km_db_chroot.sh | 61 + abs/core-testing/LinHES-config-22/soundconfig.sh | 254 ++++ abs/core-testing/LinHES-config-22/startx | 29 + abs/core-testing/LinHES-config-22/systemconfig.py | 244 ++++ abs/core-testing/LinHES-config-22/systemconfig.sh | 19 + abs/core-testing/LinHES-config-22/timezip.py | 232 ++++ abs/core-testing/LinHES-config-22/xconfig.sh | 363 +++++ 43 files changed, 7707 insertions(+) create mode 100644 abs/core-testing/LinHES-config-22/LinHES-release create mode 100644 abs/core-testing/LinHES-config-22/LinHES.install create mode 100755 abs/core-testing/LinHES-config-22/MythVantage.sh create mode 100644 abs/core-testing/LinHES-config-22/PKGBUILD create mode 100644 abs/core-testing/LinHES-config-22/README create mode 100755 abs/core-testing/LinHES-config-22/add_service.sh create mode 100755 abs/core-testing/LinHES-config-22/autocard.py create mode 100755 abs/core-testing/LinHES-config-22/bpopup-ui.xml create mode 100755 abs/core-testing/LinHES-config-22/build_diskless.sh create mode 100755 abs/core-testing/LinHES-config-22/checkout_MythVantage.sh create mode 100755 abs/core-testing/LinHES-config-22/create_master.sh create mode 100755 abs/core-testing/LinHES-config-22/file_time_offset.py create mode 100755 abs/core-testing/LinHES-config-22/install-ui.xml create mode 100644 abs/core-testing/LinHES-config-22/install_db_chroot.sh create mode 100755 abs/core-testing/LinHES-config-22/install_functions.sh create mode 100755 abs/core-testing/LinHES-config-22/install_proxy.sh create mode 100644 abs/core-testing/LinHES-config-22/issue create mode 100755 abs/core-testing/LinHES-config-22/live-install.sh create mode 100755 abs/core-testing/LinHES-config-22/mv_advanced.py create mode 100755 abs/core-testing/LinHES-config-22/mv_common.py create mode 100755 abs/core-testing/LinHES-config-22/mv_config.py create mode 100755 abs/core-testing/LinHES-config-22/mv_ddns.py create mode 100755 abs/core-testing/LinHES-config-22/mv_hostype.py create mode 100755 abs/core-testing/LinHES-config-22/mv_install.py create mode 100755 abs/core-testing/LinHES-config-22/mv_ir.py create mode 100755 abs/core-testing/LinHES-config-22/mv_misc.py create mode 100755 abs/core-testing/LinHES-config-22/mv_network.py create mode 100755 abs/core-testing/LinHES-config-22/mv_screensaver.py create mode 100755 abs/core-testing/LinHES-config-22/mv_smolt.py create mode 100755 abs/core-testing/LinHES-config-22/mv_software.py create mode 100755 abs/core-testing/LinHES-config-22/mv_webuser.py create mode 100644 abs/core-testing/LinHES-config-22/myth_user_call create mode 100755 abs/core-testing/LinHES-config-22/myth_user_call.py create mode 100644 abs/core-testing/LinHES-config-22/networkconfig.sh create mode 100755 abs/core-testing/LinHES-config-22/remove_service.sh create mode 100755 abs/core-testing/LinHES-config-22/restore_default_settings.sh create mode 100644 abs/core-testing/LinHES-config-22/restore_km_db_chroot.sh create mode 100755 abs/core-testing/LinHES-config-22/soundconfig.sh create mode 100755 abs/core-testing/LinHES-config-22/startx create mode 100755 abs/core-testing/LinHES-config-22/systemconfig.py create mode 100755 abs/core-testing/LinHES-config-22/systemconfig.sh create mode 100755 abs/core-testing/LinHES-config-22/timezip.py create mode 100755 abs/core-testing/LinHES-config-22/xconfig.sh diff --git a/abs/core-testing/LinHES-config-22/LinHES-release b/abs/core-testing/LinHES-config-22/LinHES-release new file mode 100644 index 0000000..6a885f4 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/LinHES-release @@ -0,0 +1 @@ +LinHES R6.01.00 (Chugu) diff --git a/abs/core-testing/LinHES-config-22/LinHES.install b/abs/core-testing/LinHES-config-22/LinHES.install new file mode 100644 index 0000000..a0a9d31 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/LinHES.install @@ -0,0 +1,78 @@ +# This is a default template for a post-install scriptlet. You can +# remove any functions you don't need (and this header). + +# arg 1: the new package version +pre_install() { + rm -f /etc/issue + rm -f /etc/arch-release + +} + +# arg 1: the new package version +post_install() { + if [ ! -f /etc/blacklist.package ] + then + echo "List of packages to ignore" > /etc/blacklist.package + echo "one package per line" >> /etc/blacklist.package + fi + +LINE="mythtv ALL = NOPASSWD:/usr/MythVantage/bin/mythvantage" +LINE1="mythtv ALL = NOPASSWD:/usr/MythVantage/bin/MythVantage" +for i in "$LINE" "$LINE1" +do + cp /etc/sudoers /etc/sudoers.bak + grep -q "$i" /etc/sudoers + if [ $? != 0 ] + then + echo "$i" >> /etc/sudoers + visudo -cf /etc/sudoers + if [ ! $? = 0 ] + then + cp /etc/sudoers.bak /etc/sudoers + echo $i + echo "Error adding files" + exit 1 + fi + fi +done + + +} + +# arg 1: the new package version +# arg 2: the old package version +pre_upgrade() { + /bin/true +} + +# arg 1: the new package version +# arg 2: the old package version +post_upgrade() { + . /etc/profile + ps -ef|grep mysqld|grep -v grep + status=$? + echo "status $status" + if [ $status = 0 ] + then + restore_default_settings.sh -c load + fi + if [ ! -f /etc/blacklist.package ] + then + echo "List of packages to ignore" > /etc/blacklist.package + echo "one package per line" >> /etc/blacklist.package + fi +} + +# arg 1: the old package version +pre_remove() { + /bin/true +} + +# arg 1: the old package version +post_remove() { + /bin/true +} + +op=$1 +shift +$op $* diff --git a/abs/core-testing/LinHES-config-22/MythVantage.sh b/abs/core-testing/LinHES-config-22/MythVantage.sh new file mode 100755 index 0000000..286c908 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/MythVantage.sh @@ -0,0 +1,3 @@ +export MV_ROOT=/usr/MythVantage +export PATH=$PATH:$MV_ROOT/bin +export TEMPLATES=$MV_ROOT/templates diff --git a/abs/core-testing/LinHES-config-22/PKGBUILD b/abs/core-testing/LinHES-config-22/PKGBUILD new file mode 100644 index 0000000..8bbf862 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/PKGBUILD @@ -0,0 +1,103 @@ +pkgname=LinHES-config-22 +pkgver=2.1 +pkgrel=8 +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 + python-iplib mythinstall-22) +arch=('i686') + +source=(mv_install.py + mv_config.py + 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_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) + +install=LinHES.install + +build() { + mkdir -p $startdir/pkg/etc + mkdir -p $startdir/pkg/usr/share/mythtv/themes/default + + MVDIR=$startdir/pkg/usr/MythVantage + mkdir $startdir/pkg/etc/profile.d + install -m 0755 MythVantage.sh $startdir/pkg/etc/profile.d/MythVantage.sh + mkdir -p $MVDIR/bin + 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.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 + install -m 0755 xconfig.sh $MVDIR/bin/xconfig.sh + install -m 0755 install_db_chroot.sh $MVDIR/bin/install_db_chroot.sh + install -m 0755 restore_km_db_chroot.sh $MVDIR/bin/restore_km_db_chroot.sh + install -m 0755 restore_default_settings.sh $MVDIR/bin/restore_default_settings.sh + install -m 0755 soundconfig.sh $MVDIR/bin/soundconfig.sh + install -m 0755 networkconfig.sh $MVDIR/bin/networkconfig.sh + install -m 0755 create_master.sh $MVDIR/bin/create_master.sh + install -m 0755 build_diskless.sh $MVDIR/bin/build_diskless.sh + install -m 0755 timezip.py $MVDIR/bin/timezip.py + install -m 0755 autocard.py $MVDIR/bin/autocard.py + 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/ + + #README file displayed on install + install -m 0755 README $MVDIR/README + + mkdir -p $startdir/pkg/usr/bin + install -m 0755 file_time_offset.py $startdir/pkg/usr/bin/file_time_offset.py + + #Copy in the branding stuff + install -m 0755 LinHES-release $startdir/pkg/etc/LinHES-release + install -m 0755 issue $startdir/pkg/etc/issue + + # copy over the ui files + install -m 0755 install-ui.xml $startdir/pkg/usr/share/mythtv/themes/default/ +} diff --git a/abs/core-testing/LinHES-config-22/README b/abs/core-testing/LinHES-config-22/README new file mode 100644 index 0000000..447678a --- /dev/null +++ b/abs/core-testing/LinHES-config-22/README @@ -0,0 +1,9 @@ +Thanks for choosing LinHES! At the moment, LinHES is compiled for i686. +If you have an i586 class system, LinHES won't work for you. I've not seen a great request for i586. If you want it, you have to drum up support for it. The PVR-350 TV out isn't supported at this time. I have to determine if it works with MythTV 0.22 first. + +Support for LinHES can be obtained at: +http://linhes.org +irc.freenode.net #linhes + +Bugs can be reported at: +http://linhes.org/flyspray diff --git a/abs/core-testing/LinHES-config-22/add_service.sh b/abs/core-testing/LinHES-config-22/add_service.sh new file mode 100755 index 0000000..190d604 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/add_service.sh @@ -0,0 +1,15 @@ +#!/bin/bash +SERVICE_DIR=/var/service +SCRIPT_DIR=/etc/sv +if [ -d $SCRIPT_DIR/$1 ] +then + if [ -d $SERVICE_DIR/$1 ] + then + echo "$1 already there" + else + ln -s $SCRIPT_DIR/$1 $SERVICE_DIR/$1 + echo "adding $1" + fi +else + echo "couldn't find $SCRIPT_DIR/$1" +fi diff --git a/abs/core-testing/LinHES-config-22/autocard.py b/abs/core-testing/LinHES-config-22/autocard.py new file mode 100755 index 0000000..03eecac --- /dev/null +++ b/abs/core-testing/LinHES-config-22/autocard.py @@ -0,0 +1,307 @@ +#!/usr/bin/python +# import MySQL module +#jm +import MySQLdb +import sys +import getopt +import socket +import os +import time +import string +import glob +from string import letters +from string import digits +def INSERTNULL_SOURCE(name,xmltvgrabber,userid,freqtable,lineupid,password,useeit): + cursor = db.cursor() + cursor.execute("INSERT INTO videosource(name,xmltvgrabber,userid,freqtable,lineupid,password,useeit) VALUES(%s,%s,%s,%s,%s,%s,%s);",(name,xmltvgrabber,userid,freqtable,lineupid,password,useeit)) + +def INSERTCARD_INTOMYTH(Device,Driver,Cardvendor): + global currenthostname + print Device + print Driver, + print Cardvendor + cursor = db.cursor() + insert = "false" + if Driver == "ivtv" : + cardtype="MPEG" + defaultinput="Tuner 1" + insert="true" + if Cardvendor == "pcHDTV HD3000 HDTV": + insert="false" + cardtype ="whocares" + + #print insert + if insert == "true" : + cursor.execute("INSERT INTO capturecard (videodevice,cardtype,defaultinput,hostname) VALUES(%s,%s,%s,%s);",(Device,cardtype,defaultinput,currenthostname)) + +def INSERTHDR_INTOMYTH(deviceid,tuner_number): + cardtype='HDHOMERUN' + defaultinput='MPEG2TS' + global currenthostname + print deviceid + print cardtype + print defaultinput + print tuner_number + cursor = db.cursor() + #print insert + cursor.execute("INSERT INTO capturecard (videodevice,cardtype,defaultinput,dbox2_port ,hostname) VALUES(%s,%s,%s,%s,%s);",(deviceid,cardtype,defaultinput,tuner_number,currenthostname)) + +def INSERTAUTOCARD(): + global cardlist + global currenthostname + # create a cursor + cursor = db.cursor() + + + for i in range( 1 , len(cardlist)): + insert = "false" +# print cardlist[i] + Device=cardlist[i][0] + Driver=cardlist[i][1] + Cardvendor=cardlist[i][2] + Businfo=cardlist[i][3] + if Driver == "ivtv" : + insert="true" + devicestatus="unused" + if Cardvendor == "pcHDTV HD3000 HDTV": + insert="false" + cardtype ="whocares" + if Driver == "hdr": + insert="true" + devicestatus="unused" + + if insert == "true" : + cursor.execute("delete from autocard where uniqid=%s;",(Businfo)) + if Driver=="hdr": + Cardvendor="HDHOMERUN Tuner 1" + cursor.execute("INSERT INTO autocard (dev,driver,description,uniqid,devicestatus,hostname) VALUES(%s,%s,%s,%s,%s,%s);",(Device,Driver,Cardvendor,Businfo,devicestatus,currenthostname)) + Cardvendor="HDHOMERUN Tuner 2" + cursor.execute("INSERT INTO autocard (dev,driver,description,uniqid,devicestatus,hostname) VALUES(%s,%s,%s,%s,%s,%s);",(Device,Driver,Cardvendor,Businfo,devicestatus,currenthostname)) + + else: + cursor.execute("INSERT INTO autocard (dev,driver,description,uniqid,devicestatus,hostname) VALUES(%s,%s,%s,%s,%s,%s);",(Device,Driver,Cardvendor,Businfo,devicestatus,currenthostname)) + + + +def PRINTINFO(): + global cardlist + + for list in cardlist: + if list != "_placeholder_": + print list + #print "-------------" + +def GATHER_HDR(): + global cardlist + command="/usr/bin/hdhomerun_config --discover" + results=os.popen(command,'r') + line=results.readline() + if line.strip().split()[0] == "no": + print "HDHOMERUN not detected" + else: + print line + hdrdevice=line.strip().split()[2] + print hdrdevice + Driver="hdr" + Device=hdrdevice + Cardtype="HDHOMERUN" + Businfo=hdrdevice + cardprops = [Device,Driver , Cardtype , Businfo] + cardlist.append(cardprops) + + +def GATHER_v4l_CARDS(): + global cardlist + cardlist=["_placeholder_"] + # print "Looking for v4l cards" + try: + filelist = os.listdir('/dev/v4l/') + except OSError: + filelist=" " + #fakelist=['/dev/v4l/video3', 'ivtv', 'WinTV PVR 500 (unit #2)', '0000:04:09.0'] + #cardlist.append(fakelist) + try: + filelist = glob.glob("/dev/v4l/video?") + Driver="" + Cardtype="" + Businfo="" + numcards = 0 + for Device in filelist: + #print card + numcards = numcards+1 + cmd = 'v4l2-ctl -D -d' + Device + for line in os.popen(cmd).readlines(): + #print line + pos = string.find(line,"Driver name") + if pos >=0: + splitline= line.split(':') + Driver=splitline[1].strip() + pos = string.find(line,"Card type") + if pos >=0: + splitline= line.split(':') + Cardtype=splitline[1].strip() + + pos = string.find(line,"Bus info") + if pos >=0: + splitline= line.split(':',1) + Businfo=splitline[1].strip() + + #print Device,Driver , Cardtype , Businfo,numcards + cardprops = [Device,Driver , Cardtype , Businfo] + cardlist.append(cardprops) + except IOError: + print "no v4l cards found" + sys.exit(2) + + +def WRITEUDEV_IVTV(): + global insertmyth + cursor = db.cursor() + #add ivtv,cid lookup loop through until empty. + cursor.execute("select distinct(uniqid) from autocard where driver='ivtv' and devicestatus='will-add'") + cidrows = cursor.fetchall() + for row in cidrows: + cid=row[0] + cursor.execute("select dev,driver,description,devicestatus,hostname from autocard where uniqid=%s limit 1;",(cid)) + result = cursor.fetchone() + description=result[2] + driver='DRIVERS==\"ivtv\"' + ATTRNAME='ATTR{name}=="ivtv? encoder MPG"' + KERNELS='KERNELS==\"' + KERNELS+=cid + KERNELS+="\"" + #filter out non digit or chars + keep=letters.join(digits) + description=filter(lambda c: c in keep, description) + devnode="ivtv/" + #devnode+=description + "_" + udevcid=cid.partition(":") + devnode+=udevcid[2] + devnode+="_video" + UDEV_RULE=driver +', '+ATTRNAME+', '+ KERNELS +', ' + 'NAME=\"' + devnode + '"' + print "Here is the udev rule" + print UDEV_RULE + filename='/etc/udev/rules.d/11-ivtv-'+cid+'.rules' + file = open(filename,'w') + file.write(UDEV_RULE) + if ( insertmyth == "true"): + devnode="/dev/"+devnode + INSERTCARD_INTOMYTH(devnode,"ivtv",description) + cursor.execute("update autocard set devicestatus='done' where uniqid=%s;",(cid)) +#now insert HDR + cursor.execute("select distinct(uniqid),description from autocard where driver='hdr' and devicestatus='will-add'") + cidrows = cursor.fetchall() + for row in cidrows: + if ( insertmyth == "true"): + deviceid=row[0] + #cardtype="HDHOMRUN" + #defaultinput="MPEG2TS" + dbox2_port=row[1] + tuner_number=dbox2_port.rpartition(' ')[2] + INSERTHDR_INTOMYTH(deviceid,tuner_number) + cursor.execute("update autocard set devicestatus='done' where uniqid=%s and description=%s;",(deviceid,dbox2_port)) + + + +def CLEARAUTOCARD(): + cursor = db.cursor() + cursor.execute("delete from autocard") + +def RELOADUDEV(): + print "relaoding udev rules" + os.system('udevcontrol reload_rules') + os.system('rmmod ivtv') + os.system('udevtrigger') + + +def usage(): + print " -h help" + print " -g gather and print out the found cards" + print " -w write out the udev rules" + print " -i insert cards into myth that are marked will-add(only used with -w)" + print " -r reload udev rules" + print " -c clear the autocard db" + +def main(argv): + global db + global cardlist + global currenthostname + currenthostname="" + writeudev="false" + global insertmyth + insertmyth ="false" + + db = MySQLdb.connect(host="localhost", user="mythtv", passwd="mythtv", db="mythconverg") + try: + cursor = db.cursor() + cursor.execute("describe autocard;") + except MySQLdb.Error, e: + cursor.execute("create table autocard(dev varchar(50),driver varchar(50),description varchar(50),uniqid varchar(50), devicestatus varchar(50),hostname varchar(50));") + print "table created" + + if ( currenthostname == "" ): + currenthostname = socket.gethostname() + + + try: + opts, args = getopt.getopt(argv, "hgwircd", ["help", "gathercards", "writeudev" ,"insert" , "reloadudev" , "clearautocard"] ) + except getopt.GetoptError: + sys.exit(2) + for opt, arg in opts: + if opt in ("-h", "--help"): + usage() + sys.exit() + elif opt in ( "-g" , "--gathercards"): + GATHER_v4l_CARDS() + GATHER_HDR() + INSERTAUTOCARD() + PRINTINFO() + elif opt in ("-w", "--writeudev"): + writeudev="true" + elif opt in ("-i", "--insert"): + insertmyth="true" + elif opt in ( "-r" , "--reloadudev"): + RELOADUDEV() + elif opt in ( "-c" , "--clearautocard"): + CLEARAUTOCARD() + elif opt in ( "-d" ): + INSERTCARD_INTOMYTH("file:/myth/video/TripThe1939.mpeg","ivtv","Dummy tuner") + INSERTNULL_SOURCE("dummy","/bin/true","","default","NULL","NULL","0") + + if ( writeudev == "true"): + WRITEUDEV_IVTV() + + + + + + +if __name__ == "__main__": + main(sys.argv[1:]) + + + + + +#mysql> create table autocard(dev varchar(50),driver varchar(50),description varchar(50),uniqid varchar(50), devicestatus varchar(50),hostname varchar(50)); +#Query OK, 0 rows affected (0.14 sec) + +#mysql> describe autocard; +#+--------------+-------------+------+-----+---------+-------+ +#| Field | Type | Null | Key | Default | Extra | +#+--------------+-------------+------+-----+---------+-------+ +#| dev | varchar(50) | YES | | NULL | | +#| driver | varchar(50) | YES | | NULL | | +#| description | varchar(50) | YES | | NULL | | +#| uniqid | varchar(50) | YES | | NULL | | +#| devicestatus | varchar(50) | YES | | NULL | | +#| hostname | varchar(50) | YES | | NULL | | +#+--------------+-------------+------+-----+---------+-------+ + + + + + + + + diff --git a/abs/core-testing/LinHES-config-22/bpopup-ui.xml b/abs/core-testing/LinHES-config-22/bpopup-ui.xml new file mode 100755 index 0000000..df0598b --- /dev/null +++ b/abs/core-testing/LinHES-config-22/bpopup-ui.xml @@ -0,0 +1,164 @@ + + + + + + + + #ffff00 + #000000 + 24 + 3,3 + yes + + + + #9999cc + 18 + yes + + + + #ffff00 + #000000 + 18 + 3,3 + yes + + + + #ffffff + 18 + yes + + + + #ffffff + 50 + yes + + + #ff0000 + #000000 + 16 + 2,2 + yes + + + + #ffff00 + 14 + yes + + + + 0,0,800,600 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/abs/core-testing/LinHES-config-22/build_diskless.sh b/abs/core-testing/LinHES-config-22/build_diskless.sh new file mode 100755 index 0000000..4dfd5fc --- /dev/null +++ b/abs/core-testing/LinHES-config-22/build_diskless.sh @@ -0,0 +1,143 @@ +#!/bin/bash +#CD=/mnt/cd +. /etc/profile +. /etc/systemconfig + +TFTP=/data/srv/tftp +CD=/data/srv/tftp/live +DESTCD=/data/srv/tftp/CD +BASE=/data/srv/tftp/masterbuild + +MODULES=$DESTCD/MythVantage/base/ +myip=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'|head -n1` +SRCFILES=$BASE/mnt/live/mnt/MythVantage/base/ + +function log () { +echo $1 +} + +function check_xvfb () { +export DISPLAY=127.0.0.1:25 + Xvfb -ac :25 & + +} + + +function create_base_image() { +echo $SRCFILES +if [ -f $SRCFILES/data.lzm ] +then + mkdir $HOST_IMG_DIR + cd $SRCFILES + echo "Creating image.." > $BASE/tmp/.install_state + LIST=`ls *.lzm` + for i in $LIST + do + echo $i + echo $i > $BASE/tmp/.install_percent + lzm2dir $i \/$HOST_IMG_DIR + done + + for i in sys proc dev tmp + do + mkdir /$HOST_IMG_DIR/$i + done + + chmod 777 /$HOST_IMG_DIR/tmp + mknod /$HOST_IMG_DIR/dev/null c 1 3 + mknod /$HOST_IMG_DIR/dev/null c 1 5 + mknod /$HOST_IMG_DIR/dev/console c 5 1 + chmod +s /$HOST_IMG_DIR/usr/bin/Xorg + chmod +s /$HOST_IMG_DIR/usr/bin/crontab + chmod +s /$HOST_IMG_DIR/usr/bin/sudo + chmod +s /$HOST_IMG_DIR/bin/mount + #copy fstab from masterbuild + cp -f $BASE/etc/fstab /$HOST_IMG_DIR/etc/fstab + echo "Done: installing data" > $BASE/tmp/.install_state + return 0 +else + echo "Error: no modules" > $BASE/tmp/.install_state + log "couldn't find modules to install" + return 1 +fi +} + +function configure_image () { + echo "Configuring system" > $BASE/tmp/.install_state + cp -f $BASE/etc/systemconfig $HOST_IMG_DIR/etc/systemconfig + chown root:mythtv $HOST_IMG_DIR/etc/systemconfig + chmod 775 "$HOST_IMG_DIR" /etc/systemconfig + cp /etc/mtab $HOST_IMG_DIR/etc/mtab + mount --bind /dev $HOST_IMG_DIR/dev + + chroot "$HOST_IMG_DIR" $MV_ROOT/bin/systemconfig.sh misc,hostype,network,this_is_install +#copy syssettings template to here. + SE=$BASE$TEMPLATES/settings/syssettings + mkdir -p $HOST_IMG_DIR/$TEMPLATES/settings/syssettings + cp -rp $SE/* ${HOST_IMG_DIR}/$TEMPLATES/settings/syssettings + chown root:mythtv $HOST_IMG_DIR/etc/systemconfig + chown -R mythtv:mythtv $HOST_IMG_DIR/$TEMPLATES/settings/syssettings + chmod -R 775 $HOST_IMG_DIR/$TEMPLATES/settings/syssettings +#update remotedb with this host settings + OLDDISPLAY=$DISPLAY + check_xvfb + chroot $HOST_IMG_DIR $MV_ROOT/bin/MythVantage -t restore,default_1 + chroot $HOST_IMG_DIR $MV_ROOT/bin/restore_default_settings.sh -c restore -t syssettings + if [ ! $? = 0 ] + then + touch $mountpoint/tmp/.dbsysfailed + chmod 777 $mountpoint/tmp/.dbsysfailed + else + #Run second time + chroot "$HOST_IMG_DIR" $MV_ROOT/bin/systemconfig.sh misc,hostype,network,this_is_install + chroot "$HOST_IMG_DIR" $MV_ROOT/bin/restore_default_settings.sh -c ACCESSCONTROL + fi +chroot "$HOST_IMG_DIR" $MV_ROOT/bin/systemconfig.sh advanced,this_is_install +cp -f $BASE/etc/X11/xorg.conf $HOST_IMG_DIR/etc/X11/xorg.conf +echo "Done" > $BASE/tmp/.install_state +DISPLAY=$OLDDISPLAY + +#cp /tmp/mythvantage_install.log $HOST_IMG_DIR/var/log/ +} + +function create_tftp_boot () { + + CFGFILE=$TFTP/pxelinux.cfg/01-$2 + echo "DEFAULT mythfe" > $CFGFILE + echo "LABEL mythfe" >> $CFGFILE + echo "kernel masterbuild/boot/vmlinuz26STB" >> $CFGFILE + echo "append vga=normal root=/dev/nfs rw netboot nfsroot=$myip:/data/srv/tftp/$1 ip=dhcp init=/sbin/runit" >> $CFGFILE + echo "TIMEOUT 2" >> $CFGFILE +} + +function create_nfs_export () { +echo "/data/srv/tftp/$1 *(rw,no_root_squash,anonuid=1000,anongid=1000) " >> /etc/exports +exportfs -arv +} + +#-------------------------------------------------------------------------------MAIN PROGRAM --------------------------------------------------------------------- +if [ x$1 = x -o x$2 = x ] +then + echo "usage: hostname macaddress" + exit 1 +fi + +image_name=$1 +mac_address=`echo $2| tr "[:upper:]" "[:lower:]"` + +echo "using image_name of $image_name" +echo "using mac_address of $mac_address" + +HOST_IMG_DIR=$TFTP/$1 + +create_base_image $image_name +configure_image +umount $HOST_IMG_DIR/dev +create_tftp_boot $image_name $mac_address +create_nfs_export $image_name + + + + +#create_dhcp_entry $mac_address + diff --git a/abs/core-testing/LinHES-config-22/checkout_MythVantage.sh b/abs/core-testing/LinHES-config-22/checkout_MythVantage.sh new file mode 100755 index 0000000..944b9c6 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/checkout_MythVantage.sh @@ -0,0 +1,49 @@ +#!/bin/bash +MYDIR=`pwd` +MYTHPATH="\/data\/LinHES-PKGBUILD\/abs\/core-testing\/mythtv\/stable\/mythtv\/src\/mythtv-0.21" + +function setup_links { +rm mythinstall.bin +rm mythbeselect.bin +ln -s $MYDIR/src/MythVantage-app/mythinstall/mythinstall ./mythinstall.bin +ln -s $MYDIR/src/MythVantage-app/mythbeselect/mythbeselect ./mythbeselect.bin +} + +function dl_repo { +mkdir src +cd src +if [ ! -d MythVantage-app ] +then + git clone http://mythvantage.com/MythVantage-app.git/ + cd MythVantage-app + git checkout --track -b LinHES origin/LinHES + cd $MYDIR + setup_links + cd - +else + echo "updating exisiting tree" + cd MythVantage-app + git pull + git checkout master + git merge + cd - +fi + +cd MythVantage-app +git checkout master +#git checkout origin/LinHES + +} + +dl_repo +sed -i "s/^MYTHPATH.*$/MYTHPATH\=\"$MYTHPATH\"/g" $MYDIR/src/MythVantage-app/mythinstall/mythinstall.pro +sed -i "s/#define __MVAPP__/\/\/#define __MVAPP__/g" $MYDIR/src/MythVantage-app/mythinstall/mv_common.h +sed -i "s/mythvantage/LinHES/g" $MYDIR/src/MythVantage-app/mythinstall/mv_common.h + +echo "INCLUDEPATH += /usr/include/mythtv" >> $MYDIR/src/MythVantage-app/mythbeselect/mythberestart.pro +echo "INCLUDEPATH += /usr/include/mythtv" >> $MYDIR/src/MythVantage-app/mythinstall/mythinstall.pro +cd $MYDIR/src/MythVantage-app/mythinstall && qmake +make || exit 1 +cd $MYDIR/src/MythVantage-app/mythbeselect && qmake +make ||exit 1 + diff --git a/abs/core-testing/LinHES-config-22/create_master.sh b/abs/core-testing/LinHES-config-22/create_master.sh new file mode 100755 index 0000000..1e641b4 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/create_master.sh @@ -0,0 +1,57 @@ +#!/bin/bash +#CD=/mnt/cd +CD=/data/srv/tftp/live +DESTCD=/data/srv/tftp/CD +DEST=/data/srv/tftp/masterbuild +MODULES=$DESTCD/MythVantage/base/ +myip=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'|head -n1` + +mkdir -p $DESTCD +mkdir -p $DEST + +mount $CD +status=0 +if [ -f $CD/MythVantage/base/data.lzm ] +then + status=0 +else + status=1 +fi +if [ x$status = x0 ] +then + echo "copying to disk" + cp -rp $CD/* $DESTCD + cd $MODULES + for i in *.lzm + do + echo $i + lzm2dir $i \/$DEST + done + for i in sys proc dev tmp + do + mkdir $DEST/$i + done + chmod 777 /$DEST/tmp + mknod $DEST/dev/null c 1 3 + mknod $DEST/dev/null c 1 5 + mknod $DEST/dev/console c 5 1 + chmod +s $DEST/usr/bin/Xorg + chmod +s $DEST/usr/bin/crontab + chmod +s $DEST/usr/bin/sudo + chmod +s $DEST/bin/mount +fi +if [ ! -f $DEST/etc/fstab.bak ] +then + cp $DEST/etc/fstab $DEST/etc/fstab.bak +fi +tac $DEST/etc/fstab.bak|tail +4|tac > $DEST/etc/fstab +echo "$myip:/data/srv/tftp/masterbuild / nfs" >> $DEST/etc/fstab +echo "/data/srv/tftp/masterbuild *(rw,no_root_squash,anonuid=1000,anongid=1000)" >> /etc/exports + + +exportfs -arv + +#copy in the modules +mkdir -p $DEST/mnt/live/mnt/ +mv $DESTCD/* $DEST/mnt/live/mnt/ + diff --git a/abs/core-testing/LinHES-config-22/file_time_offset.py b/abs/core-testing/LinHES-config-22/file_time_offset.py new file mode 100755 index 0000000..f2973d0 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/file_time_offset.py @@ -0,0 +1,39 @@ +#!/usr/bin/python + + +import time +import os +import glob +import getopt +import sys +def main(argv): + filecount=0 +# root = "/tmp" +# offset = 4 + now = int(time.time()) + + + try: + opts, args = getopt.getopt(argv, "hs:d:") + except getopt.GetoptError: + sys.exit(2) + for opt, arg in opts: + if opt in ("-h", "--help"): + print "-s seconds -d /testdir" + print "default if 4 seconds" + sys.exit() + elif opt in ( "-s" ): + offset = int(arg) + elif opt in ("-d"): + root = arg + + for item in glob.glob(root+"/*"): + lastmodDate = os.path.getmtime(item) + tdiff= now-lastmodDate + #print tdiff, offset + + if tdiff > offset: + filecount+=1 + print filecount +if __name__ == "__main__": + main(sys.argv[1:]) diff --git a/abs/core-testing/LinHES-config-22/install-ui.xml b/abs/core-testing/LinHES-config-22/install-ui.xml new file mode 100755 index 0000000..2b3a043 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/install-ui.xml @@ -0,0 +1,175 @@ + + + + + + + + #ffff00 + #000000 + 20 + 3,3 + yes + + + + #9999cc + 18 + yes + + + + #ffff00 + #000000 + 18 + 3,3 + yes + + + + #ffffff + 18 + yes + + + + #ffffff + 50 + yes + + + #ff0000 + #000000 + 16 + 2,2 + yes + + + + #ffff00 + 14 + yes + + + #9999cc + 12 + no + + + + 0,0,800,600 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/abs/core-testing/LinHES-config-22/install_db_chroot.sh b/abs/core-testing/LinHES-config-22/install_db_chroot.sh new file mode 100644 index 0000000..94305d2 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/install_db_chroot.sh @@ -0,0 +1,63 @@ +#!/bin/bash +. /etc/profile +. /etc/systemconfig + + +myhost=$hostname +hostname $myhost +echo $myhost > /etc/hostname +echo "install_db_chroot hostname is $hostname" + +. $MV_ROOT/bin/install_functions.sh +#myhost=`cat /etc/hostname` + +#mount -t proc none /proc +pacman --noconfirm -Sf mysql +/etc/rc.d/mysqld + +status=1 +mysqlstatus=1 +while [ ! $status = 0 ] +do + /etc/rc.d/mysqld stop + sleep 1 + /etc/rc.d/mysqld start + mysqlstatus=$? + if [ $mysqlstatus = 0 ] + then + mysql -e "show databases;" + showstatus=$? + if [ $showstatus = 0 ] + then + pacman --noconfirm -R mythdb-initial + pacman --noconfirm -S mythdb-initial + $MV_ROOT/bin/restore_default_settings.sh -c load + DISPLAY=127.0.0.1:0 $MV_ROOT/bin/MythVantage -t restore,default_1 + $MV_ROOT/bin/restore_default_settings.sh -c restore -t syssettings + $MV_ROOT/bin/systemconfig.sh misc,hostype,this_is_install + + update_db_settings HostServiceMythWEB "1" + echo 'UseMythWEB="1"' >> /etc/systemconfig + + #update database to allow user jobs on this host. + $MV_ROOT/bin/restore_default_settings.sh -c USERJOBALLOW + $MV_ROOT/bin/restore_default_settings.sh -c ACCESSCONTROL + if [ -d /data/srv/mysql/mythconverg ] + #if [ -d /var/lib/mysql/mythconverg ] + then + # pacman --noconfirm -R webcalendar + # pacman --noconfirm --nodeps -S webcalendar + status=0 + fi +# if [ $SystemType = "Master_backend" ] +# then +# $MV_ROOT/bin/restore_default_settings.sh -c BECONFIG -s master -a $dbhost +# fi + fi + fi +done +/etc/rc.d/mysqld stop +#umount /proc + + + diff --git a/abs/core-testing/LinHES-config-22/install_functions.sh b/abs/core-testing/LinHES-config-22/install_functions.sh new file mode 100755 index 0000000..83a2bed --- /dev/null +++ b/abs/core-testing/LinHES-config-22/install_functions.sh @@ -0,0 +1,344 @@ +#!/bin/bash +. /etc/profile + +disk=$2 +mountpoint=new_boot + +#------------------------------------------- +MYTHDBUSER=mythtv +MYTHTVPASSWD=mythtv +CMDLINE=$(cat /proc/cmdline) +hostname=`hostname` +MYSQLCMD_C="mysql -u$MYTHDBUSER -p$MYTHTVPASSWD mythconverg -B --exec" +BASE="" +found_remote=1 + +function update_db_settings () { + + printhl " setting database value $1 to $2 for $hostname" + $MYSQLCMD_C "delete from settings where value='${1}' and hostname=\"$hostname\";" 2>/dev/null + $MYSQLCMD_C "REPLACE INTO settings set value='${1}', data='${2}' , hostname=\"$hostname\";" 2>/dev/null +} + +function random_theme () { +THEMES="basic-blue +basic-green +basic-red +basic-purple +basic-amber" + +theme=($THEMES) # Read into array variable. + +num_themes=${#theme[*]} # Count how many elements. + +pick=${theme[$((RANDOM%num_themes))]} +printhl " Selected $pick as the theme" +update_db_settings Theme "$pick" +} + +function parse_cmdline_2_db(){ + echo $CMDLINE | grep -q displayres + if [ $? -eq 0 ] + then + TEMPVAR=${CMDLINE#*displayres=} + update_db_settings HostXres $TEMPVAR + fi + +} + + +function bootsplash_setup (){ + echo $CMDLINE | grep -q splash=silent + if [ $? -eq 0 ] + then + update_db_settings Hostbootsplash 1 + else + update_db_settings Hostbootsplash 0 + fi +} + + +function setupremote { + [ -e $BASE/etc/lircd.conf ] && mv -f $BASE/etc/lircd.conf $BASE/etc/lircd.conf.`date +%Y-%m-%d-%H-%M` + if [ -d $TEMPLATES/remotes/$Remotetype ] + then + cd $TEMPLATES/remotes/$Remotetype + for i in lircd* + do + cat $i >> $BASE/etc/lircd.conf + done + cp -f lircrc* $BASE/etc/lircrc 2> /dev/null + [ -e /etc/lircrc ] && chmod 755 /etc/lircrc + update_db_settings HostRemoteType "$Remotetype" + #special case for special remote + printhl "Starting with support for $Remotetype" + if [ "$Remotetype" == "dvico" ] + then + /usr/sbin/lircd -d /dev/usb/hiddev0 --driver=dvico + elif [ "$Remotetype" == "Dvico-Dual-Digital4-rev2" ] + then + /usr/sbin/lircd -d /dev/input/irremote --driver=devinput + else + /usr/sbin/lircd -d /dev/lirc0 + fi + [ -e /root/.mythtv ] || mkdir /root/.mythtv 2>/dev/null + ln -s /etc/lircrc /root/.mythtv/lircrc 2>/dev/null + else + echo "Couldn't open directory $TEMPLATES/remotes/$Remotetype" + fi +} + +function scan_for_hpg_receiver() { +printhl " Scanning for Hauppauge receiver" +for hpgid in `lspci -nm -d4444: |cut -d" " -f6- |tr -d '"'|tr " " :` +do + line=`grep $hpgid $TEMPLATES/remotes/i2c.id` + if [ $? -eq 0 ] + then + modprobe lirc_i2c + FoundReceiverType=`echo "$line"|cut -d"|" -f2` + Remotetype=`echo "$line"|cut -d"|" -f4` + statusline=`echo "$line"|cut -d"|" -f2,4` + #echo "Found $statusline , $Remotetype" + echo "Found Hauppauge" + echo "-------------------" + echo " 1) Hauppauge black" + echo " 2) Hauppauge silver" + echo " 3) hauppauge-grey-g3" + echo "" + read -p "Which Hauppauge remote (5 sec): " -t 5 ans + echo + if [ "$?" != "0" ]; then + echo + echo "Using default $Remotetype" + else + case $ans in + 1) Remotetype="hauppauge-black";; + 2) Remotetype="hauppauge-silver";; + 3) Remotetype="hauppauge-grey-g3" ;; + *) echo "Using default $Remotetype";; + esac + fi + update_db_settings HostReceiverType $FoundReceiverType + found_remote=0 + setupremote + break + fi +done +} + + +function scan_for_usb_remote () { +#found_remote=1 +printhl " Scanning for usb receiver/remote" +while read line +do + USBID=`echo "$line"|cut -d"|" -f1` + lsusb -d "$USBID" > /dev/null 2>/dev/null + if [ $? -eq 0 ] + then + Remotetype=`echo "$line"|cut -d"|" -f2` + printhl "Found $Remotetype" + setupremote + found_remote=0 + break + fi +done <$BASE/$TEMPLATES/remotes/receiver_usb.id +if [ $found_remote -eq 1 ] +then + scan_for_hpg_receiver +fi +printhl " Scanning for TatIR" +if lsusb | grep 04d8:0004 > /dev/null 2>/dev/null +then + /usr/bin/PyroUsb.py > /dev/null 2>&1 & +fi + +if [ $found_remote -eq 1 ] +then +#No remote found_remote + update_db_settings HostRemoteType "no_remote" +fi + +} + +function rest_of_network () { + #netmask + echo $CMDLINE | grep -q cnetmask + if [ $? -eq 0 ] + then + TEMPVAR=${CMDLINE#*cnetmask=} + NETMASK=${TEMPVAR%% *} + /sbin/ifconfig eth0 $IP netmask $NETMASK + nm=`/usr/bin/nmconv.py -obits $NETMASK` + NETMASK="/$nm $NETMASK" + #echo $NETMASK + update_db_settings HostNETMASK${MYTHDEFAULT} "$NETMASK" + else + printhl " Netmask not found" + fi + #gateway + echo $CMDLINE | grep -q cgateway + if [ $? -eq 0 ] + then + TEMPVAR=${CMDLINE#*cgateway=} + GATEWAY=${TEMPVAR%% *} + /sbin/route add default gw $GATEWAY + update_db_settings HostGW${MYTHDEFAULT} "$GATEWAY" + else + printhl " Gateway not found" + fi + + #dns + echo $CMDLINE | grep -q cdns + if [ $? -eq 0 ] + then + TEMPVAR=${CMDLINE#*cdns=} + DNS=${TEMPVAR%% *} + echo "nameserver $DNS" >> /etc/resolv.conf + update_db_settings HostDNS${MYTHDEFAULT} "$DNS" + else + printhl " DNS not found" + fi + echo $CMDLINE | grep -q chostname + if [ $? -eq 0 ] + then + TEMPVAR=${CMDLINE#*chostname=} + MYHOST=${TEMPVAR%% *} + update_db_settings HostMyhostname "$MYHOST" + else + printhl " hostname not found" + fi +} + +function init_network { + echo $CMDLINE |grep -q cnetdev + if [ $? -eq 0 ] + then + TEMPVAR=${CMDLINE#*cnetdev=} + MYTHDEFAULT=${TEMPVAR%% *} + else + MYTHDEFAULT="eth0" + fi + + echo $CMDLINE | grep -q ip + if [ $? -eq 0 ] + then + update_db_settings HostDefaulteth0 0 + update_db_settings HostDefault${MYTHDEFAULT} 1 + + update_db_settings HostActiveonbooteth0 0 + update_db_settings HostActiveonboot${MYTHDEFAULT} 1 + update_db_settings HostNetDevice ${MYTHDEFAULT} + + TEMPVAR=${CMDLINE#*cip=} + IP=${TEMPVAR%% *} + if [ "$IP" == "dhcp" ] + then + /sbin/dhcpcd $MYTHDEFAULT + update_db_settings HostUseDHCP${MYTHDEFAULT} 0 + else + /sbin/ifconfig ${MYTHDEFAULT} $IP + update_db_settings HostUseDHCP${MYTHDEFAULT} 1 + update_db_settings HostIP${MYTHDEFAULT} "$IP" + rest_of_network + fi + fi + + + + +} + +function dev_up_check(){ + /sbin/ifconfig $1 1>/dev/null 2>/dev/null + status=$? + if [ $status -eq 1 ] + then + return 0 + else + devip=`/sbin/ifconfig | grep -C1 $1| grep inet|grep -v inet6 | cut -d: -f2 | awk '{ print $1}'` + if [ "x$devip" = "x" ] + then + return 1 + else + return 0 + fi + fi +} + +function request_dhcp(){ + echo $CMDLINE |grep -q cnetdev + if [ $? -eq 0 ] + then + TEMPVAR=${CMDLINE#*cnetdev=} + MYTHDEFAULT_NET=${TEMPVAR%% *} + else + MYTHDEFAULT_NET="eth0" + fi + for ndev in eth0 eth1 wlan0 wlan1 ath0 + do + dev_up_check $ndev + status=$? + if [ $status -eq 1 ] + then + #interface is down, lets see if dhcp responds + dhcpcd -Td -t2 $ndev -h "" > /tmp/dhcpinfo.$ndev 2>/dev/null + #check for hostname here + + TEMPVAR=`grep new_ip_address /tmp/dhcpinfo.$ndev |cut -d\= -f2` + if [ ! x$TEMPVAR = x ] + then + update_db_settings HostIP$ndev "$TEMPVAR" + TEMPVAR=`grep new_subnet_mask /tmp/dhcpinfo.$ndev |cut -d\= -f2` + nm=`/usr/bin/nmconv.py -obits $TEMPVAR` + TEMPVAR="/$nm $TEMPVAR" + update_db_settings HostNETMASK$ndev "$TEMPVAR" + TEMPVAR=`grep new_routers /tmp/dhcpinfo.$ndev |cut -d\= -f2` + update_db_settings HostGW$ndev "$TEMPVAR" + TEMPVAR=`grep new_domain_name_servers /tmp/dhcpinfo.$ndev |cut -d\= -f2| tr -d \"|tr -d \'|cut -d" " -f 1` + update_db_settings HostDNS$ndev "$TEMPVAR" + fi + fi + done + TEMPVAR=`grep new_host_name /tmp/dhcpinfo.$MYTHDEFAULT_NET |cut -d\= -f2` + if [ ! x$TEMPVAR = x ] + then + update_db_settings HostMyhostname "$TEMPVAR" + fi + +} + +function init_remote { + echo $CMDLINE | grep -q remoteport + if [ $? -eq 0 ] + then + TEMPVAR=${CMDLINE#*remoteport=} + REMOTEPORT=${TEMPVAR%% *} + if [ x"$ReceiverType" = "xSerial" ] + then + if [ -e /dev/$REMOTEPORT ] + then + /usr/bin/setserial /dev/$REMOTEPORT uart none + /sbin/modprobe lirc_serial + update_db_settings HostReceiverType Serial + update_db_settings HostSerialPortlirc "$REMOTEPORT" + fi + fi + + fi + + echo $CMDLINE | grep -q remote + if [ $? -eq 0 ] + then + TEMPVAR=${CMDLINE#*remote=} + Remotetype=${TEMPVAR%% *} + setupremote + else + scan_for_usb_remote + fi +} + +#----------------------- + + diff --git a/abs/core-testing/LinHES-config-22/install_proxy.sh b/abs/core-testing/LinHES-config-22/install_proxy.sh new file mode 100755 index 0000000..71b675b --- /dev/null +++ b/abs/core-testing/LinHES-config-22/install_proxy.sh @@ -0,0 +1,234 @@ +#!/bin/bash +export TERM=vt100 +MVHOSTNAME=larch5 +. /etc/profile +TEMP_TEMPLATES=/tmp/templates +disk=$2 +rootfs=$3 +rootsize=$4 +datafs=$5 +datasize=$6 +swapsize=$7 +mountpoint="/new_boot" +run=$MV_ROOT/bin/install_functions.sh +. /etc/systemconfig 2>/dev/null +. $MV_ROOT/bin/networkconfig.sh +CMDLINE=$(cat /proc/cmdline) +BACKUPFILE="/myth/backup/mythconverg.sql.gz" + + +progress () { + mypercent=`echo "$1" | cut -d. -f1` + if [ x$mypercent = x ] + then + echo "" > /tmp/.install_percent + else + echo "${mypercent}% complete" > /tmp/.install_percent + fi +} + + +case $1 in + full_install_it ) + mv_install.py --rootdisk=$disk --rootfs=$rootfs --rootsize=$rootsize --datafs=$datafs --datasize=$datasize --datadisk=$disk --swapsize=$swapsize -c full_install + rc=$? + echo "mv_install.py exit code $rc" + if [ $rc != 0 ] + then + echo "mv_install error" >> /tmp/.install_error + fi + exit $rc + ;; + + NETBOOT) + echo "-----------------------------------------------------------------------3-----" + netboot-full_install + ;; + + find_update) + mv_install.py --rootdisk=$disk -c find_upgrade + ;; + + upgrade_it) + mv_install.py --rootdisk=$disk --rootfs=$rootfs -c upgrade + ;; + + disk_model_it) + model="unknown" + size="xxx" + case $2 in + h* ) + model=`cat /proc/ide/$2/model` + ;; + s*) model=`sginfo /dev/$2|grep Product|awk ' { print $2 } '` + ;; + esac + size=`parted /dev/$2 print |grep Disk|awk ' { print $3 } ' ` + echo ""$model" $size " >/tmp/model + ;; + + network_check_it) + #Should never return from check_network + case $2 in + setup_network) + vnc_check + install_network_setup + ;; + + check_self) + myipdefault=`ifconfig | grep -C1 $default_interface| grep -v $default_interface | cut -d: -f2 | awk '{ print $1}'` + echo "network check myself" + ifconfig + ping -c 1 $myipdefault + if [ ! $? = 0 ] + then + exit 3 + #can't ping yourself + fi + ;; + check_gw) + #check gateway + echo "network check gateway" + /sbin/route -n + mygwdefault=`/sbin/route -n |grep $default_interface|grep UG|awk '{ print $2}'` + echo "Default gateway seems to be $mygwdefault" + if [ ! x$mygwdefault = x ] + then + sleep 2 + ping -c 5 $mygwdefault + if [ ! $? = 0 ] + then + exit 4 + fi + fi + ;; + check_ns) + #check nameserver + echo " network check nameserver" + mydns=`cat /etc/resolv.conf|grep nameserver|head -1|awk '{ print $2}'` + ping -c 1 $mydns + if [ ! $? = 0 ] + then + exit 5 + fi + ;; + check_names) + echo "network check resolve names" + host google.com + if [ ! $? = 0 ] + then + exit 6 + fi + ;; + host_names) + #if host is found, then check to see if it's online + #if hoip matchs my ip assume it's ok + echo "network check my hostname $hostname" + hout=`host $hostname|head -n1` + status=$? + hoip=`echo $hout|awk '{print $4}'` + if [ $hoip = found: ] + then + status=1 + fi + + if [ $hoip = "out;" ] + then + #;; connection timed out; no servers could be reached + echo "DNS servers not found" + status=1 + fi + + unkownhost=`host unkown.linhes.org |head -n1 ` + unkownhostip=`echo $unkownhost |awk '{print $4}'` + + #found host, now grab the ip + if [ $status = 0 ] + then + hoip=`echo $hout|awk '{print $4}'` + /sbin/ifconfig -a |grep -q $hoip + if [ $? = 0 ] + then + echo "DNS ip matches on of my ips $hoip" + status=0 + else + if [ $unkownhostip = $hoip ] + then + echo "Bad DNS returning false hits" + echo "Assuming hostname is OK" + echo "DNS unknown: $unkownhostip" + echo " HOSTDNS: $hoip " + /sbin/ifconfig -a |grep "inet addr" + else + echo "IP in DNS but doesn't match mine, hostname is not safe to use" + echo "DNS:$hoip" + echo "HOST: " + /sbin/ifconfig -a |grep "inet addr" + status=7 + fi + fi + else + echo "Couldn't find hostname in DNS, must be safe to use" + status=0 + fi + exit $status + ;; + + esac + exit 0 + ;; + + * ) + if [ -f /tmp/.install_state ] + then + state=`cat /tmp/.install_state` + else + state=" " + fi + if [ x"${state}" = "xConfiguring system" ] + then + progress "" + else + + if [ -f /tmp/.startsize.io ] + then + . /tmp/.startsize.io + #finding the drive + ddrive=`df | grep $mountpoint | head -n1 | awk -F/ ' { print $3 } ' | cut -d" " -f 1|cut -b1,2,3 ` + used=`statgrab -M disk.|grep ${ddrive}.write_bytes|cut -d= -f 2|tr -d " "` + used=`echo $used-$STARTSIZE|bc` + #echo $used + fi + + if [ ! x$used = x ] + then + . /root/.install_size + #somehow find if it's an install or update + if [ -f /tmp/.this_is_upgrade ] + then + total=$UPGRADESIZE + else + total=$TOTALSIZE + fi + percent=`echo "scale=2 ; ($used/$total) * 100 " |bc ` + cond2=$(echo "$percent > 98" |bc ) + if [ $cond2 -eq 1 ] + then + percent=98 + fi + if [ x"${state}" = "xDone" ] + then + percent=100 + fi + cond3=$(echo "$percent < 3" |bc ) + if [ $cond3 -eq 0 ] + then + progress $percent + fi + fi + fi + ;; +esac + + + diff --git a/abs/core-testing/LinHES-config-22/issue b/abs/core-testing/LinHES-config-22/issue new file mode 100644 index 0000000..00d4abd --- /dev/null +++ b/abs/core-testing/LinHES-config-22/issue @@ -0,0 +1,2 @@ +LinHes + diff --git a/abs/core-testing/LinHES-config-22/live-install.sh b/abs/core-testing/LinHES-config-22/live-install.sh new file mode 100755 index 0000000..573bb1f --- /dev/null +++ b/abs/core-testing/LinHES-config-22/live-install.sh @@ -0,0 +1,28 @@ +#!/bin/bash +#redirect stderr to stdout, then rediret stdout to file +. /etc/profile +exec 2>&1 +exec > /tmp/mythvantage_install.log +. /etc/X11/STBWINDOWMANAGER +/usr/bin/nvidia-settings -a InitialPixmapPlacement=2 +keylaunch & +/usr/bin/tilda & +/usr/X11R6/bin/unclutter -root -idle 0 -jitter 400 -noevents & +export MALLOC_CHECK_=0 +if [ -f /opt/vmware/bin32/vmware-user-wrapper ] +then + /opt/vmware/bin32/vmware-user-wrapper & +fi +xhost + +CMDLINE=$(cat /proc/cmdline) +echo $CMDLINE |grep -q nfsroot +NFSROOT=$? +if [ x$NFSROOT = x1 ] +then + + unbuffer MythVantage & +else + NETBOOT=YES MythVantage & +fi + +exec $STBWINDOWMANAGER diff --git a/abs/core-testing/LinHES-config-22/mv_advanced.py b/abs/core-testing/LinHES-config-22/mv_advanced.py new file mode 100755 index 0000000..4790fcf --- /dev/null +++ b/abs/core-testing/LinHES-config-22/mv_advanced.py @@ -0,0 +1,384 @@ +# -*- coding: utf-8 -*- +import logging, os, re +import mv_common + +def setup_pacman(create_link): + if create_link: + logging.info(" Creating pacman link") + #LOOK + #This is not implmented yet, below is the bash code for reference + #if [ ! x$1 = x ] + #then + #ln -s ${BASE}/data/var ${BASE}/data/srv/httpd/htdocs/repo + #echo "creating the link for the pacman repo mirror" + #fi + + #for i in mv-core mv-core-testing mv-extra mv-extra-testing + #do + #echo "[$i]" > ${BASE}/etc/pacman.d/$i + ##add mirror if needed + #if [ x$PKG_MIRROR = x1 ] + #then + #echo " Server = http://$dbhost/repo/$i " >> ${BASE}/etc/pacman.d/$i + #fi + ##add user templates + #USERTEMPLATES="/data/home/mythtv/templates" + #if [ -f $USERTEMPLATES/sources/$i ] + #then + #echo "Adding user $i" + #cat $USERTEMPLATES/sources/$i >> ${BASE}/etc/pacman.d/$i + #fi + #cat $TEMPLATES/sources/$i >> ${BASE}/etc/pacman.d/$i + #echo "setting local mirror to $dbhost for $i " + #done + else: + logging.info(" Pacman link will not be created") + return + +def setup_ncid_client(dbhost,templatefile): + #This always runs + logging.debug(" Configuring ncid client with server %s",dbhost) + cmd = '''sed -e "s/^set Host.*$/set Host %s /" %s >/etc/ncid/ncid.conf''' %(dbhost, templatefile) + return + +def setup_ncid_daemon(port,templatefile,Runncidd): + logging.info(" Configuring callerid daemon") + if Runncidd == "1": + logging.debug(" Port: %s",port) + mv_common.cp_and_log("/etc/ncid/ncidd.conf",templatefile) + cmd = '''sed -e "s/.*set ttyport.*$/set ttyport = \/dev\/%s /" %s >/etc/ncid/ncidd.conf''' %(port,templatefile) + mv_common.runcmd(cmd) + mv_common.pacinstall("ncidd") + mv_common.add_service("ncidd") + else: + logging.debug(" Callerid will not run") + mv_common.pacremove("ncidd") + mv_common.remove_service("ncidd") + return + +def setup_splash(Usebootsplash): + if Usebootsplash == "1": + logging.info(" Enabling splash") + cmd = ''' sed -i "s/^default.*0/default 1/g" /boot/grub/menu.lst''' + mv_common.runcmd(cmd) + else: + logging.info(" Disabling splash") + cmd = ''' sed -i "s/^default.*1/default 0/g" /boot/grub/menu.lst''' + 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_hobbit(UseHobbit,SystemType,dbhost): + if UseHobbit == "1": + if SystemType == "Standalone" or SystemType == "Master_backend": + logging.info(" Installing hobbit server") + mv_common.pacinstall("hobbitserver") + mv_common.add_service("hobbit") + else: + logging.info(" Installing hobbit client") + mv_common.pacinstall("hobbit-client") + setup_hobbit_client(dbhost) + mv_common.add_service("hobbit-client") + + else: + logging.info(" Removing Hobbit") + mv_common.pacremove("hobbit") + mv_common.pacremove("hobbit-client") + mv_common.remove_service("hobbit-client") + mv_common.remove_service("hobbitserver") + cmd = "rm -f /data/srv/httpd/htdocs/hobbit/index.html" + mv_common.runcmd(cmd) + return + +def setup_hobbit_client(dbhost): + logging.info(" Configuring hobbit client") + logging.debug(" hobbit server is %s:", dbhost) + cmd='''sed -i "s/^BBDISP.*$/BBDISP=%s/g" /data/srv/hobbit/client/etc/hobbitclient.cfg ''' %dbhost + mv_common.runcmd(cmd) + return + +def setup_evrouter(UseEvrouter,EvrouterConfig,template): + if UseEvrouter == "1": + logging.info(" Configuring everouter") + logging.debug(" EvrouterConfig is %s:",EvrouterConfig) + if EvrouterConfig == "tinker": + logging.debug(" tinker mode, not changing the config") + return + mv_common.pacinstall("evrouter") + mv_common.pacinstall("Xvfb") + mv_common.cp_and_log(template+"/evrouter/"+EvrouterConfig,"/etc/evrouter.cfg") + mv_common.add_service("evrouter") + mv_common.add_service("Xvfb") + else: + logging.info(" Not using evrouter") + mv_common.pacremove("evrouter") + mv_common.remove_service("evrouter") + mv_common.remove_service("Xvfb") + + return + +def setup_DNSmasq(RunDHCP,ip,gw,nameserver): + if RunDHCP == "1": + logging.info(" Configuring dhcp server(dnsmasq)") + logging.debug(" ip: %s", ip) + logging.debug(" gw: %s", gw) + logging.debug(" ns: %s", nameserver) + mv_common.pacinstall("dnsmasq") + mv_common.pacinstall("mvpmc") + mv_common.add_service("dnsmasq") + logging.debug(" Setting default route to my gw: %s",gw) + try: + f = open("/etc/dnsmasq.conf",'r') + dnsconf = f.readlines() + f.close() + except: + logging.info(" Couldn't open dnsmasq.conf") + return + for line in dnsconf: + outline = line + if re.match("^dhcp-option=3",line): + logging.debug(" Setting default route to my gw: %s",gw) + outline = "dhcp-option=3,%s\n" %gw + if re.match("^dhcp-option=6",line): + logging.debug(" Setting dns to my ip: %s",ip) + outline = "dhcp-option=6,%s\n" %ip + f.write(outline) + f.close() + + logging.debug(" change nfsroot to my ip:%s",ip) + cmd = '''sed -i "s/nfsroot=.*:/nfsroot=%s:/g" /data/srv/tftp/pxelinux.cfg/default''' %ip + mv_common.runcmd(cmd) + + logging.debug(" Adding 127.0.0.1 to resolv.conf") + logging.debug(" other nameserver is %s",nameserver) + try: + f = open("/etc/resolv.conf",'r') + dns = f.readlines() + f.close() + except: + dns='' + logging.debug(" Couldn't open resolv.conf for reading") + try: + f = open("/etc/resolv.conf",'w') + line="search lan\n" + f.write(line) + line="nameserver 127.0.0.1\n" + f.write(line) + line="nameserver %s\n" %nameserver + f.write(line) + for line in dns: + f.write(line) + f.close() + except: + logging.debug(" Couldn't open resolv.conf for writing") + + logging.debug(" setup dongle.config") + cmd = ''' sed -i "s/mvpmc -f .*/mvpmc -f \/etc\/helvR10.fon -s %s \& /" /data/srv/tftp/dongle.bin.config ''' %ip + #COMMAND="%s/mvpmc -f .*/mvpmc -f \/etc\/helvR10.fon -s ${ip} \& /" + #ex ${BASE}/data/srv/tftp/dongle.bin.config </etc/exports''' %templatefile + mv_common.add_service("nfsd") + mv_common.add_service("nfs-utils") + mv_common.add_service("portmap") + else: + logging.info(" Removing NFS server") + mv_common.remove_service("nfsd") + return + +def setup_dyndns(DDnsEnable): + if DDnsEnable == "1": + logging.info(" Installing Dynamic DNS client") + mv_common.pacinstall("inadyn") + mv_common.add_service("inadyn") + else: + logging.info(" Removing Dynamic DNS client") + mv_common.pacremove("inadyn") + mv_common.remove_service("inadyn") + + +def setup_advanced(systemconfig,data_config): + logging.info("____Start of advanced configuration____") + create_link = False + if systemconfig["SystemType"] == "Master_backend": + create_link = True + setup_pacman(create_link) + setup_ncid_client(systemconfig["dbhost"], + systemconfig["TEMPLATES"]+"/ncid.conf.template") + + setup_ncid_daemon(systemconfig["nciddSerialPort"], + systemconfig["TEMPLATES"]+"/ncidd.conf.template", + systemconfig["Runncidd"]) + + setup_splash(systemconfig["Usebootsplash"]) + if data_config.SYSTEMTYPE == "MythVantage": + setup_hobbit(systemconfig["UseHobbit"], + systemconfig["SystemType"], + systemconfig["dbhost"]) + if data_config.SYSTEMTYPE == "LinHES": + setup_rrd(systemconfig["UseRRD"]) + + setup_evrouter(systemconfig["UseEvrouter"], + systemconfig["EvrouterConfig"], + systemconfig["TEMPLATES"]) + + setup_DNSmasq(systemconfig["RunDHCP"], + systemconfig["mythip"], + systemconfig["mythgw"], + systemconfig["mythdns"]) + + setup_mythweb(systemconfig["UseMythWEB"]) + setup_samba(systemconfig,data_config) + setup_NFSshares(systemconfig["UseNFS"], + systemconfig["TEMPLATES"]+"/exports.template") + + setup_dyndns(systemconfig["DDnsEnable"]) + logging.info("__End of advanced configuration\n") diff --git a/abs/core-testing/LinHES-config-22/mv_common.py b/abs/core-testing/LinHES-config-22/mv_common.py new file mode 100755 index 0000000..a492597 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/mv_common.py @@ -0,0 +1,201 @@ +# -*- coding: utf-8 -*- +import logging, os, time +import commands +config_file = "mv_config" +data_config = __import__(config_file, globals(), locals(), []) + +def runcmd(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[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") + +def cp_and_log(srcfile,destfile): + #return + if not os.path.exists(srcfile): + logging.info("%s is not present, skipping...",srcfile) + else: + cmd = ("rsync -arhp %s %s") %(srcfile,destfile) + runcmd(cmd) + + +def add_service(daemon): + logging.info(" Adding service %s",daemon) + cmd = "add_service.sh %s" %daemon + runcmd(cmd) + +def remove_service(daemon): + logging.info(" Removing service %s",daemon) + stop_service(daemon) + cmd = "remove_service.sh %s" %daemon + runcmd(cmd) + +def start_service(daemon): + logging.info(" start service %s",daemon) + cmd = "sv start %s" %daemon + runcmd(cmd) + +def stop_service(daemon): + logging.info(" stop service %s",daemon) + cmd = "sv stop %s" %daemon + runcmd(cmd) + +def restart_service(daemon): + logging.info(" Restarting service %s",daemon) + if daemon == "lcdd": + stop_service(daemon) + logging.debug(" killing all lcdd") + cmd = "killall -9 LCDd" + runcmd(cmd) + time.sleep(2) + start_service(daemon) + else: + cmd = "sv restart %s" %daemon + runcmd(cmd) + +def hup_service(daemon): + logging.info(" hup service %s",daemon) + cmd = "sv hup %s" %daemon + runcmd(cmd) + + + +def pkg_blacklist_check(pkg): + cmd = '''grep -q %s /etc/blacklist.package''' %pkg + rc = runcmd(cmd) + if rc == 0: + return True + else: + return False + +def pkg_installed_check(pkg): + logging.debug(" Checking if %sis installed",pkg) + cmd = "pacman -Q %s " %pkg + rc = runcmd(cmd) + if rc == 0: + return True + else: + return False + + +def pacinstall(pkg): + logging.info(" Checking %s for install",pkg) + #extra pkg check + if pkg == "xine": + pacinstall("xine-ui") + elif pkg == "dvdcss": + pacinstall("libdvdcss") + elif pkg == "webmin": + add_service("webmin") + elif pkg == "fuppes": + pacinstall("fuppes-svn") + + if not pkg_blacklist_check(pkg): + if pkg_installed_check(pkg): + logging.info(" %s is already installed, will not install",pkg) + else: + logging.info(" Installing %s",pkg) + cmd ='''pacman --noconfirm -Sf %s ''' %pkg + runcmd(cmd) + else: + logging.info(" %s is blacklisted, will not install",pkg) + +def pacremove(pkg): + logging.info(" Checking %s for removal",pkg) + if pkg == "xine": + pacremove("xine-ui") + elif pkg == "dvdcss": + pacremove("libdvdcss") + elif pkg == "webmin": + remove_service("webmin") + + if not pkg_blacklist_check(pkg): + if not pkg_installed_check(pkg): + logging.info(" %s is not installed, will not remove",pkg) + else: + logging.info(" Removing %s",pkg) + cmd ='''pacman --noconfirm -R %s ''' %pkg + runcmd(cmd) + else: + logging.info(" %s is blacklisted, will not remove",pkg) + +def getpid(process): + return commands.getoutput('pidof %s' % process) + +def remove_file(filename): + logging.debug(" Removing %s", filename) + try: + os.remove(filename) + except: + logging.debug("* Could not remove %s", filename) + + +def restartLCD(RESTART_LCD): + if RESTART_LCD : + logging.info(" Restarting lcd server") + cmd = "killall -9 mythlcdserver" + runcmd(cmd) + else: + logging.debug(" Not restarting MYTHLCD server") + + +def reloadfe(dbhost,RESTART_LCD): + logging.debug("____Start of reloadfe____") + if data_config.SYSTEMTYPE == "MythVantage": + logging.info(" Clearing Backend cache") + cmd = '''/usr/bin/backend_control.sh clearcache behost %s''' %dbhost + runcmd(cmd) + + restartLCD(RESTART_LCD) + for pid in getpid("mythfrontend"): + cmd = ''' kill -s USR1 %s ''' %pid + #runcmd(cmd) + logging.info(" Reloading frontend with pid of %s",pid) + + logging.debug("__End of reloadfe\n") + + +def restartfe(RESTART_LCD): + logging.debug("____Start of restartfe____") + if data_config.SYSTEMTYPE=="LinHES": + logging.debug(" LinHES seems to be running will not restartfe") + return + logging.info(" Restarting frontend") + restartLCD(RESTART_LCD) + cmd="killall -9 mythfrontend" + runcmd(cmd) + cmd="killall -9 welcome" + runcmd(cmd) + logging.debug("__End of restartfe\n") + + +def udev_trigger(): + logging.info(" Triggering udev") + cmd = "udevadm settle" + runcmd(cmd) + cmd = "udevadm trigger" + runcmd(cmd) + cmd = "udevadm settle" + runcmd(cmd) + cmd = "udevadm trigger" + runcmd(cmd) + + diff --git a/abs/core-testing/LinHES-config-22/mv_config.py b/abs/core-testing/LinHES-config-22/mv_config.py new file mode 100755 index 0000000..1ac4fea --- /dev/null +++ b/abs/core-testing/LinHES-config-22/mv_config.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +SYSTEMTYPE="LinHES" +MVHOSTNAME="larch5" +MOUNTPOINT="/new_boot" +DATAMOUNT="/myth" +MYTHHOME="/home/mythtv" +SQUASHFILE="/tmp/.squashlist" +SQUASHLIST=("bin","boot","etc","home","lib","opt","root","sbin","usr","var","data") +NOOPDEBUG="FALSE" +BACKUPFILE="mythconverg.sql.gz" +BACKUPPATH="/myth/backup/" +TEMP_TEMPLATES="/tmp/templates" +SMEDIA="myth" + + + + diff --git a/abs/core-testing/LinHES-config-22/mv_ddns.py b/abs/core-testing/LinHES-config-22/mv_ddns.py new file mode 100755 index 0000000..7ac7d3a --- /dev/null +++ b/abs/core-testing/LinHES-config-22/mv_ddns.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +import logging, mv_common +import os, re + +config_file = "mv_config" + +def setup_ddns(systemconfig): + 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", + "/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) + cmd = ''' sed -i -e "s/your-dynamic-dyndns-password/%s/g" /etc/ddclient/ddclient.conf''' %(systemconfig["DDnspassword"]) + mv_common.runcmd(cmd) + cmd = ''' sed -i -e "s/your-dynamic-dyndns-host/%s/g" /etc/ddclient/ddclient.conf''' %(systemconfig["DDnshostname"]) + mv_common.runcmd(cmd) + mv_common.add_service("ddclient") + else: + logging.debug(" Disabling DDNS") + mv_common.remove_service("ddclient") + + logging.info("__End of ddns\n") diff --git a/abs/core-testing/LinHES-config-22/mv_hostype.py b/abs/core-testing/LinHES-config-22/mv_hostype.py new file mode 100755 index 0000000..d6ec0ed --- /dev/null +++ b/abs/core-testing/LinHES-config-22/mv_hostype.py @@ -0,0 +1,230 @@ +# -*- coding: utf-8 -*- +import logging, mv_common +import os + +config_file = "mv_config" +data_config = __import__(config_file, globals(), locals(), []) + +def setup_ntp(usepool,ntpserver): + if usepool: + logging.info("Setting ntp server to %s",ntpserver) + print '''sed -i "s/pool.ntp.org/$dbhost/g" ${BASE}/etc/ntp.conf''' + else: + logging.info("Not changing ntp configuration") + +def setup_avahi(templates): + file="/etc/avahi/services/mysql.service" + if not os.path.exists(file): + logging.debug(" copying in mysql.service for avahi") + try: + os.makedirs("/etc/avahi/services") + except: + logging.debug(" Couldn't create /etc/avahi/services") + mv_common.cp_and_log(templates+"/mysql.service",file) + cmd="sudo sv restart avahi" + mv_common.runcmd(cmd) + +def remove_avahi_service(): + file="/etc/avahi/services/mysql.service" + if os.path.exists(file): + logging.debug(" Removing avahi mysql.service file") + cmd="rm -rf %s" %file + mv_common.runcmd(cmd) + cmd="sudo sv restart avahi" + mv_common.runcmd(cmd) + +def setup_db(): + logging.debug(" Setting up the database") + +def setup_mysqlnetwork(EnableNetwork): + logging.debug(" Setting up mysql network") + mysqlconf = "/etc/my.cnf" + cmd = '''grep "#skip-networking" %s ''' %mysqlconf + status = mv_common.runcmd(cmd) + + if EnableNetwork : + logging.debug(" Enabling mysql networking") + if status == 0 : + logging.debug(" Network is already enabled for mysql") + else: + cmd = '''sed -ie "s/^skip-networking/#skip-networking/g" %s ''' %mysqlconf + mv_common.runcmd(cmd) + mv_common.restart_service("mysqld") + else: + logging.debug(" Disabling mysql networking") + if status == 1 : + logging.debug(" Network is already disabled for mysql") + else: + cmd = '''sed -ie "s/#skip-networking/skip-networking/g" %s ''' %mysqlconf + mv_common.runcmd(cmd) + mv_common.restart_service("mysqld") + +def setup_mysql_connection(systemconfig): + logging.info(" Configuring database connection") + mythip = systemconfig["mythip"] + systemtype = systemconfig["SystemType"] + mv_root = systemconfig["MVROOT"] + mysqltxt = "/usr/share/mythtv/mysql.txt" + templates = systemconfig["TEMPLATES"] + mysqltemplate = templates + "/mysql.txt" + dbhost = systemconfig["dbhost"] + + if systemtype == "Master_backend": + logging.debug(" Setting dbhost to %s in systemconfig", mythip) + dbhost = mythip + cmd = '''sed -ei "s/^dbhost=.*$/dbhost=\"%s\"/" /etc/systemconfig ''' %dbhost + mv_common.runcmd(cmd) + logging.debug(" Changing dbhost in settings table for master_backend") + cmd = '''%s/bin/restore_default_settings.sh -c BECONFIG -s master -a %s ''' %(mv_root, dbhost) + mv_common.runcmd(cmd) + + if systemtype == "Slave_backend": + slavehost = mythip + logging.debug(" Changing slave in settings: %s", slavehost) + cmd = '''%s/bin/restore_default_settings.sh -c BECONFIG -s slave -a %s ''' %(mv_root, slavehost) + mv_common.runcmd(cmd) + + if systemtype == "Master_backend": + logging.debug(" changing mysql.txt file to use localhost") + cmd = '''sed -e "s/^DBHostName=.*$/DBHostName="localhost"/" %s > %s ''' %(mysqltemplate, mysqltxt) + mv_common.runcmd(cmd) + else: + logging.debug(" changing mysql.txt file to use %s", dbhost) + cmd = '''sed -e "s/^DBHostName=.*$/DBHostName=%s/" %s > %s ''' %(dbhost, mysqltemplate, mysqltxt) + mv_common.runcmd(cmd) + + delfile = data_config.MYTHHOME + "/.mythtv/mysql.txt" + mv_common.remove_file(delfile) + delfile = mv_root + "/bin/mythtv/.mythtv/mysql.txt" + mv_common.remove_file(delfile) + filecheck = data_config.MYTHHOME + "/templates/mysql.txt" + if os.path.exists(filecheck): + logging.info(" Scrapping all the previous work and using %s for mysql.txt", filecheck) + mv_common.cp_and_log(filecheck, mysqltxt) + + + +def setup_func_key(): + if data_config.SYSTEMTYPE == "MythVantage": + logging.debug(" Grabbing the key for Func") + cmd="/usr/MythVantage/bin/grabkey.py" + mv_common.runcmd(cmd) + +def setup_func_minion(dbhost): + logging.info(" Setting up the func minion:") + logging.debug(" certmaster is %s:",dbhost) + #cmd='''sed -i "s/^certmaster.*$/certmaster = %s/" /etc/func/minion.conf ''' %dbhost + #mv_common.runcmd(cmd) + cmd='''sed -i "s/^certmaster.*$/certmaster = %s/" /etc/certmaster/minion.conf ''' %dbhost + mv_common.runcmd(cmd) + +def setup_syslog(dbhost): + logging.debug(" Setting syslog to log to %s",dbhost) + cmd ='''sed -i "s/^destination d_remote.*$/destination d_remote \{tcp\(\"%s\" port\(514\)\) \;\} \;/" /etc/syslog-ng.conf''' %dbhost + return + +def hostypeprint(systemconfig): + logging.info("______Start of hostype config_____") + mv_common.services(systemconfig) + install_list='' + remove_list='' + daemon_list='' + daemon_remove_list='' + run_mysqlnetwork = False + + if systemconfig["SystemType"] == "Standalone": + logging.info("Stand alone system being configured") + setup_ntp(False,"null") + remove_avahi_service() + EnableNetwork = False + run_mysqlnetwork = True + if systemconfig["hostypec"]: + setup_db() + install_list=["mysql", "mythdb-initial", "avahi", "portmap", "nfs-utils", "local-website", "myth2ipod", "mythtv-status"] + daemon_list=["mysql", "mythbackend", "avahi", "portmap", "nfs-utils", "netfs", "lighttpd"] + if data_config.SYSTEMTYPE == "MythVantage": + install_list.append('ghosd') + + elif systemconfig["SystemType"] == "Master_backend": + logging.info("Master backend system being configured") + setup_ntp(False,"null") + setup_avahi(systemconfig["TEMPLATES"]) + install_list=["mysql", "mythdb-initial", "avahi", "portmap", "nfs-utils", "local-website", "myth2ipod", "mythtv-status"] + daemon_list=["mysql", "mythbackend", "avahi", "portmap", "nfs-utils", "netfs", "lighttpd"] + EnableNetwork = True + run_mysqlnetwork = True + if data_config.SYSTEMTYPE == "MythVantage": + install_list.append('func') + daemon_list.append('func') + install_list.append('certmaster') + daemon_list.append('certmaster') + install_list.append('ghosd') + + elif systemconfig["SystemType"] == "Slave_backend": + logging.info("Slave backend system being configured") + setup_ntp(True,systemconfig["dbhost"]) + remove_avahi_service() + if systemconfig["hostypec"]: + setup_db() + install_list = ["portmap", "nfs-utils", "local-website", "avahi", "libmysqlclient" ] + daemon_list = ["mythbackend", "portmap", "nfs-utils", "netfs", "lighttpd", "avahi" ] + daemon_remove_list=('mysql') + if data_config.SYSTEMTYPE == "MythVantage": + install_list.remove("local-website") + daemon_list.remove("lighttpd") + install_list.append('func') + daemon_list.append('funcd') + remove_list.append("lighttpd") + install_list.append('ghosd') + + + elif systemconfig["SystemType"] == "Frontend_only": + logging.info("Frontend only system being configured") + setup_ntp(True,systemconfig["dbhost"]) + remove_avahi_service() + install_list=["mysql-clients", "libmysqlclient", "avahi", "portmap", "nfs-utils", "local-website"] + remove_list=["mysql"] + daemon_list=["mysql", "mythbackend", "avahi", "portmap", "nfs-utils", "netfs", "lighttpd"] + daemon_remove_list=("mysql", "mythbackend") + if data_config.SYSTEMTYPE == "MythVantage": + install_list.remove("local-website") + daemon_list.remove("lighttpd") + install_list.append('func') + daemon_list.append('funcd') + remove_list.append("lighttpd") + install_list.append('ghosd') + + + for pkg in install_list: + mv_common.pacinstall(pkg) + for pkg in remove_list: + mv_common.pacinstall(pkg) + for daemon in daemon_list: + mv_common.add_service(daemon) + for daemon in daemon_remove_list: + mv_common.remove_service(daemon) + if systemconfig["RunFrontend"] == "1": + logging.debug(" Will run the frontend") + mv_common.add_service("frontend") + mv_common.add_service("hal") + if data_config.SYSTEMTYPE == "MythVantage": + mv_common.add_service("ghosd") + else: + logging.debug(" Will NOT run the frontend") + mv_common.remove_service("frontend") + mv_common.remove_service("hal") + if data_config.SYSTEMTYPE == "MythVantage": + mv_common.remove_service("ghosd") + + + if run_mysqlnetwork: + setup_mysqlnetwork(EnableNetwork) + else: + logging.debug(" Not running setup_mysql_connection") + + setup_mysql_connection(systemconfig) + if data_config.SYSTEMTYPE == "MythVantage": + setup_func_minion(systemconfig["dbhost"]) + setup_func_key() + setup_syslog(systemconfig["dbhost"]) + logging.info("__End of hostype config\n") diff --git a/abs/core-testing/LinHES-config-22/mv_install.py b/abs/core-testing/LinHES-config-22/mv_install.py new file mode 100755 index 0000000..19295ca --- /dev/null +++ b/abs/core-testing/LinHES-config-22/mv_install.py @@ -0,0 +1,1432 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +import sys, os, commands, glob, time +import getopt, re, MySQLdb +import logging +try: + import parted +except: + print "module parted not found" + +def usage(): + print "help text:" + print "example usage: --rootdisk=sda --rootfs=ext4 --rootsize=34240 --datafs=ext4 --datasize=3400 --datadisk=sda --swapsize=340 -c full_install" + +def clean_upgrade(): + return False + +def error_out(errmsg): + cmd = '''echo %s >> /tmp/.install_error ''' %errmsg + runcmd(cmd) + logging.critical("***********************************") + logging.critical("error: %s",errmsg) + print "***********************************" + print "ERROR: mv_install.py: %s" %errmsg + print "***********************************" + sys.exit(1) + + +def update_db(value, data): + db = MySQLdb.connect(host="localhost", user="mythtv", passwd="mythtv", db="mythconverg") + try: + cursor = db.cursor() + cursor.execute("DELETE FROM settings where value=%s and hostname=%s;", (value, data_config.MVHOSTNAME)) + cursor.execute("REPLACE INTO settings set value=%s, data=%s, hostname=%s;", (value, data, data_config.MVHOSTNAME)) + logging.debug("Updated database with %s, %s", data, value) + except MySQLdb.Error, e: + logging.debug("Unable to update database with %s, %s", data, value) + + +def progress(pgnum): + progressline = str(pgnum) + "% complete" + logging.debug("Progress: %s", pgnum) + f = open('/tmp/.install_percent', 'w') + f.write(progressline) + f.close() + +def update_status(status): + logging.debug("Status: %s", status) + f = open('/tmp/.install_state', 'w') + f.write(str(status)) + f.close() + +def kill_dhcp_chroot(): + logging.debug("Killing off chroot dhcpcd") + stddir = os.getcwd() + piddir = ("%s/var/run/") %data_config.MOUNTPOINT + try: + os.chdir(piddir) + for FILE in glob.glob("dhcpcd-*.pid"): + f = open(FILE, 'r') + pid = f.readline() + f.close() + cmd = "kill -9 %s" %pid + runcmd(cmd) + os.remove(FILE) + os.chdir(stddir) + except: + pass + +def statgrab(disk): + cmd = "statgrab -M disk. |grep %s.write_bytes" % hostoptions["rootdisk"] + out = commands.getoutput(cmd) + try: + prewritebytes = out.split("=")[1].strip() + except: + prewritebytes = "1024" + outline = "STARTSIZE=%s" %prewritebytes + f = open('/tmp/.startsize.io', 'w') + f.write(str(outline)) + f.close() + +def backup_sql_check(): + logging.debug("Searching for backup file") + try: + hostoptions["backupfile"] + except: + logging.debug("Backup file var is empty") + return False + if os.path.exists(data_config.MOUNTPOINT+hostoptions["backupfile"]): + logging.debug("Backup file %s is present", data_config.MOUNTPOINT+hostoptions["backupfile"]) + return True + else: + logging.debug("Backup file %s is NOT present", data_config.MOUNTPOINT+hostoptions["backupfile"]) + return False + +def mdadm_find(PREFIX): + logging.debug("Searching for mdadm.conf") + if os.path.exists(PREFIX+"/etc/KnoppMyth-version"): + mdadmconf = "/etc/mdadm/mdadm.conf" + else: + mdadmconf = "/etc/mdadm.conf" + logging.debug("Using %s for mdadm.conf", mdadmconf) + return mdadmconf + +def mdadm_assemble_all(): + # read mdadm.conf and start the arrays + #ARRAY /dev/md5 uuid=19464854:03f71b1b:e0df2edd:246cc977 + logging.debug("Starting mdadm support") + mdadmconf_file = mdadm_find("/tmp") + cmd = "cdadm --assemble --scan -c /tmp/%s" %mdadmconf_file + runcmd(cmd) + mdadm_contents = '' + try: + f = open(mdadmconf_file, 'r') + mdadm_contents = f.readlines() + f.close() + except: + logging.debug(" Couldn't open mdadmconf file") + for line in mdadm_contents: + if line.startswith("ARRAY"): + logging.debug(" Found MD array: %s", line) + array = line.split()[1] + logging.info(" assembling array: %s", array) + cmd = "mdadm --assemble -c /tmp%s %s" %(mdadmconf_file, array) + runcmd(cmd) + time.sleep(2) + cmd = "fsck -p %s" %array + runcmd + +def copy_updates(): + try: + MVROOT = os.environ["MV_ROOT"] + except: + logging.debug("MVROOT was not defined, using the default value") + MVROOT = "/usr/MythVantage" + cp_and_log2(MVROOT+"/bin/", data_config.MOUNTPOINT+MVROOT+"/bin", "*.sh") + cp_and_log2(MVROOT+"/bin/", data_config.MOUNTPOINT+MVROOT+"/bin", "*.py") + +def timezone_to_db(timefile): + logging.info("importing timezone") + try: + f = open(timefile) + timezonecontents = f.readline().strip() + f.close() + except: + logging.debug("Couldn't open /tmp/etc/timezone, will not set the timezone") + return + update_db("HostTimeZone", timezonecontents); + tzsplit = timezonecontents.partition('/') + print tzsplit + if tzsplit[2] == '' : + update_db("HostTimeZoneRegion", tzsplit[0]) + else: + update_db("HostTimeZoneRegion", tzsplit[0]) + tztemp="HostTimeZoneRegion_%s" % tzsplit[0] + update_db(tztemp, tzsplit[2]) + + + +def cp_and_log(srcfile, destfile): + #return + if not os.path.exists(srcfile): + logging.info("%s is not present, skipping...", srcfile) + else: + cmd = ("rsync -arvp %s %s") %(srcfile, destfile) + runcmd(cmd) + +def cp_and_log2(srcfile, destfile, fileglob): + #return + logging.debug("cp_and_log2") + logging.debug("%s, %s, %s", srcfile, destfile, fileglob) + + if not os.path.exists(srcfile): + logging.info("%s is not present, skipping...", srcfile) + else: + if fileglob == '': + cmd = ("rsync -arvp %s %s") %(srcfile, destfile) + runcmd(cmd) + else: + fileglob = "*" + cmd = ("rsync -arvp %s/%s %s") %(srcfile, fileglob, destfile) + runcmd(cmd) + +def runcmd(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 + +def mysqldb(cmd, inchroot): + if cmd == "start": + mycmd = " /etc/rc.d/mysqld start" + elif cmd == "stop": + mycmd = " /etc/rc.d/mysqld stop" + if inchroot == "chroot": + mycmd = " chroot /newboot %s" %mycmd + runcmd(mycmd) + + +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" + runcmd(cmd) + cmd = " umount -l %s" %data_config.MOUNTPOINT+"/sys" + runcmd(cmd) + + +def blank_table(diskdevice): + logging.debug(" writing new parition table for %s", diskdevice) + logging.debug("parition table before:") + cmd = "fdisk -l %s" %diskdevice + runcmd(cmd) + + cmd = "echo w |fdisk %s" %diskdevice + runcmd(cmd) + + logging.debug("parition table after:") + cmd = "fdisk -l %s" %diskdevice + runcmd(cmd) + +def partitions_removeall(diskdevice, label): + logging.info("Removing all partitions for %s %s", label, diskdevice) + try: + device = parted.getDevice(diskdevice) + partdisk = parted.Disk(device) + partdisk.deleteAllPartitions() + if data_config.NOOPDEBUG == "FALSE": + partdisk.commit() + for partition in partdisk.partitions: + print "type: %s" %partition.type + except: + logging.debug(" Error reading parition table, attempting to write a blank one") + blank_table(diskdevice) + + +def create_partitions(diskdevice, size, ptype, startsector): + logging.debug("_____Create partitions______") + if size == "NO": + logging.info("Size is 0, skipping") + return "NO" + partlist = [] + newstart = 0 + totalused = 0 + device = parted.getDevice(diskdevice) + partdisk = parted.Disk(device) + for partition in partdisk.partitions: + if partition.type != parted.PARTITION_FREESPACE: + partlist.append((partition, + partition.path, + partition.getFlag(parted.PARTITION_BOOT), + partition.geometry.start, + partition.geometry.end, + partition.geometry.length, + partition.type, + partition.fileSystem)) + for slice in partlist: + (usedpartition, usedpath, usedbootable, usedstart, usedend, usedlength, usedtype, usedfs) = slice + #Start the new partition one after the end of last + newstart = usedend+1 + + if startsector == 0: + newstart = 0 + if size == "ALL": + logging.debug(" Using the rest of the disk %s", (device.length-newstart) ) + try: + geom = parted.Geometry(device=device, start=newstart, length=(device.length-newstart)) + except: + logging.info("An error occured, probably invalid parition size") + return + else: + # convert size in MB to a length on the device in sectors + length = (int(size) * (1024 * 1024)) / device.sectorSize + logging.debug("Size is %s", length) + try: + geom = parted.Geometry(device=device, start=newstart, length=length) + except: + logging.info("An error occured, probably invalid parition size") + error_out("invalid parition size") + + #collect device constraint + constraint = device.getConstraint() + # new partition + if ptype == "NORMAL": + newpart = parted.Partition(disk=partdisk, type=parted.PARTITION_NORMAL, geometry=geom) + elif ptype == "SWAP": + newpart = parted.Partition(disk=partdisk, type=parted.PARTITION_NORMAL, geometry=geom) + + #add the partition to the disk and commit changes + partdisk.addPartition(partition=newpart, constraint=constraint) + if data_config.NOOPDEBUG == "FALSE": + partdisk.commit() + logging.info("created partition %s of %dMB and added it to %s" % + (newpart.getDeviceNodeName(), newpart.getSize(), diskdevice)) + return newpart.getDeviceNodeName() + +def set_active_parition(diskdevice): + """ Set the bootable flag for this partition. """ + logging.debug(" Setting active parition") + device = parted.getDevice(diskdevice) + partdisk = parted.Disk(device) + try: + for partition in partdisk.partitions: + partition.setFlag(parted.PARTITION_BOOT) + partdisk.commit() + except: + logging.info(" Couldn't set the active partition") + logging.info(" Depending on your system this may not matter") + + +def partition_disk(): + global hostoptions + logging.info("Partitioning") + logging.debug("____start of partition_disk____") + rootdisk = hostoptions["rootdisk"] + datadisk = hostoptions["datadisk"] + label = "root" + partitions_removeall("/dev/"+rootdisk, label) + label = "data" + partitions_removeall("/dev/"+datadisk, label) + hostoptions["rootpartition"] = create_partitions("/dev/"+rootdisk, hostoptions["rootsize"], "NORMAL", 0) + set_active_parition("/dev/"+rootdisk) + hostoptions["swappartition"] = create_partitions("/dev/"+rootdisk, hostoptions["swapsize"], "SWAP", 1) + if datadisk != rootdisk: + hostoptions["datapartition"] = create_partitions("/dev/"+datadisk, hostoptions["datasize"], "NORMAL", 0) + else: + hostoptions["datapartition"] = create_partitions("/dev/"+datadisk, hostoptions["datasize"], "NORMAL", 1) + time.sleep(5) + +def fscmd(fstype): + fscmds = {"reiserfs":"mkreiserfs -q -l ROOT", "xfs": "mkfs -t xfs -f", "ext3": "mkfs.ext3", "jfs":"mkfs.jfs -q", "ext4":"mkfs.ext4", "Do_not_format":"noformat", "no_format":"noformat"} + try: + rc = fscmds[fstype] + except: + logging.critical(" %s is not a valid fs type, exiting now", fstype) + error_out("Error mvinstall during format") + return rc + + +def format_disk(install_type): + logging.info("______Starting Disk Format______") + rootfs = fscmd(hostoptions["rootfs"]) + datafs = fscmd(hostoptions["datafs"]) + + rootdisk = hostoptions["rootdisk"] + datadisk = hostoptions["datadisk"] + rootpartition = hostoptions["rootpartition"] + datapartition = hostoptions["datapartition"] + if install_type != "upgrade": + swapsize = hostoptions["swapsize"] + swappartition = hostoptions["swappartition"] + + logging.debug(" Format command for rootfs %s : %s ", rootfs, rootpartition) + if ( rootfs != "noformat"): + logging.info("Starting format of %s", rootpartition) + cmd = " %s /dev/%s" %( rootfs, rootpartition) + #os.system(cmd) + runcmd(cmd) + else: + logging.info("Will not format root partition: %s", rootpartition) + + logging.debug(" Format command for datafs %s : %s ", datafs, datapartition) + if (datafs != "noformat"): + logging.info("Starting format of %s", datapartition) + cmd = " %s /dev/%s" %( datafs, datapartition) + #os.system(cmd) + runcmd(cmd) + else: + logging.info("Will not format data partition: %s", datapartition) + + if install_type == "install": + if (hostoptions["swapsize"] != "NO"): + logging.info("Starting format for swap %s", swappartition) + cmd = " mkswap /dev/%s" % swappartition + #os.system(cmd) + runcmd(cmd) + else: + logging.debug(" Swap is set to NO, will not run mkswap") + + logging.debug("_____End of format______") + + +def mount_it(): + logging.info("______Mounting disk______") +# Create mount points + try: + mountpoint = data_config.MOUNTPOINT + mp = mountpoint + logging.info("Creating mountpoints %s", mp) + os.makedirs(mp) + except OSError: + logging.debug(" Could not create %s", mp) + +# Mount root + cmd = "mount /dev/%s %s" %(hostoptions["rootpartition"], mountpoint) + runcmd(cmd) + #logging.debug(cmd) + #cmdout=commands.getoutput(cmd) + #logging.debug(cmdout) +# Mount data +#make mountpoint after mounting / + try: + mountpoint = data_config.MOUNTPOINT + datapoint = data_config.DATAMOUNT + mp = mountpoint+datapoint + logging.info("Creating mountpoints %s", mp) + os.makedirs(mp) + except OSError: + logging.debug(" Could not create %s", mp) + + cmd = "mount /dev/%s %s" %(hostoptions["datapartition"], mp) + runcmd(cmd) + #logging.debug(cmd) + #cmdout=commands.getoutput(cmd) + #logging.debug(cmdout) + +def unmount_it(): + logging.info("______Unmounting disk______") + cmd = "umount %s" %(data_config.MOUNTPOINT+data_config.DATAMOUNT) + runcmd(cmd) + time.sleep(2) + + cmd = "swapoff /dev/%s" %(hostoptions["swappartition"]) + runcmd(cmd) + + cmd = "sync" + runcmd(cmd) + + cmd = "umount %s" %(data_config.MOUNTPOINT) + runcmd(cmd) + cmd = "sync" + runcmd(cmd) + + +def create_squashlist(): + logging.debug("Creating squashlist") + squashfile = data_config.SQUASHFILE + f = open(squashfile, 'w') + for i in data_config.SQUASHLIST: + f.write(i) + f.write("\n") + logging.debug(i) + f.close() + + +def copy_it(install_type): + logging.info("______Transferring to disk______") + logging.debug( install_type) + if ( install_type == "install"): + logging.info("Transferring system") + cmd = " unsquashfs -f -d %s /.livesys/medium/system.sqf" %(data_config.MOUNTPOINT) + runcmd(cmd) + #logging.debug(cmd) + #cmdout=commands.getoutput(cmd) + + if ( install_type == "upgrade"): + logging.info("Upgrading system") + create_squashlist() + cmd = " unsquashfs -e %s -f -d %s /.livesys/medium/system.sqf" %(data_config.SQUASHFILE, data_config.MOUNTPOINT) + runcmd(cmd) + #logging.debug(cmd) + #cmdout=commands.getoutput(cmd) +# Create the missing dir + i = ("sys", "proc", "dev", "tmp", "mnt", "media", "media/cdrom", "media/dvd", "var/log/mythtv") + mountpoint = data_config.MOUNTPOINT + for item in i: + try: + mp = mountpoint+"/"+item + logging.info("Creating mountpoints %s", mp) + os.makedirs(mp) + except OSError: + logging.debug(" __Could not create %s", mp) +# General fixup + cmd = "chmod 777 %s/tmp" %(data_config.MOUNTPOINT) + runcmd(cmd) + cmd = "mknod %s/dev/null c 1 5" %(data_config.MOUNTPOINT) + runcmd(cmd) + cmd = "mknod %s/dev/console c 5 1" %(data_config.MOUNTPOINT) + runcmd(cmd) + cmd = "chmod +s %s/usr/bin/Xorg" %(data_config.MOUNTPOINT) + runcmd(cmd) + cmd = "chmod +s %s/usr/bin/crontab" %(data_config.MOUNTPOINT) + runcmd(cmd) + cmd = "chmod +s %s/usr/bin/sudo" %(data_config.MOUNTPOINT) + runcmd(cmd) + cmd = "chmod +s %s/bin/mount" %(data_config.MOUNTPOINT) + runcmd(cmd) + logging.debug("__End of copy_it__") + +def create_fstab(extralines): + logging.debug("______Creating new fstab file_______") + logging.info("Creating new fstab file") + fstabfile = data_config.MOUNTPOINT+"/etc/fstab" + fstab_list = [] + f = open(fstabfile, 'w') + line = '''# \n''' + fstab_list.append(line) + line = '''none /dev/pts devpts defaults 0 0 \n''' + fstab_list.append(line) + line = '''none /dev/shm tmpfs defaults 0 0\n''' + fstab_list.append(line) + line = '''/dev/sr0 /media/cdrom auto ro,user,noauto,unhide 0 0\n''' + fstab_list.append(line) + line = '''UUID=ROOTUID / auto defaults,noatime 0 1\n''' + fstab_list.append(line) + line = '''UUID=DATAUID %s auto defaults,noatime 0 1\n''' %(data_config.DATAMOUNT) + fstab_list.append(line) + line = '''UUID=SWAPUID swap swap defaults 0 0 \n''' + fstab_list.append(line) + for vline in extralines: + fstab_list.append(vline) + for outline in fstab_list: + logging.debug(outline) + f.write(outline) + f.close() + +def find_uuid(partition): + logging.info("Finding the UUID for %s...", partition) + cmd = "blkid -s UUID /dev/%s" %partition + tmpuuid = runcmd(cmd)[1] + splituuid = tmpuuid.partition("=") + uuid = splituuid[2].replace('"', "") + logging.info("The uuid is %s", uuid) + return uuid.strip() + +def pick_out_vg(): + logging.info("Searching for Volume Groups in old fstab") + vglines = [] + f = open("/tmp/etc/fstab", 'r') + oldfscontents = f.readlines() + for line in oldfscontents: + if line.startswith("/dev/vg"): + vglines.append(line) + templine = line.split() + mdir = templine[1] + if not os.path.exists (mdir): + logging.debug("Creating dir %s for VG mount", mdir) + os.makedirs (mdir) +# Might need to os.chown to mythtv:users + else: + logging.debug("Directory %s for VG mount already present", mdir) + return vglines + +def fstab_it(install_type): + logging.info("______Checking fstab______") + kmvg = [] + fstabfile = data_config.MOUNTPOINT+"/etc/fstab" +# Check for knoppmyth install, if found create new + if install_type == "upgrade": + if os.path.exists("/tmp/etc/KnoppMyth-version"): + logging.debug(" KnoppMyth-Version found, creating new fstab") + kmvg = pick_out_vg() + create_fstab(kmvg) + elif os.path.exists("/tmp/etc/fstab"): + logging.debug(" Upgrade and not Knoppmyth, using old fstab") + cp_and_log("/tmp/etc/fstab", fstabfile) +# Catch all for creating new fstab + if not os.path.exists(data_config.MOUNTPOINT+"/etc"): + os.makedirs(data_config.MOUNTPOINT+"/etc") + if not os.path.exists(fstabfile): + create_fstab(kmvg) + + logging.info("____UUID check for %s", "swap") + swapuuid = find_uuid(hostoptions["swappartition"]) + + logging.info("____UUID check for %s", "data") + datauuid = find_uuid(hostoptions["datapartition"]) + + logging.info("____UUID check for %s", "root") + rootuuid = find_uuid(hostoptions["rootpartition"]) + + fstabfile = data_config.MOUNTPOINT+"/etc/fstab" + logging.info("Correcting UUID's in %s", fstabfile) + f = open(fstabfile, 'r') + oldfscontents = f.readlines() + newfstab = [] + f.close() + for line in oldfscontents: + if line.startswith("UUID"): + templine = line.split() + if ( templine[1] == "/"): + logging.debug(" Found Root fstab line:") + logging.debug( templine) + templine[0] = "UUID=%s" %(rootuuid) + newline = '' + for i in templine: + newline+=i + newline+=" " + newline+="\n" + logging.debug(" New fstab line:") + logging.debug( newline) + newfstab.append(newline) + + if ( templine[1] == data_config.DATAMOUNT): + logging.debug(" Found DATA mount") + logging.debug( templine) + templine[0] = "UUID=%s" %(datauuid) + newline = '' + for i in templine: + newline+=i + newline+=" " + newline+="\n" + logging.debug(" New fstab line:") + logging.debug( newline) + newfstab.append(newline) + + if ( templine[1] == "swap"): + if len(swapuuid) <= 5: + logging.debug(" swapp uuid is to small") + else: + logging.debug(" Found swap partition") + logging.debug( templine) + templine[0] = "UUID=%s" %(swapuuid) + newline = '' + for i in templine: + newline+=i + newline+=" " + newline+="\n" + logging.debug(" New fstab line:") + logging.debug( newline) + newfstab.append(newline) + else: + logging.debug(" Line didn't match, adding to newfstab:") + logging.debug( line) + newfstab.append(line) + logging.info("Writing out newfstab") + logging.debug("______This is the new fstab_____") + f = open(fstabfile, 'w') + for line in newfstab: + logging.debug(line) + f.write(line) + #f.write("\n") + f.close() + +def grub_it(): + logging.info("______Start of grub install______") + cmd = " grub-install --recheck --no-floppy --root-directory=%s \"(hd0)\" " % data_config.MOUNTPOINT + logging.info("Running grub-install") + runcmd(cmd) + rootuuid = find_uuid(hostoptions["rootpartition"]) + cmd = " mkinitcpio -g %s/boot/kernel26.img" % data_config.MOUNTPOINT + logging.info("Running mkinitcpio") + runcmd(cmd) + logging.info("Adding root uuid to grub menu") + grubfile = data_config.MOUNTPOINT+"/boot/grub/menu.lst" + try: + f = open(grubfile, 'r') + oldgrub = f.readlines() + newgrub = [] + f.close() + for line in oldgrub: + if line.startswith("kernel"): + templine = line.split() + logging.debug(" Found kernel Root grubline:") + logging.debug( templine) + templine[2] = "root=/dev/disk/by-uuid/%s" %(rootuuid) + newline = '' + for i in templine: + newline+=i + newline+=" " + newline+="\n" + logging.debug(" New grub menu.lst line:") + logging.debug( newline) + newgrub.append(newline) + else: + logging.debug("Line didn't match, adding to newgrub:") + logging.debug( line) + newgrub.append( line) + logging.info("Writing out new grub file") + logging.debug("______This is the new grub_____") + f = open(grubfile, 'w') + for line in newgrub: + logging.debug(line) + f.write(line) + f.close() + except: + logging.debug("Couldn't open grub file") + +def fix_permissions(): + logging.info("Fixing permissions") + SE = os.environ["TEMPLATES"]+"/settings/syssettings" + cmd = " chmod -R 755 %s" %(data_config.MOUNTPOINT+SE) + runcmd(cmd) + cmd = " chmod 775 %s" %(data_config.MOUNTPOINT+"/etc/systemconfig") + runcmd(cmd) + cmd = " chmod 755 %s" %(data_config.MOUNTPOINT+"/root") + runcmd(cmd) + cmd = " chown root:mythtv %s" %(data_config.MOUNTPOINT+"/etc/systemconfig") + runcmd(cmd) + cmd = " chown -R mythtv:mythtv %s" %(data_config.MOUNTPOINT+SE) + runcmd(cmd) + cmd = " chown -R mythtv:mythtv %s" %(data_config.MOUNTPOINT+"/var/log/mythtv") + runcmd(cmd) + +def apply_new_auth(): + logging.info("_____Applying Password updates_______") + passfile = "/root/myth_user_call.out" + try: + MVROOT = os.environ["MV_ROOT"] + except: + logging.debug("MVROOT was not defined, using the default value") + MVROOT = "/usr/MythVantage" + if data_config.NOOPDEBUG == "FALSE": + cmdprefix = "chroot " + data_config.MOUNTPOINT + " " + MVROOT+"/bin/myth_user_call -i " + else: + cmdprefix = "echo chroot " + data_config.MOUNTPOINT + " " + MVROOT+"/bin/myth_user_call -i " + try: + f = open(passfile, 'r') + passcmds = f.readlines() + f.close() + for cmd in passcmds: + execmd = cmdprefix+cmd +# Using os.system because runcmd fails + logging.debug(execmd) + os.system(execmd) + except: + logging.debug("Applying password updates failed, couldn't open %s", passfile) + logging.debug + +def add_to_blacklist(module): + rcfile = data_config.MOUNTPOINT + "/etc/rc.conf" + logging.debug(" Attempting to add %s to blacklist", module) + newline='' + try: + f = open(rcfile, 'r') + conflines = f.readlines() + f.close() + except: + logging.critical(" *Couldn't open %s for reading",rcfile) + return + + try: + f = open(rcfile, 'w') + except: + logging.critical(" *Couldn't open %s for reading",rcfile) + return + + for line in conflines: + newline = line + if re.match("MOD_BLACKLIST",line): + logging.debug(line) + try: + lastpar = line.rindex(')') + logging.debug(" found ) at %s", lastpar) + newline = line[:lastpar] +" !" + module + " " + line[lastpar:] + logging.debug(newline) + except: + logging.debug("Couldn't find ending )") + newline = line + f.write(newline) + f.close() + + +def add_to_modulelist(module): + rcfile = data_config.MOUNTPOINT + "/etc/rc.conf" + logging.debug(" Attempting to add %s to modulelist", module) + newline='' + try: + f = open(rcfile, 'r') + conflines = f.readlines() + f.close() + except: + logging.critical(" *Couldn't open %s for reading",rcfile) + return + + try: + f = open(rcfile, 'w') + except: + logging.critical(" *Couldn't open %s for reading",rcfile) + return + + for line in conflines: + newline = line + if re.match("MODULES=",line): + logging.debug(line) + try: + lastpar = line.rindex(')') + logging.debug(" found ) at %s", lastpar) + newline = line[:lastpar] +" " + module + " " + line[lastpar:] + logging.debug(newline) + except: + logging.debug("Couldn't find ending )") + newline = line + f.write(newline) + f.close() + + + +def special_hardware_check(): + logging.info("_____Applying special boot parameters_______") + try: + f = open('/proc/cmdline', 'r') + bootoptions = f.readlines() + f.close() + except: + logging.critical(" *Couldn't open /proc/cmdline") + return + bootoptions = bootoptions[0].split() + logging.debug(" Boot options: %s", bootoptions) + for item in bootoptions: + logging.debug(item) + if re.match("disablemodules",item) != None : + logging.debug(" Found disabledmodules") + modulelist = item.split("=")[1] + for module in modulelist.split(','): + add_to_blacklist(module) + + if re.match("modules",item) != None : + logging.debug(" Found modules") + modulelist = item.split("=")[1] + for module in modulelist.split(','): + add_to_modulelist(module) + + if re.match("type",item) != None : + logging.debug(" Found special hardware type") + try: + typefile = open(data_config.MOUNTPOINT + "/myth/.special_hardware_type", 'w') + typelist = item.split("=")[1] + # there should be only one special hardware type, but this will handle multiples, just in case + for type in typelist.split(','): + typefile.write(type) + typefile.write("\n") + typefile.close() + except: + logging.debug("Couldn't write to file: ", typefile) + if re.match("no_meth",item) != None : + cmd = " touch %s%s/.no_meth" %(data_config.MOUNTPOINT, data_config.MYTHHOME) + runcmd(cmd) + +def swapsearch(): +#currently unused! + partlist = [] + stddir = os.getcwd() + os.chdir("/sys/block") + partitionlist = glob.glob("*") + for item in partitionlist: + try: + newitem = item.strip().rpartition(" ")[2] + if (not newitem == '') and (not newitem.startswith("loop")): + path = "/dev/"+newitem.strip() + path = path.strip() + device = parted.getDevice(path) + (cylinders, heads, sectors) = device.biosGeometry + sizeInBytes = device.length * device.sectorSize + disk = parted.Disk(device) + for partition in disk.partitions: + if partition.type == parted.PARTITION_PROTECTED or \ + partition.type == parted.PARTITION_METADATA or \ + partition.type == parted.PARTITION_FREESPACE: + continue + + partlist.append((partition, + partition.path, + partition.getFlag(parted.PARTITION_BOOT), + partition.geometry.start, + partition.geometry.end, + partition.geometry.length, + partition.type, + partition.fileSystem)) + for slice in partlist: + (partition, path, bootable, start, end, length, type, fs) = slice + if partition.getFlag(parted.PARTITION_SWAP) or fs.type == "linux-swap": + print "found swap" + print path + except: + pass + os.chdir(stddir) + +def sane_settings(file): + #Remove some settings from file_name + removeline = ("HOSTrootfstype", "HOSTrootfstype", "HOSTdatafstype", "HOSTOSsize", "HostUseALLdata", "HOSTDATAsize", "HOSTuprootfstype", "HostUseSWAP", "HOSTSWAPsize") + logging.debug("__Running sane settings") + try: + f = open(file, 'r') + filecontents = f.readlines() + f.close() + except: + logging.debug(" Couldn't find file %s to sane", file) + try: + f = open(file, 'w') + for line in filecontents: + for item in removeline: + if line.startsize(line.strip()): + logging.debug(" Found a line to remove in %s, %s", file, line) + else: + f.write(line) + except: + logging.debug(" Couldn't open file %s for writing", file) + logging.debug(" __End sane settings") + +def restore_default_settings(): + try: + MVROOT = os.environ["MV_ROOT"] + except: + logging.debug(" MVROOT was not defined, using the default value") + MVROOT = "/usr/MythVantage" + logging.info("Saving syssettings") + cmd = "%s/bin/restore_default_settings.sh -c save -t syssettings -h %s -d localhost" %(MVROOT, data_config.MVHOSTNAME) + runcmd(cmd) + SE = os.environ["TEMPLATES"]+"/settings/syssettings/" + cp_and_log(SE, data_config.MOUNTPOINT+SE) + cp_and_log("/etc/mtab", data_config.MOUNTPOINT+"/etc/mtab") + copy_updates() + fix_permissions() + +def full_install(hostoptions): + logging.info("______Start of full install______") + try: + MVROOT = os.environ["MV_ROOT"] + except: + logging.debug(" MVROOT was not defined, using the default value") + MVROOT = "/usr/MythVantage" + + try: + os.remove("/tmp/.this_is_upgrade") + except OSError: + logging.debug(" File /tmp/.this_is_upgrade not present, couldn't delete it") + pass +# Partition disk + statusmsg = "Partitioning %s" %( hostoptions["rootdisk"]) + update_status(statusmsg) + progress(1) + if data_config.NOOPDEBUG == "FALSE": + partition_disk() + else: + logging.debug(" Debug mode, skipping partitioning step") + +# Format disk + statusmsg = "Preparing %s" %( hostoptions["rootdisk"]) + update_status(statusmsg) + progress(2) + format_disk("install") + + +# Mount partitions + statusmsg = "Mounting %s" %( hostoptions["rootdisk"]) + update_status(statusmsg) + progress(3) + mount_it() + +# Find number of bytes written to disk before starting copy. This is used +# to have a somewhat decent progress indication. + statgrab( hostoptions["rootdisk"]) + msg = "Creating %s" %(systemconfig["hostname"]) + update_status(msg) + +# Copy system to disk + copy_it("install") +# Remove old fstab so that a new one is created + fstabfile = data_config.MOUNTPOINT+"/etc/fstab" + try: + os.remove(fstabfile) + except OSError: + logging.debug(" ERROR: deleting %s", fstabfile) + fstab_it("full_install") +# Configure system + msg = "Configuring system" + update_status(msg) + progress(98) + grub_it() + special_hardware_check() +# Configuring the system + logging.info("______Configuring system________") + cp_and_log("/etc/systemconfig", data_config.MOUNTPOINT+"/etc/systemconfig") + cp_and_log("/root/xorg.conf.install", data_config.MOUNTPOINT+"/etc/X11/xorg.conf.install") + restore_default_settings() + #try: + #MVROOT=os.environ["MV_ROOT"] + #except: + #logging.debug(" MVROOT was not defined, using the default value") + #MVROOT="/usr/MythVantage" + #logging.info("Saving syssettings") + #cmd="%s/bin/restore_default_settings.sh -c save -t syssettings -h %s -d localhost" %(MVROOT, data_config.MVHOSTNAME) + #runcmd(cmd) + #SE=os.environ["TEMPLATES"]+"/settings/syssettings" + #cp_and_log(SE, data_config.MOUNTPOINT+SE) + #cp_and_log("/etc/mtab", data_config.MOUNTPOINT+"/etc/mtab") + #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________") + mysqldb("stop", '') + mount_bind_chroot() + cmd = " chroot %s %s/bin/install_db_chroot.sh |tee /tmp/chrootdb.out" %(data_config.MOUNTPOINT, MVROOT) + runcmd(cmd) + logging.info("Running systemconfig in chroot") + #cmd = " chroot %s %s/bin/systemconfig.sh misc, hostype, network, advanced, user, this_is_install" %(data_config.MOUNTPOINT, MVROOT) + cmd = "chroot %s %s/bin/systemconfig.sh all,this_is_install" %(data_config.MOUNTPOINT, MVROOT) + rc = runcmd(cmd)[0] + if rc != 0 : + error_out("Running systemconfig") + + mysqldb("stop", "chroot") + kill_dhcp_chroot() + logging.info("____End Database in CHROOT____") + mysqldb("start", '') + umount_bind_chroot() + else: + logging.info("______No database required, continuing configuration________") + mount_bind_chroot() + cmd = " chroot %s DISPLAY=127.0.0.1:0 %s/bin/MythVantage -t restore, default 1" %(data_config.MOUNTPOINT, MVROOT) + runcmd(cmd) +# Need to check for to touch /tmp/.dbsysfailed + cmd = " chroot %s %s/bin/restore_default_settings.sh -c restore -t syssettings " %(data_config.MOUNTPOINT, MVROOT) + runcmd(cmd) + if ( 'x' == '1' ): + logging.debug("touching /tmp/.dbsysfailed") + else: + #cmd = " chroot %s %s/bin/systemconfig.sh misc, hostype, network, advanced, user, this_is_install" %(data_config.MOUNTPOINT, MVROOT) + cmd = "chroot %s %s/bin/systemconfig.sh all,this_is_install" %(data_config.MOUNTPOINT, MVROOT) + rc = runcmd(cmd)[0] + if rc != 0 : + error_out("Running systemconfig") + cmd = "chroot %s %s/bin/restore_default_settings.sh -c ACCESSCONTROL " %(data_config.MOUNTPOINT, MVROOT) + runcmd(cmd) + umount_bind_chroot() + cmd = " touch %s%s/.configure" %(data_config.MOUNTPOINT, data_config.MYTHHOME) + runcmd(cmd) + cmd = " chmod 777 %s%s/.configure" %(data_config.MOUNTPOINT, data_config.MYTHHOME) + runcmd(cmd) + + msg = "Done" + update_status(msg) + cp_and_log("/tmp/mythvantage_install.log", data_config.MOUNTPOINT+"/var/log/mythvantage_install.log") + cp_and_log("/tmp/mv_debug.log", data_config.MOUNTPOINT+"/var/log/mv_debug.log") + unmount_it() + logging.debug("_____End of full install_____") + +def find_upgrade(): + logging.info("_____Start of find_upgrade_____") + global hostoptions + #try to mount first partition of disk + #copy old /etc/systemconfig to live, import settings into db + #umount drive. + #check for clean upgrade + if ( clean_upgrade() ): + logging.info("Clean upgrade requested, not using old data") + return + mount_it() + oldbackupfile = data_config.MOUNTPOINT+"/root/backup/"+data_config.BACKUPFILE + newbackupfile = "/tmp/"+data_config.BACKUPFILE + if os.path.exists(oldbackupfile): + logging.debug("Setting backup file to %s", newbackupfile) + hostoptions["backupfile"] = newbackupfile + cp_and_log(oldbackupfile, newbackupfile) + + srcfile = data_config.MOUNTPOINT+"/etc/systemconfig" + logging.info("Searching for systemconfig file %s", srcfile) + if os.path.exists(srcfile): + logging.info("Found systemconfig file %s", srcfile) + TEMPLATES = os.environ["TEMPLATES"]+"/settings/syssettings" + cp_and_log2(data_config.MOUNTPOINT+TEMPLATES, data_config.TEMP_TEMPLATES, '') + sane_settings("/tmp/templates/settings/syssettings/settings.txt") + cp_and_log2(data_config.TEMP_TEMPLATES, TEMPLATES, '') + cp_and_log(srcfile, "/etc/systemconfig") + cp_and_log(data_config.MOUNTPOINT+"/etc/", "/tmp/etc/") + cp_and_log(data_config.MOUNTPOINT+"/var/lib/alsa/", "/tmp/alsa") + cp_and_log(data_config.MOUNTPOINT+"/var/lib/oss/", "/tmp/oss") + cp_and_log("/tmp/etc/mdadm.conf", "/etc/mdadm.conf") + else: + logging.info("Could not find systemconfig file %s", srcfile) + cp_and_log(data_config.MOUNTPOINT+"/etc/", "/tmp/etc/") + cp_and_log(data_config.MOUNTPOINT+"/var/lib/alsa/", "/tmp/alsa") + cp_and_log("/tmp/etc/mdadm.conf", "/etc") + timezone_to_db("/tmp/etc/timezone") + unmount_it() + logging.debug("End of find_upgrade") + +def upgrade_mount_search(): + #Search for data/myth partition based on contents of fstab + logging.debug("______Start of upgrade_mount_search_____") + cmd = "umount %s%s" %(data_config.MOUNTPOINT, data_config.DATAMOUNT) + runcmd(cmd) + fstab_list = [] + fstab_data_mount = '' + try: + f = open("/tmp/etc/fstab", 'r') + oldfscontents = f.readlines() + f.close() + ## ['UUID=', '/myth', 'auto', 'defaults, noatime', '0', '1'] + #for line in oldfscontents: + #mountdir=line.split() + #if mountdir[1] == (data_config.DATAMOUNT): + #fstablist.append(mountdir) + except: + logging.debug(" Couldn't open /tmp/etc/fstab") + for line in oldfscontents: + if line.startswith("#"): + continue + mountdir=line.split() + try: + if mountdir[1] == (data_config.DATAMOUNT): + fstablist.append(mountdir) + except: + continue + #search fstab for data/myth mountpoint + for i in fstab_list: + if i[1] == data_config.DATAMOUNT: + fstab_data_mount = i[0] + break + + #start software raid support if needed + for i in fstab_list: + if i[0].startswith("/dev/md"): + logging.debug(" starting software raid support") + mdadm_assemble_all + + + if re.search("UUID", fstab_data_mount): + fstab_data_uuid = fstab_data_mount.split("=")[1] + cmd = "blkid -t UUID=%s" %fstab_data_uuid + retcode = call(cmd, shell=True) + if retcode != 0: + logging.debug(" Couldn't find uuid %s, starting md support", fstab_data_uuid) + mdadm_assemble_all + #hoping everything is up and running and data/myth will be available for mount + cmd = "mount -U %s %s" %(fstab_data_uuid, data_config.MOUNTPOINT) + runcmd(cmd) + cmd = "blkid -t UUID=%s|cut -d: -f1" %fstab_data_uuid + logging.debug(cmd) + datadisk = commands.getoutput(cmd) + cmd = "basename %s" %datadisk + datadisk = commands.getoutput(cmd) + else: + cmd = "mount %s %s" %(fstab_data_mount, data_config.MOUNTPOINT) + runcmd(cmd) + cmd = "basename %s" %fstab_data_mount + datadisk = commands.getoutput(cmd) + time.sleep(3) +# hostoptions["backupfile"]=data_config.BACKUPPATH+data_config.BACKUPFILE + if not backup_sql_check(): + newbackupfile = "/tmp/"+data_config.BACKUPFILE + if os.path.exists(newbackupfile): + logging.debug("Setting backup file to %s", newbackupfile) + cp_and_log(newbackupfile, data_config.MOUNTPOINT+newbackupfile) + hostoptions["backupfile"] = newbackupfile + else: + logging.info("Couldn't find any database to restore, upgrade will continue with a new database") + + + +def upgrade(hostoptions): + + try: + MVROOT = os.environ["MV_ROOT"] + except: + logging.debug("MVROOT was not defined, using the default value") + MVROOT = "/usr/MythVantage" + logging.info("______Start of upgrade______") + cmd = "touch /tmp/.this_is_upgrade" + runcmd(cmd) + if hostoptions["rootfs"] == "Do_not_format": + logging.info("Will not format root filesystem") + else: + statusmsg = "Preparing %s" %( hostoptions["rootdisk"]) + update_status(statusmsg) + progress(2) + format_disk("upgrade") + #sys.exit(2) + statusmsg = "Mounting %s" %( hostoptions["rootdisk"]) + update_status(statusmsg) + progress(3) + mount_it() + hostoptions["backupfile"] = data_config.BACKUPPATH+data_config.BACKUPFILE + statgrab( hostoptions["rootdisk"]) + msg = "Upgrading %s" %(systemconfig["hostname"]) + update_status(msg) + time.sleep(3) + copy_it("upgrade") + cmd = "rm -rf %s/etc.old" %data_config.MOUNTPOINT + runcmd(cmd) + cmd = "rm -rf %s/alsa.old" %data_config.MOUNTPOINT + runcmd(cmd) + + cp_and_log("/tmp/etc/", data_config.MOUNTPOINT+"/etc.old/") + cp_and_log("/tmp/alsa/", data_config.MOUNTPOINT+"/alsa.old/") + cp_and_log("/tmp/oss", data_config.MOUNTPOINT+"/var/lib/oss.old") + + srcfile = "%s/etc.old/ssh/" %(data_config.MOUNTPOINT) + destfile = "%s/etc/ssh/" %(data_config.MOUNTPOINT) + cp_and_log2(srcfile, destfile, '*.pub') + cp_and_log2(srcfile, destfile, '*.key') + cp_and_log2(srcfile, destfile, '*key') + + mdfile = mdadm_find("/tmp") + cp_and_log("/tmp"+mdfile, data_config.MOUNTPOINT+"/etc") + + srcfile = "%s/etc.old/asound.conf" %(data_config.MOUNTPOINT) + destfile = "%s/etc/asound.conf" %(data_config.MOUNTPOINT) + cp_and_log(srcfile, destfile) + + # R5.5 -> R6 + srcfile = "%s/alsa.old/asound.state" %(data_config.MOUNTPOINT) + destfile = "%s/etc/asound.state" %(data_config.MOUNTPOINT) + cp_and_log(srcfile, destfile) + # R6 -> R6 + srcfile = "%s/etc.old/asound.state" %(data_config.MOUNTPOINT) + destfile = "%s/etc/asound.state" %(data_config.MOUNTPOINT) + cp_and_log(srcfile, destfile) + + srcfile = "%s/etc.old/mplayer/mplayer.conf" %(data_config.MOUNTPOINT) + destfile = "%s/etc/mplayer/mplayer.conf" %(data_config.MOUNTPOINT) + cp_and_log(srcfile, destfile) + + if not os.path.exists("/tmp/etc/KnoppMyth-version"): + logging.debug(" standard upgrade, restoring auth files") + cp_and_log(data_config.MOUNTPOINT+"/etc.old/passwd", data_config.MOUNTPOINT+"/etc/passwd") + cp_and_log(data_config.MOUNTPOINT+"/etc.old/shadow", data_config.MOUNTPOINT+"/etc/shadow") + cp_and_log(data_config.MOUNTPOINT+"/etc.old/group", data_config.MOUNTPOINT+"/etc/group") + msg = "Configuring system" + + update_status(msg) + progress(98) + logging.info("______Configuring system________") + cp_and_log("/etc/systemconfig", data_config.MOUNTPOINT+"/etc/systemconfig") + if not backup_sql_check(): + upgrade_mount_search() + fstab_it("upgrade") + time.sleep(1) + grub_it() + time.sleep(1) + #needed to get around a bug with pacman + special_hardware_check() + cp_and_log("/root/xorg.conf.install", data_config.MOUNTPOINT+"/etc/X11/xorg.conf.install") + cp_and_log("/etc/mtab", data_config.MOUNTPOINT+"/etc/mtab") + if clean_upgrade() or os.path.exists("/tmp/etc/KnoppMyth-version"): + logging.debug("clean upgrade or knoppmyth upgrade detected, running restore settings") + restore_default_settings() + if clean_upgrade(): + file = "%s/%s/.kmupgrade" %(data_config.MOUNTPOINT, data_config.MYTHHOME) + cmd = "touch %s && chmod 777 %s" %(file, file) + runcmd(cmd) + copy_updates() + fix_permissions() + mount_bind_chroot() + logging.info("Running systemconfig in chroot") + #cmd = " chroot %s %s/bin/systemconfig.sh misc, hostype, network, advanced, user, this_is_install" %(data_config.MOUNTPOINT, MVROOT) + cmd = "chroot %s %s/bin/systemconfig.sh all,this_is_install" %(data_config.MOUNTPOINT, MVROOT) + rc = runcmd(cmd)[0] + if rc != 0 : + error_out("Running systemconfig") + mysqldb("stop", "") + if ( systemconfig["SystemType"] == "Master_backend" or systemconfig["SystemType"] == "Standalone" ): + if clean_upgrade() or not backup_sql_check(): + logging.info("Installing new database") + cmd = " chroot %s %s/bin/install_db_chroot.sh |tee /tmp/chrootdb.out" %(data_config.MOUNTPOINT, MVROOT) + runcmd(cmd) + else: + logging.info("Restoring database") + cmd = " chroot %s %s/bin/restore_km_db_chroot.sh %s|tee /tmp/chrootdb.out" %(data_config.MOUNTPOINT, MVROOT, hostoptions["backupfile"]) + runcmd(cmd) + + if os.path.exists("/tmp/etc/KnoppMyth-version"): + cmd = " chroot %s %s/bin/restore_default_settings.sh -c restore -t hostsettings " %(data_config.MOUNTPOINT, MVROOT) + runcmd(cmd) + logging.debug("Correcting permissions because of km->linhes upgrade") + cmd = " chown -R mythtv:mythtv %s" %(data_config.MOUNTPOINT+data_config.DATAMOUNT) + runcmd(cmd) + cmd = " chown -R root:root %s" %(data_config.MOUNTPOINT+data_config.DATAMOUNT+"/backup") + runcmd(cmd) + else: + cmd = " chroot %s %s/bin/restore_default_settings.sh -c restore -t syssettings " %(data_config.MOUNTPOINT, MVROOT) + runcmd(cmd) + + logging.info("Running systemconfig in chroot 2nd time") + #cmd = " chroot %s %s/bin/systemconfig.sh misc, hostype, network, advanced, user, this_is_install" %(data_config.MOUNTPOINT, MVROOT) + cmd = "chroot %s %s/bin/systemconfig.sh all,this_is_install" %(data_config.MOUNTPOINT, MVROOT) + rc = runcmd(cmd)[0] + if rc != 0 : + error_out("Running systemconfig") + #logging.info("Running systemconfig in chroot") + #cmd = " chroot %s %s/bin/systemconfig.sh advanced" %(data_config.MOUNTPOINT, MVROOT) + #runcmd(cmd) + mysqldb("stop", 'chroot') + apply_new_auth() + kill_dhcp_chroot() + umount_bind_chroot() + cp_and_log("/tmp/mythvantage_install.log", data_config.MOUNTPOINT+"/var/log/mythvantage_install.log") + cp_and_log("/tmp/mv_debug.log", data_config.MOUNTPOINT+"/var/log/mv_debug.log") + unmount_it() + msg = "Done" + update_status(msg) + mysqldb("start", '') + + + + +def main(argv): + global hostoptions + try: + opts, args = getopt.getopt(argv, 'c:h', ["help", "rootdisk=", "rootfs=", "rootsize=", "datafs=", "datasize=", "datadisk=", "swapsize=", "datapartition=" ] ) + except getopt.GetoptError, why: + print why + usage() + sys.exit(2) + hostoptions = {"op": 'null'} + for opt, arg in opts: + if opt in ("-h", "--help"): + usage() + sys.exit(0) + elif opt in ( "--rootdisk"): + hostoptions["rootdisk"] = arg + hostoptions["rootpartition"] = arg+str(1) + elif opt in ("--rootfs"): + hostoptions["rootfs"] = arg + elif opt in ("--rootsize"): + hostoptions["rootsize"] = arg + elif opt in ("--datafs"): + hostoptions["datafs"] = arg + elif opt in ("--datasize"): + hostoptions["datasize"] = arg + elif opt in ("--datadisk"): + hostoptions["datadisk"] = arg + elif opt in ("--datapartition"): + hostoptions["datapartition"] = arg + elif opt in ("--swapsize"): + hostoptions["swapsize"] = arg + + elif opt in ("-c"): + validop = ["full_install", "upgrade", "netboot", "find_upgrade"] + if arg not in validop: + logging.critical("-c %s is not a valid option", arg) + sys.exit(2) + else: + hostoptions["op"] = arg + try: + hostoptions["datadisk"] + except: + hostoptions["datadisk"] = hostoptions["rootdisk"] + hostoptions["datapartition"] = hostoptions["datadisk"]+str(3) + try: + hostoptions["datapartition"] + except: + hostoptions["datapartition"] = hostoptions["datadisk"]+str(3) + hostoptions["swappartition"] = hostoptions["rootdisk"] + str(2) + + + if ( hostoptions["op"] == "full_install" ) : + full_install(hostoptions) + elif (hostoptions["op"] == "upgrade" ) : + hostoptions["datafs"] = "no_format" + find_upgrade() + upgrade(hostoptions) + elif (hostoptions["op"] == "find_upgrade" ) : + find_upgrade() + return hostoptions + + +#____________________________________________setup the logging______________________________________________________ +LOG_FILENAME = '/tmp/mv_status.log' +DEBUGLOG = '/tmp/mv_debug.log' +logging.basicConfig(level=logging.DEBUG, + format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', + datefmt='%m-%d %H:%M', + filename=DEBUGLOG, + filemode='a') +# define a Handler which writes INFO messages or higher to the sys.stderr +console = logging.StreamHandler() +console.setLevel(logging.INFO) +# set a format which is simpler for console use +#formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s') +formatter = logging.Formatter("%(message)s") +# tell the handler to use this format +console.setFormatter(formatter) +# add the handler to the root logger +logging.getLogger('').addHandler(console) + +#infoformatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") +infoformatter = logging.Formatter("%(message)s") +infofile = logging.FileHandler(LOG_FILENAME, 'w') +infofile.setFormatter(infoformatter) +infofile.setLevel(logging.INFO) +logging.getLogger('').addHandler(infofile) + +#Read in systemconfig +global systemconfig +systemconfig = {} +file_name = "/etc/systemconfig" +try: + config_file = open(file_name) +except: + logging.debug("%s could not be opened", file_name) + config_file = '' + +for line in config_file: + line = line.strip() + if line and line[0] is not "#" and line[-1] is not "=": + var, val = line.rsplit("=", 1) + val = val.strip('"') + systemconfig[var.strip()] = val.strip() + + +if __name__ == "__main__": + config_file = "mv_config" + data_config = __import__(config_file, globals(), locals(), []) + logging.debug("___________START OF DEBUG_________________________") + cmdoptions = main(sys.argv[1:]) + logging.debug("______cmd line options______") + for i in cmdoptions.items(): + logging.debug (i) + logging.debug("______systemconfig______") + for i in systemconfig.items(): + logging.debug(i) + logging.debug("______hostoptions______") + for i in hostoptions.items(): + logging.debug(i) + pass + diff --git a/abs/core-testing/LinHES-config-22/mv_ir.py b/abs/core-testing/LinHES-config-22/mv_ir.py new file mode 100755 index 0000000..bc1ae37 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/mv_ir.py @@ -0,0 +1,330 @@ +# -*- coding: utf-8 -*- +import logging, mv_common +import os, re , glob +from time import time, localtime, strftime +import time +import pwd + +def setup_lirc_links(mythhome): + logging.debug(" Creating links for lirc") + try: + mythuid = pwd.getpwnam('mythtv')[2] + mythgid = pwd.getpwnam('mythtv')[3] + except: + logging.critical("* mythuid not found") + mythuid = '1000' + mythgid = '1000' + if not os.path.exists(mythhome+"/.mythtv"): + logging.debug(" Creating %s/.mythtv",mythhome) + try: + os.mkdir(mythhome+"/.mythtv") + except: + logging.debug(" Couldn't create .mythtv ") + return + try: + os.chown(mythhome+"/.mythtv", mythuid, mythgid) + logging.debug("* Couldn't chown of %s", mythhome) + except: + cmd = ''' chown -R mythtv %s/.mythtv''' %mythhome + mv_common.runcmd(cmd) + cmd = ''' chgrp -R mythtv %s/.mythtv''' %mythhome + mv_common.runcmd(cmd) + pass + + if os.path.exists("/etc/lircrc"): + if not os.path.exists(mythhome+"/.mythtv/lircrc"): + logging.debug(" Creating symlink for myth lircrc") + os.symlink("/etc/lircrc",mythhome+"/.mythtv/lircrc") + else: + logging.debug(" %s/lircrc already present",mythhome) + + if not os.path.exists(mythhome+"/.lircrc"): + logging.debug(" Creating symlink for lircrc") + os.symlink("/etc/lircrc",mythhome+"/.lircrc") + else: + logging.debug(" %s/.lircrc already present",mythhome) + else: + logging.debug(" /etc/lircrc does not exisit, can not link it") + +def scrub_modules(filename,module): + logging.debug(" scrubbing %s from %s",module,filename) + cmd = '''sed -i -e '/.*#%s/d' %s''' %(module,filename) + mv_common.runcmd(cmd) + +def add_module(filename,module): + logging.debug(" adding %s to %s",module,filename) + cmd = ''' echo "%s" >> %s ''' %(module,filename) + mv_common.runcmd(cmd) + +def unload_all_lirc(): + logging.debug(" Unloading all lirc modules") + cmd = "sv stop lircd" + 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) + + + +def include_file( incfile,filename): + logging.debug(" including %s within %s",filename,incfile) + try: + f = open( incfile, 'a') + except: + logging.debug(" Couldn't open %s for writing",incfile) + return + line = '''include "%s" ''' %filename + logging.debug(" %s",line) + f.write(line) + f.write("\n") + f.close() + +def setup_ir_remote(Remotetype,templates): + logging.debug(" Setup of remote type %s",Remotetype) + if Remotetype == "no_remote": + mv_common.remove_service("lircd") + elif Remotetype == "tinker": + pass + else: + currenttime = strftime("%b-%d-%Y-%H:%M:%S", localtime()) + cmd = "mv /etc/lircd.conf /etc/lircd.conf-%s" %currenttime + mv_common.runcmd(cmd) + cmd = "mv /etc/lircrc /etc/lircrc-%s" %currenttime + mv_common.runcmd(cmd) + files = templates + "/remotes/" + Remotetype + "/lircd*" + logging.debug(" Using %s",files) + for filename in glob.glob(files): + # Ignore subfolders + if os.path.isdir (filename): + logging.debug(" %s is a dir, skipping",filename) + continue + include_file("/etc/lircd.conf",filename) + files = templates + "/remotes/" + Remotetype + "/lircrc*" + logging.debug(" Using %s",files) + for filename in glob.glob(files): + # Ignore subfolders + if os.path.isdir (filename): + logging.debug(" %s is a dir, skipping",filename) + continue + include_file("/etc/lircrc",filename) + cmd = "chmod 755 /etc/lircrc" + mv_common.runcmd(cmd) + mv_common.add_service("lircd") + + +def setup_ir_receiver(ReceiverType,TEMPLATES): + logging.info(" Configuring receiver %s", ReceiverType) + if ReceiverType == "Serial": + scrub_modules("/etc/modules.mythvantage","lirc") + add_module("/etc/modules.mythvantage","lirc_serial #lirc") + cmd = "load-modules-mythvantage.sh" + mv_common.runcmd(cmd) + mv_common.remove_service("igdaemon") + mv_common.remove_service("tatir") + + elif ReceiverType == "Usb-imon": + scrub_modules("/etc/modules.mythvantage","lirc") + add_module("/etc/modules.mythvantage","lirc_imon #lirc") + cmd = "load-modules-mythvantage.sh" + mv_common.runcmd(cmd) + mv_common.remove_service("igdaemon") + mv_common.remove_service("tatir") + + elif ReceiverType == "Hauppauge": + scrub_modules("/etc/modules.mythvantage","lirc") + add_module("/etc/modules.mythvantage","lirc_i2c #lirc") + mv_common.cp_and_log(TEMPLATES+"/modules/lirc_i2c.conf" , + "/etc/modprobe.d/lirc_i2c.conf") + cmd = "rmmod lirc_i2c" + mv_common.runcmd(cmd) + cmd = "load-modules-mythvantage.sh" + mv_common.runcmd(cmd) + mv_common.remove_service("igdaemon") + mv_common.remove_service("tatir") + elif ReceiverType == "pvr150": + scrub_modules("/etc/modules.mythvantage","lirc") + add_module("/etc/modules.mythvantage","lirc_i2c #lirc") + mv_common.cp_and_log(TEMPLATES+"/modules/lirc_i2c.conf" , + "/etc/modprobe.d/lirc_i2c.conf") + cmd = "rmmod lirc_i2c" + mv_common.runcmd(cmd) + cmd = "load-modules-mythvantage.sh" + 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") + mv_common.remove_service("tatir") + + elif ReceiverType == "tatir": + scrub_modules("/etc/modules.mythvantage","lirc") + mv_common.add_service("tatir") + mv_common.remove_service("igdaemon") + + else: + logging.debug(" didn't match receiver, using genric case") + scrub_modules("/etc/modules.mythvantage","lirc") + mv_common.remove_service("igdaemon") + mv_common.remove_service("tatir") + +def setup_blaster_proto(HostBlasterType,Hostnumblaster,TEMPLATES,systemconfig): + logging.debug(" Start of setup_blaster_proto") + logging.debug(" HostBlasterType: %s", HostBlasterType) + logging.debug(" Hostnumblaster: %s" , Hostnumblaster) + if not HostBlasterType == "pvr150" and not HostBlasterType == "None": + for i in range(int(Hostnumblaster)): + try: + proto = systemconfig["HostTransmitproto_"+str(i+1)] + logging.debug(" proto: %s",proto) + except: + logging.info(" unkown proto for %s",i+1) + continue + template=TEMPLATES+"/transmit/%s/lircd.conf" %proto + if os.path.exists(template): + logging.debug(" include blaster template: %s",proto) + include_file("/etc/lircd.conf",template) + else: + logging.debug(" template: %s is not present",template) + logging.info("------NEED TO SETUP CHANGE_CHANNEL------") + + +def setup_blaster_transmiter(HostBlasterType): + logging.debug(" Start of setup_blaster_transmiter") + logging.info(" HostBlasterType : %s", HostBlasterType) + + if HostBlasterType == "Receiver": + logging.info(" Blaster is receiver, skipping module config for Blaster") + return + + if HostBlasterType == "no blaster": + scrub_modules("/etc/modules.mythvantage","blaster") + elif HostBlasterType == "Serial": + scrub_modules("/etc/modules.mythvantage","blaster") + add_module("/etc/modules/.mythvantage","lirc_serial #blaster") + cmd = "load-modules-mythvantage.sh" + mv_common.runcmd(cmd) + elif HostBlasterType == "pvr150": + scrub_modules("/etc/modules.mythvantage", "blaster") + scrub_modules("/etc/modules.mythvantage", "lirc") + add_module("/etc/modules.mythvantage", "lirc_pvr150 #blaster") + add_module("/etc/modules.mythvantage", "lirc_pvr150 #lirc") + cmd = "rmmod lirc_i2c" + mv_common.runcmd(cmd) + cmd = "load-modules-mythvantage.sh" + mv_common.runcmd(cmd) + else: + scrub_modules("/etc/modules.mythvantage","blaster") + +def setup_lcd(LCDtype, TEMPLATES, Remotetype): + logging.debug("____Start of setup_lcd____") + logging.debug(" LCDType: %s", LCDtype) + logging.debug(" Remotetype: %s", Remotetype) + if LCDtype == "tinker": + logging.info(" tinker mode detected") + return + + if LCDtype == "no_lcd": + logging.info(" Disabling LCD support") + cmd = "sv stop lcdd" + mv_common.runcmd(cmd) + #sometimes it doesn't want to die + 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") + mv_common.remove_service("lcdd") + else: + lcdmodule="%s/LCD/%s/modules" %(TEMPLATES,LCDtype) + if os.path.exists(lcdmodule): + logging.debug(" Adding module for LCD") + scrub_modules("/etc/modules.mythvantage", "LCD") + cmd = "cat %s >> /etc/modules.mythvantage" %lcdmodule + mv_common.runcmd(cmd) + if Remotetype != "tinker": + lcdconf = "%s/LCD/%s/LCDd.conf" %(TEMPLATES,LCDtype) + lcdlirc = "%s/LCD/%s" %(TEMPLATES,LCDtype) + mv_common.pacinstall("lcdproc") + if os.path.exists(lcdconf): + logging.debug(" Copying in lcdconf template file: %s",lcdconf) + mv_common.cp_and_log(lcdconf, "/etc/LCDd.conf") + else: + logging.debug(" %s is not present, will not copy it") + + if os.path.exists(lcdlirc+"/lircrc"): + logging.debug(" LCD seems to support lirc") + #setup the lirc aspect of the lcd + #copied from setup_ir_remote + files = lcdlirc+"/lircd*" + logging.debug(" Using %s",files) + for filename in glob.glob(files): + # Ignore subfolders + if os.path.isdir (filename): + logging.debug(" %s is a dir, skipping",filename) + continue + include_file("/etc/lircd.conf",filename) + files = lcdlirc+"/lircrc*" + logging.debug(" Using %s",files) + for filename in glob.glob(files): + # Ignore subfolders + if os.path.isdir (filename): + logging.debug(" %s is a dir, skipping",filename) + continue + include_file("/etc/lircrc",filename) + cmd = "chmod 755 /etc/lircrc" + mv_common.runcmd(cmd) + + mv_common.add_service("lcdd") + mv_common.restart_service("lcdd") + logging.debug("__End of setup_lcd") + +def setup_ir(systemconfig, data_config): + rc = False + logging.info("____Start of IR____") + if systemconfig["Remotetype"] == "tinker": + logging.info(" Tinker mode detected") + else: + if not systemconfig["HostBlasterType"]: + HostBlasterType = "unknown" + Hostnumblaster = "0" + else: + HostBlasterType = systemconfig["HostBlasterType"] + Hostnumblaster = systemconfig["Hostnumblaster"] + + if systemconfig["HostBlasterType"] == "pvr150": + remotetype = "hauppauge-blaster" + logging.debug(" pvr150 blaster selected, setting remote to hauppauge-blaster") + else: + remotetype = systemconfig["Remotetype"] + + setup_ir_remote(remotetype,systemconfig["TEMPLATES"]) + setup_lirc_links(data_config.MYTHHOME) + + if systemconfig["ReceiverType"]: + setup_ir_receiver(systemconfig["ReceiverType"], + systemconfig["TEMPLATES"]) + else: + setup_ir_receiver("unknown", systemconfig["TEMPLATES"]) + unload_all_lirc() + setup_blaster_proto(HostBlasterType, + Hostnumblaster, + systemconfig["TEMPLATES"], + systemconfig) + setup_blaster_transmiter(HostBlasterType) + cmd = "load-modules-mythvantage.sh" + mv_common.runcmd(cmd) + time.sleep(2) + mv_common.udev_trigger() + cmd="sv start lircd" + mv_common.runcmd(cmd) + rc = [ True , True ] + if systemconfig["LCDtype"]: + setup_lcd(systemconfig["LCDtype"], + systemconfig["TEMPLATES"], + systemconfig["Remotetype"]) + else: + logging.debug(" LCD not defined") + logging.info("__End IR\n") + return rc \ No newline at end of file diff --git a/abs/core-testing/LinHES-config-22/mv_misc.py b/abs/core-testing/LinHES-config-22/mv_misc.py new file mode 100755 index 0000000..9ea9c95 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/mv_misc.py @@ -0,0 +1,180 @@ +# -*- coding: utf-8 -*- +import logging, mv_common +import os, re +from urllib2 import Request, urlopen, URLError, HTTPError + +config_file = "mv_config" +data_config = __import__(config_file, globals(), locals(), []) + +def setup_zip(MVROOT,zipcode): + logging.debug("____Setting up the zipcode____") + + if zipcode: + cmd="%s/bin/restore_default_settings.sh -c ZIP -c %s" %(MVROOT,zipcode) + mv_common.runcmd(cmd) + #Let's also speed things up for those in North America + cmd="mkdir /usr/bin/perlbin/vendor/tv_grabbers_non_na" + mv_common.runcmd(cmd) + cmd="mv /usr/bin/perlbin/vendor/tv_grab_* /usr/bin/perlbin/vendor/tv_grabbers_non_na" + mv_common.runcmd(cmd) + cmd="mv /usr/bin/perlbin/vendor/tv_grabbers_non_na/tv_grab_na* /usr/bin/perlbin/vendor/" + mv_common.runcmd(cmd) + else: + logging.debug(" Zipcode is not set") + + logging.debug("__End of zipcode\n") + +def setup_tz(timezone,TEMPLATES): + logging.info("____Setting up the timezone____") + + if not timezone: + timezone="unknown" + logging.info(" Setting timezone to %s",timezone) + mv_common.remove_file("/etc/localtime") + #try: + #logging.debug(" Removing /etc/localtime") + #os.remove("/etc/localtime") + #except: + #logging.debug(" Couldn't remove /etc/localtime") + #pass + + srclink="/usr/share/zoneinfo/%s" %timezone + logging.debug(" symlinking %s to /etc/localtime",srclink) + try: + os.symlink(srclink,"/etc/localtime") + except: + logging.critical(" Couldn't make symlink for /etc/localtime") + cmd = '''sed -e "s/^TIMEZONE=.*$/TIMEZONE=\\"%s\\" /" /etc/rc.conf > $TEMPLATES/rc.conf''' %re.escape(timezone) + mv_common.runcmd(cmd) + + if os.path.exists("/etc/php/php.ini"): + logging.info(" Changing timezone for php") + cmd = '''sed -i "s/^.*date.timezone.*$/date.timezone=%s/" ${BASE}/etc/php/php.ini''' %re.escape(timezone) + mv_common.runcmd(cmd) + + mv_common.cp_and_log(TEMPLATES+"/rc.conf","/etc/rc.conf") + logging.info("__End of timezone\n") + +def setup_nfs(systemconfig): + nfslist=[] + logging.info("____Start of setup_nfs____") + scrubnfs(systemconfig["TEMPLATES"]) + + if systemconfig["HaveCentralNFS"] == "yes": + logging.debug(" Using a Central NFS server") + if systemconfig["NFSserver"] == "file:nfsmap": + #if it's a file check for it, failure results in downloading attempt from MBE + nfsmap_file=data_config.MYTHHOME+"/templates/nfsmap" + if not os.path.exists(nfsmap_file): + logging.debug(" Couldn't find local %s",nfsmap_file) + logging.info(" Trying to download nfsmap from MBE") + nfsmap_file = download_nfsmap(systemconfig["dbhost"]) + nfslist = process_nfsmap_file(nfsmap_file) + # if it's an ip parse ip and download file + elif re.search(systemconfig["NFSserver"],":nfsmap"): + ip=systemconfig["NFSserver"].split(":")[0] + nfsmap_file = download_nfsmap(ip) + nfslist = process_nfsmap_file(nfsmap_file) + #else treat it as a single mount point + else: + item = (systemconfig["NFSserver"] , systemconfig["NFSmount"]) + nfslist.append(item) + else: + #if standalone or slave try to use MBE + if systemconfig["SystemType"] == "Frontend_only" or systemconfig["SystemType"] == "Slave_Backend": + item = (systemconfig["dbhost"] , data_config.DATAMOUNT) + nfslist.append(item) + setup_nfs_fstab(nfslist) + logging.info("__End of nfs\n") + +def setup_sleep(systemconfig): + logging.debug("____Setting up sleep____") + autoshutdown = systemconfig["AutoShutdown"] + stime1 = systemconfig["Shutdowntime"] + stime2 = systemconfig["Shutdowntime2"] + cstime1='' + + if autoshutdown == "1" : + if not stime1 == "-1" : + cstime1 = stime1 + cshutdown = cstime1 + if not stime2 == "-1" : + if cstime1 : + cshutdown = "%s,%s" %(cstime1,stime2) + else: + cshutdown = stime2 + logging.debug(" Shutdown time at %s",cshutdown) + cmd='''sed -e "s/HOUR/%s/g" %s/cron.template | crontab - -u mythtv''' %(cshutdown,systemconfig["TEMPLATES"]) + mv_common.runcmd(cmd) + else: + logging.info(" Shutdown not enabled") + cmd='''sed -e "/00 HOUR.*/d" %s/cron.template | crontab - -u mythtv''' %systemconfig["TEMPLATES"] + mv_common.runcmd(cmd) + + logging.debug("__End of sleep\n") + + +def process_nfsmap_file(mapfile): + logging.debug(" processing nfsmap file %s",mapfile) + nfslist = [] + try: + f = open(mapfile,"r") + for line in f.readlines(): + if line.startswith("#"): + continue + item = line.split() + if len(item) <= 1 : + continue + logging.debug(" %s",item) + nfslist.append(item) + except : + logging.critical("Couldn't read file %s, or some other error",mapfile) + return nfslist + +def scrubnfs(templates): + logging.info(" Scrubbing nfs") + mv_common.cp_and_log("/etc/fstab",templates+"/fstab.conf.template") + #used this sed cmd because it's clean and took me forever to figure out =) + cmd='''sed '/^#STARTSCRUB.*$/,/^#ENDSCRUB.*$/d' %s/fstab.conf.template > /etc/fstab''' %templates + mv_common.runcmd(cmd) + +def download_nfsmap(ip): + nfsmap_file="/tmp/nfsmap" + myurl="http://%s:1337/templates/nfsmap" %ip + req = Request(myurl) + try: + f = urlopen(req) + logging.info(" downloading %s", myurl) + local_file = open(nfsmap_file, "w") + #Write to our local file + local_file.write(f.read()) + local_file.close() + #handle errors + except HTTPError, e: + logging.info(" File download failed") + logging.debug(" %s", myurl) + logging.debug(" HTTP Error: %s", e.code) + except URLError, e: + logging.info(" File download failed") + logging.debug(" %s",myurl) + logging.debug(" URL Error: %s ", e.reason) + + return nfsmap_file + +def setup_nfs_fstab(nfslist): + logging.info(" Adding nfs paths to fstab") + try: + f = open('/etc/fstab', 'a') + line = "#STARTSCRUB --------------anything in this block will be scrubbed\n" + f.write(line) + for s, m in nfslist: + line = "%s %s nfs \n" %(s,m) + logging.debug(" %s",line) + f.write(line) + line = "#ENDSCRUB\n" + f.write(line) + f.close() + except: + logging.critical(" *Couldn't open /etc/fstab for writing") + logging.debug(" Done adding nfs paths to fstab") + diff --git a/abs/core-testing/LinHES-config-22/mv_network.py b/abs/core-testing/LinHES-config-22/mv_network.py new file mode 100755 index 0000000..b80e4cc --- /dev/null +++ b/abs/core-testing/LinHES-config-22/mv_network.py @@ -0,0 +1,507 @@ +# -*- coding: utf-8 -*- +import sys , os, commands , glob, time, re +import logging +import mv_common +import socket, fcntl, struct, array +import netifaces, iplib +global etcnetdir +etcnetdir = "/etc/net/ifaces" + +def setup_MYTH_DHCP(systemconfig): + default_interface = systemconfig["default_interface"] + try: + defaultdhcp = systemconfig["HostUSEDHCP"+default_interface] + except: + logging.critical(" *Error occured finding default dhcp") + defaultdhcp = "0" + logging.debug(" Using %s as dhcp value for %s", defaultdhcp, default_interface) + return defaultdhcp + +def all_interfaces(): + max_possible = 128 # arbitrary. raise if needed. + bytes = max_possible * 32 + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + names = array.array('B', '\0' * bytes) + outbytes = struct.unpack('iL', fcntl.ioctl( + s.fileno(), + 0x8912, # SIOCGIFCONF + struct.pack('iL', bytes, names.buffer_info()[0]) + ))[0] + namestr = names.tostring() + return [namestr[i:i+32].split('\0', 1)[0] for i in range(0, outbytes, 32)] + +def get_ip(ifname): + logging.debug(" Finding ip address for %s", ifname) + all_if = all_interfaces() + logging.debug(" found interfaces:%s", all_if) + if ifname in all_if : + logging.debug(" Found %s in all_interfaces", ifname) + else: + logging.critical("* Couldn't find %s in list", ifname) + ifname = all_if[0] + logging.critical("* Using %s for interface name", ifname) + + + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + return socket.inet_ntoa(fcntl.ioctl( + s.fileno(), + 0x8915, # SIOCGIFADDR + struct.pack('256s', ifname[:15]) + )[20:24]) + +def get_default_route(iface): + rcroute = "127.0.0.1" + f = open ('/proc/net/route', 'r') + for line in f: + words = string.split (line) + netiface = words[0] + route = words[2] + flags = words[3] + try: + if ( netiface == iface ) and ( flags == "0003") : + route = iplib.IPv4Address(route, notation="hex") + t = str(route.get_dot()) + s = t.split(".") + rcroute = s[3] + "." + s[2] + "." + s[1] + "." + s[0] + break + except ValueError: + pass + return rcroute + +def setup_MYTH_IP(systemconfig): + default_interface = systemconfig["default_interface"] + #check for dhcp in use + if setup_MYTH_DHCP(systemconfig) == "0": + logging.debug(" dhcp is in use, finding dhcp ip") + defaultip = get_ip(default_interface) + else: + try: + defaultip = systemconfig["Hostip"+default_interface] + except: + logging.debug(" Error occured finding the defaultip") + defaultip = "127.0.0.1" + logging.debug(" Using %s as default ip", defaultip) + return defaultip + + +def setup_MYTH_GW(systemconfig): + default_interface = systemconfig["default_interface"] + #check for dhcp in use + if setup_MYTH_DHCP(systemconfig) == "0": + logging.debug(" dhcp is in use, finding dhcp ip") + defaultgw = get_default_route(default_interface) + else: + try: + defaultgw = systemconfig["Hostgw"+default_interface] + except: + logging.debug(" Error occured finding the defaultgw") + defaultgw = "127.0.0.1" + logging.debug(" Using %s as default gw", defaultgw) + return defaultgw + + +def setup_MTYH_DNS(): + returndns = "127.0.0.1" + try: + f = open ('/etc/resolv.conf', 'r') + for line in f: + if line.startswith("nameserver"): + print line + returndns = line.split()[1] + break + except: + logging.debug(" Couldn't open /etc/resolv.conf for myth_dns") + logging.debug(" using %s for myth_dns", returndns) + return returndns + + + + + +def flush(netdev): + logging.debug(" Flushing %s",netdev) + cmd = '''ip address flush dev %s''' %netdev + mv_common.runcmd(cmd) + +def kill_dhcp(basedir): + logging.debug(" _Start of kill_dhcp") + logging.debug(" Killing off dhcpd") + stddir = os.getcwd() + piddir = ("%s/var/run/") %basedir + try: + os.chdir(piddir) + for FILE in glob.glob("dhcpcd-*.pid"): + f = open(FILE,'r') + pid = f.readline() + f.close + cmd = "kill -9 %s" %pid + mv_common.runcmd(cmd) + mv_common.remove_file(FILE) + os.chdir(stddir) + except: + pass + +def setup_nameserver(dns): + logging.info(" Adding %s for DNS", dns) + cmd = '''grep -q %s /etc/resolv.conf''' %dns + status = mv_common.runcmd(cmd) + if not status == 0 : + cmd = ''' echo "nameserver %s" >> /etc/resolv.conf ''' %dns + mv_common.runcmd(cmd) + + + +def setup_hostname(systemconfig): + logging.debug(" _Start of setup_hostname") + try: + hostname = systemconfig["hostname"] + except: + logging.critical(" *Hostname could not be set") + logging.info(" Using default value of me") + hostname = "me" + logging.info(" Setting the hostname to %s", hostname) + cmd = ''' echo %s > /etc/hostname ''' %hostname + mv_common.runcmd(cmd) + cmd = "cat /etc/hosts | grep -v 127.0.0.1 | grep -v %s > /tmp/hosts" %hostname + mv_common.runcmd(cmd) + if systemconfig["mythdhcp"] == "1" : + 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"]) + mv_common.runcmd(cmd) + else: + cmd = ''' echo 127.0.0.1 %s localhost > /etc/hosts ''' %systemconfig["hostname"] + mv_common.runcmd(cmd) + cmd = '''cat /tmp/hosts >> /etc/hosts ''' + mv_common.runcmd(cmd) + + +def write_wpafile(line,netdev): + logging.debug(" writing out wpa_supplicant.conf file") + logging.debug(line) + wpafile = etcnetdir+"/"+netdev+"/wpa_supplicant.conf" + try: + f = open(wpafile,'w') + f.write(line) + f.close() + except: + logging.debug(" Couldn't write to %s",wpafile) + +def setup_wpa(netinfo,netdev): + logging.info(" %s will use wpa for encryption",netdev) + line = ''' +#This file was automaticly generated, any changes may be lost +ctrl_interface=/var/run/wpa_supplicant +network={ + ssid="%s" + # Preshared key as an ASCII passphrase + psk="%s" + scan_ssid=1 + key_mgmt=WPA-EAP WPA-PSK NONE + pairwise=CCMP TKIP + proto=WPA RSN +}''' %(netinfo["ESSID"],netinfo["KEY"]) + write_wpafile(line,netdev) + +def setup_wep(netinfo,netdev): + logging.info(" %s will use wep for encryption",netdev) + logging.debug(" When a packet comes along, you must wep it") + line=''' +#This file was automaticly generated, any changes may be lost +ctrl_interface=/var/run/wpa_supplicant +network={ + ssid="%s" + key_mgmt=NONE + wep_key0=%s + wep_tx_keyidx=0 + scan_ssid=1 + auth_alg=SHARED +} +''' %(netinfo["ESSID"],netinfo["KEY"]) + write_wpafile(line,netdev) + + +def setup_none(netinfo,netdev): + logging.info(" %s will not use encryption",netdev) + line = ''' +#This file was automaticly generated, any changes may be lost +ctrl_interface=/var/run/wpa_supplicant +network={ + ssid="%s" + key_mgmt=NONE +} +''' %netinfo["ESSID"] + write_wpafile(line,netdev) + +def setup_interface(netdev,systemconfig): + logging.debug(" _Start of setup_interface for %s",netdev) + nettrans = {'Hostip':'ip', + 'Hostnetmask':'netmask', + 'HostActive':'isactive', + 'HostDNS':'dns', + 'HostUSEDHCP':'UseDHCP', + 'HostGW':'GW', + 'HostMTU':'mtu', + 'HOST_iswireless':"wireless", + 'HostESSID':'ESSID', + 'HostKey':'KEY', + 'HostUseEncryption':'ENCRYPT'} + netinfo = {} + #populate the netinfo dict + for netitem in nettrans: + if systemconfig[netitem+netdev]: + netinfo[nettrans[netitem]] = systemconfig[netitem+netdev] + else: + netinfo[nettrans[netitem]] = False + logging.debug(" %s:%s",netitem,netinfo[nettrans[netitem]]) + logging.info(" %s wireless: %s", netdev,netinfo["wireless"]) + try: + os.makedirs(etcnetdir) + except: + logging.debug(" Could not create %s",etcnetdir) + + optionfile=etcnetdir+"/"+netdev+"/options" + if not os.path.exists(optionfile): + try: + os.makedirs(etcnetdir+"/"+netdev) + except: + pass + mv_common.cp_and_log(systemconfig["TEMPLATES"]+"/etcnet/eth/options", optionfile) + + if netinfo["isactive"] == "1" : + change_iface_state(netdev,"enabled") + else: + change_iface_state(netdev,"disabled") + + if netinfo["wireless"] == "1" : + + logging.info(" Enabling wireless extensions") + cmd = ''' sed -i -e 's/^CONFIG_WIRELESS=.*$/CONFIG_WIRLESS=yes/g' %s/%s/options''' %(etcnetdir,netdev) + mv_common.runcmd(cmd) + if netinfo["ENCRYPT"] == "WEP": + setup_wep(netinfo,netdev) + elif netinfo["ENCRYPT"] == "WPA": + setup_wpa(netinfo,netdev) + elif netinfo["ENCRYPT"] == "none": + setup_none(netinfo,netdev) + + else: + logging.info(" Disabling wireless extensions") + cmd = '''sed -i -e 's/^CONFIG_WIRLESS=.*$/CONFIG_WIRLESS=no/g' %s/%s/options''' %(etcnetdir, netdev) + mv_common.runcmd(cmd) + #try: + wpafile=etcnetdir+"/"+netdev+"/wpa_supplicant.conf" + #os.remove(wpafile) + mv_common.remove_file(wpafile) + #except: + #logging.debug(" Couldn't remove %s",wpafile) + + if netinfo["UseDHCP"] == "0" : + logging.info(" Enabling DHCP support") + cmd = ''' sed -i -e 's/^BOOTPROTO=.*$/BOOTPROTO=dhcp/g' %s/%s/options''' %(etcnetdir, netdev) + mv_common.runcmd(cmd) + else: + logging.info(" Using static ip address of %s",netinfo["ip"]) + cmd = ''' sed -i -e 's/^BOOTPROTO=.*$/BOOTPROTO=static/g' %s/%s/options''' %(etcnetdir, netdev) + mv_common.runcmd(cmd) + cmd = '''echo "default via %s" > %s/%s/ipv4route''' %(netinfo["GW"], etcnetdir, netdev) + mv_common.runcmd(cmd) + cmd = '''echo "%s%s" > %s/%s/ipv4address ''' %(netinfo["ip"], netinfo["netmask"].split()[0], etcnetdir, netdev) + mv_common.runcmd(cmd) + setup_nameserver(netinfo["dns"]) + + if netinfo["mtu"] : + logging.info(" Setting mtu to %s", netinfo["mtu"]) + cmd = '''sed -i '/^mtu.*$/d' %s/%s/iplink''' %(etcnetdir,netdev) + mv_common.runcmd(cmd) + cmd = ''' echo "mtu %s" >> %s/%s/iplink''' %(netinfo["mtu"], etcnetdir,netdev) + mv_common.runcmd(cmd) + else: + logging.info(" Using default mtu value") + cmd = '''sed -i '/^mtu.*$/d' %s/%s/iplink''' %(etcnetdir,netdev) + mv_common.runcmd(cmd) + + +def change_iface_state(netdev, state): + if state == "enabled": + logging.info(" Activating %s", netdev) + cmd = '''sed -i -e 's/^ONBOOT=.*$/ONBOOT=yes/g' %s/%s/options''' %(etcnetdir,netdev) + mv_common.runcmd(cmd) + cmd = '''sed -i -e 's/^DISABLED=.*$/DISABLED=no/g' %s/%s/options ''' %(etcnetdir,netdev) + mv_common.runcmd(cmd) + else: + logging.info(" Disabling %s", netdev) + cmd = '''sed -i -e 's/^ONBOOT=.*$/ONBOOT=no/g' %s/%s/options''' %(etcnetdir,netdev) + mv_common.runcmd(cmd) + cmd = '''sed -i -e 's/^DISABLED=.*$/DISABLED=yes/g' %s/%s/options ''' %(etcnetdir,netdev) + mv_common.runcmd(cmd) + cmd = "/sbin/ifconfig %s down" %netdev + mv_common.runcmd(cmd) + cmd = "ip address flush %s" %netdev + mv_common.runcmd(cmd) + +def devcheck(netdev): + cmd = ''' /sbin/ifconfig %s''' %netdev + rc = mv_common.runcmd(cmd) + if rc == 0 : + return True + else: + return False + +def udev_rules(netdev): + filename = "/etc/udev/rules.d/net.rules" + if devcheck(netdev): + logging.info(" Finding macaddress for %s",netdev) + try: + macaddress = netifaces.ifaddresses(netdev)[netifaces.AF_LINK][0]['addr'] + logging.debug(" Macaddress: %s",macaddress) + except: + logging.debug(" Couldn't find mac address for %s",netdev) + return + try: + f = open(filename,'a') + except: + logging.debug(" Couldn't open %s for writing", filename) + return + if netdev.startswith('eth'): + line = '''KERNEL=="eth*", SYSFS{address}=="%s", NAME="%s"''' % ( macaddress , netdev) + elif netdev.startswith('wlan'): + line = '''KERNEL=="wlan*", SYSFS{address}=="%s", NAME="%s"'''% ( macaddress , netdev) + elif netdev.startswith('ath'): + line = '''KERNEL=="ath*", SYSFS{address}=="%s", NAME="%s"''' % ( macaddress , netdev) + logging.debug(" adding to net.rules ") + logging.debug(" %s",line) + f.write(line) + f.write("\n") + f.close() + +def find_active(systemconfig,this_is_install): + interfacelist=('eth0', 'eth1', 'wlan0', 'wlan1', 'ath0') + logging.debug(" _Start of find_active") + + if systemconfig["mythdhcp"] == "1": + mv_common.remove_file("/etc/resolv.conf") + cmd = ''' echo search lan > /etc/resolv.conf ''' + mv_common.runcmd(cmd) + cmd = ''' echo nameserver 127.0.0.1 >> /etc/resolv.conf ''' + mv_common.runcmd(cmd) + + for netdev in interfacelist: + if this_is_install: + udev_rules(netdev) + currentnet = "HostActive" + netdev + try: + systemconfig[currentnet] + except: + logging.debug(" %s is not defined",currentnet) + change_iface_state(netdev, "disabled") + continue + if systemconfig[currentnet] == "1" : + #check if device is present + if devcheck(netdev) : + setup_interface(netdev,systemconfig) + else: + logging.debug(" Interface %s not found in config", netdev) + #change_iface_state(netdev, "disabled") + else: + change_iface_state(netdev, "disabled") + +def vnc_netboot_check(): + logging.debug(" Start of VNC/NETBOOT check") + vnc = False + netboot = False + try: + f = open('/proc/cmdline', 'r') + bootoptions = f.readlines() + f.close() + except: + logging.critical(" *Couldn't open /proc/cmdline") + logging.debug(" Assuming it's ok to fiddle with the network") + return True + bootoptions = bootoptions[0] + if re.match("vnc",bootoptions) != None : + logging.debug(" Found VNC option") + vnc = True + if re.match("nfsroot",bootoptions) != None : + logging.debug(" Found netboot option") + netboot = True + + return (vnc or netboot) + +def start_network(): + if not vnc_netboot_check(): + logging.info(" Restarting network") + cmd ="/etc/net/scripts/network.init reload" + mv_common.runcmd(cmd) + cmd ="/etc/net/scripts/network.init restart" + mv_common.runcmd(cmd) + else: + logging.info(" Will not restart network due to netboot/vnc") + + +def stop_network(): + if not vnc_netboot_check(): + logging.info(" Stopping network") + cmd ="/etc/net/scripts/network.init stop" + mv_common.runcmd(cmd) + kill_dhcp("") + interfacelist=('eth0', 'eth1', 'wlan0', 'wlan1', 'ath0') + for i in interfacelist: + flush(i) + else: + logging.info(" Will not stop network due to netboot/vnc") + pass + +def hostname_change_check(systemconfig): + restartfe = False + logging.debug(" _Start of hostname_change_check") + oldhostname = socket.gethostname() + #oldhostname = "crap" + newhostname = systemconfig["hostname"] + mv_root = systemconfig["MVROOT"] + logging.debug(" Old hostname: %s", oldhostname) + logging.debug(" New hostname: %s", newhostname) + if oldhostname != newhostname : + logging.info(" Changing hostname in database to match new hostname") + cmd ="%s/bin/restore_default_settings.sh -cuhostname -o -h%s" %(mv_root, oldhostname) + mv_common.runcmd(cmd) + logging.info(" Changing hostname to %s", newhostname) + cmd = "hostname %s" %newhostname + mv_common.runcmd(cmd) + if systemconfig["SystemType"] != "Frontend_only" : + logging.info(" Restarting backend") + mv_common.stop_service("mythbackend") + mv_common.start_service("mythbackend") + restartfe = True + else: + logging.debug(" old and new hostnames matched, leaving things along") + logging.debug(" __End of hostname_change_check") + return restartfe + + + +def setup_network (systemconfig,this_is_install): + logging.info("____Start of network____") + logging.info(" Setting up the network") + restartfe = hostname_change_check(systemconfig) + setup_hostname(systemconfig) + find_active(systemconfig,this_is_install) + start_network() + logging.info("__End of network\n") + return restartfe + + + +##this is used by the install process to start the network +def install_network_setup(systemconfig): + logging.info("____Start of network_install____") + logging.info(" Setting up the network") + #setup_MYTH_vars + setup_hostname(systemconfig) + stop_network() + find_active(systemconfig) + start_network() + logging.info("__End of network install \n") + + diff --git a/abs/core-testing/LinHES-config-22/mv_screensaver.py b/abs/core-testing/LinHES-config-22/mv_screensaver.py new file mode 100755 index 0000000..2da970c --- /dev/null +++ b/abs/core-testing/LinHES-config-22/mv_screensaver.py @@ -0,0 +1,199 @@ +# -*- coding: utf-8 -*- +import logging, mv_common +import re +import os + + +def mplayer_saver_check (cmd,templatefile): + logging.debug(" Checking for heartbeat command in mplayer.conf") + mplayerconf = "/etc/mplayer/mplayer.conf" + if not os.path.exists(mplayerconf): + logging.debug(" copying in mplayer template file") + mv_common.cp_and_log(templatefile, mplayerconf) + + try: + f = open(mplayerconf, 'r') + mplayerconf_contents = f.readlines() + f.close() + except: + logging.debug(" Couldn't open %s for reading",mplayerconf) + mplayerconf_contents = "#\n" + + try: + f = open(mplayerconf, 'w') + except: + logging.debug(" Couldn't open %s for writing",mplayerconf) + return + + for line in mplayerconf_contents: + if re.match("^.*stop-xscreensaver",line): + continue + elif re.match("^.*heartbeat-cmd",line): + continue + else: + f.write(line) + + f.write("stop-xscreensaver = 0\n") + line='''heartbeat-cmd="%s"\n''' %cmd + f.write(line) + f.close() + + +def killxscreensaver(): + logging.info(" Stopping xscreensaver") + cmd="xscreensaver-command --exit " + mv_common.runcmd(cmd) + cmd="killall xscreensaver " + mv_common.runcmd(cmd) + +def killgscreensaver(): + logging.info(" Stopping gnome-screensaver") + cmd="gnome-screensaver-command --exit " + mv_common.runcmd(cmd) + cmd="killall gnome-screensaver " + mv_common.runcmd(cmd) + + +def setup_x_screensaver(idle,theme,screenconfigfile,templatefile): + logging.info(" Configuring X screensaver") + killgscreensaver() + logging.debug(" Why can't xscreensaver have a nice configuration !") + + if not os.path.exists(screenconfigfile): + logging.debug(" copying in new template file") + mv_common.cp_and_log(templatefile,screenconfigfile) + + try: + f = open(screenconfigfile, 'r') + screenconfigcontents=f.readlines() + f.close() + except: + logging.info("Couldn't open %s for reading",screenconfigfile) + return + try: + f = open(screenconfigfile, 'w') + except: + logging.info("Couldn't open %s for writing",screenconfigfile) + return + + startline=0 + foundline=0 + + for k, line in enumerate(screenconfigcontents): + if re.match("programs:",line): + startline = k + if re.search(theme,line): + foundline = k + themenumber=foundline-startline-2 + + for line in screenconfigcontents: + if re.match("selected.*$",line): + continue + + if re.match("timeout",line): + logging.info(" Setting idletime to %s",idle) + outline = "timeout: 0:%s:00 \n" %idle + f.write(outline) + elif re.match("mode",line): + if theme == "Random": + logging.info(" Setting theme to %s", "Random") + outline = "mode: random \n" + f.write(outline) + outline = "selected: -1 \n" + f.write(outline) + continue + + elif theme == "Blank": + logging.info(" Setting theme to %s", "blank") + outline = "mode: blank \n" + f.write(outline) + outline = "selected: -1 \n" + f.write(outline) + continue + + else: + logging.info(" Setting theme to %s", theme) + outline = "mode: one\n" + f.write(outline) + logging.debug(" Theme number is %s",themenumber) + outline = "selected: %s\n" %themenumber + f.write(outline) + continue + + else: + outline = line + f.write(outline) + f.close() + logging.debug("__End of xscreensaver") + +def setup_gnome_screensaver(theme,idletime): + logging.info(" Configuring gnome screensaver") + + logging.info(" Disabling lock screen") + cmd='''gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type bool --set /apps/gnome-screensaver/lock_enabled false''' + mv_common.runcmd(cmd) + + logging.info(" Setting idletime to %s",idletime) + cmd='''gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type int -s "/apps/gnome-screensaver/idle_delay" %s''' %idletime + mv_common.runcmd(cmd) + + logging.info(" Setting mode to single") + cmd='''gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type string -s "/apps/gnome-screensaver/mode" single''' + mv_common.runcmd(cmd) + + if theme == "Random": + logging.info(" setting theme to random") + cmd='''gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type string -s "/apps/gnome-screensaver/mode" random''' + mv_common.runcmd(cmd) + + elif theme == "Blank": + logging.info(" setting theme to blank") + cmd='''gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type string -s "/apps/gnome-screensaver/themes" blank''' + mv_common.runcmd(cmd) + + else: + logging.info(" setting theme to %s",theme) + cmd='''gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --set --type list --list-type=string /apps/gnome-screensaver/themes [screensavers-%s]''' %theme + mv_common.runcmd(cmd) + + killxscreensaver() + logging.info("__End gnome screensaver") + + + + +def setup_screensaver (systemconfig,data_config): + logging.info("____Start of screensaver configuration____") + screensavertype = systemconfig["Screensavertype"] + theme = systemconfig["Screensavertheme"] + idletime = systemconfig["Screensaveridle"] + configfile = data_config.MYTHHOME+"/.xscreensaver" + templatefile = systemconfig["TEMPLATES"]+"/xscreensaver.template" + mtemplate = systemconfig["TEMPLATES"]+"/mplayer.conf.template" + + if screensavertype == "xscreensaver": + mv_common.pacinstall("xscreensaver") + mv_common.pacremove("gnome-screensaver") + setup_x_screensaver(idletime, theme, configfile, templatefile) + mplayer_saver_check("/usr/bin/xscreensaver-command -deactivate &",mtemplate) + + elif screensavertype == "gscreensaver": + mv_common.pacinstall("xscreensaver") + mv_common.pacinstall("gnome-screensaver") + setup_gnome_screensaver(theme,idletime) + mplayer_saver_check("/usr/bin/gnome-screensaver-command -p &",mtemplate) + + elif screensavertype == "none": + mv_common.pacremove("xscreensaver") + mv_common.pacremove("gnome-screensaver") + killgscreensaver() + killxscreensaver() + + elif screensavertype == "tinker" : + logging.debug(" screensaver tinker mode detected") + else: + logging.debug(" Unknown screensaver") + logging.info("__End of screensaver\n") + + + diff --git a/abs/core-testing/LinHES-config-22/mv_smolt.py b/abs/core-testing/LinHES-config-22/mv_smolt.py new file mode 100755 index 0000000..5fd3722 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/mv_smolt.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +import logging +import mv_common + +def read_release(stype): + if stype == "LinHES": + rfile = "/etc/LinHES-release" + else: + rfile = "/etc/MythVantage-release" + + try: + f= open(rfile,'r') + releasename = f.readlines()[0] + f.close() + except: + logging.debug(" Couldn't open %s",rfile) + releasename = "unknown" + + return releasename + + +def setup_smolt_type(SystemType,Remotetype,RunFrontend,mythhome,stype): + logging.debug("____Start of setup_smolt_type____") + releasename = read_release(stype) + + if SystemType == "Standalone": + smoltsystem = 6 + MVRELEASE="%s (Standalone)" %releasename + elif SystemType == "Master_backend": + if RunFrontend == "1": + smoltsystem = 2 + MVRELEASE="%s (MBE with Frontend)" %releasename + else: + smoltsystem=1 + MVRELEASE="%s (MBE)" %releasename + elif SystemType == "Slave_backend": + if RunFrontend == "1" : + smoltsystem = 4 + MVRELEASE="%s (SLAVE with Frontend)" %releasename + else: + smoltsystem = 5 + MVRELEASE="%s (SLAVE)" %releasename + elif SystemType == "Frontend_only": + smoltsystem = 3 + MVRELEASE="%s ( Frontend only)" %releasename + + logging.debug(" smolt type is %s : %s", MVRELEASE,smoltsystem) + smoltfile = mythhome+"/.mythtv/smolt.info" + cmd = ''' echo "%s" > /etc/os_myth_release ''' %MVRELEASE + mv_common.runcmd(cmd) + + cmd = '''echo "systemtype=%s" > %s''' %(smoltsystem,smoltfile) + mv_common.runcmd(cmd) + + cmd = '''echo "remote=%s" >> %s ''' %(Remotetype,smoltfile) + mv_common.runcmd(cmd) + + logging.debug("__End of setup_smolt_type") + diff --git a/abs/core-testing/LinHES-config-22/mv_software.py b/abs/core-testing/LinHES-config-22/mv_software.py new file mode 100755 index 0000000..aabcf89 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/mv_software.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +import logging, mv_common +import os, re + +def setup_software(systemconfig, data_config): + logging.info("____Start of Software install____") + postfix='' + if data_config.SYSTEMTYPE == "MythVantage": + #look for the installed prefix + cmd="pacman -Q mythtv-release-fixes" + rc = mv_common.runcmd(cmd) + if rc == 0: + postfix = "-release-fixes" + else: + postfix = "-svn" + + default_disabled = ("mythphone", "mytharchive", "mythbrowser", "mythnews", + "mythgame", "mythflix", "mythweather", + "mythzoneminder" ) + + default_installed=("mythcontrols", "mythgallery", "mythmovies", + "mythmusic", "mythsmolt", "mythvideo") + other_pkg=("miro", "mednafen", "romdb", "xine", "dvdcss", "webmin" , "fuppes", "foldingathome", "mythappletrailers", "mythstream", "mythvodka") + else: + default_disabled = ("mythphone", "mytharchive", "mythbrowser", "mythnews", + "mythgame", "mythflix", "mythweather", + "mythappletrailers", "mythstream", "mythvodka", + "mythzoneminder" ) + + default_installed=("mythcontrols", "mythgallery", "mythmovies", + "mythmusic", "mythsmolt", "mythvideo") + other_pkg=("miro", "mednafen", "romdb", "xine", "dvdcss", "webmin" , "fuppes", "foldingathome") + + for pkg in default_disabled: + pkgname=pkg+postfix + try: + if systemconfig[pkg] == "1": + mv_common.pacinstall(pkgname) + else: + mv_common.pacremove(pkgname) + except: + logging.debug(" ERROR-- %s is not defined", pkg) + + for pkg in default_installed: + try: + if systemconfig[pkg] == "0": + mv_common.pacremove(pkgname) + else: + mv_common.pacinstall(pkgname) + except: + logging.debug(" ERROR-- %s is not defined", pkg) + + for pkg in other_pkg: + try: + if systemconfig[pkg] == "1": + mv_common.pacinstall(pkg) + elif systemconfig[pkg] == "0": + mv_common.pacremove(pkg) + except: + logging.debug(" ERROR-- %s is not defined", pkg) + logging.info("__End Software\n ") diff --git a/abs/core-testing/LinHES-config-22/mv_webuser.py b/abs/core-testing/LinHES-config-22/mv_webuser.py new file mode 100755 index 0000000..a8517a8 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/mv_webuser.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +import logging, mv_common +#import os + +def setup_web_auth(UseMythWEB_auth): + logging.info("____Start of setup_web_auth____") + if UseMythWEB_auth == str(1): + #enable auth + logging.info(" Enabling authorization for mythweb") + cmd='''sed -i "s/^.*include.*auth-inc.conf.*$/include \\"\/etc\/lighttpd\/auth-inc.conf\\"/g" /etc/lighttpd/lighttpd.conf''' + mv_common.runcmd(cmd) + else: + #disable auth + logging.info(" Disabling authorization for mythweb") + cmd='''sed -i "s/^.*include.*auth-inc.conf.*$/#include \\"\/etc\/lighttpd\/auth-inc.conf\\"/g" /etc/lighttpd/lighttpd.conf''' + mv_common.runcmd(cmd) + logging.debug("Restarting lighttpd") + cmd="sudo sv restart lighttpd" + mv_common.runcmd(cmd) + logging.info("__End of webauth\n") + diff --git a/abs/core-testing/LinHES-config-22/myth_user_call b/abs/core-testing/LinHES-config-22/myth_user_call new file mode 100644 index 0000000..0914b03 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/myth_user_call @@ -0,0 +1,174 @@ +#!/bin/bash +#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 + +INIT_CHECK=TRUE +FULL_CALL="$@" +function CHROOT_CHECK { + INIT=`ps -p 1 -o comm=` + if [ x$INIT = xrunit ] + then + CHROOT_NEEDED=FALSE + else + CHROOT_NEEDED=TRUE + fi +} + +function store_commands () { + echo "$FULL_CALL" >> /root/myth_user_call.out + chmod 600 /root/myth_user_call.out +} + + +function add_user() { + if [ $CHROOT_NEEDED = TRUE ] + then + echo "calling myth_call_user in chroot to add user" + store_commands + else + echo "adding user $USERNAME" + useradd -m -s /bin/bash $USERNAME -G audio,video,optical,storage,users + usermod -a -G mythtv $USERNAME + + fi + +} + + +function del_user() { + if [ $CHROOT_NEEDED = TRUE ] + then + echo "calling myth_call_user in chroot to delete user" + store_commands + else + echo "removing user $USERNAME" + userdel $USERNAME + fi + +} + + +function pass_change() { + if [ $CHROOT_NEEDED = TRUE ] + then + echo "calling myth_call_user in chroot to change password" + store_commands + else + echo "changing password for $USERNAME" + echo $USERNAME:$PASSWORD | chpasswd + fi + +} + + +function web_security { + + grep -q ${USERNAME}: /etc/lighttpd/lighttpd.user + if [ $? = 0 ] + then + #delete user + sed -i "/${USERNAME}\:/d" /etc/lighttpd/lighttpd.user + fi + echo "${USERNAME}:${PASSWORD}" >> /etc/lighttpd/lighttpd.user + +} + +function ARG_ERR() { + if [ x$OPTARG = "x" ] + then + echo "$SWITCH NEEDS AND ARG" + exit 11 + fi +} + + +function print_help { + + echo "Valid options are:" + echo " -c (add|delete|pass|web)" + echo " -u USERNAMEname" + echo " -p password" + exit 1 +} + +if [ $# -eq 0 ] +then + print_help +fi + +declare -r OPTSTRING="c:u:p:i" +while getopts "$OPTSTRING" SWITCH +do + case $SWITCH in + + c) ARG_ERR + OPERATION=$OPTARG + ;; + u) ARG_ERR + USERNAME=$OPTARG + ;; + p) ARG_ERR + PASSWORD=$OPTARG + ;; + i) INIT_CHECK=FALSE + + esac +done + +if [ $INIT_CHECK = TRUE ] +then + CHROOT_CHECK +else + CHROOT_NEEDED=FALSE +fi + +case $OPERATION in + add) + if [ x$USERNAME = x ] + then + print_help + fi + add_user + ;; + delete) + if [ x$USERNAME = x ] + then + print_help + fi + del_user + ;; + pass) + if [ x$USERNAME = x ] + then + print_help + fi + + if [ x$PASSWORD = x ] + then + print_help + fi + pass_change + ;; + + web) + if [ x$USERNAME = x ] + then + print_help + fi + + + if [ x$PASSWORD = x ] + then + print_help + fi + echo "adding webUSERNAME $USERNAME with pass $PASSWORD" + web_security + ;; + *) print_help + ;; +esac + + diff --git a/abs/core-testing/LinHES-config-22/myth_user_call.py b/abs/core-testing/LinHES-config-22/myth_user_call.py new file mode 100755 index 0000000..63915a4 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/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-22/networkconfig.sh b/abs/core-testing/LinHES-config-22/networkconfig.sh new file mode 100644 index 0000000..770aa98 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/networkconfig.sh @@ -0,0 +1,341 @@ +#!/bin/bash +#. /etc/profile +#. /etc/systemconfig +#BASE=/tmp +ETCNETDIR=$BASE/etc/net/ifaces + + + +function kill_dhcp () +{ +#for i in ${BASE}/etc/dhcpc/dhcpcd-*.pid +for i in ${BASE}/var/run/dhcpcd-*.pid +do + if [ -f ${i} ] + then + pid=`cat ${i}` + kill -9 $pid + rm -f ${i} + fi + if [ x$1 = xflush ] + then + for ifdev in eth0 wlan0 eth1 wlan1 + do + echo ${i} |grep $ifdev + status=$? + if [ $status = 1 ] + then + ip address flush $ifdev + fi + done + fi + +done + +} + +function kill_dhcp_chroot () +{ +#for i in ${BASE}/etc/dhcpc/dhcpcd-*.pid +for i in ${mountpoint}/var/run/dhcpcd-*.pid +do + if [ -f ${i} ] + then + pid=`cat ${i}` + kill -9 $pid + rm -f ${i} + fi +done + +} + + + +function setup_nameserver(){ +grep -q $1 ${BASE}/etc/resolv.conf +status=$? +if [ ! $status = 0 ] +then + echo "nameserver $1" >> ${BASE}/etc/resolv.conf +fi + +} + +function change_iface_state () { + if [ x$2 = xenabled ] + then + echo "setting $1 to active" + sed -i -e 's/^ONBOOT=.*$/ONBOOT=yes/g' $ETCNETDIR/$1/options + sed -i -e 's/^DISABLED=.*$/DISABLED=no/g' $ETCNETDIR/$1/options + else + echo "setting $1 to inactive" + if [ -e $ETCNETDIR/$1/options ] + then + sed -i -e 's/^ONBOOT=.*$/ONBOOT=no/g' $ETCNETDIR/$1/options + sed -i -e 's/^DISABLED=.*$/DISABLED=yes/g' $ETCNETDIR/$1/options + fi + /sbin/ifconfig $1 down + ip address flush $1 + fi + +} + +function setup_interfaces() { + local IS_WIRELESS + local ip + local netmask + local isactive + local dns + local UseDHCP + local GW + local ESSID + local KEY + local ENCRYPT + local TEMPNET + local MTU + IS_WIRELESS=false + + #local ip + TEMPNET="Hostip"$1 + echo $TEMPNET + eval ip=\$${TEMPNET} + + TEMPNET=Hostnetmask$1 + eval netmask=\$${TEMPNET} + netmask=`echo "$netmask" | cut -d " " -f1` + + TEMPNET=HostActive$1 + eval isactive=\$${TEMPNET} + + TEMPNET=HostDNS$1 + eval dns=\$${TEMPNET} + + TEMPNET="HostUSEDHCP"$1 + eval UseDHCP=\$${TEMPNET} + + TEMPNET=HostGW$1 + eval GW=\$${TEMPNET} + + TEMPNET=HOST_iswireless$1 + eval wireless=\$${TEMPNET} + + TEMPNET=HostMTU$1 + eval MTU=\$${TEMPNET} + + + + if [ x$wireless = x1 ] + then + IS_WIRELESS=TRUE + TEMPNET=HostESSID$1 + eval ESSID=\$${TEMPNET} + + TEMPNET="HostKey"$1 + eval KEY=\$${TEMPNET} + + TEMPNET=HostUseEncryption$1 + eval ENCRYPT=\$${TEMPNET} + fi + + + echo "Setup $1 in progress, wireless: $IS_WIRELESS" + + if [ ! -d $ETCNETDIR/$1 ] + then + mkdir -p $ETCNETDIR/$1 + fi + + if [ ! -f $ETCNETDIR/$1/options ] + then + cp -f $TEMPLATES/etcnet/eth/options $ETCNETDIR/$1/options + fi + + if [ x$isactive = x1 ] + then + change_iface_state $1 enabled + #echo "setting $1 to active" + #sed -i -e 's/^ONBOOT=.*$/ONBOOT=yes/g' $ETCNETDIR/$1/options + #sed -i -e 's/^DISABLED=.*$/DISABLED=no/g' $ETCNETDIR/$1/options + else + change_iface_state $1 disabled + #echo "setting $1 to inactive" + #sed -i -e 's/^ONBOOT=.*$/ONBOOT=no/g' $ETCNETDIR/$1/options + #sed -i -e 's/^DISABLED=.*$/DISABLED=yes/g' $ETCNETDIR/$1/options + fi + + if [ x$IS_WIRELESS = xTRUE ] + then + echo "setting $1 wireless" + sed -i -e 's/^CONFIG_WIRELESS=.*$/CONFIG_WIRLESS=yes/g' $ETCNETDIR/$1/options + #set the key and essid + echo "essid $ESSID" > $ETCNETDIR/$1/iwconfig + if [ x$ENCRYPT = x1 ] + then + echo "key $KEY" >> $ETCNETDIR/$1/iwconfig + fi + + else + echo "disabling wireless" + sed -i -e 's/^CONFIG_WIRLESS=.*$/CONFIG_WIRLESS=no/g' $ETCNETDIR/$1/options + fi + + if [ x$UseDHCP = x0 ] + then + echo using dhcp + sed -i -e 's/^BOOTPROTO=.*$/BOOTPROTO=dhcp/g' $ETCNETDIR/$1/options + + else + echo "using static ip" + sed -i -e 's/^BOOTPROTO=.*$/BOOTPROTO=static/g' $ETCNETDIR/$1/options + echo "default via $GW" > $ETCNETDIR/$1/ipv4route + echo "$ip$netmask" > $ETCNETDIR/$1/ipv4address + setup_nameserver $dns + fi + + if [ x$MTU = x ] + then + echo "MTU is blank, card will use default values" + sed -i '/^mtu.*$/d' /etc/net/ifaces/$1/iplink + else + echo "setting mtu for $1 to $MTU" + sed -i '/^mtu.*$/d' /etc/net/ifaces/$1/iplink + echo "mtu $MTU " >> /etc/net/ifaces/$1/iplink + fi +} + + +function find_active () { +#HostActiveeth1="1" +rm -f ${BASE}/etc/resolv.conf +if [ x$MYTHDHCP = x1 ] + then + #add 127.0.0.1 to /etc/resolv.conf + echo "search lan" > ${BASE}/etc/resolv.conf + echo "nameserver 127.0.0.1" >> ${BASE}/etc/resolv.conf + fi + +for i in eth0 eth1 wlan0 wlan1 +do + CURRENTIF="HostActive"$i + eval IFSTATE=\$${CURRENTIF} + echo $IFSTATE "---" + echo $i + if [ x$IFSTATE = x1 ] + then + setup_interfaces $i + else + change_iface_state $i disabled + fi +done + +} + +function setup_hostname { +#set the hostname +if [ ! x$hostname = x ] +then + echo $hostname > ${BASE}/etc/hostname + cat $BASE/etc/hosts |grep -v 127.0.0.1|grep -v $hostname > /tmp/hosts + #cat $BASE/etc/hosts |grep -v 127.0.0.1|grep -v $hostname | grep -v $ip > /tmp/hosts + + if [ x$MYTHDHCP = x1 ] + then + echo "127.0.0.1 localhost " > ${BASE}/etc/hosts + echo "$MYTHIP $hostname " >> ${BASE}/etc/hosts + else + echo "127.0.0.1 $hostname localhost " > ${BASE}/etc/hosts + fi + cat /tmp/hosts >> ${BASE}/etc/hosts +fi + +kill_dhcp +} + +function vnc_check() { + CMDLINE=$(cat /proc/cmdline) + echo $CMDLINE |grep -q vnc + USEVNC=$? + echo $CMDLINE |grep -q nfsroot + NETBOOT=$? + echo $USEVNC + if [ ! x$USEVNC = x0 ] + then + echo "not using vnc" + if [ ! x$NETBOOT = x0 ] + then + echo "not using netboot" + else + echo "using netboot" + USEVNC=0 + fi + + else + echo " using vnc" + fi +} + +function setup_MYTH_vars { + TEMPMYTH="Hostip"$default_interface + #echo $TEMPMYTH + eval MYTHIP=\$${TEMPMYTH} + + TEMPMYTH="HostUSEDHCP"$default_interface + eval MYTHDHCP=\$${TEMPMYTH} + + + +} + + + + +function start_network { +if [ ! $USEVNC = 0 ] +then + /etc/net/scripts/network.init reload + /etc/net/scripts/network.init restart +else + echo "VNC/NETBOOT in use, will NOT restart network" +fi + +} + +function setup_network { + setup_MYTH_vars + setup_hostname + find_active +} + + +function stop_network { +if [ ! $USEVNC = 0 ] +then + echo "stopping the network" + kill_dhcp flush + ip address flush dev eth0 2>&1 >/dev/null + ip address flush dev eth1 2>&1 >/dev/null + ip address flush dev wlan0 2>&1 >/dev/null + ip address flush dev wlan1 2>&1 >/dev/null +else + echo "VNC/NETBOOT in use, will NOT restart network" +fi + +} + + +#this is used by the install process to start the network +function install_network_setup { + setup_MYTH_vars + setup_hostname + stop_network + find_active + start_network + +} + + + + + + + diff --git a/abs/core-testing/LinHES-config-22/remove_service.sh b/abs/core-testing/LinHES-config-22/remove_service.sh new file mode 100755 index 0000000..6cc4b4f --- /dev/null +++ b/abs/core-testing/LinHES-config-22/remove_service.sh @@ -0,0 +1,8 @@ +#!/bin/bash +SERVICE_DIR=/var/service +SCRIPT_DIR=/etc/sv +if [ -e $SERVICE_DIR/$1 ] +then + echo "removing" + rm $SERVICE_DIR/$1 +fi diff --git a/abs/core-testing/LinHES-config-22/restore_default_settings.sh b/abs/core-testing/LinHES-config-22/restore_default_settings.sh new file mode 100755 index 0000000..dcf5e23 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/restore_default_settings.sh @@ -0,0 +1,362 @@ +#!/bin/bash +. /etc/profile +. /etc/systemconfig +shopt -s -o nounset +echo $@ >> /tmp/restore.out +#TEMPLATES="/usr/share/templates/settings" +TEMPLATES="$TEMPLATES/settings" +TABLES="settings keybindings" +MYTHDBUSER=mythtv +MYTHTVPASSWD=mythtv +declare -r OPTSTRING="c:e:t:d:h:s:a:z:Ho" +Thistemplate="" +declare -i OVERRIDE=0 +declare -i EVERYTHING=0 + + +function CMD_DEFINE () { + #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\";" + 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" + MYSQLCMD_UPDATE_HOST="select hostname from settings;" + fi +} + +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 + + 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';" + #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}" +} + +function ARG_ERR() { + if [ x$OPTARG = "x" ] + then + echo "$SWITCH NEEDS AND ARG" + exit 11 + fi +} + +function ALSADEVICE () { +#ALSA:hw:1,4 + if [ x$Audiotype = xALSA ] + then + SoundDevice=ALSA:$SoundDevice + MixerDevice="ALSA:default" + else + MixerDevice="/dev/mixer" + fi + +} + + + +if [ $# -eq 0 ] +then + echo "Valid options are:" + echo " -c (save|restore|load|uhostname|BECONFIG|ZIP|ACCESSCONTROL)" + echo " -t (syssettings|hostsettings)" + echo " -d databasename" + echo " -h hostname" + echo " -s systemtype (master|slave|standalone|frontendonly)" + echo " -a ipaddress" + echo " -z zipcode" + echo " -o override (only used upgrade installs)" + exit 1 +fi + + + + +while getopts "$OPTSTRING" SWITCH +do + case $SWITCH in + # \?) echo "unkown option" + # exit 11 ;; + c) echo "$SWITCH" "$OPTARG" + ARG_ERR + OPERATION=$OPTARG + ;; + t) echo "$SWITCH" "$OPTARG" + ARG_ERR + Thistemplate=$OPTARG + + if [ x$Thistemplate = x"syssettings" ] + then + echo "template is syssettings" + loadhost=false + elif [ x$Thistemplate = x"hostsettings" ] + then + echo "template is hostsettings" + Thistemplate=syssettings + loadhost=true + else + echo "invalid template name" + exit 1 + fi + ;; + d) echo "$SWITCH" "$OPTARG" + ARG_ERR + if [ $OVERRIDE = 1 ] + then + ovdbhost=$OPTARG + else + dbhost=$OPTARG + fi + ;; + h) echo "$SWITCH" "$OPTARG" + ARG_ERR + if [ $OVERRIDE = 1 ] + then + oldhostname=$hostname + hostname=$OPTARG + else + hostname=$OPTARG + fi + + ;; + s) echo "$SWITCH" "$OPTARG" + ARG_ERR + SYSTEMTYPE=$OPTARG + ;; + a) echo "$SWITCH" "$OPTARG" + ARG_ERR + IP_ADDRESS=$OPTARG + ;; + z) echo "$SWITCH" "$OPTARG" + ARG_ERR + ZIPCODE=$OPTARG + ;; + o) OVERRIDE=1 + ;; + + esac +done + +echo $OVERRIDE + +#setup the Mysql commands +CMD_DEFINE + +$MYSQLCMD_C "show tables" > /dev/null +status=$? +if [ $status = 1 ] +then + echo "$@ failed" + echo "$@ failed" >> /tmp/restore.out + exit 1 +fi + + + + + + + +case $OPERATION in + + restore) + #used to restore settings from syssettings + if [ -d $TEMPLATES/$Thistemplate ] + then + cd $TEMPLATES/$Thistemplate + if [ $loadhost = false ] + then + for i in $TABLES + do + SQL_DEFINE $i + sed -e "s/REPLACEME/$hostname/g" $i.txt > /tmp/$i.txt + #echo $MYSQLCMD "$SELECTSQL" + echo $i + $MYSQLCMD "$CREATESQL" + $MYSQLCMD "$ALTERSQL" + $MYSQLCMD "$COPY_TMP_SQL" + $MYSQLCMD "$INSERTSQL" + $MYSQLCMD "$DROPSQL" + $MYSQLCMD "$COPY_BCK_SQL " + $MYSQLCMD "$DROP_TABLE " + #rm /tmp/$i.txt + done + fi + if [ $loadhost = true ] + then + #only load the settings table with values HOST + i=settings + SQL_DEFINE $i + sed -e "s/REPLACEME/$hostname/g" $i.txt > /tmp/$i.txt + echo $i + $MYSQLCMD "$CREATESQL" + $MYSQLCMD "$ALTERSQL" + $MYSQLCMD "$INSERTSQL" + $MYSQLCMD "$COPY_TMP_SQL" + $MYSQLCMD "$DROPSQL" + $MYSQLCMD "$COPY_BCK_SQL" + $MYSQLCMD "$DROP_TABLE " + fi + else + echo "couldn't find $TEMPLATES/$Thistemplate" + fi + ;; + + save) + + 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 + ;; + esac + # sed -e "s/$hostname/REPLACEME/g" $i > $i.txt && rm $i + + done + ;; + + load) + + #will load both default_1 and default_2 unless either file is not found + for i in default_1 default_2 + do + if [ -f $TEMPLATES/$i/settings.txt ] + then + echo $i + for tablename in $TABLES + do + #create table + CREATESQL="create table IF NOT EXISTS ${tablename}_${i} like $tablename;" + $MYSQLCMD_C "$CREATESQL" + #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';" + $MYSQLCMD_C "$INSERTSQL" + #update_hostname + UPDATEHOSTNAMESQL="update ${tablename}_${i} set hostname='$i' ; " + $MYSQLCMD_C "$UPDATEHOSTNAMESQL" + done + else + + echo "couldn't find $TEMPLATES/$i/settings.txt template to load" + fi + CREATESQL="create table IF NOT EXISTS settings_user1 like settings;" + $MYSQLCMD_C "$CREATESQL" + CREATESQL="create table IF NOT EXISTS settings_user2 like settings;" + $MYSQLCMD_C "$CREATESQL" + CREATESQL="create table IF NOT EXISTS settings_user3 like settings;" + $MYSQLCMD_C "$CREATESQL" + + CREATESQL="create table IF NOT EXISTS keybindings_user1 like keybindings;" + $MYSQLCMD_C "$CREATESQL" + CREATESQL="create table IF NOT EXISTS keybindings_user2 like keybindings;" + $MYSQLCMD_C "$CREATESQL" + CREATESQL="create table IF NOT EXISTS keybindings_user3 like keybindings;" + $MYSQLCMD_C "$CREATESQL" + done +;; + + + + BECONFIG) + if [ $SYSTEMTYPE = "master" ] + then + $MYSQLCMD_C "UPDATE settings set data='${IP_ADDRESS}' where value='MasterServerIP';" + $MYSQLCMD_C "delete from settings where value='BackendServerIP' and hostname=\"$hostname\";" + $MYSQLCMD_C "REPLACE INTO settings set data='${IP_ADDRESS}' , value='BackendServerIP' , hostname=\"$hostname\";" + fi + + 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\";" + 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\";" + ;; + MUSICFRONT) + ALSADEVICE + $MYSQLCMD_C "delete from settings where value='AudioOutputDevice' and hostname=\"$hostname\";" + $MYSQLCMD_C "delete from settings where value='MixerDevice' and hostname=\"$hostname\";" + $MYSQLCMD_C "REPLACE INTO settings set data='$SoundDevice', value='AudioOutputDevice' , hostname=\"$hostname\";" + $MYSQLCMD_C "REPLACE INTO settings set data='$MixerDevice', value='MixerDevice' , hostname=\"$hostname\";" + #need to reload the settings. + systemconfig.sh reloadfe + ;; + MUSICMYTH) + ALSADEVICE + $MYSQLCMD_C "delete from settings where value='MusicAudioDevice' and hostname=\"$hostname\";" + $MYSQLCMD_C "REPLACE INTO settings set data='$SoundDevice', value='MusicAudioDevice' , hostname=\"$hostname\";" + ;; + uhostname) + #used when the hostname is changed. + TABLES="settings capturecard keybindings storagegroup recorded" + for i in $TABLES + do + USQL="update $i set hostname=\"$oldhostname\" where hostname=\"$hostname\" ;" + $MYSQLCMD_C "$USQL" + done + + ;; + USERJOBALLOW) + SQL="update settings set data='1' where value like 'JobAllowUserJob%' and hostname=\"$hostname\" ;" + $MYSQLCMD_C "$SQL" + ;; + + ACCESSCONTROL) + LIST="Hostaccessnetwork Hostaccesshostype HostaccesshostypeSystemtype Hostaccessmisc Hostaccesssleep Hostaccessadvanced HostaccessadvancedX Hostaccesssound" + + for i in $LIST + do + $MYSQLCMD_C "delete from settings where value=\"$i\" and hostname=\"$hostname\";" + $MYSQLCMD_C "REPLACE INTO settings set data='1', value=\"$i\" , hostname=\"$hostname\";" + done + SQL="update settings set data='0' where value='HostaccesshostypeSystemtype' and hostname=\"$hostname\" ;" + $MYSQLCMD_C "$SQL" + SQL="update settings set data='0' where value='Hostaccessuser' and hostname=\"$hostname\" ;" + $MYSQLCMD_C "$SQL" + ;; + esac + +#SELECT * INTO OUTFILE 'data.txt' +# FIELDS TERMINATED BY ',' +# FROM table2; + + diff --git a/abs/core-testing/LinHES-config-22/restore_km_db_chroot.sh b/abs/core-testing/LinHES-config-22/restore_km_db_chroot.sh new file mode 100644 index 0000000..e72e8c2 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/restore_km_db_chroot.sh @@ -0,0 +1,61 @@ +#!/bin/bash +. /etc/profile +. /etc/systemconfig +. $MV_ROOT/bin/install_functions.sh + +myhost=$hostname +hostname $myhost +mount -t proc none /proc +DBFILE=$1 + +if [ $SystemType = "Master_backend" -o $SystemType = "Standalone" ] + then + #restore database + pacman --noconfirm -Sf mysql + status=1 + mysqlstatus=1 + while [ ! $status = 0 ] + do + /etc/rc.d/mysqld stop + sleep 1 + /etc/rc.d/mysqld start + mysqlstatus=$? + if [ $mysqlstatus = 0 ] + then + mysql -e "show databases;" + showstatus=$? + if [ $showstatus = 0 ] + then + #load database + pacman --noconfirm -R mythdb-initial + pacman --noconfirm -S mythdb-initial + + if [ -f $DBFILE ] + then + echo "restoring old database" + gunzip -c $DBFILE > /tmp/mythconverg.sql + mysql mythconverg < /tmp/mythconverg.sql + update_db_settings HostServiceMythWEB "1" + echo 'UseMythWEB="1"' >> /etc/systemconfig + else + echo "Could not restore old database, mythconverg.sql is missing." + touch /tmp/.upgrade_db_failed + fi + + if [ -d /data/srv/mysql/mythconverg ] + then + status=0 + fi + fi + fi + done + rm -f /tmp/mythconverg.sql + else + exit 0 + fi + +#/etc/rc.d/mysqld stop +#umount /proc + + + diff --git a/abs/core-testing/LinHES-config-22/soundconfig.sh b/abs/core-testing/LinHES-config-22/soundconfig.sh new file mode 100755 index 0000000..75998d6 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/soundconfig.sh @@ -0,0 +1,254 @@ +#!/bin/bash +. /etc/systemconfig +. /etc/profile +echo $@ >/tmp/audio.call +#set -x +BASE="" +. /etc/profile +#TEMPLATES="/usr/share/templates" +#TESTFILE="$TEMPLATES/audio/space_battle_A.wav" +TESTFILE="/usr/share/sounds/alsa/Front_Center.wav" +OSSinstalled="false" + +function testaudio () { + +ossplay -d$AUDIODEVICE $TESTFILE + +} + +function load_alsa() { + + remove_service.sh alsa-utils +# cd /lib/modules/2.6.21-STB + KER=`uname -r` + cd /lib/modules/$KER/kernel/ + tar -xvf /lib/modules/alsa-$KER.tar + pacman -Sf --noconfirm alsa-lib + + depmod -a + cd - + udevadm trigger + udevadm settle + udevadm trigger + + add_service.sh alsa-utils + sleep 4 + sv start alsa-utils +} + + +function unload_alsa () { +#kill $(lsof -t /dev/dsp* /dev/audio* /dev/mixer* /dev/snd/*) && modprobe -r $(lsmod |grep ^snd |awk '{print $1}') + sv stop alsa-utils + remove_service.sh alsa-utils + rm -rf /dev/adsp* + rm -rf /dev/snd/* + rm -rf /dev/audio + modprobe -r $(lsmod |grep ^snd |awk '{print $1}') +} + +function unload_oss { + sv stop oss + soundoff + rm -rf /dev/dsp* + rm -rf /dev/oss* + rm -rf /dev/sndstat + remove_service.sh oss +} + +function installOSS { + echo "installing oss" + pacman -Q oss 2>/dev/null + if [ ! $? = 0 ] + then + pacman --noconfirm -Sf oss + fi + add_service.sh oss + sleep 4 + sv start oss +} + + +function SYNCXINE { +echo "modify xine config file" + if [ -f /data/home/mythtv/.xine/config ] + then + cp -f /data/home/mythtv/.xine/config $TEMPLATES/xine.config + else + cp $TEMPLATES/xine.config.template $TEMPLATES/xine.config + fi + + if [ x$Audiotype = xOSS ] + then + DEVICENUMBER=`echo $SoundDevice|awk -F/ ' { print $3 } '|tr -d dsp ` + sed -e "s/^.*audio.driver.*$/audio.driver:oss/" \ + -e "s/^.audio.device.oss_device_name.*$/audio.device.oss_device_name:\/dev\/dsp/" \ + -e "s/^.audio.devic.oss_device_number.*$/audio.device.oss_device_number:$DEVICENUMER/" \ + -e "s/^.*audio.output.speaker_arrangement:.*$/Audio.output.speaker_arrangement:PassThrough/" \ + $TEMPLATES/xine.config > /data/home/mythtv/.xine/config + else + cp $TEMPLATES/xine.config /data/home/mythtv/.xine/config + fi + +} + +function SYNCMPLAYER { +echo "modify mplayer not implmented yet" +} + +function SYNCMYTHMUSIC { +echo "sync mythmusic" +$MV_ROOT/bin/restore_default_settings.sh -c MUSICMYTH +} + +function SYNCMYTHFRONTEND { +echo "sync mythfrontend" +$MV_ROOT/bin/restore_default_settings.sh -c MUSICFRONT +} + + +function checkOSSinstalled () { + ossinfo |grep Version |grep -q OSS >/dev/null + resultcode=$? + echo $resultcode + if [ $resultcode = 0 ] + then + OSSinstalled='true' + else + OSSinstalled='false' + fi +} + +function sound_config_system { + + if [ x$syncXine = x1 ] + then + SYNCXINE + fi + if [ x$syncMplayer = x1 ] + then + SYNCMPLAYER + fi + if [ x$syncMythMusic = x1 ] + then + SYNCMYTHMUSIC + fi + if [ x$syncMythFrontend = x1 ] + then + SYNCMYTHFRONTEND + fi + +} + +function loadsound (){ + checkOSSinstalled + if [ x$AUDIOTYPE = xOSS -o x$AUDIOTYPE = xoss ] + #then + # if [ $OSSinstalled = "false" ] + then + while [ $OSSinstalled = "false" ] + do + unload_alsa + rm /tmp/.alsatest + installOSS + installOSS + sleep 2 + checkOSSinstalled + done + # fi + else + touch /tmp/.alsatest + unload_oss + load_alsa + load_alsa + rm /tmp/.alsatest + + fi + +} + + + + +#####################MAIN PROGRAM########################## + +declare -r OPTSTRING="i:t:d:" + +if [ $# -eq 0 ] +then + echo "Valid options are:" + echo " -i (oss|alsa) oss or alsa subsystem " + echo " -t (test|real|LOAD) " + echo " -d device" + exit 1 +fi + + + + +while getopts "$OPTSTRING" SWITCH +do + case $SWITCH in + \?) echo "unkown option" + exit 11 ;; + i) echo "$SWITCH" "$OPTARG" + AUDIOTYPE="$OPTARG" + ;; + d) echo "$SWITCH" "$OPTARG" + AUDIODEVICE=$OPTARG + ;; + t) echo "$SWITCH" "$OPTARG" + SOUNDOPTYPE="$OPTARG" + if [ x"$OPTARG" = xtest ] + then + TEST=true + else + TEST=false + fi + + + ;; + + esac +done + + + + +case $SOUNDOPTYPE in + REAL|real ) + loadsound + sound_config_system + ;; + test|TEST) + echo $@ > /tmp/audio.test + #loadsound + if [ x$AUDIOTYPE = xOSS -o x$AUDIOTYPE = xoss ] + then + echo "testing OSS $AUDIODEVICE " + ossplay -d$AUDIODEVICE $TESTFILE + else + echo "testing ALSA $AUDIODEVICE " + aplay --device=$AUDIODEVICE $TESTFILE + fi + + ;; + + LOAD|load) + loadsound + ;; + esac + + +exit 0 + + + + + + + + + + + diff --git a/abs/core-testing/LinHES-config-22/startx b/abs/core-testing/LinHES-config-22/startx new file mode 100755 index 0000000..75ba06a --- /dev/null +++ b/abs/core-testing/LinHES-config-22/startx @@ -0,0 +1,29 @@ +#!/bin/bash +. /etc/profile + +export USER=root +export HOME=/root +#TEMPLATES=/usr/share/templates + +CMDLINE=$(cat /proc/cmdline) +TEMPVAR=${CMDLINE#*ip=} +IP=${TEMPVAR%% *} +echo $CMDLINE |grep -q vnc +USEVNC=$? + +if [ x$USEVNC = x1 ] +then + $MV_ROOT/bin/xconfig.sh + cat /etc/X11/xorg.conf | sed -e 's/dev\/mouse/dev\/psaux/g'> /root/xorg.conf.install + startx /root/live-install.sh -- -logverbose 6 -config /root/xorg.conf.install -allowMouseOpenFail + else + #VNC + pacman -Sf --noconfirm tightvnc + cd /root + mkdir .vnc + echo mythvantage |vncpasswd -f > /root/.vnc/passwd + chmod 500 /root/.vnc/passwd + rm /root/.vnc/xstartup + ln -s /root/live-install.sh /root/.vnc/xstartup + vncserver +fi diff --git a/abs/core-testing/LinHES-config-22/systemconfig.py b/abs/core-testing/LinHES-config-22/systemconfig.py new file mode 100755 index 0000000..28e2e7a --- /dev/null +++ b/abs/core-testing/LinHES-config-22/systemconfig.py @@ -0,0 +1,244 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +import sys, os, commands, glob, time +import getopt, re, MySQLdb +import logging +import mv_common , mv_network +import inspect +#____________________________________________setup the logging______________________________________________________ +LOG_FILENAME = '/tmp/systemconfig.log' +DEBUGLOG = '/tmp/systemconfig_debug.log' +logging.basicConfig(level=logging.DEBUG, + format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', + datefmt='%m-%d %H:%M', + filename=DEBUGLOG, + filemode='w') +# define a Handler which writes INFO messages or higher to the sys.stderr +console = logging.StreamHandler() +console.setLevel(logging.INFO) +# set a format which is simpler for console use +#formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s') +formatter = logging.Formatter("%(message)s") +# tell the handler to use this format +console.setFormatter(formatter) +# add the handler to the root logger +logging.getLogger('').addHandler(console) + +#infoformatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") +infoformatter = logging.Formatter("%(message)s") +infofile = logging.FileHandler(LOG_FILENAME, 'w') +infofile.setFormatter(infoformatter) +infofile.setLevel(logging.INFO) +logging.getLogger('').addHandler(infofile) + + +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) + +def main(argv): + try: + MVROOT = os.environ["MV_ROOT"] + except: + logging.debug("MVROOT was not defined, using the default value") + MVROOT = "/usr/MythVantage" + + global cmdmodule + global systemconfig + systemconfig["MVROOT"]=MVROOT + restartlcd = False + cmdmodule={"misc":False , "sleep":False , "hostype":False , "hostypec":False , "advanced":False , "audio":False , "network":False , "advancedX":False , "webuser":False , "restartfe":False , "reloadfe":False , "ddns":False , "screensaver":False , "ir":False , "this_is_install":False , "user":False, "software":False, "plugins":False, "smolt":False, "all":False, "dhcp_request":False } + try: + opts, args = getopt.getopt(argv, 'c:hm:d:', ["help","modules" ] ) + 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 ("-m"): + for i in arg.split(","): + cmdmodule[i]=True + elif opt in ("-d"): + dhcp_dev = arg + + + if cmdmodule["this_is_install"] or cmdmodule["hostypec"]: + systemconfig["hostypec"] = True + cmdmodule["smolt"] = True + + systemconfig["mythip"] = mv_network.setup_MYTH_IP(systemconfig) + systemconfig["mythdhcp"] = mv_network.setup_MYTH_DHCP(systemconfig) + systemconfig["mythgw"] = mv_network.setup_MYTH_DHCP(systemconfig) + systemconfig["mythdns"] = mv_network.setup_MYTH_DHCP(systemconfig) + + if cmdmodule["all"]: + logging.info("*** WILL RUN ALL MODULES ***") + cmdmodule["hostype"] = True + cmdmodule["ir"]= True + cmdmodule["network"] = True + cmdmodule["audio"] = True + cmdmodule["misc"] = True + cmdmodule["sleep"] = True + cmdmodule["webuser"] = True + cmdmodule["ddns"] = True + cmdmodule["screensaver"] = True + cmdmodule["advanced"] = True + cmdmodule["software"] = True + cmdmodule["advancedX"] = True + cmdmodule["smolt"] = True + cmdmodule["user"] = True + + + if cmdmodule["hostype"]: + import mv_hostype + cmdmodule["advancedX"] = True + setup_x(systemconfig) + cmdmodule["ir"] = True + mv_hostype.hostypeprint(systemconfig) + cmdmodule["smolt"] = True + + if cmdmodule["network"]: + restartfe = mv_network.setup_network(systemconfig, cmdmodule["this_is_install"]) + if restartfe == True : + logging.debug(" Setting the frontend to restart due to network change") + cmdmodule["restartfe"] = True + + + + if cmdmodule["ir"] == True: + import mv_ir + restart = mv_ir.setup_ir(systemconfig,data_config) + restartfe = restart[0] + restartlcd = restart[1] + if restartfe == True : + logging.debug(" Setting the frontend to restart due to lirc change") + cmdmodule["restartfe"] = True + cmdmodule["smolt"] = True + + + 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) + 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 cmdmodule["sleep"]: + import mv_misc + mv_misc.setup_sleep(systemconfig) + + if cmdmodule["webuser"]: + import mv_webuser + mv_webuser.setup_web_auth(systemconfig["UseMythWEB_auth"]) + + if cmdmodule["ddns"]: + import mv_ddns + mv_ddns.setup_ddns(systemconfig) + + if cmdmodule["screensaver"]: + import mv_screensaver + mv_screensaver.setup_screensaver(systemconfig, data_config) + + if cmdmodule["advanced"]: + import mv_advanced + mv_advanced.setup_advanced(systemconfig, data_config) + + if cmdmodule["software"] or cmdmodule["plugins"]: + import mv_software + mv_software.setup_software(systemconfig, data_config) + + if cmdmodule["advancedX"]: + setup_x(systemconfig) + + if cmdmodule["restartfe"]: + mv_common.restartfe(restartlcd) + + if cmdmodule["reloadfe"]: + mv_common.reloadfe(systemconfig["dbhost"],restartlcd) + + if cmdmodule["smolt"]: + import mv_smolt + mv_smolt.setup_smolt_type(systemconfig["SystemType"], + systemconfig["Remotetype"], + systemconfig["RunFrontend"], + data_config.MYTHHOME, + data_config.SYSTEMTYPE) + + if cmdmodule["user"]: + logging.info("____Start of ssh user____") + if systemconfig["rootSSH"] == "1" : + logging.info(" Allowing ssh access for root") + cmd = '''sed -i "s/^.*PermitRootLogin.*$/PermitRootLogin yes/" /etc/ssh/sshd_config''' + mv_common.runcmd(cmd) + else: + logging.info(" Removing ssh access for root") + cmd = '''sed -i "s/^.*PermitRootLogin.*$/PermitRootLogin no/" /etc/ssh/sshd_config''' + mv_common.runcmd(cmd) + logging.info("__End of ssh user\n") + + if cmdmodule["dhcp_request"]: + cmd = '''dhcpcd -t4 -h' ' -Td %s > /tmp/mvnetwork.dhcpinfo ''' %dhcp_dev + mv_common.runcmd(cmd) + + +if __name__ == "__main__": + + config_file = "mv_config" + data_config = __import__(config_file, globals(), locals(), []) + #Read in systemconfig + global systemconfig + systemconfig = {"hostypec":False} + file_name = "/etc/systemconfig" + try: + config_file = open(file_name) + except: + logging.critical("%s could not be opened", file_name) + sys.exit(1) + + for line in config_file: + line = line.strip() + if line and line[0] is not "#" and line[-1] is not "=": + var, val = line.rsplit("=", 1) + val = val.strip('"') + systemconfig[var.strip()] = val.strip() + try: + systemconfig["TEMPLATES"] = os.environ["TEMPLATES"] + except: + logging.critical(" *TEMPLATES is not defined") + logging.critical(" *using default value") + systemconfig["TEMPLATES"] = "/usr/MythVantage/templates" + + logging.debug("______START OF DEBUG______") + main(sys.argv[1:]) + logging.debug("______cmd line options______") + for i in cmdmodule.items(): + logging.debug (i) + logging.debug("______systemconfig______") + for i in systemconfig.items(): + logging.debug(i) + #pass + + + + + + + + + + diff --git a/abs/core-testing/LinHES-config-22/systemconfig.sh b/abs/core-testing/LinHES-config-22/systemconfig.sh new file mode 100755 index 0000000..218f705 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/systemconfig.sh @@ -0,0 +1,19 @@ +#!/bin/bash +################################################################### +#Script to configure your system based off the values in /etc/systemconfig +#Any changes made to config files will be removed when systemconfig.sh is run +# +#JM +echo $@ >/tmp/systemconfig.call +echo "----------------------start of systemconfig $@ ----------------------" +. /etc/profile +. $MV_ROOT/bin/networkconfig.sh +postfix=`cat ${BASE}/usr/local/share/mythtv/.releasetype` + +systemconfig.py -m $@ +rc=$? +echo "systemconfig.py exit code $rc" +exit $rc + + + diff --git a/abs/core-testing/LinHES-config-22/timezip.py b/abs/core-testing/LinHES-config-22/timezip.py new file mode 100755 index 0000000..bf6b389 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/timezip.py @@ -0,0 +1,232 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# import MySQL module +#used to import the zipcode/timezone/nfs info fromMBE +import MySQLdb +import sys +import getopt +import socket + + +def usage(): + print " -h --help" + print " -d --installdb" + print " -m --masterdb" + print " -n --hostname of current machine" + +def printvars(): + print "masterdb: " + masterdb + print "installdb:" + installdb + print "hostname: " + thishostname + print "BEhostname:" + BEhostname + print "zipcode:" + zipcode + print "timezone:" + tz + print "timezone region:" + tz_region + print "timezone subregion:" + tz_subregion + print "nfsip:" + nfsip + print "nfstoggle:" + nfstoggle + print "nfsmount:" + nfsmount + print "hobbitclient:" + hobbitclient +# connect +def selectvars(): + + global BEhostname + global zipcode + global tz + global tz_region + global tz_subregion + global nfsip + global nfstoggle + global nfsmount + global hobbitclient + + db = MySQLdb.connect(host=masterdb, user="mythtv", passwd="mythtv", db="mythconverg") + # create a cursor + cursor = db.cursor() + # execute SQL statement + cursor.execute("select hostname from settings where value='BackendServerIP' and data=(%s)",(masterdb)) + result = cursor.fetchone() + try: + BEhostname=result[0] + except TypeError: + BEhostname="" + + cursor.execute("select data from settings where value='HostZipcode' and hostname=(%s)",(BEhostname)) + result = cursor.fetchone() + try: + zipcode = result[0] + except TypeError: + zipcode="" + + cursor.execute("select data from settings where value='HostCentralNFSIP' and hostname=(%s)",(BEhostname)) + result = cursor.fetchone() + try: + nfsip=result[0] + except TypeError: + nfsip="" + + cursor.execute("select data from settings where value='HostHaveCentralNFS' and hostname=(%s)",(BEhostname)) + result = cursor.fetchone() + try: + nfstoggle=result[0] + except TypeError: + nfstoggle="" + + cursor.execute("select data from settings where value='HostNFSmountpoint' and hostname=(%s)",(BEhostname)) + result = cursor.fetchone() + try: + nfsmount=result[0] + except TypeError: + nfsmount="" + + cursor.execute("select data from settings where value='HostTimeZone' and hostname=(%s)",(BEhostname)) + result = cursor.fetchone() + try: + tz=result[0] + except TypeError: + tz="" +########## + cursor.execute("select data from settings where value='HostTimeZoneRegion' and hostname=(%s)",(BEhostname)) + result = cursor.fetchone() + try: + tz_region=result[0] + except TypeError: + tz_region="" + tempsubregion="HostTimeZoneRegion_" + tz_region + + cursor.execute("select data from settings where value=%s and hostname=(%s)",(tempsubregion,BEhostname)) + result = cursor.fetchone() + try: + tz_subregion=result[0] + except TypeError: + tz_subregion="" +############### + if ( thishostname != BEhostname ): + cursor.execute("select data from settings where value='GlobalServiceHobbitserver'") + result = cursor.fetchone() + try: + hobbitclient=result[0] + except TypeError: + hobbitclient="1" + + + +def insertvars(): + + db = MySQLdb.connect(host=installdb, user="mythtv", passwd="mythtv", db="mythconverg") + cursor = db.cursor() +#inserting the zipcode + cursor.execute("select * from settings where value='HostZipcode' and hostname=(%s)",(thishostname)) + result = cursor.fetchone() + if ( zipcode!="" ): + if (result == None): + cursor.execute("INSERT INTO settings (value,data,hostname) VALUES ('HostZipcode',(%s),(%s))",(zipcode,thishostname)) + print "inserting zipcode" + else: + cursor.execute("update settings set data=(%s) where hostname=(%s) and value='HostZipcode'",(zipcode,thishostname)) + print "updating zipcode" + +#inserting the timezone + cursor.execute("select * from settings where value='HostTimeZone' and hostname=(%s)",(thishostname)) + result = cursor.fetchone() + if ( tz != ""): + if (result == None): + cursor.execute("INSERT INTO settings (value,data,hostname) VALUES ('HostTimeZone',(%s),(%s))",(tz,thishostname)) + print "inserting timezone" + else: + cursor.execute("update settings set data=(%s) where hostname=(%s) and value='HostTimeZone'",(tz,thishostname)) + print "updating timezone" + + cursor.execute("select * from settings where value='HostTimeZoneRegion' and hostname=(%s)",(thishostname)) + result = cursor.fetchone() + if ( tz != ""): + if (result == None): + cursor.execute("INSERT INTO settings (value,data,hostname) VALUES ('HostTimeZoneRegion',(%s),(%s))",(tz_region,thishostname)) + print "inserting timezone region" + else: + cursor.execute("update settings set data=(%s) where hostname=(%s) and value='HostTimeZoneRegion'",(tz_region,thishostname)) + print "updating timezone region" + + tempsubregion="HostTimeZoneRegion_" + tz_region + cursor.execute("select * from settings where value=%s and hostname=(%s)",(tempsubregion,thishostname)) + result = cursor.fetchone() + if ( tz != ""): + if (result == None): + cursor.execute("INSERT INTO settings (value,data,hostname) VALUES ((%s),(%s),(%s))",(tempsubregion,tz_subregion,thishostname)) + print "inserting timezone subregion" + else: + cursor.execute("update settings set data=(%s) where hostname=(%s) and value=(%s)",(tempsubregion,tz_subregion,thishostname)) + print "updating timezone subregion" + + +#start of NFSIP + cursor.execute("select data from settings where value='HostCentralNFSIP' and hostname=(%s)",(thishostname)) + result = cursor.fetchone() + if ( nfsip != ""): + if (result == None): + cursor.execute("INSERT INTO settings (value,data,hostname) VALUES ('HostCentralNFSIP',(%s),(%s))",(nfsip,thishostname)) + print "inserting nfsip" + + if (nfstoggle != ""): + cursor.execute("select data from settings where value='HostHaveCentralNFS' and hostname=(%s)",(thishostname)) + result = cursor.fetchone() + if (result == None): + cursor.execute("INSERT INTO settings (value,data,hostname) VALUES ('HostHaveCentralNFS',(%s),(%s))",(nfstoggle,thishostname)) + print "inserting nfstoggle" + + if ( nfsmount !="") : + cursor.execute("select data from settings where value='HostNFSmountpoint' and hostname=(%s)",(thishostname)) + result = cursor.fetchone() + if (result == None): + cursor.execute("INSERT INTO settings (value,data,hostname) VALUES ('HostNFSmountpoint',(%s),(%s))",(nfsmount,thishostname)) + print "inserting nfsmountpoint" + +#hobbitclient + cursor.execute("select * from settings where value='HostServiceHobbitclient' and hostname=(%s)",(thishostname)) + result = cursor.fetchone() + if ( tz != ""): + if (result == None): + cursor.execute("INSERT INTO settings (value,data,hostname) VALUES ('HostServiceHobbitclient',(%s),(%s))",(hobbitclient,thishostname)) + print "inserting hobbitcleint" + else: + cursor.execute("update settings set data=(%s) where hostname=(%s) and value='HostServiceHobbitclient'",(hobbitclient,thishostname)) + print "updating hobbitclient" + + +def main(argv): + global masterdb + global installdb + global thishostname + thishostname="" + global BEhostname + global zipcode + global tz + global tz_region + global tz_subregion + + global nfsip + global hobbitclient + try: + opts, args = getopt.getopt(argv, "hm:d:n:", ["help", "masterdb=", "installdb=" , "hostname=" ] ) + except getopt.GetoptError: + sys.exit(2) + for opt, arg in opts: + if opt in ("-h", "--help"): + usage() + sys.exit() + elif opt in ( "-d" , "--installdb"): + installdb = arg + elif opt in ("-m", "--masterdb"): + masterdb = arg + elif opt in ("-n", "--hostname"): + thishostname = arg + + if ( thishostname == "" ): + thishostname = socket.gethostname() + + selectvars() + printvars() + insertvars() +if __name__ == "__main__": + main(sys.argv[1:]) + diff --git a/abs/core-testing/LinHES-config-22/xconfig.sh b/abs/core-testing/LinHES-config-22/xconfig.sh new file mode 100755 index 0000000..2fad821 --- /dev/null +++ b/abs/core-testing/LinHES-config-22/xconfig.sh @@ -0,0 +1,363 @@ +#!/bin/bash +#SET DISPLAYCARD to force a cardtype +#SET DISPLAYRES to force Xres, ENV takes precendent over cmdline +#displayres=cmdline +#NVPKGS="ati-dri xf86-video-ati xf86-video-radeonhd intel-dri xf86-video-intel unichrome-dri xf86-video-unichrome xf86-video-mga xf86-video-savage xf86-video-trident" +NVPKGS="ati-dri xf86-video-ati xf86-video-radeonhd intel-dri xf86-video-intel xf86-video-mga xf86-video-savage xf86-video-trident unichrome-dri xf86-video-openchrome" +BASE="" +. /etc/profile +NVIDIA_96XX="$TEMPLATES/xorg/96xx_supported.txt" +#TEMPLATES="/usr/share/templates" +MYTHHOME=$BASE/home/mythtv + +function Xvalues { + CMDLINE=$(cat /proc/cmdline) + echo "$CMDLINE" | grep -q forceXvesa + if [ $? = 0 ] + then + VGACARDTYPE=vesa + Xcardtype=$VGACARDTYPE + else + VGACARDTYPE=`lspci | grep -i vga | sort -r | head -n 1 | cut -d: -f3 | cut -d" " -f2` + VGAPCIID=`lspci | grep -i vga | sort -r | head -n 1 | cut -d" " -f1` + CARDID=`lspci -n | grep "$VGAPCIID" | grep 10de | cut -d" " -f3 | cut -d: -f2` + VENDORID=`lspci -n | grep "$VGAPCIID" | grep 10de | cut -d" " -f3 | cut -d: -f1` + fi + #force VGACARDTYPE + if [ ! x$DISPLAYCARD = x ] + then + VGACARDTYPE=$DISPLAYCARD + Xcardtype=$VGACARDTYPE + fi + echo "Will use $VGACARDTYPE" + currentmode=`cat "$BASE/etc/X11/xorg.conf" | grep Modes | awk -Fs '{ print $2 }'` +} + +function presetupX { + if [ -f /etc/sysconfig/IGNORE_X ] + then + echo "Will not run xconfig.sh due to presence of /etc/sysconfig/IGNORE_X" + return 1 + else + if [ "$XIgnoreConfig" = 1 ] + then + echo "Using User supplied X" + if [ -f "$MYTHHOME/templates/xorg.user" ] + then + cp -f "$MYTHHOME/templates/xorg.user" "$XORG_CONF" + else + echo "Didn't find the file" + echo "Copy your config file to $MYTHHOME/templates/xorg.user" > "$XORG_CONF" + fi + else + if [ "$XUseAdvanced" = 1 ] + then + setupAdvancedX + else + setupX + fi + fi + fi + +} + +function setupAdvancedX { + echo "#doing the advanced" > /tmp/options + Xcategory=`echo "$Xresadvanced" | cut -d_ -f1` + Xres=`echo "$Xresadvanced" | cut -d_ -f2` + echo "$Xcategory" + if [ "$Xcategory" = "nVidia Modeline" ] + then + Xres="" + if [ "$XnVidia1080p" = "1" ] + then + Xres="${Xres} \"1920x1080_60\"" + fi + if [ "$XnVidia1080i" = "1" ] + then + Xres="${Xres} \"1920x1080_60i\"" + fi + if [ "$XnVidia720p" = "1" ] + then + Xres="${Xres} \"1280x720_60\"" + fi + if [ "$XnVidia480p" = "1" ] + then + Xres="${Xres} \"720x480_60\"" + fi + ML="\t Modes ${Xres}" + else + + ML="\t Modes \"${Xres}\"" + fi +# echo $ML + case $Xcardtype in + NVIDIA|nVidia|nvidia) + case $Xconnection in + DVI) ConnectedMonitor=DFP ;; + vga) ConnectedMonitor=CRT;; + Auto) ConnectedMonitor=Auto;; + TV) ConnectedMonitor=TV + echo "Option \"TVStandard\" \"$XTVstandard\"" >>/tmp/options + echo "Option \"TVOutFormat\" \"$XTVconnection\"" >> /tmp/options + ;; + esac + if [ "$ConnectedMonitor" = Auto ] + then + echo "auto connection" + else + echo "Option \"ConnectedMonitor\" \"$ConnectedMonitor\"" >> /tmp/options + echo "Option \"FlatPanelProperties\" \"Scaling = centered, Dithering = enabled\"" >> /tmp/options + echo "Option \"DigitalVibrance\" \"0\"" >> /tmp/options + fi + + if [ "$XignoreEDID" = 1 ] + then + EDIDvalue=true + EDIDFREQ=false + DS=" DisplaySize $XDisplaysize" + HS=" HorizSync $XHsync" + VR=" VertRefresh $XVrefresh" + else + EDIDvalue=false + EDIDFREQ=true + DS="# Display size edid used " + HS="# Hsync edid used " + VR="# Vertrefresh edid used " + fi + echo "Option \"UseEdidFreqs\" \"$EDIDFREQ\"" >> /tmp/options + echo "Option \"IgnoreEDID\" \"$EDIDvalue\"" >> /tmp/options + + + sed -e "s/^.*Modes.*$/${ML}/" \ + -e "/INSERT MODELINE/r $TEMPLATES/xorg/modeline.$Xcategory" \ + -e "s/^.*DisplaySize.*$/ $DS/" \ + -e "s/^#.*HorizSync.*$/ $HS/g" \ + -e "s/^#.*VertRefresh.*$/ $VR/g" \ + -e "/INSERT HERE/r /tmp/options" "$TEMPLATES/xorg/xorg.conf.nvidia" > "$XORG_CONF" + ;; + + ati|ATI) + case $Xconnection in + DVI) ConnectedMonitor="tmds1,nocrt1,notv";; + VGA) ConnectedMonitor="crt1,notmds1,notv" ;; + TV) ConnectedMonitor="tv,nocrt1,notmds1" + echo "Option \"TVStandard\" \"$XTVstandard\"" >>/tmp/options + echo "Option \"TVFormat\" \"$XTVconnection\"" >> /tmp/options + ;; + esac + if [ "$XignoreEDID" = 1 ] + then + DS=" DisplaySize $XDisplaysize" + HS=" HorizSync $XHsync" + VR=" VertRefresh $XVrefresh" + else + DS="# Display size edid used " + HS="# Hsync edid used " + VR="# Vertrefresh edid used " + fi + + echo "Option \"ForceMonitors\" \"$ConnectedMonitor\"" >> /tmp/options + + sed -e "s/^.*Modes.*$/\t $ML/" \ + -e "/INSERT MODELINE/r $TEMPLATES/xorg/modeline.$Xcategory" \ + -e "s/^.*DisplaySize.*$/ $DS/" \ + -e "s/^#.*HorizSync.*$/ $HS/g" \ + -e "s/^#.*VertRefresh.*$/ $VR/g" \ + -e "/INSERT HERE/r /tmp/options" "$TEMPLATES/xorg/xorg.conf.ati" > "$XORG_CONF" + ;; + + via|VIA|Via|S3) + # Need to add appropriate Modules, Device and DRI sections + # See the http://www.mythtv.org/wiki/XvMC wiki page + echo "no via here" + ;; + + *) + echo "unknown card type" + ;; + esac +} + + +function setupX { + Xvalues + #echo "$currentmode ____ ${Xres}" + #if [ "${currentmode}" != \"${Xres}\" ] + if [ x = x ] + then + case $VGACARDTYPE in + nVidia) + if [ ${Xres} = Auto ] + then + sed -e "/^.*Modes.*$/d" "$TEMPLATES/xorg/xorg.conf.nvidia" > "$XORG_CONF" + else + sed -e "s/^.*Modes.*$/\t Modes \"${Xres}\"/" "$TEMPLATES/xorg/xorg.conf.nvidia" > "$XORG_CONF" + fi + if [ "$TESTMODE" != "test" ] + then + #nvidia check right here + grep -qi "$CARDID" "$NVIDIA_96XX" + if [ $? = 0 ] + then + #install 96xx drivers + echo "installing nvidia 96xx drivers" + pacman --noconfirm -Rd libgl > /dev/null 2>&1 + pacman --noconfirm -R $NVPKGS > /dev/null 2>&1 + pacman --noconfirm -S nvidia-96xx nvidia-96xx-utils > /dev/null 2>&1 + else + #install latest drivers + echo "installing current nvidia drivers" + pacman --noconfirm -Rd libgl > /dev/null 2>&1 + pacman --noconfirm -R $NVPKGS > /dev/null 2>&1 + pacman --noconfirm -S nvidia nvidia-utils > /dev/null 2>&1 + fi + fi + echo "/usr/lib/libXvMCNVIDIA_dynamic.so.1" > "$XVMC_CONFIG" + ;; + + # VMware) + # sed -e "s/^.*Modes.*$/\t Modes \"${Xres}\"/" "$TEMPLATES/xorg/xorg.conf.vmware" > "$XORG_CONF" + # ;; + + VIA|S3) + # There are actually multiple options here + # xf86-video-openchrome + # xf86-video-unichrome + # There is also a seperate driver for the Unichrome Pro + if [ ${Xres} = Auto ] + then + sed -e "/^.*Modes.*$/d" "$TEMPLATES/xorg/xorg.conf.via" > "$XORG_CONF" + else + sed -e "s/^.*Modes.*$/\t Modes \"${Xres}\"/" "$TEMPLATES/xorg/xorg.conf.via" > "$XORG_CONF" + fi + if [ "$TESTMODE" != "test" ] + then + if [ "$OPENCHROME" = "1" ] + then + pacman --noconfirm -R nvidia nvidia-utils > /dev/null 2>&1 + pacman --noconfirm -S libgl unichrome-dri xf86-video-openchrome > /dev/null 2>&1 + else + pacman --noconfirm -R nvidia nvidia-utils > /dev/null 2>&1 + pacman --noconfirm -S libgl unichrome-dri xf86-video-unichrome > /dev/null 2>&1 + fi + fi + # I'm making educated guesses here... + if lspci | grep "VGA" | grep -qi "Unichrome Pro" + then + if [ -f "/usr/lib/libchromeXvMCPro.so.1" ] + then + echo "/usr/lib/libchromeXvMCPro.so.1" > "$XVMC_CONFIG" + else + echo "/usr/lib/libviaXvMCPro.so.1" > "$XVMC_CONFIG" + fi + else + if [ -f "/usr/lib/libchromeXvMC.so.1" ] + then + echo "/usr/lib/libchromeXvMC.so.1" > "$XVMC_CONFIG" + else + echo "/usr/lib/libviaXvMC.so.1" > "$XVMC_CONFIG" + fi + fi + ;; + + Intel|intel) + if [ ${Xres} = Auto ] + then + sed -e "/^.*Modes.*$/d" "$TEMPLATES/xorg/xorg.conf.intel" > "$XORG_CONF" + else + sed -e "s/^.*Modes.*$/\t Modes \"${Xres}\"/" "$TEMPLATES/xorg/xorg.conf.intel" > "$XORG_CONF" + fi + if [ "$TESTMODE" != "test" ] + then + pacman --noconfirm -R nvidia-utils > /dev/null 2>&1 + pacman --noconfirm -S libgl > /dev/null 2>&1 + fi + echo "/usr/lib/libIntelXvMC.so.1" > "$XVMC_CONFIG" + ;; + + vesa|InnoTek) + if [ ${Xres} = Auto ] + then + sed -e "/^.*Modes.*$/d" "$TEMPLATES/xorg/xorg.conf.vesa" > "$XORG_CONF" + else + sed -e "s/^.*Modes.*$/\t Modes \"${Xres}\"/" "$TEMPLATES/xorg/xorg.conf.vesa" > "$XORG_CONF" + fi + ;; + + *) + XCONF=/root/xorg.conf.new + XCONFB=/etc/X11/xorg.conf.install + X -configure + if [ -f "$XCONF" ] + then + echo "Using $XCONF" + if [ ${Xres} = Auto ] + then + grep -v Modes "$XCONF" | sed -e 's/dev\/mouse/dev\/psaux/g'> "$XORG_CONF" + else + grep -v Modes "$XCONF" | sed -e "/Depth.*16/a Modes \"${Xres}\" " -e "/Depth.*24/a Modes \"${Xres}\"" -e 's/dev\/mouse/dev\/psaux/g'> "$XORG_CONF" + fi + elif [ -f "$XCONFB" ] + then + echo "Using $XCONFB" + if [ ${Xres} = Auto ] + then + sed -e "/^.*Modes.*$/d" "$XCONFB" > "$XORG_CONF" + else + sed -e "s/^.*Modes.*$/\t Modes \"${Xres}\"/" "$XCONFB" > "$XORG_CONF" + fi + else + echo "Xorg configuration failed" + fi + rm -f "$XCONF" 2>&1 > /dev/null + ;; + esac + fi + +} + +#MAIN +TESTMODE="$1" +if [ "$TESTMODE" = "test" ] +then + XORG_CONF="/tmp/xorg.conf.test" + XVMC_CONFIG="/tmp/XvMCConfig.test" + XUseAdvanced="1" + XIgnoreConfig="${2}" + Xcardtype="${3}" + XIgnoreEDID="${4}" + Xconnection="${5}" + XHsync="${6}" + XVrefresh="${7}" + Xresadvanced="${8}" + XTVstandard="${9}" + XTVconnection="${10}" + XDisplaysize="${11}" +else + if [ -f /etc/systemconfig ] + then + . /etc/systemconfig + else + Xres="800x600" + fi + CMDLINE=$(cat /proc/cmdline) + echo $CMDLINE | grep -q displayres + if [ $? = 0 ] + then + TEMPVAR=${CMDLINE#*displayres=} + DSR=${TEMPVAR%% *} + fi + if [ ! x$DSR = x ] + then + Xres=$DSR + fi + if [ ! x$DISPLAYRES = x ] + then + Xres=$DISPLAYRES + fi + + XORG_CONF="/etc/X11/xorg.conf" + XVMC_CONFIG="/etc/X11/XvMCConfig" +fi +presetupX -- cgit v0.12 From 68d0bb4bac5f75e27592d7a054c5f66a666108da Mon Sep 17 00:00:00 2001 From: James Meyer Date: Fri, 13 Nov 2009 22:57:18 -0600 Subject: linhes-config-22: remove install-ui.xml file since the MythVangate binary was removed the ui file not longer belongs in the pkg. --- abs/core-testing/LinHES-config-22/PKGBUILD | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/abs/core-testing/LinHES-config-22/PKGBUILD b/abs/core-testing/LinHES-config-22/PKGBUILD index 8bbf862..145a633 100644 --- a/abs/core-testing/LinHES-config-22/PKGBUILD +++ b/abs/core-testing/LinHES-config-22/PKGBUILD @@ -1,6 +1,6 @@ pkgname=LinHES-config-22 pkgver=2.1 -pkgrel=8 +pkgrel=9 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 @@ -13,7 +13,6 @@ source=(mv_install.py mv_config.py myth_user_call file_time_offset.py - install-ui.xml install_proxy.sh install_functions.sh systemconfig.sh @@ -98,6 +97,4 @@ build() { install -m 0755 LinHES-release $startdir/pkg/etc/LinHES-release install -m 0755 issue $startdir/pkg/etc/issue - # copy over the ui files - install -m 0755 install-ui.xml $startdir/pkg/usr/share/mythtv/themes/default/ } -- cgit v0.12 From 7a4c89a2598d1e20eec9c576530a5107ad94ec58 Mon Sep 17 00:00:00 2001 From: James Meyer Date: Fri, 13 Nov 2009 22:58:24 -0600 Subject: mythinstall-22: add install-ui.xml file to pkg --- abs/core-testing/mythinstall-22/PKGBUILD | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/abs/core-testing/mythinstall-22/PKGBUILD b/abs/core-testing/mythinstall-22/PKGBUILD index 89cca2f..ce3e4e4 100644 --- a/abs/core-testing/mythinstall-22/PKGBUILD +++ b/abs/core-testing/mythinstall-22/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Jams pkgname=mythinstall-22 pkgver=2 -pkgrel=1 +pkgrel=6 pkgdesc="LinHES installer/systemconfig GUI." arch=i686 depends=() @@ -13,6 +13,10 @@ build() { # It is assumed that you have built the mythtv package in the same # LinHES-PKGBUILD area. + cd $startdir + ./checkout_MythVantage.sh || exit 1 + cd - + install -D MythVantage-app/mythinstall/install-ui.xml $pkgdir/usr/share/mythtv/themes/default/install-ui.xml MVBINDIR=$startdir/pkg/usr/MythVantage/bin mkdir -p $MVBINDIR install -m 0755 mythinstall.bin $MVBINDIR/MythVantage @@ -20,4 +24,5 @@ build() { ln -s MythVantage mythvantage ln -s MythVantage mythinstall cd - + } -- cgit v0.12 From df0eb5882580e5b5479e81ea51eb81bc2aa2ac6d Mon Sep 17 00:00:00 2001 From: Greg Frost Date: Sun, 22 Nov 2009 17:08:43 +1030 Subject: lirc: send carrier support for lirc_mod_mce --- abs/core-testing/lirc/PKGBUILD | 4 +- abs/core-testing/lirc/lirc_mod_mce.patch | 95 ++++++++++++++++++++++++++++++-- 2 files changed, 93 insertions(+), 6 deletions(-) diff --git a/abs/core-testing/lirc/PKGBUILD b/abs/core-testing/lirc/PKGBUILD index d15cf1d..df8e22a 100644 --- a/abs/core-testing/lirc/PKGBUILD +++ b/abs/core-testing/lirc/PKGBUILD @@ -3,7 +3,7 @@ pkgname=lirc pkgver=0.8.5CVS -pkgrel=15 +pkgrel=16 _kernver=2.6.28-LinHES pkgdesc="Linux Infrared Remote Control kernel modules for stock arch kernel" arch=(i686 x86_64) @@ -79,7 +79,7 @@ md5sums=('b96dae91b566143b3af433fa2714ec9a' '6f151eb4e81fc7776a06c9063e6ad9a5' '7eccd7826ab99e5cf1b9154171c8b927' '21ce358809105f005e888e3b138c59e6' - 'd299b696b007fc9b663a73cc1758a1ef' + '2d64683eba51960a76b80e303df07a5a' 'f059f4030afc682c9539a03bf837c1cf' '4e698654cc44fc6c4163814acda5a7ee' '9a3a6dc03647ee6674a166dfb884ddd6' diff --git a/abs/core-testing/lirc/lirc_mod_mce.patch b/abs/core-testing/lirc/lirc_mod_mce.patch index 314f2d7..2147ec5 100644 --- a/abs/core-testing/lirc/lirc_mod_mce.patch +++ b/abs/core-testing/lirc/lirc_mod_mce.patch @@ -1,6 +1,6 @@ -diff -Naru lirc_mod_mce.orig/lirc_mod_mce.c lirc_mod_mce/lirc_mod_mce.c ---- lirc_mod_mce.orig/lirc_mod_mce.c 2008-04-18 02:12:28.000000000 +0930 -+++ lirc_mod_mce/lirc_mod_mce.c 2009-05-28 07:53:10.000000000 +0930 +diff -Naru lirc_mod_mce/lirc_mod_mce.c lirc_mod_mce_new/lirc_mod_mce.c +--- lirc_mod_mce/lirc_mod_mce.c 2008-04-18 02:12:28.000000000 +0930 ++++ lirc_mod_mce_new/lirc_mod_mce.c 2009-11-22 16:22:41.000000000 +1030 @@ -171,17 +171,76 @@ #define VENDOR_TATUNG 0x1460 #define VENDOR_GATEWAY 0x107b @@ -86,7 +86,94 @@ diff -Naru lirc_mod_mce.orig/lirc_mod_mce.c lirc_mod_mce/lirc_mod_mce.c }; static unsigned char usb_kbd_keycode[256] = { -@@ -1108,7 +1167,7 @@ +@@ -252,6 +311,8 @@ + struct semaphore lock; + char name[NAME_BUFSIZE]; + char phys[NAME_BUFSIZE]; ++ ++ unsigned int carrier_freq; + }; + + /* init strings */ +@@ -889,6 +950,51 @@ + } + } + ++/* Sets the send carrier frequency */ ++static int set_send_carrier(struct irctl *ir, int carrier) ++{ ++ int clk = 10000000; ++ int prescaler = 0, divisor = 0; ++ unsigned char cmdbuf[] = { 0x9F, 0x06, 0x01, 0x80 }; ++ ++ /* Carrier is changed */ ++ if (ir->carrier_freq != carrier) { ++ ++ if (carrier <= 0) { ++ ir->carrier_freq = carrier; ++ dprintk(DRIVER_NAME "[%d]: SET_CARRIER disabling " ++ "carrier modulation\n", ir->devnum); ++ request_packet_async(ir, ir->usb_ep_out, ++ cmdbuf, sizeof(cmdbuf), ++ PHILUSB_OUTBOUND); ++ return carrier; ++ } ++ ++ for (prescaler = 0; prescaler < 4; ++prescaler) { ++ divisor = (clk >> (2 * prescaler)) / carrier; ++ if (divisor <= 0xFF) { ++ ir->carrier_freq = carrier; ++ cmdbuf[2] = prescaler; ++ cmdbuf[3] = divisor; ++ dprintk(DRIVER_NAME "[%d]: SET_CARRIER " ++ "requesting %d Hz\n", ++ ir->devnum, carrier); ++ ++ /* Transmit new carrier to mce device */ ++ request_packet_async(ir, ir->usb_ep_out, ++ cmdbuf, sizeof(cmdbuf), ++ PHILUSB_OUTBOUND); ++ return carrier; ++ } ++ } ++ ++ return -EINVAL; ++ ++ } ++ ++ return carrier; ++} ++ + static int input_open(struct input_dev *id) + { + return 0; +@@ -945,6 +1051,15 @@ + if(lvalue!=(LIRC_MODE_PULSE&LIRC_CAN_SEND_MASK)) return -EINVAL; + break; + ++ case LIRC_SET_SEND_CARRIER: ++ ++ result = get_user(ivalue, (unsigned int *) arg); ++ if (result) ++ return result; ++ ++ set_send_carrier(ir, ivalue); ++ break; ++ + default: + return -ENOIOCTLCMD; + } +@@ -1047,7 +1162,8 @@ + plugin->minor = -1; + plugin->features = LIRC_CAN_SEND_PULSE | + LIRC_CAN_SET_TRANSMITTER_MASK | +- LIRC_CAN_REC_MODE2; ++ LIRC_CAN_REC_MODE2 | ++ LIRC_CAN_SET_SEND_CARRIER; + plugin->data = ir; + plugin->rbuf = rbuf; + plugin->set_use_inc = &set_use_inc; +@@ -1108,7 +1224,7 @@ input_dev->name = ir->name; input_dev->phys = ir->phys; usb_to_input_id(dev, &input_dev->id); -- cgit v0.12 From af23ac920cf8c5b1a1e39b63e18f9232bb4484c3 Mon Sep 17 00:00:00 2001 From: Greg Frost Date: Sun, 22 Nov 2009 17:16:45 +1030 Subject: system-templates: extra streamzap buttons --- abs/core-testing/system-templates/PKGBUILD | 2 +- .../system-templates/templates/remotes/streamzap/lircd.conf.streamzap | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/abs/core-testing/system-templates/PKGBUILD b/abs/core-testing/system-templates/PKGBUILD index 8a4d35e..0dd7fb4 100755 --- a/abs/core-testing/system-templates/PKGBUILD +++ b/abs/core-testing/system-templates/PKGBUILD @@ -1,6 +1,6 @@ pkgname=system-templates pkgver=1.0 -pkgrel=36 +pkgrel=37 conflicts=( ) pkgdesc="Templates used for system configuration" depends=() diff --git a/abs/core-testing/system-templates/templates/remotes/streamzap/lircd.conf.streamzap b/abs/core-testing/system-templates/templates/remotes/streamzap/lircd.conf.streamzap index 8e453b9..36b52fa 100644 --- a/abs/core-testing/system-templates/templates/remotes/streamzap/lircd.conf.streamzap +++ b/abs/core-testing/system-templates/templates/remotes/streamzap/lircd.conf.streamzap @@ -62,6 +62,9 @@ begin remote GREEN 0x21 YELLOW 0x22 BLUE 0x23 + DISP 0x24 + PTZ 0x25 + HELP 0x26 end codes end remote -- cgit v0.12 From 1e4ef029d3646f3e86bc2a725cbed7ac1e3e6613 Mon Sep 17 00:00:00 2001 From: Greg Frost Date: Sun, 22 Nov 2009 19:03:33 +1030 Subject: lirc: lirc_mod_mce fix --- abs/core-testing/lirc/PKGBUILD | 4 ++-- abs/core-testing/lirc/lirc_mod_mce.patch | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/abs/core-testing/lirc/PKGBUILD b/abs/core-testing/lirc/PKGBUILD index df8e22a..12dc3b4 100644 --- a/abs/core-testing/lirc/PKGBUILD +++ b/abs/core-testing/lirc/PKGBUILD @@ -3,7 +3,7 @@ pkgname=lirc pkgver=0.8.5CVS -pkgrel=16 +pkgrel=17 _kernver=2.6.28-LinHES pkgdesc="Linux Infrared Remote Control kernel modules for stock arch kernel" arch=(i686 x86_64) @@ -79,7 +79,7 @@ md5sums=('b96dae91b566143b3af433fa2714ec9a' '6f151eb4e81fc7776a06c9063e6ad9a5' '7eccd7826ab99e5cf1b9154171c8b927' '21ce358809105f005e888e3b138c59e6' - '2d64683eba51960a76b80e303df07a5a' + 'b5d52566a9dae8d76e24e8753f33abef' 'f059f4030afc682c9539a03bf837c1cf' '4e698654cc44fc6c4163814acda5a7ee' '9a3a6dc03647ee6674a166dfb884ddd6' diff --git a/abs/core-testing/lirc/lirc_mod_mce.patch b/abs/core-testing/lirc/lirc_mod_mce.patch index 2147ec5..1dc6644 100644 --- a/abs/core-testing/lirc/lirc_mod_mce.patch +++ b/abs/core-testing/lirc/lirc_mod_mce.patch @@ -1,6 +1,6 @@ diff -Naru lirc_mod_mce/lirc_mod_mce.c lirc_mod_mce_new/lirc_mod_mce.c --- lirc_mod_mce/lirc_mod_mce.c 2008-04-18 02:12:28.000000000 +0930 -+++ lirc_mod_mce_new/lirc_mod_mce.c 2009-11-22 16:22:41.000000000 +1030 ++++ lirc_mod_mce_new/lirc_mod_mce.c 2009-11-22 18:45:24.000000000 +1030 @@ -171,17 +171,76 @@ #define VENDOR_TATUNG 0x1460 #define VENDOR_GATEWAY 0x107b @@ -147,11 +147,14 @@ diff -Naru lirc_mod_mce/lirc_mod_mce.c lirc_mod_mce_new/lirc_mod_mce.c static int input_open(struct input_dev *id) { return 0; -@@ -945,6 +1051,15 @@ +@@ -945,6 +1051,18 @@ if(lvalue!=(LIRC_MODE_PULSE&LIRC_CAN_SEND_MASK)) return -EINVAL; break; + case LIRC_SET_SEND_CARRIER: ++ /* Retrieve lirc_plugin data for the device */ ++ ir=lirc_get_pdata(filep); ++ if (!ir && !ir->usb_ep_out) return -EFAULT; + + result = get_user(ivalue, (unsigned int *) arg); + if (result) @@ -163,7 +166,7 @@ diff -Naru lirc_mod_mce/lirc_mod_mce.c lirc_mod_mce_new/lirc_mod_mce.c default: return -ENOIOCTLCMD; } -@@ -1047,7 +1162,8 @@ +@@ -1047,7 +1165,8 @@ plugin->minor = -1; plugin->features = LIRC_CAN_SEND_PULSE | LIRC_CAN_SET_TRANSMITTER_MASK | @@ -173,7 +176,7 @@ diff -Naru lirc_mod_mce/lirc_mod_mce.c lirc_mod_mce_new/lirc_mod_mce.c plugin->data = ir; plugin->rbuf = rbuf; plugin->set_use_inc = &set_use_inc; -@@ -1108,7 +1224,7 @@ +@@ -1108,7 +1227,7 @@ input_dev->name = ir->name; input_dev->phys = ir->phys; usb_to_input_id(dev, &input_dev->id); -- cgit v0.12