enigma2: set the linux OOM score for the enigma2 process.. so the kernel first kills...
authorhschang <chang@dev3>
Tue, 5 Feb 2013 08:04:30 +0000 (17:04 +0900)
committerhschang <chang@dev3>
Wed, 6 Feb 2013 07:03:04 +0000 (16:03 +0900)
meta-openvuplus/recipes-vuplus/enigma2/enigma2.bb
meta-openvuplus/recipes-vuplus/enigma2/enigma2/enigma2_vuplus_proc_oom_score_adj.patch [new file with mode: 0644]

index c513389..b3ca68b 100644 (file)
@@ -85,7 +85,7 @@ RDEPENDS_enigma2-plugin-systemplugins-3gmodemmanager = "ppp usb-modeswitch usb-m
 RDEPENDS_enigma2-plugin-systemplugins-devicemanager = "util-linux-blkid ntfs-3g dosfstools"
 
 PN = "enigma2"
-PR = "r7"
+PR = "r8"
 
 SRCDATE = "20121128"
 #SRCDATE is NOT used by git to checkout a specific revision
@@ -110,6 +110,7 @@ SRC_URI = "git://code.vuplus.com/git/dvbapp.git;protocol=http;branch=${BRANCH};t
            file://enigma2_vuplus_addlibpythondeps.patch;patch=1;pnum=1 \
           file://enigma2_vuplus_pluginbrowser.patch;striplevel=1 \
           file://enigma2_vuplus_transcodingsetup_inetd.patch;striplevel=1 \
+           file://enigma2_vuplus_proc_oom_score_adj.patch;striplevel=1 \
            file://MyriadPro-Regular.otf \
            file://MyriadPro-Semibold.otf \
            file://MyriadPro-SemiboldIt.otf \
diff --git a/meta-openvuplus/recipes-vuplus/enigma2/enigma2/enigma2_vuplus_proc_oom_score_adj.patch b/meta-openvuplus/recipes-vuplus/enigma2/enigma2/enigma2_vuplus_proc_oom_score_adj.patch
new file mode 100644 (file)
index 0000000..f4c7d41
--- /dev/null
@@ -0,0 +1,14 @@
+diff --git a/tools/enigma2.sh.in b/tools/enigma2.sh.in
+index 2f9292a..170835e 100755
+--- a/tools/enigma2.sh.in
++++ b/tools/enigma2.sh.in
+@@ -24,6 +24,9 @@ if [ -e @libdir@/libpassthrough.so ]; then
+       LIBS="$LIBS @libdir@/libpassthrough.so"
+ fi
++(sleep 2; echo "enigma2 is the main pvr application... adjust oom score!"; PID=$(pidof enigma2); \
++        [ -e /proc/$PID/oom_score_adj ] && echo "-999" > /proc/$PID/oom_score_adj || echo "-17" > /proc/$PID/oom_adj;) &
++
+ LD_PRELOAD=$LIBS @bindir@/enigma2
+ # enigma2 exit codes: