vdr-addon: moved REMOVE_MODULES to addon config

This commit is contained in:
Stefan Saraev 2012-03-08 20:47:17 +02:00
parent 1fdfab121e
commit 77cfb80df8
5 changed files with 33 additions and 28 deletions

View File

@ -33,7 +33,6 @@ mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/config
cp $BUILD/vdr-[0-9]*/sources.conf $ADDON_BUILD/$PKG_ADDON_ID/config
cp $BUILD/vdr-[0-9]*/svdrphosts.conf $ADDON_BUILD/$PKG_ADDON_ID/config
echo '0.0.0.0/0' >> $ADDON_BUILD/$PKG_ADDON_ID/config/svdrphosts.conf
cp -PR $PKG_DIR/config/vdr-sleep.conf $ADDON_BUILD/$PKG_ADDON_ID/config
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/plugin
cp -PR $BUILD/vdr-plugin-xvdr-*/libvdr*.so.* $ADDON_BUILD/$PKG_ADDON_ID/plugin

View File

@ -1,6 +0,0 @@
# space-separated list of modules to remove on suspend
# and load on resume
# example:
# REMOVE_MODULES="cx23885 mantis"
REMOVE_MODULES=""

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<strings>
<string id="1000">DVB</string>
<string id="1020">DVB Configuration</string>
<string id="1021">Unload DVB mudules before suspend</string>
</strings>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<category label="1000">
<setting label="1020" type="lsep"/>
<setting type="sep" />
<setting id="REMOVE_MODULES" type="text" label="1021" values="" default=""/>
</category>
</settings>

View File

@ -24,26 +24,24 @@
ADDON_HOME="$HOME/.xbmc/userdata/addon_data/service.multimedia.vdr-addon"
ADDON_CONFIG_DIR="$ADDON_HOME/config"
ADDON_SETTINGS="$ADDON_HOME/settings.xml"
REMOVE_MODULES=`grep REMOVE_MODULES $ADDON_SETTINGS | awk '{print $3}' | sed -e "s,value=,," -e "s,\",,g"`
if [ -f "$ADDON_CONFIG_DIR/vdr-sleep.conf" ]; then
. "$ADDON_CONFIG_DIR/vdr-sleep.conf"
if [ ! "$REMOVE_MODULES" == "" ] ; then
case "$1" in
hibernate|suspend)
vdr.stop
for module in $REMOVE_MODULES ; do
rmmod -w $module
done
;;
thaw|resume)
for module in $REMOVE_MODULES ; do
modprobe $module
done
xbmc-send --host=127.0.0.1 -a "XBMC.RunScript(service.multimedia.vdr-addon)" &
;;
*) exit $NA
;;
esac
fi
if [ ! "$REMOVE_MODULES" == "" ] ; then
case "$1" in
hibernate|suspend)
vdr.stop
for module in $REMOVE_MODULES ; do
rmmod -w $module
done
;;
thaw|resume)
for module in $REMOVE_MODULES ; do
modprobe $module
done
xbmc-send --host=127.0.0.1 -a "XBMC.RunScript(service.multimedia.vdr-addon)" &
;;
*) exit $NA
;;
esac
fi