Index: /ipk/source/system_permanenttimeshift_2_0/CONTROL/control
===================================================================
--- /ipk/source/system_permanenttimeshift_2_0/CONTROL/control	(revision 2840)
+++ /ipk/source/system_permanenttimeshift_2_0/CONTROL/control	(revision 2840)
@@ -0,0 +1,10 @@
+Package: enigma2-plugin-system-permanenttimeshift
+Version: 2.0
+Architecture: sh4
+OE: PermanentTimeshift v2.0
+Section: extra
+Priority: optional
+Maintainer: AAF
+Homepage: http://www.aaf-digital.info
+Description: PermanentTimeshift v2.0
+Source: http://www.aaf-digital.info
Index: /ipk/source/system_permanenttimeshift_2_0/CONTROL/postinst
===================================================================
--- /ipk/source/system_permanenttimeshift_2_0/CONTROL/postinst	(revision 2840)
+++ /ipk/source/system_permanenttimeshift_2_0/CONTROL/postinst	(revision 2840)
@@ -0,0 +1,13 @@
+#!/bin/sh
+TMP=/tmp/.au
+PLUGINDIR=/usr/lib/enigma2/python/Plugins/Extensions/PermanentTimeshift
+
+echo "successfully installed"
+echo "syncing disk"
+sync
+if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1 | wc -l` -eq 1 ]; then
+	SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1`
+	FREE=`expr $SPACE - 100`
+	echo new freespace size $FREE kb
+fi
+exit 0
Index: /ipk/source/system_permanenttimeshift_2_0/CONTROL/postrm
===================================================================
--- /ipk/source/system_permanenttimeshift_2_0/CONTROL/postrm	(revision 2840)
+++ /ipk/source/system_permanenttimeshift_2_0/CONTROL/postrm	(revision 2840)
@@ -0,0 +1,14 @@
+#!/bin/sh
+TMP=/tmp/.au
+PLUGINDIR=/usr/lib/enigma2/python/Plugins/Extensions/PermanentTimeshift
+rm -r $PLUGINDIR > /dev/null 2>&1
+
+echo "successfully removed"
+echo "syncing disk"
+sync
+if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1 | wc -l` -eq 1 ]; then
+	SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1`
+	FREE=`expr $SPACE - 100`
+	echo new freespace size $FREE kb
+fi
+exit 0
Index: /ipk/source/system_permanenttimeshift_2_0/CONTROL/preinst
===================================================================
--- /ipk/source/system_permanenttimeshift_2_0/CONTROL/preinst	(revision 2840)
+++ /ipk/source/system_permanenttimeshift_2_0/CONTROL/preinst	(revision 2840)
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+TMP=/tmp/.au
+echo "syncing disk"
+sync
+
+if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1 | wc -l` -eq 1 ]; then
+	SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1`
+	FREE=`expr $SPACE - 100`
+	SIZE=28
+	echo "checking freespace"
+	echo packege size $SIZE kb
+	echo freespace size $FREE kb
+	if  [ "$FREE" -lt "$SIZE" ]; then
+		echo "sorry no freespace left on device"
+		exit 1
+	else
+		echo ok
+	fi
+fi   
+echo "installing PermanentTimeshift ..."
+echo "checking OS"
+if  [ `cat /etc/motd | grep AAF | grep M | grep rev | wc -l` -eq 0 ]; then                      
+	echo ---------------------------
+	echo DONT USE this IPK Package!!
+	echo ---
+	echo Only for AAF Image!!
+	echo ---------------------------
+	exit 1
+fi
+exit 0
Index: /ipk/source/system_permanenttimeshift_2_0/CONTROL/prerm
===================================================================
--- /ipk/source/system_permanenttimeshift_2_0/CONTROL/prerm	(revision 2840)
+++ /ipk/source/system_permanenttimeshift_2_0/CONTROL/prerm	(revision 2840)
@@ -0,0 +1,11 @@
+#!/bin/sh
+TMP=/tmp/.au
+echo "syncing disk"
+sync
+if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1 | wc -l` -eq 1 ]; then
+	SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1`
+	FREE=`expr $SPACE - 100`
+	echo freespace size $FREE kb
+fi
+echo "removing PermanentTimeshift"
+exit 0
Index: /ipk/source/system_permanenttimeshift_2_0/usr/lib/enigma2/python/Plugins/Extensions/PermanentTimeshift/__init__.py
===================================================================
--- /ipk/source/system_permanenttimeshift_2_0/usr/lib/enigma2/python/Plugins/Extensions/PermanentTimeshift/__init__.py	(revision 2840)
+++ /ipk/source/system_permanenttimeshift_2_0/usr/lib/enigma2/python/Plugins/Extensions/PermanentTimeshift/__init__.py	(revision 2840)
@@ -0,0 +1,17 @@
+import Plugins.Plugin
+from Components.config import config
+from Components.config import ConfigSubsection
+from Components.config import ConfigSelection
+from Components.config import ConfigInteger
+from Components.config import ConfigSubList
+from Components.config import ConfigSubDict
+from Components.config import ConfigText
+from Components.config import configfile
+from Components.config import ConfigYesNo
+
+config.plugins.pts = ConfigSubsection()
+config.plugins.pts.enabled = ConfigYesNo(default = False)
+config.plugins.pts.maxlength = ConfigInteger(default=180, limits=(1, 999))
+config.plugins.pts.disableInstantRec = ConfigYesNo(default = False)
+config.plugins.pts.startdelay = ConfigInteger(default=5, limits=(1, 999))
+config.plugins.pts.showdebug = ConfigYesNo(default = False)
Index: /ipk/source/system_permanenttimeshift_2_0/usr/lib/enigma2/python/Plugins/Extensions/PermanentTimeshift/plugin.py
===================================================================
--- /ipk/source/system_permanenttimeshift_2_0/usr/lib/enigma2/python/Plugins/Extensions/PermanentTimeshift/plugin.py	(revision 2840)
+++ /ipk/source/system_permanenttimeshift_2_0/usr/lib/enigma2/python/Plugins/Extensions/PermanentTimeshift/plugin.py	(revision 2840)
@@ -0,0 +1,94 @@
+#===============================================================================
+# Permanent Timeshift Setup by Homey
+#
+# This is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#===============================================================================
+
+from Plugins.Plugin import PluginDescriptor
+from Screens.Screen import Screen
+
+from Components.ActionMap import ActionMap, NumberActionMap
+from Components.Label import Label
+from Components.Button import Button
+
+from Components.ConfigList import ConfigList
+from Components.ConfigList import ConfigListScreen
+from Components.config import *
+
+#------------------------------------------------------------------------------------------
+
+class PermanentTimeShiftSetup(Screen):
+	skin = """
+		<screen position="70,90" size="560,330" title="Settings" >
+			<widget name="configlist" position="5,5" size="480,335" />
+			<ePixmap name="red" position="120,280" zPosition="4" size="140,40" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/PermanentTimeshift/button-red.png" transparent="1" alphatest="on" />
+			<ePixmap name="green" position="320,280" zPosition="4" size="140,40" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/PermanentTimeshift/button-green.png" transparent="1" alphatest="on" />
+			<widget name="key_red" position="120,280" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
+			<widget name="key_green" position="320,280" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
+		</screen>"""
+	
+	def __init__(self, session):
+		Screen.__init__(self, session)
+
+		self["actions"] = NumberActionMap(["SetupActions", "ColorActions"],
+		{
+			"ok": self.keySave,
+			"green": self.keySave,
+			"red": self.Exit,
+			"cancel": self.Exit,
+			"left": self.keyLeft,
+			"right": self.keyRight,
+			"0": self.keyNumber,
+			"1": self.keyNumber,
+			"2": self.keyNumber,
+			"3": self.keyNumber,
+			"4": self.keyNumber,
+			"5": self.keyNumber,
+			"6": self.keyNumber,
+			"7": self.keyNumber,
+			"8": self.keyNumber,
+			"9": self.keyNumber
+		}, -1)
+
+		self["key_red"] = Button(_("Cancel"))
+		self["key_green"] = Button(_("OK"))
+		
+		self.list = []
+		self.list.append(getConfigListEntry(_("Permanent TimeShift Enable"), config.plugins.pts.enabled))
+		self.list.append(getConfigListEntry(_("Permanent TimeShift Max Length"), config.plugins.pts.maxlength))
+		self.list.append(getConfigListEntry(_("Permanent TimeShift Delay"), config.plugins.pts.startdelay))
+		self.list.append(getConfigListEntry(_("Disable Instant Record Button"), config.plugins.pts.disableInstantRec))
+		self.list.append(getConfigListEntry(_("Show Debug Messages"), config.plugins.pts.showdebug))
+		self["configlist"] = ConfigList(self.list)
+
+	def keyLeft(self):
+		self["configlist"].handleKey(KEY_LEFT)
+
+	def keyRight(self):
+		self["configlist"].handleKey(KEY_RIGHT)
+		
+	def keyNumber(self, number):
+		self["configlist"].handleKey(KEY_0 + number)
+
+	def keySave(self):
+		config.plugins.pts.save()
+		configfile.save()
+		self.close()
+		
+	def Exit(self):
+		self.close()
+		
+#------------------------------------------------------------------------------------------
+
+def main(session, **kwargs):
+	session.open(PermanentTimeShiftSetup)
+
+def Plugins(**kwargs):
+ 	return PluginDescriptor(
+		name="Permanent Timeshift", 
+		description="Permanent Timeshift Setup", 
+		where = [ PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_PLUGINMENU ],
+		fnc = main)
