- AC_INIT(enigma2,2.4)
- AM_INIT_AUTOMAKE(enigma2,2.4)
+ AC_INIT([enigma2],[2.8.0],[enigma2-devel@lists.elitedvb.net])
+ AM_INIT_AUTOMAKE([dist-bzip2 no-define tar-pax -Wno-portability])
+ AC_CONFIG_HEADERS([enigma2_config.h])
- TUXBOX_APPS
- TUXBOX_APPS_DIRECTORY
+ # Silent rules are available since 1.11, but older versions
+ # are still in use. So don't use them unconditionally.
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+ AC_USE_SYSTEM_EXTENSIONS
+ AC_SYS_LARGEFILE
AC_PROG_CC
AC_PROG_CXX
- AC_PROG_RANLIB
+ m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL])
+ AC_CONFIG_MACRO_DIR([m4])
- AC_ARG_WITH(libsdl,
- AC_HELP_STRING([--with-libsdl], [use sdl, yes or no]),
- [[withsdl=$withval]],
- [[withsdl=yes]]
- )
-
- AC_CHECK_HEADER(dreamdvd/ddvdlib.h,have_ddvdlib="yes",have_ddvdlib="no")
- if test x"${have_ddvdlib}" = xyes ; then
- AC_DEFINE(HAVE_DDVDLIB, 1,[Define if ddvdlib is available])
- else
- AC_MSG_NOTICE([ddvdlib not found... dont build dvd plugin])
+ AC_CHECK_HEADERS([dbox/fp.h dbox/lcd-ks0713.h])
+
+ AC_PATH_PROG(MSGFMT,[msgfmt])
+ AC_PATH_PROG(MSGINIT,[msginit])
+ AC_PATH_PROG(MSGMERGE,[msgmerge])
+ AC_PATH_PROG(MSGUNIQ,[msguniq])
+ AC_PATH_PROG(XGETTEXT,[xgettext])
+ if test -z "$MSGFMT" -o -z "$MSGINIT" -o -z "$MSGMERGE" -o -z "$MSGUNIQ" -o -z "$XGETTEXT"; then
+ AC_MSG_ERROR([Could not find required gettext tools])
fi
- AM_CONDITIONAL(HAVE_DDVDLIB, test "$have_ddvdlib" = "yes")
- AM_PATH_PYTHON()
- AC_PYTHON_DEVEL
- #AM_PATH_XINE(1.1.0,, AC_MSG_ERROR([*** Please install xine-lib (devel) first ***]))
+ AM_PATH_PYTHON
+ AX_PYTHON_DEVEL
+ AX_PKG_SWIG
+ AX_SWIG_ENABLE_CXX
+ AX_SWIG_PYTHON
+ AX_PTHREAD
TUXBOX_APPS_DVB
- _TUXBOX_APPS_LIB_PKGCONFIG_OPTIONAL(FREETYPE, freetype2, HAVE_FREETYPE2)
- if test "$HAVE_FREETYPE2" = "no" ; then
- TUXBOX_APPS_LIB_CONFIG(FREETYPE, freetype-config)
+ AM_CONDITIONAL(HAVE_GIT_DIR, test -d "$srcdir/.git")
+ AM_CONDITIONAL(HAVE_FAKE_GIT_DIR, test -f "$srcdir/.git/last_commit_info")
+
+ PKG_CHECK_MODULES(BASE, [freetype2 fribidi gstreamer-0.10 gstreamer-pbutils-0.10 libdvbsi++ libpng libxml-2.0 sigc++-1.2])
+ PKG_CHECK_MODULES(LIBDDVD, libdreamdvd, HAVE_LIBDDVD="yes", HAVE_LIBDDVD="no")
+ AM_CONDITIONAL(HAVE_LIBDDVD, test "$HAVE_LIBDDVD" = "yes")
+
+ AC_CHECK_LIB([dl], [dlopen], [LIBDL_LIBS="-ldl"], [AC_MSG_ERROR([Could not find libdl])])
+ AC_SUBST(LIBDL_LIBS)
+ AC_CHECK_LIB([jpeg], [jpeg_set_defaults], [LIBJPEG_LIBS="-ljpeg"], [AC_MSG_ERROR([Could not find libjpeg])])
+ AC_SUBST(LIBJPEG_LIBS)
+ AC_CHECK_LIB([ungif], [DGifOpen], [LIBGIF_LIBS="-lungif"], [AC_CHECK_LIB([gif], [DGifOpen], [LIBGIF_LIBS="-lgif"], [AC_MSG_ERROR([Could not find libgif or libungif])])])
+ AC_SUBST(LIBGIF_LIBS)
+
+ AC_LANG_PUSH([C++])
+ AC_CHECK_LIB([xmlccwrap], [exit], [LIBXMLCCWRAP_LIBS="-lxmlccwrap"], [AC_MSG_ERROR([Could not find libxmlccwrap])])
+ AC_SUBST(LIBXMLCCWRAP_LIBS)
+ AC_LANG_POP
+
+ AC_ARG_WITH(libsdl,
+ AS_HELP_STRING([--with-libsdl],[use libsdl, yes or no]),
+ [with_libsdl=$withval],[with_libsdl=no])
+ if test "$with_libsdl" = "yes"; then
+ PKG_CHECK_MODULES(LIBSDL, sdl)
fi
- TUXBOX_APPS_LIB_PKGCONFIG(FRIBIDI,fribidi)
- TUXBOX_APPS_LIB_PKGCONFIG(ID3TAG,id3tag)
- TUXBOX_APPS_LIB_PKGCONFIG(MAD,mad)
- #TUXBOX_APPS_LIB_PKGCONFIG(PLUGINS,tuxbox-plugins)
- TUXBOX_APPS_LIB_PKGCONFIG(PNG,libpng)
- TUXBOX_APPS_LIB_PKGCONFIG(SIGC,sigc++-1.2)
- TUXBOX_APPS_LIB_PKGCONFIG(DVBSI,libdvbsi++)
- _TUXBOX_APPS_LIB_PKGCONFIG_OPTIONAL(GSTREAMER,gstreamer,HAVE_GSTREAMER)
- _TUXBOX_APPS_LIB_PKGCONFIG_OPTIONAL(GSTREAMERPBUTILS,gstreamer-pbutils,HAVE_GSTSTREAMERPBUTILS)
- _TUXBOX_APPS_LIB_PKGCONFIG_OPTIONAL(LIBXINE,libxine,HAVE_LIBXINE)
- AC_CHECK_LIB(jpeg, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
- JPEG_LIBS="-ljpeg"
- AC_SUBST(JPEG_LIBS)
-
- AC_SUBST(LIBUNGIF_LIBS,"")
- AC_CHECK_HEADERS(gif_lib.h,
- AC_CHECK_LIB(ungif,DGifOpen,
- [AC_DEFINE(HAVE_LIBUNGIF,1,[Define if you have libgif/libungif including devel headers])
- LIBUNGIF_LIBS="-lungif"],
- [AC_CHECK_LIB(gif,DGifOpen,
- [AC_DEFINE(HAVE_LIUNBGIF,1)
- LIBUNGIF_LIBS="-lgif"])]))
-
- TUXBOX_APPS_LIB_PKGCONFIG(XML2,libxml-2.0)
-
- # ok, we are in trouble: XMLCCWRAP only defines C++ symbols. So let's just check if linking works,
- # and assume everything will be ok. Then just check for the "exit" symbol, which should be always there.
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- TUXBOX_APPS_LIB_SYMBOL(XMLCCWRAP, xmlccwrap, exit)
- AC_LANG_RESTORE
-
- if test "$withsdl" = "yes" ; then
- _TUXBOX_APPS_LIB_PKGCONFIG_OPTIONAL(SDL,sdl,WITH_SDL)
- if test "$WITH_SDL" = "no" ; then
- TUXBOX_APPS_LIB_CONFIG(SDL,sdl-config)
- AC_DEFINE_UNQUOTED([WITH_SDL],[$withsdl],[With SDL])
- fi
+ AM_CONDITIONAL(HAVE_LIBSDL, test "$with_libsdl" = "yes")
+
+ AC_ARG_WITH(libxine,
+ AS_HELP_STRING([--with-libxine],[use libxine, yes or no]),
+ [with_libxine=$withval],[with_libxine=no])
+ if test "$with_libxine" = "yes"; then
+ PKG_CHECK_MODULES(LIBXINE, libxine)
+ AC_DEFINE([WITH_XINE],[1],[Define to 1 if you have libxine])
fi
- # allow 'if WITH_SDL' conditionals in Makefile.am
- AM_CONDITIONAL(WITH_SDL, test "$WITH_SDL" = "yes")
+ AM_CONDITIONAL(HAVE_LIBXINE, test "$with_libxine" = "yes")
- CPPFLAGS="$CPPFLAGS "'-I$(top_srcdir)'
- CPPFLAGS="$CPPFLAGS -D_REENTRANT $PYTHON_CPPFLAGS $MD5SUM_CFLAGS $FREETYPE_CFLAGS $FRIBIDI_CFLAGS $ID3TAG_CFLAGS $MAD_CFLAGS $PLUGINS_CFLAGS $PNG_CFLAGS $SDL_CFLAGS $SIGC_CFLAGS $XMLTREE_CFLAGS $DVBSI_CFLAGS $GSTREAMER_CFLAGS $GSTREAMERPBUTILS_CFLAGS $LIBXINE_CFLAGS $LIBUNGIF_CFLAGS"
- #CPPFLAGS="$CPPFLAGS -DMEMLEAK_CHECK"
- CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions -Wall"
- LDFLAGS="$LDFLAGS -pthread $PYTHON_LDFLAGS $SDL_LDFLAGS $GSTREAMER_LDFLAGS $GSTREAMERPBUTILS_LDFLAGS $LIBXINE_LDFLAGS $LIBUNGIF_LDFLAGS"
- #LDFLAGS="-rdynamic $LDFLAGS"
+ AC_ARG_WITH(debug,
+ AS_HELP_STRING([--without-debug],[disable debugging code]),
+ [with_debug="$withval"],[with_debug="yes"])
+ if test "$with_debug" = "yes"; then
+ DEBUG_CFLAGS="-ggdb3"
+ AC_DEFINE([DEBUG],[1],[Define to 1 to enable debugging code])
+ fi
- TUXBOX_APPS_GETTEXT
+ AC_ARG_WITH(memcheck,
+ AS_HELP_STRING([--with-memcheck],[enable memory leak checks]),
+ [with_memcheck="$withval"],[with_memcheck="no"])
+ if test "$with_memcheck" = "yes"; then
+ AC_DEFINE([MEMLEAK_CHECK],[1],[Define to 1 to enable memory leak checks])
+ fi
- AC_OUTPUT([
+ AC_ARG_WITH(po,
+ AS_HELP_STRING([--with-po],[enable updating of po files]),
+ [with_po="$withval"],[with_po="no"])
+ AM_CONDITIONAL(UPDATE_PO, test "$with_po" = "yes")
+
+ CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS"
+ CXXFLAGS="$CXXFLAGS $BASE_CFLAGS $PTHREAD_CFLAGS $DEBUG_CFLAGS -fno-rtti -fno-exceptions -Wall"
+
+ AC_CONFIG_FILES([
Makefile
data/Makefile
data/fonts/Makefile
data/defaults/Dream/hdbouquets/Makefile
data/defaults/Dream/sdbouquets/Makefile
data/extensions/Makefile
+ data/keymaps/Makefile
data/skin_default/Makefile
data/skin_default/menu/Makefile
data/skin_default/icons/Makefile
lib/Makefile
lib/actions/Makefile
lib/base/Makefile
+ lib/base/eenv.cpp
lib/driver/Makefile
lib/dvb/Makefile
lib/dvb/lowlevel/Makefile
lib/python/Plugins/SystemPlugins/Videomode/meta/Makefile
lib/python/Plugins/SystemPlugins/WirelessLan/Makefile
lib/python/Plugins/SystemPlugins/WirelessLan/meta/Makefile
+lib/python/Plugins/SystemPlugins/FactoryTest/Makefile
+lib/python/Plugins/SystemPlugins/Fancontrol/Makefile
+lib/python/Plugins/SystemPlugins/Fancontrol/meta/Makefile
lib/python/Tools/Makefile
lib/service/Makefile
lib/components/Makefile
po/Makefile
main/Makefile
tools/Makefile
+ tools/enigma2.sh
enigma2.pc
])
-
- #lib/python/Plugins/Extensions/SimpleRSS/Makefile
- #lib/python/Plugins/Extensions/FileManager/Makefile
+ AC_OUTPUT
<item level="0" text="Aspect Ratio">config.av.aspectratio</item>
<item level="0" text="TV System">config.av.tvsystem</item>
<item level="1" text="WSS on 4:3">config.av.wss</item>
- <item level="1" text="AC3 default">config.av.defaultac3</item>
- <item level="1" text="General AC3 delay (ms)">config.av.generalAC3delay</item>
+ <item level="1" text="Dolby Digital default">config.av.defaultac3</item>
+ <item level="1" text="General Dolby Digital delay (ms)">config.av.generalAC3delay</item>
<item level="1" text="General PCM delay (ms)">config.av.generalPCMdelay</item>
- <item level="1" text="AC3 downmix" requires="CanDownmixAC3">config.av.downmix_ac3</item>
+ <item level="1" text="Dolby Digital downmix" requires="CanDownmixAC3">config.av.downmix_ac3</item>
<item level="1" text="Auto scart switching" requires="ScartSwitch">config.av.vcrswitch</item>
</setup>
<setup key="usage" title="Customize">
<item level="2" text="Fast Forward speeds">config.seek.speeds_forward</item>
<item level="2" text="Rewind speeds">config.seek.speeds_backward</item>
<item level="2" text="Slow Motion speeds">config.seek.speeds_slowmotion</item>
- <!-- TRANSLATORS: Note that "Enter" in the two strings below should *not*
- be interpreted as "Give speed as input". The intended meaning is
- instead "Initial speed when starting winding", i.e. the speed at
- which "winding mode" is entered when first pressing "rewind" or
- "fast forward". -->
- <item level="2" text="Enter Fast Forward at speed">config.seek.enter_forward</item>
- <item level="2" text="Enter Rewind at speed">config.seek.enter_backward</item>
- <!-- TRANSLATORS: The effect of "Non-smooth winding" is that rather
- than using ordinary "continuous" or "smooth" winding, a fast
- sequence of stills is shown when winding at high speeds. This
- makes it much easier too follow when almost each frame comes from
- a new scene. The effect is achieved by repeating each shown frame
- a couple of times. The settings control both at which speed this
- winding mode sets in, and how many times each frame should be
- repeated. This was previously called "Discontinuous playback"
- which was incomprehensible. "Non-smooth winding" may be a better
- term, but note that there is nothing irregular about it. Synonyms
- better suited for translation to other languages may be "stepwise
- winding/playback", or "winding/playback using stills". -->
- <item level="2" text="Use non-smooth winding at speeds above">config.seek.stepwise_minspeed</item>
- <item level="2" text="Frame repeat count during non-smooth winding">config.seek.stepwise_repeat</item>
+ <!-- TRANSLATORS: The following is the speed you get on the first press on fast-forward.
+ It was previously called "enter fast forward at speed" which was easily misunderstood. -->
+ <item level="2" text="Initial Fast Forward speed">config.seek.enter_forward</item>
+ <item level="2" text="Initial Rewind speed">config.seek.enter_backward</item>
<item level="2" text="Behavior of 'pause' when paused">config.seek.on_pause</item>
<item level="2" text="Behavior of 0 key in PiP-mode">config.usage.pip_zero_button</item>
<item level="2" text="Alternative services tuner priority">config.usage.alternatives_priority</item>
<pixmap pos="bpBottomRight" filename="skin_default/b_br.png" />
</borderset>
</windowstyle>
- <!-- Main screen colors (id=1 LCD) -->
- <windowstyle type="skinned" id="1">
- <color name="Background" color="#000000" />
- <color name="LabelForeground" color="#ffffff" />
- <color name="ListboxBackground" color="#000000" />
- <color name="ListboxForeground" color="#ffffff" />
- <color name="ListboxSelectedBackground" color="#000000" />
- <color name="ListboxSelectedForeground" color="#ffffff" />
- <color name="ListboxMarkedBackground" color="#000000" />
- <color name="ListboxMarkedForeground" color="#ffffff" />
- <color name="ListboxMarkedAndSelectedBackground" color="#000000" />
- <color name="ListboxMarkedAndSelectedForeground" color="#ffffff" />
- <color name="WindowTitleForeground" color="#ffffff" />
- <color name="WindowTitleBackground" color="#000000" />
- </windowstyle>
- <windowstyle type="skinned" id="2">
- <color name="Background" color="#000000" />
- <color name="LabelForeground" color="#ffffff" />
- <color name="ListboxBackground" color="#000000" />
- <color name="ListboxForeground" color="#ffffff" />
- <color name="ListboxSelectedBackground" color="#000000" />
- <color name="ListboxSelectedForeground" color="#ffffff" />
- <color name="ListboxMarkedBackground" color="#000000" />
- <color name="ListboxMarkedForeground" color="#ffffff" />
- <color name="ListboxMarkedAndSelectedBackground" color="#000000" />
- <color name="ListboxMarkedAndSelectedForeground" color="#ffffff" />
- <color name="WindowTitleForeground" color="#ffffff" />
- <color name="WindowTitleBackground" color="#000000" />
- </windowstyle>
<!-- Fonts -->
<fonts>
<!-- <font filename="md_khmurabi_10.ttf" name="Regular" scale="90" /> -->
<convert type="ConditionalShowHide" />
</widget>
<!-- Crypt icon (encrypted service?) -->
- <ePixmap position="563,48" zPosition="0" size="107,15" pixmap="skin_default/icons/icons_off.png" />
+ <!-- ikseong
+ <ePixmap position="563,48" zPosition="0" size="107,15" pixmap="skin_default/icons/icons_off.png" /> -->
+ <ePixmap position="563,48" zPosition="0" size="80,15" pixmap="skin_default/icons/icons_off.png" />
<widget source="session.CurrentService" render="Pixmap" pixmap="skin_default/icons/icon_crypt.png" position="563,48" zPosition="1" size="12,16" alphatest="on">
<convert type="ServiceInfo">IsCrypted</convert>
<convert type="ConditionalShowHide" />
<convert type="ConditionalShowHide" />
</widget>
<!-- Audio icon (is there multichannel audio?) -->
+<!-- ikseong
<widget source="session.CurrentService" render="Pixmap" pixmap="skin_default/icons/icon_dolby.png" position="645,48" zPosition="1" size="26,16" alphatest="on">
<convert type="ServiceInfo">IsMultichannel</convert>
<convert type="ConditionalShowHide" />
- </widget>
+ </widget> -->
<!-- Progressbar (current event duration)-->
<ePixmap pixmap="skin_default/progress_bg.png" position="48,77" size="84,7" transparent="1" alphatest="on" />
<widget source="session.Event_Now" render="Progress" pixmap="skin_default/progress_small.png" position="50,78" zPosition="1" size="80,5" transparent="1">
- INCLUDES = \
- -I$(top_srcdir)/include
+ AM_CPPFLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/include \
+ -include Python.h \
+ -include $(top_builddir)/enigma2_config.h
+
+ AM_CXXFLAGS = \
+ $(LIBSDL_CFLAGS)
noinst_LIBRARIES = libenigma_driver.a
libenigma_driver_a_SOURCES = \
- rc.cpp rcinput.cpp rcconsole.cpp avswitch.cpp rfmod.cpp etimezone.cpp misc_options.cpp memtest.cpp sc_test.cpp
+ avswitch.cpp \
+ etimezone.cpp \
+ misc_options.cpp \
+ rc.cpp \
+ rcconsole.cpp \
+ rcinput.cpp \
- rfmod.cpp
++ rfmod.cpp \
++ memtest.cpp \
++ sc_test.cpp
+
+ driverincludedir = $(pkgincludedir)/lib/driver
+ driverinclude_HEADERS = \
+ avswitch.h \
+ etimezone.h \
+ input_fake.h \
+ misc_options.h \
+ rc.h \
+ rcconsole.h \
+ rcdbox.h \
+ rcdreambox2.h \
+ rcinput.h \
+ rfmod.h
+
+ if HAVE_LIBSDL
+ libenigma_driver_a_SOURCES += \
+ rcsdl.cpp \
+ rcsdl.h
+ endif
}
} else if (state == iDVBFrontend::stateFailed)
{
+#ifdef BUILD_VUPLUS /* ikseong */
+ if (m_current_frontend_parameters)
+ {
+ eDebug("OURSTATE: lost lock, trying to retune");
+ ourstate = state_tuning;
+ m_frontend->get().tune(*m_current_frontend_parameters);
+ }
+ else
+ {
+ eDebug("OURSTATE: failed");
+ ourstate = state_failed;
+ }
+#else
eDebug("OURSTATE: failed");
ourstate = state_failed;
+#endif
} else
eFatal("state unknown");
RESULT eDVBChannel::playFile(const char *file)
{
+ eRawFile *f = new eRawFile();
+ ePtr<iTsSource> source = f;
+
+ if (f->open(file) < 0)
+ {
+ eDebug("can't open PVR file %s (%m)", file);
+ return -ENOENT;
+ }
+
+ return playSource(source, file);
+ }
+
+ RESULT eDVBChannel::playSource(ePtr<iTsSource> &source, const char *streaminfo_file)
+ {
ASSERT(!m_frontend);
if (m_pvr_thread)
{
m_pvr_thread = 0;
}
- m_tstools.openFile(file);
+ if (!source->valid())
+ {
+ eDebug("PVR source is not valid!");
+ return -ENOENT;
+ }
+
+ m_tstools.setSource(source, streaminfo_file);
/* DON'T EVEN THINK ABOUT FIXING THIS. FIX THE ATI SOURCES FIRST,
THEN DO A REAL FIX HERE! */
m_event(this, evtPreStart);
- if (m_pvr_thread->start(file, m_pvr_fd_dst))
- {
- delete m_pvr_thread;
- m_pvr_thread = 0;
- ::close(m_pvr_fd_dst);
- m_pvr_fd_dst = -1;
- eDebug("can't open PVR file %s (%m)", file);
- return -ENOENT;
- }
+ m_pvr_thread->start(source, m_pvr_fd_dst);
CONNECT(m_pvr_thread->m_event, eDVBChannel::pvrEvent);
m_state = state_ok;
return 0;
}
- void eDVBChannel::stopFile()
+ void eDVBChannel::stopSource()
{
if (m_pvr_thread)
{
}
if (m_pvr_fd_dst >= 0)
::close(m_pvr_fd_dst);
+ ePtr<iTsSource> d;
+ m_tstools.setSource(d);
+ }
+
+ void eDVBChannel::stopFile()
+ {
+ stopSource();
}
void eDVBChannel::setCueSheet(eCueSheet *cuesheet)
openFrontend();
}
+#ifdef BUILD_VUPLUS /* ikseong */
+int frontend0_fd;
+int frontend1_fd;
+#endif
+
int eDVBFrontend::openFrontend()
{
if (m_state != stateClosed)
eWarning("failed! (%s) %m", m_filename);
return -1;
}
+#ifdef BUILD_VUPLUS /* ikseong */
+ else
+ {
+ if (m_dvbid==0)
+ frontend0_fd = m_fd;
+ else if (m_dvbid==1)
+ frontend1_fd = m_fd;
+ }
+#endif
}
}
else
m_tuning = 0;
if (m_state == stateTuning)
{
+#ifdef BUILD_VUPLUS /* ikseong */
+ eDVBFrontend *sec_fe = this;
+ sec_fe->m_data[CSW] = sec_fe->m_data[UCSW] = sec_fe->m_data[TONEBURST] = -1; // reset diseqc
+#endif
m_state = stateFailed;
m_stateChanged(this);
}
return -EINVAL;
}
#if HAVE_DVB_API_VERSION < 5
- parm_inversion |= (feparm.rolloff << 2); // Hack.. we use bit 2..3 of inversion param for rolloff
- parm_inversion |= (feparm.pilot << 4); // Hack.. we use bit 4..5 of inversion param for pilot
+ parm_inversion = (fe_spectral_inversion_t)((feparm.rolloff << 2) | parm_inversion); // Hack.. we use bit 2..3 of inversion param for rolloff
+ parm_inversion = (fe_spectral_inversion_t)((feparm.pilot << 4) | parm_inversion); // Hack.. we use bit 4..5 of inversion param for pilot
if (feparm.modulation == eDVBFrontendParametersSatellite::Modulation_8PSK)
{
parm_u_qpsk_fec_inner = (fe_code_rate_t)((int)parm_u_qpsk_fec_inner+9);
instance=0;
}
- void gLCDDC::exec(gOpcode *o)
+ void gLCDDC::exec(const gOpcode *o)
{
switch (o->opcode)
{
case gOpcode::flush:
// if (update)
+#ifndef BUILD_VUPLUS /* ikseong */
lcd->update();
+#else
+ ;
+#endif
default:
gDC::exec(o);
break;
#include <fcntl.h>
#include <sys/ioctl.h>
+ #if defined(HAVE_DBOX_FP_H) && defined(HAVE_DBOX_LCD_KS0713_H)
#include <dbox/fp.h>
#include <dbox/lcd-ks0713.h>
+ #else
+ #define NO_LCD 1
+ #endif
#include <lib/gdi/esize.h>
#include <lib/base/init.h>
eDebug("found OLED display!");
is_oled = 1;
}
- #else
- lcdfd = -1;
- #endif
- instance=this;
if (lcdfd<0)
eDebug("couldn't open LCD - load lcd.o!");
is_oled = 3;
}
}
+ #endif
+ instance=this;
+
setSize(xres, yres, bpp);
}
int eDBoxLCD::setLCDContrast(int contrast)
{
+ #ifndef NO_LCD
int fp;
if((fp=open("/dev/dbox/fp0", O_RDWR))<=0)
{
eDebug("[LCD] can't set lcd contrast");
}
close(fp);
+ #endif
return(0);
}
int eDBoxLCD::setLCDBrightness(int brightness)
{
+ #ifndef NO_LCD
eDebug("setLCDBrightness %d", brightness);
FILE *f=fopen("/proc/stb/lcd/oled_brightness", "w");
if (!f)
eDebug("[LCD] can't set lcd brightness (%m)");
close(fp);
}
+ #endif
return(0);
}
void eDBoxLCD::update()
{
+#ifdef BUILD_VUPLUS /* ikseong */
+ return ;
+#endif
if (lcdfd >= 0)
{
if (!is_oled || is_oled == 2)
from os import system, listdir, statvfs, popen, makedirs, stat, major, minor, path, access
-from Tools.Directories import SCOPE_HDD, resolveFilename
+# ikseong
+from Tools.Directories import SCOPE_HDD, resolveFilename, fileExists
+
from Tools.CList import CList
from SystemInfo import SystemInfo
import time
from Components.Console import Console
+ def MajorMinor(path):
+ rdev = stat(path).st_rdev
+ return (major(rdev),minor(rdev))
+
def readFile(filename):
file = open(filename)
data = file.read().strip()
file.close()
return data
- class Harddisk:
- DEVTYPE_UDEV = 0
- DEVTYPE_DEVFS = 1
+ DEVTYPE_UDEV = 0
+ DEVTYPE_DEVFS = 1
+ class Harddisk:
def __init__(self, device):
self.device = device
if access("/dev/.udev", 0):
- self.type = self.DEVTYPE_UDEV
+ self.type = DEVTYPE_UDEV
elif access("/dev/.devfsd", 0):
- self.type = self.DEVTYPE_DEVFS
+ self.type = DEVTYPE_DEVFS
else:
print "Unable to determine structure of /dev"
self.disk_path = ''
self.phys_path = path.realpath(self.sysfsPath('device'))
- if self.type == self.DEVTYPE_UDEV:
+ if self.type == DEVTYPE_UDEV:
self.dev_path = '/dev/' + self.device
self.disk_path = self.dev_path
- elif self.type == self.DEVTYPE_DEVFS:
+ elif self.type == DEVTYPE_DEVFS:
tmp = readFile(self.sysfsPath('dev')).split(':')
s_major = int(tmp[0])
s_minor = int(tmp[1])
return self.device < ob.device
def partitionPath(self, n):
- if self.type == self.DEVTYPE_UDEV:
+ if self.type == DEVTYPE_UDEV:
return self.dev_path + n
- elif self.type == self.DEVTYPE_DEVFS:
+ elif self.type == DEVTYPE_DEVFS:
return self.dev_path + '/part' + n
def sysfsPath(self, filename):
def bus(self):
# CF (7025 specific)
- if self.type == self.DEVTYPE_UDEV:
+ if self.type == DEVTYPE_UDEV:
ide_cf = False # FIXME
- elif self.type == self.DEVTYPE_DEVFS:
+ elif self.type == DEVTYPE_DEVFS:
ide_cf = self.device[:2] == "hd" and "host0" not in self.dev_path
internal = "pci" in self.phys_path
return ret
def diskSize(self):
- line = readFile(self.sysfsPath('size'))
+ # ikseong
+ try:
+ line = readFile(self.sysfsPath('size'))
+ except:
+ harddiskmanager.removeHotplugPartition(self.device)
+ print "error remove",self.device
+ return -1
try:
cap = int(line)
except:
return "%d.%03d GB" % (cap/1000, cap%1000)
def model(self):
- if self.device[:2] == "hd":
- return readFile('/proc/ide/' + self.device + '/model')
- elif self.device[:2] == "sd":
- vendor = readFile(self.sysfsPath('device/vendor'))
- model = readFile(self.sysfsPath('device/model'))
- return vendor + '(' + model + ')'
- else:
- assert False, "no hdX or sdX"
+ # ikseong
+ try:
+ if self.device[:2] == "hd":
+ return readFile('/proc/ide/' + self.device + '/model')
+ elif self.device[:2] == "sd":
+ vendor = readFile(self.sysfsPath('device/vendor'))
+ model = readFile(self.sysfsPath('device/model'))
+ return vendor + '(' + model + ')'
+ else:
+ assert False, "no hdX or sdX"
+ except:
+ harddiskmanager.removeHotplugPartition(self.device)
+ print "error remove",self.device
+ return -1
def free(self):
try:
for line in lines:
parts = line.strip().split(" ")
- if path.realpath(parts[0]).startswith(self.dev_path):
- try:
+ real_path = path.realpath(parts[0])
+ if not real_path[-1].isdigit():
+ continue
+ try:
+ if MajorMinor(real_path) == MajorMinor(self.partitionPath(real_path[-1])):
stat = statvfs(parts[1])
- except OSError:
- continue
- return stat.f_bfree/1000 * stat.f_bsize/1000
-
+ return stat.f_bfree/1000 * stat.f_bsize/1000
+ except OSError:
+ pass
return -1
def numPartitions(self):
numPart = -1
- if self.type == self.DEVTYPE_UDEV:
+ if self.type == DEVTYPE_UDEV:
try:
devdir = listdir('/dev')
except OSError:
if filename.startswith(self.device):
numPart += 1
- elif self.type == self.DEVTYPE_DEVFS:
+ elif self.type == DEVTYPE_DEVFS:
try:
idedir = listdir(self.dev_path)
except OSError:
cmd = "umount"
- for line in lines:
- parts = line.strip().split(" ")
- if path.realpath(parts[0]).startswith(self.dev_path):
- cmd = ' ' . join([cmd, parts[1]])
+ for line in lines:
+ parts = line.strip().split(" ")
+ real_path = path.realpath(parts[0])
+ if not real_path[-1].isdigit():
+ continue
+ try:
+ if MajorMinor(real_path) == MajorMinor(self.partitionPath(real_path[-1])):
+ cmd = ' ' . join([cmd, parts[1]])
+ break
+ except OSError:
+ pass
res = system(cmd)
return (res >> 8)
res = -1
for line in lines:
parts = line.strip().split(" ")
- if path.realpath(parts[0]) == self.partitionPath("1"):
- cmd = "mount -t ext3 " + parts[0]
- res = system(cmd)
- break
+ real_path = path.realpath(parts[0])
+ if not real_path[-1].isdigit():
+ continue
+ try:
+ if MajorMinor(real_path) == MajorMinor(self.partitionPath(real_path[-1])):
+ cmd = "mount -t ext3 " + parts[0]
+ res = system(cmd)
+ break
+ except OSError:
+ pass
return (res >> 8)
def createMovieFolder(self):
+# ikseong
try:
+ if not fileExists("/hdd", 0):
+ print "not found /hdd"
+ system("ln -s /media/hdd /hdd")
+#
makedirs(resolveFilename(SCOPE_HDD))
except OSError:
return -1
idle_time = t - self.last_access
stats = self.readStats()
+ # ikseong
+ if stats == -1:
+ self.setIdleTime(0)
+ return
print "nr_read", stats[0], "nr_write", stats[1]
l = sum(stats)
print "sum", l, "prev_sum", self.last_stat
return True
return False
- DEVICEDB = \
+ DEVICEDB_SR = \
{"dm8000":
{
- # dm8000:
- "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.1/1-1.1:1.0": "Front USB Slot",
- "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.2/1-1.2:1.0": "Back, upper USB Slot",
- "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.3/1-1.3:1.0": "Back, lower USB Slot",
- "/devices/platform/brcm-ehci-1.1/usb2/2-1/2-1:1.0/host1/target1:0:0/1:0:0:0": "DVD Drive",
+ "/devices/pci0000:01/0000:01:00.0/host0/target0:0:0/0:0:0:0": _("DVD Drive"),
+ "/devices/pci0000:01/0000:01:00.0/host1/target1:0:0/1:0:0:0": _("DVD Drive"),
+ "/devices/platform/brcm-ehci-1.1/usb2/2-1/2-1:1.0/host3/target3:0:0/3:0:0:0": _("DVD Drive"),
+ },
+ "dm800":
+ {
+ },
+ "dm7025":
+ {
+ }
+ }
+
+ DEVICEDB = \
+ {"dm8000":
+ {
+ "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.1/1-1.1:1.0": _("Front USB Slot"),
+ "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.2/1-1.2:1.0": _("Back, upper USB Slot"),
+ "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.3/1-1.3:1.0": _("Back, lower USB Slot"),
+ "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.1/1-1.1:1.0": _("Front USB Slot"),
+ "/devices/platform/brcm-ehci-1.1/usb2/2-1/2-1:1.0/": _("Internal USB Slot"),
+ "/devices/platform/brcm-ohci-1.1/usb4/4-1/4-1:1.0/": _("Internal USB Slot"),
},
"dm800":
{
- # dm800:
"/devices/platform/brcm-ehci.0/usb1/1-2/1-2:1.0": "Upper USB Slot",
"/devices/platform/brcm-ehci.0/usb1/1-1/1-1:1.0": "Lower USB Slot",
},
"dm7025":
{
- # dm7025:
"/devices/pci0000:00/0000:00:14.1/ide1/1.0": "CF Card Slot", #hdc
"/devices/pci0000:00/0000:00:14.1/ide0/0.0": "Internal Harddisk"
}
self.hdd = [ ]
self.cd = ""
self.partitions = [ ]
+ self.devices_scanned_on_init = [ ]
self.on_partition_list_change = CList()
def enumerateBlockDevices(self):
print "enumerating block devices..."
for blockdev in listdir("/sys/block"):
- error, blacklisted, removable, is_cdrom, partitions, medium_found = self.getBlockDevInfo(blockdev)
- print "found block device '%s':" % blockdev,
- if error:
- print "error querying properties"
- elif blacklisted:
- print "blacklisted"
- elif not medium_found:
- print "no medium"
- else:
- print "ok, removable=%s, cdrom=%s, partitions=%s, device=%s" % (removable, is_cdrom, partitions, blockdev)
-
- self.addHotplugPartition(blockdev)
- for part in partitions:
- self.addHotplugPartition(part)
+ error, blacklisted, removable, is_cdrom, partitions, medium_found = self.addHotplugPartition(blockdev)
+ if not error and not blacklisted:
+ if medium_found:
+ for part in partitions:
+ self.addHotplugPartition(part)
+ self.devices_scanned_on_init.append((blockdev, removable, is_cdrom, medium_found))
def getAutofsMountpoint(self, device):
- return "/autofs/%s/" % (device)
+ return "/media/%s/" % (device)
+
+ def is_hard_mounted(self, device):
+ mounts = file('/proc/mounts').read().split('\n')
+ for x in mounts:
+ if x.find('/autofs') == -1 and x.find(device) != -1:
+ return True
+ return False
+
def addHotplugPartition(self, device, physdev = None):
if not physdev:
dev, part = self.splitDeviceName(device)
physdev = dev
print "couldn't determine blockdev physdev for device", device
- # device is the device name, without /dev
- # physdev is the physical device path, which we (might) use to determine the userfriendly name
- description = self.getUserfriendlyDeviceName(device, physdev)
+ error, blacklisted, removable, is_cdrom, partitions, medium_found = self.getBlockDevInfo(device)
+ print "found block device '%s':" % device,
- p = Partition(mountpoint = self.getAutofsMountpoint(device), description = description, force_mounted = True, device = device)
- self.partitions.append(p)
- self.on_partition_list_change("add", p)
+ if blacklisted:
+ print "blacklisted"
+ else:
+ if error:
+ print "error querying properties"
+ elif not medium_found:
+ print "no medium"
+ else:
+ print "ok, removable=%s, cdrom=%s, partitions=%s" % (removable, is_cdrom, partitions)
+
+ l = len(device)
+ if l:
+ # see if this is a harddrive
+ if not device[l-1].isdigit() and not removable and not is_cdrom:
+ self.hdd.append(Harddisk(device))
+ self.hdd.sort()
+ SystemInfo["Harddisk"] = len(self.hdd) > 0
+
+ if (not removable or medium_found) and not self.is_hard_mounted(device):
+ # device is the device name, without /dev
+ # physdev is the physical device path, which we (might) use to determine the userfriendly name
+ description = self.getUserfriendlyDeviceName(device, physdev)
+ p = Partition(mountpoint = self.getAutofsMountpoint(device), description = description, force_mounted = True, device = device)
+ self.partitions.append(p)
+ self.on_partition_list_change("add", p)
- # see if this is a harddrive
- l = len(device)
- if l and not device[l-1].isdigit():
- error, blacklisted, removable, is_cdrom, partitions, medium_found = self.getBlockDevInfo(device)
- if not blacklisted and not removable and not is_cdrom and medium_found:
- self.hdd.append(Harddisk(device))
- self.hdd.sort()
- SystemInfo["Harddisk"] = len(self.hdd) > 0
+ return error, blacklisted, removable, is_cdrom, partitions, medium_found
def removeHotplugPartition(self, device):
mountpoint = self.getAutofsMountpoint(device)
def HDDList(self):
list = [ ]
for hd in self.hdd:
+ # ikseong
+ if hd.model() == -1:
+ continue
hdd = hd.model() + " - " + hd.bus()
cap = hd.capacity()
if cap != "":
def getUserfriendlyDeviceName(self, dev, phys):
dev, part = self.splitDeviceName(dev)
description = "External Storage %s" % dev
+ have_model_descr = False
try:
description = readFile("/sys" + phys + "/model")
+ have_model_descr = True
except IOError, s:
print "couldn't read model: ", s
from Tools.HardwareInfo import HardwareInfo
- for physdevprefix, pdescription in DEVICEDB.get(HardwareInfo().device_name,{}).items():
+ if dev.find('sr') == 0 and dev[2].isdigit():
+ devicedb = DEVICEDB_SR
+ else:
+ devicedb = DEVICEDB
+ for physdevprefix, pdescription in devicedb.get(HardwareInfo().device_name,{}).items():
if phys.startswith(physdevprefix):
- description = pdescription
-
+ if have_model_descr:
+ description = pdescription + ' - ' + description
+ else:
+ description = pdescription
# not wholedisk and not partition 1
if part and part != 1:
description += " (Partition %d)" % part
from Components.config import config, ConfigSubsection, ConfigInteger, ConfigText, ConfigSelection, getConfigListEntry, ConfigSequence, ConfigSubList
import DVDTitle
import xml.dom.minidom
+ from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_FONTS
class ConfigColor(ConfigSequence):
def __init__(self, default = [128,128,128]):
self.target = None
self.settings = ConfigSubsection()
self.settings.name = ConfigText(fixed_size = False, visible_width = 40)
- self.settings.authormode = ConfigSelection(choices = [("menu_linked", _("Linked titles with a DVD menu")), ("just_linked", _("Direct playback of linked titles without menu")), ("menu_seperate", _("Seperate titles with a main menu")), ("data_ts", _("Dreambox format data DVD (HDTV compatible)"))])
+ self.settings.authormode = ConfigSelection(choices = [("menu_linked", _("Linked titles with a DVD menu")), ("just_linked", _("Direct playback of linked titles without menu")), ("menu_seperate", _("Seperate titles with a main menu")), ("data_ts", _("STB format data DVD (HDTV compatible)"))])
self.settings.titlesetmode = ConfigSelection(choices = [("single", _("Simple titleset (compatibility for legacy players)")), ("multi", _("Complex (allows mixing audio tracks and aspects)"))], default="multi")
self.settings.output = ConfigSelection(choices = [("iso", _("Create DVD-ISO")), ("dvd", _("Burn DVD"))])
self.settings.isopath = ConfigText(fixed_size = False, visible_width = 40)
for key in self.filekeys:
val = self.settings.dict()[key].getValue()
if not fileExists(val):
+ if val[0] != "/":
+ if key.find("font") == 0:
+ val = resolveFilename(SCOPE_FONTS)+val
+ else:
+ val = resolveFilename(SCOPE_PLUGINS)+"Extensions/DVDBurn/"+val
+ if fileExists(val):
+ self.settings.dict()[key].setValue(val)
+ continue
self.error += "\n%s '%s' not found" % (key, val)
#except AttributeError:
#print "loadProject AttributeError", self.error
# 'None' is magic to start at the list of mountpoints
defaultDir = config.mediaplayer.defaultDir.getValue()
- self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|m2ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|m4v|mkv|mp4|m4a|dat|flac|mov)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls")
+ self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|m4v|mkv|mp4|m4a|dat|flac|mov|m2ts)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls")
self["filelist"] = self.filelist
self.playlist = MyPlayList()
self.seek_target = None
- from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
- hotplugNotifier.append(self.hotplugCB)
+# ikseong
+# from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
+# hotplugNotifier.append(self.hotplugCB)
class MoviePlayerActionMap(NumberActionMap):
def __init__(self, player, contexts = [ ], actions = { }, prio=0):
"prevBouquet": (self.switchToPlayList, _("switch to playlist")),
"nextBouquet": (self.switchToFileList, _("switch to filelist")),
"delete": (self.deletePlaylistEntry, _("delete playlist entry")),
- "shift_stop": (self.clear_playlist, _("clear playlist")),
- "shift_record": (self.playlist.PlayListShuffle, _("shuffle playlist")),
+#ikseong
+# "shift_stop": (self.clear_playlist, _("clear playlist")),
+# "shift_record": (self.playlist.PlayListShuffle, _("shuffle playlist")),
+ "shift_stop": self.clear_playlist,
+ "shift_record": self.playlist.PlayListShuffle,
"subtitles": (self.subtitleSelection, _("Subtitle selection")),
}, -2)
if config.mediaplayer.saveDirOnExit.getValue():
config.mediaplayer.defaultDir.setValue(self.filelist.getCurrentDirectory())
config.mediaplayer.defaultDir.save()
- from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
- hotplugNotifier.remove(self.hotplugCB)
+# ikseong
+# from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
+# hotplugNotifier.remove(self.hotplugCB)
del self["coverArt"].picload
self.close()
currPlay = self.session.nav.getCurrentService()
sTagAudioCodec = currPlay.info().getInfoString(iServiceInformation.sTagAudioCodec)
print "[__evAudioDecodeError] audio-codec %s can't be decoded by hardware" % (sTagAudioCodec)
- self.session.open(MessageBox, _("This Dreambox can't decode %s streams!") % sTagAudioCodec, type = MessageBox.TYPE_INFO,timeout = 20 )
+ self.session.open(MessageBox, _("This STB can't decode %s streams!") % sTagAudioCodec, type = MessageBox.TYPE_INFO,timeout = 20 )
def __evVideoDecodeError(self):
currPlay = self.session.nav.getCurrentService()
sTagVideoCodec = currPlay.info().getInfoString(iServiceInformation.sTagVideoCodec)
print "[__evVideoDecodeError] video-codec %s can't be decoded by hardware" % (sTagVideoCodec)
- self.session.open(MessageBox, _("This Dreambox can't decode %s streams!") % sTagVideoCodec, type = MessageBox.TYPE_INFO,timeout = 20 )
+ self.session.open(MessageBox, _("This STB can't decode %s streams!") % sTagVideoCodec, type = MessageBox.TYPE_INFO,timeout = 20 )
def __evPluginError(self):
currPlay = self.session.nav.getCurrentService()
from Plugins.Plugin import PluginDescriptor
from xml.etree.cElementTree import parse as ci_parse
from Tools.XMLTools import elementsWithTag, mergeText, stringToXML
- from enigma import eDVBCI_UI, eDVBCIInterfaces
+ from enigma import eDVBCI_UI, eDVBCIInterfaces, eEnv
from os import system, path as os_path
appname = _("Slot %d") %(slot+1) + " - " + _("init modules")
elif state == 2:
appname = _("Slot %d") %(slot+1) + " - " + eDVBCI_UI.getInstance().getAppName(slot)
+ # ikseong
+ else :
+ appname = _("Slot %d") %(slot+1) + " - " + _("no module found")
+ #
self.list.append( (appname, ConfigNothing(), 0, slot) )
else:
self.list.append( (_("no CI slots found") , ConfigNothing(), 1, -1) )
Screen.__init__(self, session)
self.ci_slot=ci_slot
- self.filename="/etc/enigma2/ci"+str(self.ci_slot)+".xml"
+ self.filename = eEnv.resolve("${sysconfdir}/enigma2/ci") + str(self.ci_slot) + ".xml"
self["key_red"] = StaticText(_("Delete"))
self["key_green"] = StaticText(_("add Service"))
return Len > 0 and definitions[Len-1].text or default
for ci in range(NUM_CI):
- filename="/etc/enigma2/ci"+str(ci)+".xml"
+ filename = eEnv.resolve("${sysconfdir}/enigma2/ci") + str(ci) + ".xml"
if not os_path.exists(filename):
print "[CI_Activate_Config_CI%d] no config file found" %ci
from Components.ScrollLabel import ScrollLabel
from Components.Harddisk import harddiskmanager
from Components.Task import Task, Job, job_manager, Condition
- from Tools.Directories import fileExists, isMount
+ from Tools.Directories import fileExists, isMount, resolveFilename, SCOPE_HDD, SCOPE_MEDIA
from Tools.HardwareInfo import HardwareInfo
from Tools.Downloader import downloadWithProgress
from enigma import eConsoleAppContainer, gFont, RT_HALIGN_LEFT, RT_HALIGN_CENTER, RT_VALIGN_CENTER, RT_WRAP, eTimer
self.box = HardwareInfo().get_device_name()
self.feed_base = "http://www.dreamboxupdate.com/opendreambox" #/1.5/%s/images/" % self.box
- self.usbmountpoint = "/mnt/usb/"
+ self.usbmountpoint = resolveFilename(SCOPE_MEDIA)+"usb/"
self.menulist = []
def ackedDestination(self):
print "[ackedDestination]", self.branch, self.target_dir
- self.container.setCWD("/mnt")
+ self.container.setCWD(resolveFilename(SCOPE_MEDIA)+"usb/")
if self.target_dir[:8] == "/autofs/":
self.target_dir = "/dev/" + self.target_dir[8:-1]
self.umountCallback()
def main(session, **kwargs):
- session.open(NFIDownload,"/home/root")
+ session.open(NFIDownload,resolveFilename(SCOPE_HDD))
def filescan_open(list, session, **kwargs):
dev = "/dev/" + (list[0].path).rsplit('/',1)[0][7:]
- print "mounting device " + dev + " to /mnt/usb..."
- system("mount "+dev+" /mnt/usb/ -o rw,sync")
- session.open(NFIDownload,"/mnt/usb/")
+ print "mounting device " + dev + " to /media/usb..."
+ usbmountpoint = resolveFilename(SCOPE_MEDIA)+"usb/"
+ system("mount %s %s -o rw,sync" % (dev, usbmountpoint))
+ session.open(NFIDownload,usbmountpoint)
def filescan(**kwargs):
from Components.Scanner import Scanner, ScanPath
import sha
from time import time
+ rootkey = ['\x9f', '|', '\xe4', 'G', '\xc9', '\xb4', '\xf4', '#', '&', '\xce', '\xb3', '\xfe', '\xda', '\xc9', 'U', '`', '\xd8', '\x8c', 's', 'o', '\x90', '\x9b', '\\', 'b', '\xc0', '\x89', '\xd1', '\x8c', '\x9e', 'J', 'T', '\xc5', 'X', '\xa1', '\xb8', '\x13', '5', 'E', '\x02', '\xc9', '\xb2', '\xe6', 't', '\x89', '\xde', '\xcd', '\x9d', '\x11', '\xdd', '\xc7', '\xf4', '\xe4', '\xe4', '\xbc', '\xdb', '\x9c', '\xea', '}', '\xad', '\xda', 't', 'r', '\x9b', '\xdc', '\xbc', '\x18', '3', '\xe7', '\xaf', '|', '\xae', '\x0c', '\xe3', '\xb5', '\x84', '\x8d', '\r', '\x8d', '\x9d', '2', '\xd0', '\xce', '\xd5', 'q', '\t', '\x84', 'c', '\xa8', ')', '\x99', '\xdc', '<', '"', 'x', '\xe8', '\x87', '\x8f', '\x02', ';', 'S', 'm', '\xd5', '\xf0', '\xa3', '_', '\xb7', 'T', '\t', '\xde', '\xa7', '\xf1', '\xc9', '\xae', '\x8a', '\xd7', '\xd2', '\xcf', '\xb2', '.', '\x13', '\xfb', '\xac', 'j', '\xdf', '\xb1', '\x1d', ':', '?']
def bin2long(s):
return reduce( lambda x,y:(x<<8L)+y, map(ord, s))
def checkNetworkCB(self,data):
if data is not None:
if data <= 2:
- SoftwareTools.NetworkConnectionAvailable = True
+ self.NetworkConnectionAvailable = True
self.getUpdates()
else:
- SoftwareTools.NetworkConnectionAvailable = False
+ self.NetworkConnectionAvailable = False
self.getUpdates()
def getUpdates(self, callback = None):
- if SoftwareTools.lastDownloadDate is None:
+ if self.lastDownloadDate is None:
- if self.hardware_info.device_name != "dm7025":
+ if self.hardware_info.device_name != "dm8000":
- rootkey = ['\x9f', '|', '\xe4', 'G', '\xc9', '\xb4', '\xf4', '#', '&', '\xce', '\xb3', '\xfe', '\xda', '\xc9', 'U', '`', '\xd8', '\x8c', 's', 'o', '\x90', '\x9b', '\\', 'b', '\xc0', '\x89', '\xd1', '\x8c', '\x9e', 'J', 'T', '\xc5', 'X', '\xa1', '\xb8', '\x13', '5', 'E', '\x02', '\xc9', '\xb2', '\xe6', 't', '\x89', '\xde', '\xcd', '\x9d', '\x11', '\xdd', '\xc7', '\xf4', '\xe4', '\xe4', '\xbc', '\xdb', '\x9c', '\xea', '}', '\xad', '\xda', 't', 'r', '\x9b', '\xdc', '\xbc', '\x18', '3', '\xe7', '\xaf', '|', '\xae', '\x0c', '\xe3', '\xb5', '\x84', '\x8d', '\r', '\x8d', '\x9d', '2', '\xd0', '\xce', '\xd5', 'q', '\t', '\x84', 'c', '\xa8', ')', '\x99', '\xdc', '<', '"', 'x', '\xe8', '\x87', '\x8f', '\x02', ';', 'S', 'm', '\xd5', '\xf0', '\xa3', '_', '\xb7', 'T', '\t', '\xde', '\xa7', '\xf1', '\xc9', '\xae', '\x8a', '\xd7', '\xd2', '\xcf', '\xb2', '.', '\x13', '\xfb', '\xac', 'j', '\xdf', '\xb1', '\x1d', ':', '?']
etpm = eTPM()
l2cert = etpm.getCert(eTPM.TPMD_DT_LEVEL2_CERT)
if l2cert is None:
return
l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT)
if l3cert is None:
- print "please run the genuine dreambox plugin"
return
l3key = validate_cert(l3cert, l2key)
if l3key is None:
return
val = etpm.challenge(rnd)
result = decrypt_block(val, l3key)
- if self.hardware_info.device_name == "dm7025" or result[80:88] == rnd:
+ if self.hardware_info.device_name == "dm8000" or result[80:88] == rnd:
- if SoftwareTools.NetworkConnectionAvailable == True:
- SoftwareTools.lastDownloadDate = time()
- if SoftwareTools.list_updating is False and callback is None:
- SoftwareTools.list_updating = True
+ if self.NetworkConnectionAvailable == True:
+ self.lastDownloadDate = time()
+ if self.list_updating is False and callback is None:
+ self.list_updating = True
self.ipkg.startCmd(IpkgComponent.CMD_UPDATE)
- elif SoftwareTools.list_updating is False and callback is not None:
- SoftwareTools.list_updating = True
+ elif self.list_updating is False and callback is not None:
+ self.list_updating = True
self.NotifierCallback = callback
self.ipkg.startCmd(IpkgComponent.CMD_UPDATE)
- elif SoftwareTools.list_updating is True and callback is not None:
+ elif self.list_updating is True and callback is not None:
self.NotifierCallback = callback
else:
- SoftwareTools.list_updating = False
+ self.list_updating = False
if callback is not None:
callback(False)
elif self.NotifierCallback is not None:
self.NotifierCallback(False)
else:
- SoftwareTools.NetworkConnectionAvailable = False
- SoftwareTools.list_updating = False
+ self.NetworkConnectionAvailable = False
+ self.list_updating = False
if callback is not None:
callback(False)
elif self.NotifierCallback is not None:
self.NotifierCallback(False)
else:
- if SoftwareTools.NetworkConnectionAvailable == True:
- SoftwareTools.lastDownloadDate = time()
- if SoftwareTools.list_updating is False and callback is None:
- SoftwareTools.list_updating = True
+ if self.NetworkConnectionAvailable == True:
+ self.lastDownloadDate = time()
+ if self.list_updating is False and callback is None:
+ self.list_updating = True
self.ipkg.startCmd(IpkgComponent.CMD_UPDATE)
- elif SoftwareTools.list_updating is False and callback is not None:
- SoftwareTools.list_updating = True
+ elif self.list_updating is False and callback is not None:
+ self.list_updating = True
self.NotifierCallback = callback
self.ipkg.startCmd(IpkgComponent.CMD_UPDATE)
- elif SoftwareTools.list_updating is True and callback is not None:
+ elif self.list_updating is True and callback is not None:
self.NotifierCallback = callback
else:
- SoftwareTools.list_updating = False
- if callback is not None:
- callback(False)
- elif self.NotifierCallback is not None:
- self.NotifierCallback(False)
+ if self.list_updating and callback is not None:
- if self.hardware_info.device_name != "dm7025":
++ if self.hardware_info.device_name != "dm8000":
+ etpm = eTPM()
+ l2cert = etpm.getCert(eTPM.TPMD_DT_LEVEL2_CERT)
+ if l2cert is None:
+ return
+ l2key = validate_cert(l2cert, rootkey)
+ if l2key is None:
+ return
+ l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT)
+ if l3cert is None:
+ return
+ l3key = validate_cert(l3cert, l2key)
+ if l3key is None:
+ return
+ rnd = read_random()
+ if rnd is None:
+ return
+ val = etpm.challenge(rnd)
+ result = decrypt_block(val, l3key)
- if self.hardware_info.device_name == "dm7025" or result[80:88] == rnd:
++ if self.hardware_info.device_name == "dm8000" or result[80:88] == rnd:
+ self.NotifierCallback = callback
+ self.startIpkgListAvailable()
+ else:
+ self.list_updating = False
+ if callback is not None:
+ callback(False)
+ elif self.NotifierCallback is not None:
+ self.NotifierCallback(False)
def ipkgCallback(self, event, param):
if event == IpkgComponent.EVENT_ERROR:
- SoftwareTools.list_updating = False
+ self.list_updating = False
if self.NotifierCallback is not None:
self.NotifierCallback(False)
elif event == IpkgComponent.EVENT_DONE:
- if SoftwareTools.list_updating:
+ if self.list_updating:
self.startIpkgListAvailable()
#print event, "-", param
pass
def startIpkgListAvailable(self, callback = None):
if callback is not None:
- SoftwareTools.list_updating = True
- if SoftwareTools.list_updating:
+ self.list_updating = True
+ if self.list_updating:
if not self.UpdateConsole:
self.UpdateConsole = Console()
cmd = "ipkg list"
def IpkgListAvailableCB(self, result, retval, extra_args = None):
(callback) = extra_args
if result:
- if SoftwareTools.list_updating:
- SoftwareTools.available_packetlist = []
+ if self.list_updating:
+ self.available_packetlist = []
for x in result.splitlines():
tokens = x.split(' - ')
name = tokens[0].strip()
l = len(tokens)
version = l > 1 and tokens[1].strip() or ""
descr = l > 2 and tokens[2].strip() or ""
- SoftwareTools.available_packetlist.append([name, version, descr])
+ self.available_packetlist.append([name, version, descr])
if callback is None:
self.startInstallMetaPackage()
else:
if len(self.UpdateConsole.appContainers) == 0:
callback(True)
else:
- SoftwareTools.list_updating = False
+ self.list_updating = False
if self.UpdateConsole:
if len(self.UpdateConsole.appContainers) == 0:
if callback is not None:
def startInstallMetaPackage(self, callback = None):
if callback is not None:
- SoftwareTools.list_updating = True
- if SoftwareTools.list_updating:
- if not self.UpdateConsole:
- self.UpdateConsole = Console()
- cmd = "ipkg install enigma2-meta enigma2-plugins-meta enigma2-skins-meta"
- self.UpdateConsole.ePopen(cmd, self.InstallMetaPackageCB, callback)
+ self.list_updating = True
+ if self.list_updating:
+ if self.NetworkConnectionAvailable == True:
+ if not self.UpdateConsole:
+ self.UpdateConsole = Console()
+ cmd = "ipkg install enigma2-meta enigma2-plugins-meta enigma2-skins-meta"
+ self.UpdateConsole.ePopen(cmd, self.InstallMetaPackageCB, callback)
+ else:
+ self.InstallMetaPackageCB(True)
- def InstallMetaPackageCB(self, result, retval, extra_args = None):
+ def InstallMetaPackageCB(self, result, retval = None, extra_args = None):
(callback) = extra_args
if result:
self.fillPackagesIndexList()
if len(self.UpdateConsole.appContainers) == 0:
callback(True)
else:
- SoftwareTools.list_updating = False
+ self.list_updating = False
if self.UpdateConsole:
if len(self.UpdateConsole.appContainers) == 0:
if callback is not None:
callback(False)
def startIpkgListInstalled(self, callback = None):
+ print "STARTIPKGLISTINSTALLED"
if callback is not None:
- SoftwareTools.list_updating = True
- if SoftwareTools.list_updating:
+ self.list_updating = True
+ if self.list_updating:
if not self.UpdateConsole:
self.UpdateConsole = Console()
cmd = "ipkg list_installed"
def IpkgListInstalledCB(self, result, retval, extra_args = None):
(callback) = extra_args
if result:
- SoftwareTools.installed_packetlist = {}
+ self.installed_packetlist = {}
for x in result.splitlines():
tokens = x.split(' - ')
name = tokens[0].strip()
if not any(name.endswith(x) for x in self.unwanted_extensions):
l = len(tokens)
version = l > 1 and tokens[1].strip() or ""
- SoftwareTools.installed_packetlist[name] = version
+ self.installed_packetlist[name] = version
for package in self.packagesIndexlist[:]:
if not self.verifyPrerequisites(package[0]["prerequisites"]):
self.packagesIndexlist.remove(package)
if len(self.UpdateConsole.appContainers) == 0:
callback(True)
else:
- SoftwareTools.list_updating = False
+ self.list_updating = False
if self.UpdateConsole:
if len(self.UpdateConsole.appContainers) == 0:
if callback is not None:
callback(False)
def countUpdates(self, callback = None):
- SoftwareTools.available_updates = 0
- SoftwareTools.available_updatelist = []
+ self.available_updates = 0
+ self.available_updatelist = []
for package in self.packagesIndexlist[:]:
attributes = package[0]["attributes"]
packagename = attributes["packagename"]
- for x in SoftwareTools.available_packetlist:
+ for x in self.available_packetlist:
if x[0] == packagename:
- if SoftwareTools.installed_packetlist.has_key(packagename):
- if SoftwareTools.installed_packetlist[packagename] != x[1]:
- SoftwareTools.available_updates +=1
- SoftwareTools.available_updatelist.append([packagename])
+ if self.installed_packetlist.has_key(packagename):
+ if self.installed_packetlist[packagename] != x[1]:
+ self.available_updates +=1
+ self.available_updatelist.append([packagename])
- SoftwareTools.list_updating = False
+ self.list_updating = False
if self.UpdateConsole:
if len(self.UpdateConsole.appContainers) == 0:
if callback is not None:
return False
return True
-iSoftwareTools = SoftwareTools()
+iSoftwareTools = SoftwareTools()
from Tools.Directories import pathExists, fileExists, resolveFilename, SCOPE_PLUGINS, SCOPE_CURRENT_PLUGIN, SCOPE_CURRENT_SKIN, SCOPE_METADIR
from Tools.LoadPixmap import LoadPixmap
from Tools.NumericalTextInput import NumericalTextInput
- from enigma import eTimer, quitMainloop, RT_HALIGN_LEFT, RT_VALIGN_CENTER, eListboxPythonMultiContent, eListbox, gFont, getDesktop, ePicLoad, eRCInput, getPrevAsciiCode
+ from enigma import eTimer, quitMainloop, RT_HALIGN_LEFT, RT_VALIGN_CENTER, eListboxPythonMultiContent, eListbox, gFont, getDesktop, ePicLoad, eRCInput, getPrevAsciiCode, eEnv
from cPickle import dump, load
from os import path as os_path, system as os_system, unlink, stat, mkdir, popen, makedirs, listdir, access, rename, remove, W_OK, R_OK, F_OK
from time import time, gmtime, strftime, localtime
config.plugins.configurationbackup = ConfigSubsection()
config.plugins.configurationbackup.backuplocation = ConfigText(default = '/media/hdd/', visible_width = 50, fixed_size = False)
- config.plugins.configurationbackup.backupdirs = ConfigLocations(default=['/etc/enigma2/', '/etc/network/interfaces', '/etc/wpa_supplicant.conf', '/etc/resolv.conf', '/etc/default_gw', '/etc/hostname'])
+ config.plugins.configurationbackup.backupdirs = ConfigLocations(default=[eEnv.resolve('${sysconfdir}/enigma2/'), '/etc/network/interfaces', '/etc/wpa_supplicant.conf', '/etc/resolv.conf', '/etc/default_gw', '/etc/hostname'])
config.plugins.SoftwareManager = ConfigSubsection()
config.plugins.SoftwareManager.overwriteConfigFiles = ConfigSelection(
self.backupdirs = ' '.join( config.plugins.configurationbackup.backupdirs.value )
if self.menu == 0:
print "building menu entries"
- self.list.append(("install-extensions", _("Manage extensions"), _("\nManage extensions or plugins for your Dreambox" ) + self.oktext, None))
- self.list.append(("software-update", _("Software update"), _("\nOnline update of your Dreambox software." ) + self.oktext, None))
- self.list.append(("software-restore", _("Software restore"), _("\nRestore your Dreambox with a new firmware." ) + self.oktext, None))
- self.list.append(("system-backup", _("Backup system settings"), _("\nBackup your Dreambox settings." ) + self.oktext + "\n\n" + self.infotext, None))
- self.list.append(("system-restore",_("Restore system settings"), _("\nRestore your Dreambox settings." ) + self.oktext, None))
+ self.list.append(("install-extensions", _("Manage extensions"), _("\nManage extensions or plugins for your STB" ) + self.oktext, None))
+ self.list.append(("software-update", _("Software update"), _("\nOnline update of your STB software." ) + self.oktext, None))
+ self.list.append(("software-restore", _("Software restore"), _("\nRestore your STB with a new firmware." ) + self.oktext, None))
+ self.list.append(("system-backup", _("Backup system settings"), _("\nBackup your STB settings." ) + self.oktext + "\n\n" + self.infotext, None))
+ self.list.append(("system-restore",_("Restore system settings"), _("\nRestore your STB settings." ) + self.oktext, None))
self.list.append(("ipkg-install", _("Install local extension"), _("\nScan for local extensions and install them." ) + self.oktext, None))
for p in plugins.getPlugins(PluginDescriptor.WHERE_SOFTWAREMANAGER):
if p.__call__.has_key("SoftwareSupported"):
currentEntry = current[0]
if self.menu == 0:
if (currentEntry == "software-update"):
- self.session.openWithCallback(self.runUpgrade, MessageBox, _("Do you want to update your Dreambox?")+"\n"+_("\nAfter pressing OK, please wait!"))
+ self.session.openWithCallback(self.runUpgrade, MessageBox, _("Do you want to update your STB?")+"\n"+_("\nAfter pressing OK, please wait!"))
elif (currentEntry == "software-restore"):
self.session.open(ImageWizard)
elif (currentEntry == "install-extensions"):
statuspng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/upgrade.png"))
self.statuslist.append(( _("Package list update"), '', _("Searching for new installed or removed packages. Please wait..." ),'', '', statuspng, divpng, None, '' ))
elif status == 'error':
+ self["key_green"].setText(_("Continue"))
statuspng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/remove.png"))
self.statuslist.append(( _("Error"), '', _("There was an error downloading the packetlist. Please try again." ),'', '', statuspng, divpng, None, '' ))
self["list"].style = "default"
def getUpdateInfos(self):
- self.setState('update')
- iSoftwareTools.startSoftwareTools(self.getUpdateInfosCB)
+ if (iSoftwareTools.lastDownloadDate is not None and iSoftwareTools.NetworkConnectionAvailable is False):
+ self.rebuildList()
+ else:
+ self.setState('update')
+ iSoftwareTools.startSoftwareTools(self.getUpdateInfosCB)
def getUpdateInfosCB(self, retval = None):
if retval is not None:
self["status"].setText(_("There are no updates available."))
self.rebuildList()
elif retval is False:
- self.setState('error')
- if iSoftwareTools.NetworkConnectionAvailable:
- self["status"].setText(_("Updatefeed not available."))
+ if iSoftwareTools.lastDownloadDate is None:
+ self.setState('error')
+ if iSoftwareTools.NetworkConnectionAvailable:
+ self["status"].setText(_("Updatefeed not available."))
+ else:
+ self["status"].setText(_("No network connection available."))
else:
- self["status"].setText(_("No network connection available."))
+ iSoftwareTools.lastDownloadDate = time()
+ iSoftwareTools.list_updating = True
+ self.setState('update')
+ iSoftwareTools.getUpdates(self.getUpdateInfosCB)
def rebuildList(self, retval = None):
if self.currentSelectedTag is None:
self["key_green"].setText(_("Uninstall"))
elif current[4] == 'installable':
self["key_green"].setText(_("Install"))
+ if iSoftwareTools.NetworkConnectionAvailable is False:
+ self["key_green"].setText("")
elif current[4] == 'remove':
self["key_green"].setText(_("Undo uninstall"))
elif current[4] == 'install':
self["key_green"].setText(_("Undo install"))
+ if iSoftwareTools.NetworkConnectionAvailable is False:
+ self["key_green"].setText("")
self["key_yellow"].setText(_("View details"))
self["key_blue"].setText("")
if len(self.selectedFiles) == 0 and iSoftwareTools.available_updates is not 0:
if entry[0] == detailsFile:
alreadyinList = True
if not alreadyinList:
- self.selectedFiles.append((detailsFile,current[4],current[3]))
- self.currentSelectedPackage = ((detailsFile,current[4],current[3]))
+ if (iSoftwareTools.NetworkConnectionAvailable is False and current[4] in ('installable','install')):
+ pass
+ else:
+ self.selectedFiles.append((detailsFile,current[4],current[3]))
+ self.currentSelectedPackage = ((detailsFile,current[4],current[3]))
if current[4] == 'installed':
self.list[idx] = self.buildEntryComponent(current[0], current[1], current[2], current[3], 'remove', True)
elif current[4] == 'installable':
- self.list[idx] = self.buildEntryComponent(current[0], current[1], current[2], current[3], 'install', True)
+ if iSoftwareTools.NetworkConnectionAvailable:
+ self.list[idx] = self.buildEntryComponent(current[0], current[1], current[2], current[3], 'install', True)
elif current[4] == 'remove':
self.list[idx] = self.buildEntryComponent(current[0], current[1], current[2], current[3], 'installed', False)
elif current[4] == 'install':
- self.list[idx] = self.buildEntryComponent(current[0], current[1], current[2], current[3], 'installable',False)
+ if iSoftwareTools.NetworkConnectionAvailable:
+ self.list[idx] = self.buildEntryComponent(current[0], current[1], current[2], current[3], 'installable',False)
self["list"].setList(self.list)
self["list"].setIndex(idx)
self["list"].updateList(self.list)
self.selectionChanged()
-
+ elif self.currList == "status":
+ iSoftwareTools.lastDownloadDate = time()
+ iSoftwareTools.list_updating = True
+ self.setState('update')
+ iSoftwareTools.getUpdates(self.getUpdateInfosCB)
+
def handleSelected(self):
current = self["list"].getCurrent()
if current:
self.close()
def runExecuteFinished(self):
- self.session.openWithCallback(self.ExecuteReboot, MessageBox, _("Install or remove finished.") +" "+_("Do you want to reboot your Dreambox?"), MessageBox.TYPE_YESNO)
+ self.session.openWithCallback(self.ExecuteReboot, MessageBox, _("Install or remove finished.") +" "+_("Do you want to reboot your STB?"), MessageBox.TYPE_YESNO)
def ExecuteReboot(self, result):
if result is None:
elif cmd == 2:
info = args['package']
else:
- info = _("Dreambox software because updates are available.")
+ info = _("STB software because updates are available.")
self.list.append(self.buildEntryComponent(action,info))
self['list'].setList(self.list)
self["author"].setText(_("Author: ") + self.author)
self["detailtext"].setText(_(self.description))
if self.pluginstate in ('installable', 'install'):
- self["key_green"].setText(_("Install"))
+ if iSoftwareTools.NetworkConnectionAvailable:
+ self["key_green"].setText(_("Install"))
+ else:
+ self["key_green"].setText("")
else:
self["key_green"].setText(_("Remove"))
if thumbnailUrl is not None:
self.thumbnail = "/tmp/" + thumbnailUrl.split('/')[-1]
print "[PluginDetails] downloading screenshot " + thumbnailUrl + " to " + self.thumbnail
- client.downloadPage(thumbnailUrl,self.thumbnail).addCallback(self.setThumbnail).addErrback(self.fetchFailed)
+ if iSoftwareTools.NetworkConnectionAvailable:
+ client.downloadPage(thumbnailUrl,self.thumbnail).addCallback(self.setThumbnail).addErrback(self.fetchFailed)
+ else:
+ self.setThumbnail(noScreenshot = True)
else:
self.setThumbnail(noScreenshot = True)
if len(self.cmdList):
self.session.openWithCallback(self.runRemove, MessageBox, _("Do you want to remove the package:\n") + self.pluginname + "\n" + self.oktext)
else:
- if self.packagefiles:
- for package in self.packagefiles[:]:
- self.cmdList.append((IpkgComponent.CMD_INSTALL, { "package": package["name"] }))
- if len(self.cmdList):
- self.session.openWithCallback(self.runUpgrade, MessageBox, _("Do you want to install the package:\n") + self.pluginname + "\n" + self.oktext)
+ if iSoftwareTools.NetworkConnectionAvailable:
+ if self.packagefiles:
+ for package in self.packagefiles[:]:
+ self.cmdList.append((IpkgComponent.CMD_INSTALL, { "package": package["name"] }))
+ if len(self.cmdList):
+ self.session.openWithCallback(self.runUpgrade, MessageBox, _("Do you want to install the package:\n") + self.pluginname + "\n" + self.oktext)
def runUpgrade(self, result):
if result:
self.session.openWithCallback(self.runUpgradeFinished, Ipkg, cmdList = self.cmdList)
def runUpgradeFinished(self):
- self.session.openWithCallback(self.UpgradeReboot, MessageBox, _("Installation finished.") +" "+_("Do you want to reboot your Dreambox?"), MessageBox.TYPE_YESNO)
+ self.session.openWithCallback(self.UpgradeReboot, MessageBox, _("Installation finished.") +" "+_("Do you want to reboot your STB?"), MessageBox.TYPE_YESNO)
def UpgradeReboot(self, result):
if result is None:
self.session.openWithCallback(self.runRemoveFinished, Ipkg, cmdList = self.cmdList)
def runRemoveFinished(self):
- self.session.openWithCallback(self.RemoveReboot, MessageBox, _("Remove finished.") +" "+_("Do you want to reboot your Dreambox?"), MessageBox.TYPE_YESNO)
+ self.session.openWithCallback(self.RemoveReboot, MessageBox, _("Remove finished.") +" "+_("Do you want to reboot your STB?"), MessageBox.TYPE_YESNO)
def RemoveReboot(self, result):
if result is None:
<widget name="activityslider" position="0,0" size="550,5" />
<widget name="slider" position="0,150" size="550,30" />
<widget source="package" render="Label" position="10,30" size="540,20" font="Regular;18" halign="center" valign="center" backgroundColor="#25062748" transparent="1" />
- <widget source="status" render="Label" position="10,60" size="540,45" font="Regular;20" halign="center" valign="center" backgroundColor="#25062748" transparent="1" />
+ <widget source="status" render="Label" position="10,180" size="540,100" font="Regular;20" halign="center" valign="center" backgroundColor="#25062748" transparent="1" />
</screen>"""
def __init__(self, session, args = None):
self["slider"] = self.slider
self.activityslider = Slider(0, 100)
self["activityslider"] = self.activityslider
- self.status = StaticText(_("Upgrading STB... Please wait"))
+ self.status = StaticText(_("Please wait..."))
self["status"] = self.status
- self.package = StaticText()
+ self.package = StaticText(_("Verifying your internet connection..."))
self["package"] = self.package
self.oktext = _("Press OK on your remote control to continue.")
self.activity = 0
self.activityTimer = eTimer()
self.activityTimer.callback.append(self.doActivityTimer)
- self.activityTimer.start(100, False)
self.ipkg = IpkgComponent()
self.ipkg.addCallback(self.ipkgCallback)
- self.updating = True
- self.package.setText(_("Package list update"))
- self.ipkg.startCmd(IpkgComponent.CMD_UPDATE)
+ self.updating = False
self["actions"] = ActionMap(["WizardActions"],
{
"ok": self.exit,
"back": self.exit
}, -1)
+
+ iNetwork.checkNetworkState(self.checkNetworkCB)
+ self.onClose.append(self.cleanup)
+
+ def cleanup(self):
+ iNetwork.stopPingConsole()
+
+ def checkNetworkCB(self,data):
+ if data is not None:
+ if data <= 2:
+ self.updating = True
+ self.activityTimer.start(100, False)
+ self.package.setText(_("Package list update"))
+ self.status.setText(_("Upgrading Dreambox... Please wait"))
+ self.ipkg.startCmd(IpkgComponent.CMD_UPDATE)
+ else:
+ self.package.setText(_("Your network is not working. Please try again."))
+ self.status.setText(self.oktext)
def doActivityTimer(self):
self.activity += 1
self.activityTimer.stop()
self.activityslider.setValue(0)
- self.package.setText("")
- self.status.setText(_("Done - Installed or upgraded %d packages") % self.packages + "\n\n" + self.oktext)
+ self.package.setText(_("Done - Installed or upgraded %d packages") % self.packages)
+ self.status.setText(self.oktext)
else:
self.activityTimer.stop()
self.activityslider.setValue(0)
- error = _("your dreambox might be unusable now. Please consult the manual for further assistance before rebooting your dreambox.")
+ error = _("your STB might be unusable now. Please consult the manual for further assistance before rebooting your STB.")
if self.packages == 0:
error = _("No packages were upgraded yet. So you can check your network and try again.")
if self.updating:
- error = _("Your dreambox isn't connected to the internet properly. Please check it and try again.")
+ error = _("Your STB isn't connected to the internet properly. Please check it and try again.")
self.status.setText(_("Error") + " - " + error)
#print event, "-", param
pass
def exit(self):
if not self.ipkg.isRunning():
if self.packages != 0 and self.error == 0:
- self.session.openWithCallback(self.exitAnswer, MessageBox, _("Upgrade finished.") +" "+_("Do you want to reboot your Dreambox?"))
+ self.session.openWithCallback(self.exitAnswer, MessageBox, _("Upgrade finished.") +" "+_("Do you want to reboot your STB?"))
else:
self.close()
+ else:
+ if not self.updating:
+ self.close()
def exitAnswer(self, result):
if result is not None and result:
self.list_updating = True
self.packetlist = []
self.installed_packetlist = {}
+ self.upgradeable_packages = {}
self.Console = Console()
self.cmdList = []
self.cachelist = []
self.cache_ttl = 86400 #600 is default, 0 disables, Seconds cache is considered valid (24h should be ok for caching ipkgs)
- self.cache_file = '/usr/lib/enigma2/python/Plugins/SystemPlugins/SoftwareManager/packetmanager.cache' #Path to cache directory
+ self.cache_file = eEnv.resolve('${libdir}/enigma2/python/Plugins/SystemPlugins/SoftwareManager/packetmanager.cache') #Path to cache directory
self.oktext = _("\nAfter pressing OK, please wait!")
self.unwanted_extensions = ('-dbg', '-dev', '-doc', 'busybox')
+ self.opkgAvail = fileExists('/usr/bin/opkg')
self.ipkg = IpkgComponent()
self.ipkg.addCallback(self.ipkgCallback)
self.session.openWithCallback(self.runRemoveFinished, Ipkg, cmdList = self.cmdList)
def runRemoveFinished(self):
- self.session.openWithCallback(self.RemoveReboot, MessageBox, _("Remove finished.") +" "+_("Do you want to reboot your Dreambox?"), MessageBox.TYPE_YESNO)
+ self.session.openWithCallback(self.RemoveReboot, MessageBox, _("Remove finished.") +" "+_("Do you want to reboot your STB?"), MessageBox.TYPE_YESNO)
def RemoveReboot(self, result):
if result is None:
self.session.openWithCallback(self.runUpgradeFinished, Ipkg, cmdList = self.cmdList)
def runUpgradeFinished(self):
- self.session.openWithCallback(self.UpgradeReboot, MessageBox, _("Upgrade finished.") +" "+_("Do you want to reboot your Dreambox?"), MessageBox.TYPE_YESNO)
+ self.session.openWithCallback(self.UpgradeReboot, MessageBox, _("Upgrade finished.") +" "+_("Do you want to reboot your STB?"), MessageBox.TYPE_YESNO)
def UpgradeReboot(self, result):
if result is None:
def IpkgList_Finished(self, result, retval, extra_args = None):
if result:
self.packetlist = []
+ last_name = ""
for x in result.splitlines():
- tokens = x.split(' - ') #self.blacklisted_packages
+ tokens = x.split(' - ')
name = tokens[0].strip()
if not any(name.endswith(x) for x in self.unwanted_extensions):
l = len(tokens)
version = l > 1 and tokens[1].strip() or ""
descr = l > 2 and tokens[2].strip() or ""
+ if name == last_name:
+ continue
+ last_name = name
self.packetlist.append([name, version, descr])
+
if not self.Console:
self.Console = Console()
cmd = "ipkg list_installed"
if result:
self.installed_packetlist = {}
for x in result.splitlines():
- tokens = x.split(' - ') #self.blacklisted_packages
+ tokens = x.split(' - ')
name = tokens[0].strip()
if not any(name.endswith(x) for x in self.unwanted_extensions):
l = len(tokens)
version = l > 1 and tokens[1].strip() or ""
self.installed_packetlist[name] = version
- self.buildPacketList()
+ if self.opkgAvail:
+ if not self.Console:
+ self.Console = Console()
+ cmd = "opkg list-upgradable"
+ self.Console.ePopen(cmd, self.OpkgListUpgradeable_Finished)
+ else:
+ self.buildPacketList()
+ def OpkgListUpgradeable_Finished(self, result, retval, extra_args = None):
+ if result:
+ self.upgradeable_packages = {}
+ for x in result.splitlines():
+ tokens = x.split(' - ')
+ name = tokens[0].strip()
+ if not any(name.endswith(x) for x in self.unwanted_extensions):
+ l = len(tokens)
+ version = l > 2 and tokens[2].strip() or ""
+ self.upgradeable_packages[name] = version
+ self.buildPacketList()
+
def buildEntryComponent(self, name, version, description, state):
divpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/div-h.png"))
if state == 'installed':
installedpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/installed.png"))
- return((name, version, description, state, installedpng, divpng))
+ return((name, version, _(description), state, installedpng, divpng))
elif state == 'upgradeable':
upgradeablepng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/upgradeable.png"))
- return((name, version, description, state, upgradeablepng, divpng))
+ return((name, version, _(description), state, upgradeablepng, divpng))
else:
installablepng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/installable.png"))
- return((name, version, description, state, installablepng, divpng))
+ return((name, version, _(description), state, installablepng, divpng))
def buildPacketList(self):
self.list = []
self.cachelist = []
-
if self.cache_ttl > 0 and self.vc != 0:
print 'Loading packagelist cache from ',self.cache_file
try:
print 'rebuilding fresh package list'
for x in self.packetlist:
status = ""
- if self.installed_packetlist.has_key(x[0].strip()):
- if self.installed_packetlist[x[0].strip()] == x[1].strip():
- status = "installed"
- self.list.append(self.buildEntryComponent(x[0].strip(), x[1].strip(), x[2].strip(), status))
+ if self.installed_packetlist.has_key(x[0]):
+ if self.opkgAvail:
+ if self.upgradeable_packages.has_key(x[0]):
+ status = "upgradeable"
+ else:
+ status = "installed"
else:
- status = "upgradeable"
- self.list.append(self.buildEntryComponent(x[0].strip(), x[1].strip(), x[2].strip(), status))
+ if self.installed_packetlist[x[0]] == x[1]:
+ status = "installed"
+ else:
+ status = "upgradeable"
else:
status = "installable"
- self.list.append(self.buildEntryComponent(x[0].strip(), x[1].strip(), x[2].strip(), status))
- if not any(x[0].strip().endswith(x) for x in self.unwanted_extensions):
- self.cachelist.append([x[0].strip(), x[1].strip(), x[2].strip(), status])
+ self.list.append(self.buildEntryComponent(x[0], x[1], x[2], status))
+ self.cachelist.append([x[0], x[1], x[2], status])
write_cache(self.cache_file, self.cachelist)
self['list'].setList(self.list)
def reloadPluginlist(self):
plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
+
class IpkgInstaller(Screen):
skin = """
<screen name="IpkgInstaller" position="center,center" size="550,450" title="Install extensions" >
from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase
profile("ChannelSelection.py 1")
from EpgSelection import EPGSelection
- from enigma import eServiceReference, eEPGCache, eServiceCenter, eRCInput, eTimer, eDVBDB, iPlayableService, iServiceInformation, getPrevAsciiCode
+ from enigma import eServiceReference, eEPGCache, eServiceCenter, eRCInput, eTimer, eDVBDB, iPlayableService, iServiceInformation, getPrevAsciiCode, eEnv
from Components.config import config, ConfigSubsection, ConfigText
from Tools.NumericalTextInput import NumericalTextInput
profile("ChannelSelection.py 2")
profile("ChannelSelection.py 2.3")
from Components.Input import Input
profile("ChannelSelection.py 3")
- from Components.ParentalControl import parentalControl
from Components.ChoiceList import ChoiceList, ChoiceEntryComponent
from Components.SystemInfo import SystemInfo
from Screens.InputBox import InputBox, PinInput
class ChannelContextMenu(Screen):
def __init__(self, session, csel):
+
Screen.__init__(self, session)
#raise Exception("we need a better summary screen here")
self.csel = csel
isPlayable = not (current_sel_flags & (eServiceReference.isMarker|eServiceReference.isDirectory))
if isPlayable:
if config.ParentalControl.configured.value:
+ from Components.ParentalControl import parentalControl
if parentalControl.getProtectionLevel(csel.getCurrentSelection().toCompareString()) == -1:
append_when_current_valid(current, menu, (_("add to parental protection"), boundFunction(self.addParentalProtection, csel.getCurrentSelection())), level = 0)
else:
self.close()
def addParentalProtection(self, service):
+ from Components.ParentalControl import parentalControl
parentalControl.protectService(service.toCompareString())
self.close()
def pinEntered(self, service, result):
if result:
+ from Components.ParentalControl import parentalControl
parentalControl.unProtectService(service)
self.close()
else:
refstr = refstr[pos+14:]
pos = refstr.find('"')
if pos != -1:
- filename = '/etc/enigma2/' + refstr[:pos] # FIXMEEE !!! HARDCODED /etc/enigma2
+ filename = eEnv.resolve('${sysconfdir}/enigma2/') + refstr[:pos]
self.removeCurrentService()
try:
if filename is not None:
SEEK_STATE_PAUSE = (1, 0, 0, "||")
SEEK_STATE_EOF = (1, 0, 0, "END")
- def __init__(self, actionmap = "InfobarSeekActions", useSeekBackHack=True):
+ def __init__(self, actionmap = "InfobarSeekActions"):
self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
{
iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged,
self.__seekableStatusChanged()
def makeStateForward(self, n):
- # minspeed = config.seek.stepwise_minspeed.value
- # repeat = int(config.seek.stepwise_repeat.value)
- # if minspeed != "Never" and n >= int(minspeed) and repeat > 1:
- # return (0, n * repeat, repeat, ">> %dx" % n)
- # else:
- return (0, n, 0, ">> %dx" % n)
+ return (0, n, 0, ">> %dx" % n)
def makeStateBackward(self, n):
- # minspeed = config.seek.stepwise_minspeed.value
- # repeat = int(config.seek.stepwise_repeat.value)
- # if minspeed != "Never" and n >= int(minspeed) and repeat > 1:
- # return (0, -n * repeat, repeat, "<< %dx" % n)
- # else:
- return (0, -n, 0, "<< %dx" % n)
+ return (0, -n, 0, "<< %dx" % n)
def makeStateSlowMotion(self, n):
return (0, 0, n, "/%d" % n)
dir = preferredInstantRecordPath()
if not dir or not fileExists(dir, 'w'):
dir = defaultMoviePath()
+# ikseong
+ if not fileExists("/hdd", 0):
+ print "not found /hdd"
+ system("ln -s /media/hdd /hdd")
+#
try:
stat = os_stat(dir)
except:
return True
def jumpPreviousMark(self):
- # we add 2 seconds, so if the play position is <2s after
+ # we add 5 seconds, so if the play position is <5s after
# the mark, the mark before will be used
self.jumpPreviousNextMark(lambda x: -x-5*90000, start=True)
def jumpNextMark(self):
- if not self.jumpPreviousNextMark(lambda x: x):
+ if not self.jumpPreviousNextMark(lambda x: x-90000):
self.doSeek(-1)
def getNearestCutPoint(self, pts, cmp=abs, start=False):
# can be optimized
- beforecut = False
+ beforecut = True
nearest = None
+ bestdiff = -1
+ instate = True
if start:
- beforecut = True
bestdiff = cmp(0 - pts)
if bestdiff >= 0:
nearest = [0, False]
beforecut = False
if cp[1] == self.CUT_TYPE_IN: # Start is here, disregard previous marks
diff = cmp(cp[0] - pts)
- if diff >= 0:
+ if start and diff >= 0:
nearest = cp
bestdiff = diff
else:
nearest = None
- if cp[1] in (self.CUT_TYPE_MARK, self.CUT_TYPE_LAST):
+ bestdiff = -1
+ if cp[1] == self.CUT_TYPE_IN:
+ instate = True
+ elif cp[1] == self.CUT_TYPE_OUT:
+ instate = False
+ elif cp[1] in (self.CUT_TYPE_MARK, self.CUT_TYPE_LAST):
diff = cmp(cp[0] - pts)
- if diff >= 0 and (nearest is None or bestdiff > diff):
+ if instate and diff >= 0 and (nearest is None or bestdiff > diff):
nearest = cp
bestdiff = diff
return nearest
from Components.MenuList import MenuList
from Components.ConfigList import ConfigList
from Components.Sources.List import List
- from enigma import eTimer
+ from enigma import eTimer, eEnv
from xml.sax import make_parser
from xml.sax.handler import ContentHandler
+# ikseong
+from Plugins.SystemPlugins.FactoryTest.plugin import FactoryTest
+
class WizardSummary(Screen):
skin = """
<screen position="0,0" size="132,64">
parser.setContentHandler(wizardHandler)
for xmlfile in self.xmlfile:
if xmlfile[0] != '/':
- parser.parse('/usr/share/enigma2/' + xmlfile)
+ parser.parse(eEnv.resolve('${datadir}/enigma2/') + xmlfile)
else:
parser.parse(xmlfile)
self.timeoutTimer = eTimer()
self.timeoutTimer.callback.append(self.timeoutCounterFired)
+ # ikseong - for memory test
+ self.memorytestmode = 0
+ self.testkey = 0
+
self["text"] = Label()
if showConfig:
"7": self.keyNumberGlobal,
"8": self.keyNumberGlobal,
"9": self.keyNumberGlobal,
- "0": self.keyNumberGlobal
+ "0": self.keyNumberGlobal,
+# ikseong
+ "test":self.testmode
}, -1)
self["VirtualKB"] = NumberActionMap(["VirtualKeyboardActions"],
self.configInstance.run()
self.finished()
+# ikseong
+ def testmode(self):
+ print "testmode ",self.memorytestmode
+ if self.memorytestmode == 0:
+ self.memorytestmode = 1
+ else:
+ self.memorytestmode = 0
+
def keyNumberGlobal(self, number):
+ if self.memorytestmode == 1:
+ self.testkey = self.testkey * 10 + number
+ if self.testkey > 10000:
+ self.testkey = self.testkey%10000
+ if self.testkey == 4599:
+ self.session.open(FactoryTest)
+ print "testkey", self.testkey
+ return
if (self.wizard[self.currStep]["config"]["screen"] != None):
self.configInstance.keyNumberGlobal(number)
elif (self.wizard[self.currStep]["config"]["type"] == "dynamic"):
#define SWIG_COMPILE
#include <lib/base/ebase.h>
#include <lib/base/smartptr.h>
+ #include <lib/base/eenv.h>
#include <lib/base/eerror.h>
#include <lib/base/etpm.h>
#include <lib/base/nconfig.h>
#include <lib/gdi/fb.h>
#include <lib/gdi/font.h>
#include <lib/gdi/gpixmap.h>
- #include <lib/gdi/gfbdc.h>
+ #include <lib/gdi/gmaindc.h>
#include <lib/gui/ewidget.h>
#include <lib/gui/elabel.h>
#include <lib/gui/einput.h>
#include <lib/dvb_ci/dvbci_ui.h>
#include <lib/python/python.h>
#include <lib/gdi/picload.h>
+#include <lib/driver/memtest.h>
+#include <lib/driver/sc_test.h>
%}
%feature("ref") iObject "$this->AddRef(); /* eDebug(\"AddRef (%s:%d)!\", __FILE__, __LINE__); */ "
#define DEBUG
+#define BUILD_VUPLUS
typedef long time_t;
%include "typemaps.i"
%include "std_string.i"
%include <lib/python/swig.h>
%include <lib/base/object.h>
+ %include <lib/base/eenv.h>
%include <lib/base/eerror.h>
%immutable eSocketNotifier::activated;
%include <lib/gdi/fb.h>
%include <lib/gdi/font.h>
%include <lib/gdi/gpixmap.h>
- %include <lib/gdi/gfbdc.h>
+ %include <lib/gdi/gmaindc.h>
%include <lib/gdi/epoint.h>
%include <lib/gdi/erect.h>
%include <lib/gdi/esize.h>
%include <lib/dvb/db.h>
%include <lib/python/python.h>
%include <lib/gdi/picload.h>
+%include <lib/driver/memtest.h>
+%include <lib/driver/sc_test.h>
/************** eptr **************/
/************** signals **************/
RESULT eStaticServiceDVBPVRInformation::getName(const eServiceReference &ref, std::string &name)
{
ASSERT(ref == m_ref);
- if (m_parser.m_name.size())
+ if (!ref.name.empty())
+ name = ref.name;
+ else if (!m_parser.m_name.empty())
name = m_parser.m_name;
else
{
int err = f.open(m_ref.path.c_str(), 0);
if (err < 0)
return -1;
-
+
+ off_t offset = 0;
off_t length = f.length();
unsigned char buffer[188*256*4];
while (1)
{
- off_t offset = f.lseek(0, SEEK_CUR);
eDebug("at %08llx / %08llx (%d %%)", offset, length, (int)(offset * 100 / length));
- int r = f.read(buffer, sizeof(buffer));
+ int r = f.read(offset, buffer, sizeof(buffer));
if (!r)
break;
if (r < 0)
return r;
+ offset += r;
parser.parseData(offset, buffer, r);
}
if (m_skipmode < 0)
m_cue->seekTo(0, -1000);
- m_service_handler_timeshift.tune(r, 1, m_cue, 0, m_dvb_service); /* use the decoder demux for everything */
+ ePtr<iTsSource> source = createTsSource(r);
+ m_service_handler_timeshift.tuneExt(r, 1, source, r.path.c_str(), m_cue, 0, m_dvb_service); /* use the decoder demux for everything */
m_event((iPlayableService*)this, evUser+1);
}
m_service_handler_timeshift.free();
resetTimeshift(1);
- m_service_handler_timeshift.tune(r, 1, m_cue, 0, m_dvb_service); /* use the decoder demux for everything */
+ ePtr<iTsSource> source = createTsSource(r);
+ m_service_handler_timeshift.tuneExt(r, 1, source, m_timeshift_file_next.c_str(), m_cue, 0, m_dvb_service); /* use the decoder demux for everything */
m_event((iPlayableService*)this, evUser+1);
}
m_event(this, evStart);
m_first_program_info = 1;
- m_service_handler.tune(service, m_is_pvr, m_cue, false, m_dvb_service);
+ ePtr<iTsSource> source = createTsSource(service);
+ m_service_handler.tuneExt(service, m_is_pvr, source, service.path.c_str(), m_cue, false, m_dvb_service);
if (m_is_pvr)
{
{
eDVBServicePMTHandler::program program;
- if (w == sCAIDs)
+ if (w == sCAIDs || w == sCAIDPIDs)
return resIsPyObject;
eDVBServicePMTHandler &h = m_timeshift_active ? m_service_handler_timeshift : m_service_handler;
{
case sCAIDs:
return m_service_handler.getCaIds();
+ case sCAIDPIDs:
+ return m_service_handler.getCaIds(true);
case sTransponderData:
return eStaticServiceDVBInformation().getInfoObject(m_reference, w);
default:
if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atMPEG)
info.m_description = "MPEG";
else if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atAC3)
- info.m_description = "AC3";
+ info.m_description = "Dolby Digital";
else if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atAAC)
info.m_description = "AAC";
else if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atAACHE)
info.m_description = "AAC-HE";
else if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atDTS)
info.m_description = "DTS";
+ else if (program.audioStreams[i].type == eDVBServicePMTHandler::audioStream::atDTSHD)
+ info.m_description = "DTS-HD";
else
info.m_description = "???";
m_timeshift_active = 0;
}
+ ePtr<iTsSource> eDVBServicePlay::createTsSource(eServiceReferenceDVB &ref)
+ {
+ eRawFile *f = new eRawFile();
+ f->open(ref.path.c_str());
+ return ePtr<iTsSource>(f);
+ }
+
void eDVBServicePlay::switchToTimeshift()
{
if (m_timeshift_active)
r.path = m_timeshift_file;
m_cue->seekTo(0, -1000);
- m_service_handler_timeshift.tune(r, 1, m_cue, 0, m_dvb_service); /* use the decoder demux for everything */
+
+ ePtr<iTsSource> source = createTsSource(r);
+ m_service_handler_timeshift.tuneExt(r, 1, source, m_timeshift_file.c_str(), m_cue, 0, m_dvb_service); /* use the decoder demux for everything */
eDebug("eDVBServicePlay::switchToTimeshift, in pause mode now.");
pause();
- #include <string.h>
- #include <signal.h>
- #include <asm/ptrace.h>
-
+ #include <csignal>
+ #include <fstream>
+ #include <sstream>
+ #include <lib/base/eenv.h>
#include <lib/base/eerror.h>
- #include <lib/base/smartptr.h>
#include <lib/base/nconfig.h>
- #include <lib/gdi/grc.h>
- #include <lib/gdi/gfbdc.h>
- #ifdef WITH_SDL
- #include <lib/gdi/sdl.h>
+ #include <lib/gdi/gmaindc.h>
+
+ #if defined(__MIPSEL__)
+ #include <asm/ptrace.h>
+ #else
+ #warning "no oops support!"
+ #define NO_OOPS_SUPPORT
#endif
- #include "version.h"
+ #include "xmlgenerator.h"
+ #include "version_info.h"
/************************************************/
+#ifdef BUILD_VUPLUS /* ikseong */
+#define CRASH_EMAILADDR "crashlog"
+#else
#define CRASH_EMAILADDR "crashlog@dream-multimedia-tv.de"
- #define STDBUFFER_SIZE 512
+#endif
+ #define INFOFILE "/maintainer.info"
+
#define RINGBUFFER_SIZE 16384
static char ringbuffer[RINGBUFFER_SIZE];
- static int ringbuffer_head;
+ static unsigned int ringbuffer_head;
- static void addToLogbuffer(const char *data, int len)
+ static void addToLogbuffer(const char *data, unsigned int len)
{
while (len)
{
- int remaining = RINGBUFFER_SIZE - ringbuffer_head;
-
+ unsigned int remaining = RINGBUFFER_SIZE - ringbuffer_head;
+
if (remaining > len)
remaining = len;
-
+
memcpy(ringbuffer + ringbuffer_head, data, remaining);
len -= remaining;
data += remaining;
ringbuffer_head += remaining;
- if (ringbuffer_head >= RINGBUFFER_SIZE)
+ ASSERT(ringbuffer_head <= RINGBUFFER_SIZE);
+ if (ringbuffer_head == RINGBUFFER_SIZE)
ringbuffer_head = 0;
}
}
- static std::string getLogBuffer()
+ static const std::string getLogBuffer()
{
- int begin = ringbuffer_head;
+ unsigned int begin = ringbuffer_head;
while (ringbuffer[begin] == 0)
{
++begin;
if (begin == ringbuffer_head)
return "";
}
+
if (begin < ringbuffer_head)
return std::string(ringbuffer + begin, ringbuffer_head - begin);
else
- {
return std::string(ringbuffer + begin, RINGBUFFER_SIZE - begin) + std::string(ringbuffer, ringbuffer_head);
- }
}
static void addToLogbuffer(int level, const std::string &log)
addToLogbuffer(log.c_str(), log.size());
}
- static std::string getConfigFileValue(const char *entry)
+ static const std::string getConfigString(const std::string &key, const std::string &defaultValue)
{
- std::string configfile = "/etc/enigma2/settings";
- std::string configvalue;
- if (entry)
- {
- ePythonConfigQuery::getConfigValue(entry, configvalue);
- if (configvalue != "") //we get at least the default value if python is still alive
- {
- return configvalue;
- }
- else // get value from enigma2 settings file
- {
- FILE *f = fopen(configfile.c_str(), "r");
- if (!f)
- {
- return "Error";
- }
- while (1)
- {
- char line[1024];
- if (!fgets(line, 1024, f))
- break;
- if (!strncmp(line, entry, strlen(entry) ))
- {
- if (strlen(line) && line[strlen(line)-1] == '\r')
- line[strlen(line)-1] = 0;
- if (strlen(line) && line[strlen(line)-1] == '\n')
- line[strlen(line)-1] = 0;
- std::string tmp = line;
- int posEqual = tmp.find("=", 0);
- configvalue = tmp.substr(posEqual+1);
- }
- }
- fclose(f);
- return configvalue;
- }
- }
- }
+ std::string value;
- static std::string getFileContent(const char *file)
- {
- std::string filecontent;
+ ePythonConfigQuery::getConfigValue(key.c_str(), value);
+ //we get at least the default value if python is still alive
+ if (!value.empty())
+ return value;
- if (file)
- {
- FILE *f = fopen(file, "r");
- if (!f)
- {
- return "Error";
- }
- while (1)
- {
- char line[1024];
- if (!fgets(line, 1024, f))
+ value = defaultValue;
+
+ // get value from enigma2 settings file
+ std::ifstream in(eEnv::resolve("${sysconfdir}/enigma2/settings").c_str());
+ if (in.good()) {
+ do {
+ std::string line;
+ std::getline(in, line);
+ size_t size = key.size();
+ if (!key.compare(0, size, line) && line[size] == '=') {
+ value = line.substr(size + 1);
break;
- std::string tmp = line;
- std::string password;
- int pwdpos = tmp.find(".password=", 0);
- if( pwdpos != std::string::npos)
- {
- filecontent += tmp.substr(0,pwdpos +10);
- for ( int pos = pwdpos +10; pos < tmp.length()-1; ++pos )
- {
- filecontent += "X";
- }
- filecontent += "\n";
}
- else {
- filecontent += line;
- }
- }
- fclose(f);
+ } while (in.good());
+ in.close();
}
- return filecontent;
- }
- static std::string execCommand(char* cmd) {
- FILE* pipe = popen(cmd, "r");
- if (!pipe)
- return "Error";
- char buffer[STDBUFFER_SIZE];
- std::string result = "";
- while(!feof(pipe))
- {
- if(!fgets(buffer,STDBUFFER_SIZE, pipe))
- break;
- result += buffer;
- }
- pclose(pipe);
- return result;
+ return value;
}
- extern std::string execCommand();
- extern std::string getConfigFileValue();
- extern std::string getFileContent();
- extern std::string getLogBuffer();
+ static bool getConfigBool(const std::string &key, bool defaultValue)
+ {
+ std::string value = getConfigString(key, defaultValue ? "true" : "false");
+ const char *cvalue = value.c_str();
- #define INFOFILE "/maintainer.info"
+ if (!strcasecmp(cvalue, "true"))
+ return true;
+ if (!strcasecmp(cvalue, "false"))
+ return false;
+
+ return defaultValue;
+ }
void bsodFatal(const char *component)
{
- char logfile[128];
- sprintf(logfile, "/media/hdd/enigma2_crash_%u.log", (unsigned int)time(0));
- FILE *f = fopen(logfile, "wb");
+ std::ostringstream os;
+ os << time(0);
+
+ std::string logfile("/media/hdd/enigma2_crash_" + os.str() + ".log");
+
+ FILE *f = fopen(logfile.c_str(), "wb");
std::string lines = getLogBuffer();
/* find python-tracebacks, and extract " File "-strings */
size_t start = 0;
- char crash_emailaddr[256] = CRASH_EMAILADDR;
- char crash_component[256] = "enigma2";
+ std::string crash_emailaddr = CRASH_EMAILADDR;
+ std::string crash_component = "enigma2";
if (component)
- snprintf(crash_component, 256, component);
+ crash_component = component;
else
{
while ((start = lines.find("\n File \"", start)) != std::string::npos)
if (end == std::string::npos)
break;
- if (end - start >= (256 - strlen(INFOFILE)))
- continue;
- char filename[256];
- snprintf(filename, 256, "%s%s", lines.substr(start, end - start).c_str(), INFOFILE);
- FILE *cf = fopen(filename, "r");
- if (cf)
- {
- fgets(crash_emailaddr, sizeof crash_emailaddr, cf);
- if (*crash_emailaddr && crash_emailaddr[strlen(crash_emailaddr)-1] == '\n')
- crash_emailaddr[strlen(crash_emailaddr)-1] = 0;
-
- fgets(crash_component, sizeof crash_component, cf);
- if (*crash_component && crash_component[strlen(crash_component)-1] == '\n')
- crash_component[strlen(crash_component)-1] = 0;
- fclose(cf);
+
+ std::string filename(lines.substr(start, end - start) + INFOFILE);
+ std::ifstream in(filename.c_str());
+ if (in.good()) {
+ std::getline(in, crash_emailaddr) && std::getline(in, crash_component);
+ in.close();
}
}
}
if (f)
{
time_t t = time(0);
- char crashtime[STDBUFFER_SIZE];
- sprintf(crashtime, "%s",ctime(&t));
- if (strlen(crashtime) && crashtime[strlen(crashtime)-1] == '\n')
- crashtime[strlen(crashtime)-1] = 0;
- fprintf(f, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n<opendreambox>\n");
- fprintf(f, "\t<enigma2>\n");
- fprintf(f, "\t\t<crashdate>%s</crashdate>\n", crashtime);
- #ifdef ENIGMA2_CHECKOUT_TAG
- fprintf(f, "\t\t<checkouttag>" ENIGMA2_CHECKOUT_TAG "</checkouttag>\n");
- #else
- fprintf(f, "\t\t<compiledate>" __DATE__ "</compiledate>\n");
- #endif
- #ifdef ENIGMA2_CHECKOUT_ROOT
- fprintf(f, "\t\t<checkoutroot>" ENIGMA2_CHECKOUT_ROOT "</checkoutroot>\n");
- #endif
- fprintf(f, "\t\t<contactemail>%s</contactemail>\n", crash_emailaddr);
- fprintf(f, "\t\t<!-- Please email this crashlog to above address -->\n");
- std::string activeSkin = getConfigFileValue("config.skin.primary_skin");
- if (activeSkin != "Error")
- {
- if (activeSkin == "")
- activeSkin = "Default Skin";
- fprintf(f, "\t\t<skin>%s</skin>\n", activeSkin.c_str());
- }
- fprintf(f, "\t</enigma2>\n");
+ struct tm tm;
+ char tm_str[32];
- fprintf(f, "\t<image>\n");
- std::string model = getFileContent("/proc/stb/info/model");
- if (model != "Error")
- {
- char modelname[STDBUFFER_SIZE];
- sprintf(modelname, "%s",model.c_str());
- if (strlen(modelname) && modelname[strlen(modelname)-1] == '\n')
- modelname[strlen(modelname)-1] = 0;
- fprintf(f, "\t\t<dreamboxmodel>%s</dreamboxmodel>\n", modelname);
- }
- std::string kernel = getFileContent("/proc/cmdline");
- if (kernel != "Error")
- {
- char kernelcmd[STDBUFFER_SIZE];
- sprintf(kernelcmd, "%s",kernel.c_str());
- if (strlen(kernelcmd) && kernelcmd[strlen(kernelcmd)-1] == '\n')
- kernelcmd[strlen(kernelcmd)-1] = 0;
- fprintf(f, "\t\t<kernelcmdline>%s</kernelcmdline>\n", kernelcmd);
- }
- std::string sendAnonCrashlog = getConfigFileValue("config.plugins.crashlogautosubmit.sendAnonCrashlog");
- if (sendAnonCrashlog == "False" || sendAnonCrashlog == "false") // defaults to true... default anonymized crashlogs
- {
- std::string ca = getFileContent("/proc/stb/info/ca");
- if (ca != "Error")
- {
- char dreamboxca[STDBUFFER_SIZE];
- sprintf(dreamboxca, "%s",ca.c_str());
- if (strlen(dreamboxca) && dreamboxca[strlen(dreamboxca)-1] == '\n')
- dreamboxca[strlen(dreamboxca)-1] = 0;
- fprintf(f, "\t\t<dreamboxca>\n\t\t<![CDATA[\n%s\n\t\t]]>\n\t\t</dreamboxca>\n", dreamboxca);
- }
- std::string settings = getFileContent("/etc/enigma2/settings");
- if (settings != "Error")
- {
- fprintf(f, "\t\t<enigma2settings>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</enigma2settings>\n", settings.c_str());
- }
- }
- std::string addNetwork = getConfigFileValue("config.plugins.crashlogautosubmit.addNetwork");
- if (addNetwork == "True" || addNetwork == "true")
- {
- std::string nwinterfaces = getFileContent("/etc/network/interfaces");
- if (nwinterfaces != "Error")
- {
- fprintf(f, "\t\t<networkinterfaces>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</networkinterfaces>\n", nwinterfaces.c_str());
- }
- std::string dns = getFileContent("/etc/resolv.conf");
- if (dns != "Error")
- {
- fprintf(f, "\t\t<dns>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</dns>\n", dns.c_str());
- }
- std::string defaultgw = getFileContent("/etc/default_gw");
- if (defaultgw != "Error")
- {
- char gateway[STDBUFFER_SIZE];
- sprintf(gateway, "%s",defaultgw.c_str());
- if (strlen(gateway) && gateway[strlen(gateway)-1] == '\n')
- gateway[strlen(gateway)-1] = 0;
- fprintf(f, "\t\t<defaultgateway>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</defaultgateway>\n", gateway);
- }
- }
- std::string addWlan = getConfigFileValue("config.plugins.crashlogautosubmit.addWlan");
- if (addWlan == "True" || addWlan == "true")
- {
- std::string wpasupplicant = getFileContent("/etc/wpa_supplicant.conf");
- if (wpasupplicant != "Error")
- {
- fprintf(f, "\t\t<wpasupplicant>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</wpasupplicant>\n", wpasupplicant.c_str());
- }
- }
- std::string imageversion = getFileContent("/etc/image-version");
- if (imageversion != "Error")
- {
- fprintf(f, "\t\t<imageversion>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</imageversion>\n", imageversion.c_str());
+ localtime_r(&t, &tm);
+ strftime(tm_str, sizeof(tm_str), "%a %b %_d %T %Y", &tm);
+
+ XmlGenerator xml(f);
+
+ xml.open("opendreambox");
+
+ xml.open("enigma2");
+ xml.string("crashdate", tm_str);
+ xml.string("compiledate", __DATE__);
+ xml.string("contactemail", crash_emailaddr);
+ xml.comment("Please email this crashlog to above address");
+
+ xml.string("skin", getConfigString("config.skin.primary_skin", "Default Skin"));
+ xml.string("sourcedate", enigma2_date);
+ xml.string("branch", enigma2_branch);
+ xml.string("rev", enigma2_rev);
+ xml.string("version", PACKAGE_VERSION);
+ xml.close();
+
+ xml.open("image");
+ xml.stringFromFile("dreamboxmodel", "/proc/stb/info/model");
+ xml.stringFromFile("kernelcmdline", "/proc/cmdline");
+ xml.stringFromFile("nimsockets", "/proc/bus/nim_sockets");
+ if (!getConfigBool("config.plugins.crashlogautosubmit.sendAnonCrashlog", true)) {
+ xml.cDataFromFile("dreamboxca", "/proc/stb/info/ca");
+ xml.cDataFromFile("enigma2settings", eEnv::resolve("${sysconfdir}/enigma2/settings"), ".password=");
}
- std::string imageissue = getFileContent("/etc/issue.net");
- if (imageissue != "Error")
- {
- fprintf(f, "\t\t<imageissue>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</imageissue>\n", imageissue.c_str());
+ if (getConfigBool("config.plugins.crashlogautosubmit.addNetwork", false)) {
+ xml.cDataFromFile("networkinterfaces", "/etc/network/interfaces");
+ xml.cDataFromFile("dns", "/etc/resolv.conf");
+ xml.cDataFromFile("defaultgateway", "/etc/default_gw");
}
- fprintf(f, "\t</image>\n");
-
- fprintf(f, "\t<software>\n");
- std::string installedplugins = execCommand("ipkg list_installed | grep enigma2");
- fprintf(f, "\t\t<enigma2software>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</enigma2software>\n", installedplugins.c_str());
- std::string dreambox = execCommand("ipkg list_installed | grep dream");
- fprintf(f, "\t\t<dreamboxsoftware>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</dreamboxsoftware>\n", dreambox.c_str());
- std::string gstreamer = execCommand("ipkg list_installed | grep gst");
- fprintf(f, "\t\t<gstreamersoftware>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</gstreamersoftware>\n", gstreamer.c_str());
- fprintf(f, "\t</software>\n");
-
- fprintf(f, "\t<crashlogs>\n");
- std::string buffer = getLogBuffer();
- fprintf(f, "\t\t<enigma2crashlog>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</enigma2crashlog>\n", buffer.c_str());
- std::string pythonmd5 = execCommand("find /usr/lib/enigma2/python/ -name \"*.py\" | xargs md5sum");
- fprintf(f, "\t\t<pythonMD5sum>\n\t\t<![CDATA[\n%s\t\t]]>\n\t\t</pythonMD5sum>\n", pythonmd5.c_str());
- fprintf(f, "\t</crashlogs>\n");
-
- fprintf(f, "\n</opendreambox>\n");
+ if (getConfigBool("config.plugins.crashlogautosubmit.addWlan", false))
+ xml.cDataFromFile("wpasupplicant", "/etc/wpa_supplicant.conf");
+ xml.cDataFromFile("imageversion", "/etc/image-version");
+ xml.cDataFromFile("imageissue", "/etc/issue.net");
+ xml.close();
+
+ xml.open("software");
+ xml.cDataFromCmd("enigma2software", "ipkg list_installed | grep enigma2");
+ xml.cDataFromCmd("dreamboxsoftware", "ipkg list_installed | grep dream");
+ xml.cDataFromCmd("gstreamersoftware", "ipkg list_installed | grep gst");
+ xml.close();
+
+ xml.open("crashlogs");
+ xml.cDataFromString("enigma2crashlog", getLogBuffer());
+ xml.cDataFromCmd("pythonMD5sum", "find " + eEnv::resolve("${libdir}/enigma2/python/") + " -name \"*.py\" | xargs md5sum");
+ xml.close();
+
+ xml.close();
+
fclose(f);
-
}
-
- #ifdef WITH_SDL
- ePtr<gSDLDC> my_dc;
- gSDLDC::getInstance(my_dc);
- #else
- ePtr<gFBDC> my_dc;
- gFBDC::getInstance(my_dc);
- #endif
-
- {
- gPainter p(my_dc);
- p.resetOffset();
- p.resetClip(eRect(ePoint(0, 0), my_dc->size()));
- #ifdef ENIGMA2_CHECKOUT_TAG
- if (ENIGMA2_CHECKOUT_TAG[0] == 'T') /* tagged checkout (release) */
- p.setBackgroundColor(gRGB(0x0000C0));
- else if (ENIGMA2_CHECKOUT_TAG[0] == 'D') /* dated checkout (daily experimental build) */
- {
- srand(time(0));
- int r = rand();
- unsigned int col = 0;
- if (r & 1)
- col |= 0x800000;
- if (r & 2)
- col |= 0x008000;
- if (r & 4)
- col |= 0x0000c0;
- p.setBackgroundColor(gRGB(col));
- }
- #else
- p.setBackgroundColor(gRGB(0x008000));
- #endif
- p.setForegroundColor(gRGB(0xFFFFFF));
-
- ePtr<gFont> font = new gFont("Regular", 20);
- p.setFont(font);
- p.clear();
-
- eRect usable_area = eRect(100, 70, my_dc->size().width() - 150, 100);
-
- char text[512];
- #ifdef BUILD_VUPLUS /* ikseong */
- snprintf(text, 512, "We are really sorry. Your STB encountered "
- #else
- snprintf(text, 512, "We are really sorry. Your Dreambox encountered "
- #endif
- "a software problem, and needs to be restarted. "
- "Please send the logfile created in /hdd/ to %s.\n"
- #ifdef BUILD_VUPLUS /* ikseong */
- "Your STB restarts in 10 seconds!\n"
- #else
- "Your Dreambox restarts in 10 seconds!\n"
- #endif
- "Component: %s",
- crash_emailaddr, crash_component);
-
- p.renderText(usable_area, text, gPainter::RT_WRAP|gPainter::RT_HALIGN_LEFT);
-
- usable_area = eRect(100, 170, my_dc->size().width() - 180, my_dc->size().height() - 20);
-
- int i;
-
- size_t start = std::string::npos + 1;
- for (i=0; i<20; ++i)
+ ePtr<gMainDC> my_dc;
+ gMainDC::getInstance(my_dc);
-
++
+ gPainter p(my_dc);
+ p.resetOffset();
+ p.resetClip(eRect(ePoint(0, 0), my_dc->size()));
+ p.setBackgroundColor(gRGB(0x008000));
+ p.setForegroundColor(gRGB(0xFFFFFF));
+
+ ePtr<gFont> font = new gFont("Regular", 20);
+ p.setFont(font);
+ p.clear();
+
+ eRect usable_area = eRect(100, 70, my_dc->size().width() - 150, 100);
-
- std::string text("We are really sorry. Your Dreambox encountered "
++
++ std::string text("We are really sorry. Your STB encountered "
+ "a software problem, and needs to be restarted. "
+ "Please send the logfile created in /hdd/ to " + crash_emailaddr + ".\n"
- "Your Dreambox restarts in 10 seconds!\n"
++ "Your STB restarts in 10 seconds!\n"
+ "Component: " + crash_component);
+
+ p.renderText(usable_area, text.c_str(), gPainter::RT_WRAP|gPainter::RT_HALIGN_LEFT);
+
+ usable_area = eRect(100, 170, my_dc->size().width() - 180, my_dc->size().height() - 20);
+
+ int i;
+
+ start = std::string::npos + 1;
+ for (i=0; i<20; ++i)
+ {
+ start = lines.rfind('\n', start - 1);
+ if (start == std::string::npos)
{
- start = lines.rfind('\n', start - 1);
- if (start == std::string::npos)
- {
- start = 0;
- break;
- }
+ start = 0;
+ break;
}
-
- font = new gFont("Regular", 14);
- p.setFont(font);
-
- p.renderText(usable_area,
- lines.substr(start), gPainter::RT_HALIGN_LEFT);
- sleep(10);
}
+ font = new gFont("Regular", 14);
+ p.setFont(font);
+
+ p.renderText(usable_area,
+ lines.substr(start), gPainter::RT_HALIGN_LEFT);
+ sleep(10);
+
raise(SIGKILL);
}
eDebug(" (end)");
}
}
- #else
- #warning "no oops support!"
- #define NO_OOPS_SUPPORT
#endif
void handleFatalSignal(int signum, siginfo_t *si, void *ctx)
{
+ #ifndef NO_OOPS_SUPPORT
ucontext_t *uc = (ucontext_t*)ctx;
- #ifndef NO_OOPS_SUPPORT
oops(uc->uc_mcontext, signum == SIGSEGV || signum == SIGABRT);
#endif
eDebug("-------");
void bsodCatchSignals()
{
struct sigaction act;
- act.sa_handler = SIG_DFL;
act.sa_sigaction = handleFatalSignal;
act.sa_flags = SA_RESTART | SA_SIGINFO;
if (sigemptyset(&act.sa_mask) == -1)