Merge pull request #1505 from stefansaraev/standby

make hdd standby optional, default timeout is 15 min
This commit is contained in:
Stephan Raue 2012-11-26 06:30:09 -08:00
commit 78aa66173a
4 changed files with 19 additions and 5 deletions

View File

@ -1,5 +1,7 @@
<settings>
<setting id="LCD_DRIVER" value="none" />
<setting id="HDD_STANDBY" value="false" />
<setting id="HDD_STANDBY_TIME" value="15" />
<setting id="NET_DNS1" value="" />
<setting id="NET_DNS2" value="" />
<setting id="NET_DNS3" value="" />

View File

@ -10,6 +10,9 @@
<string id="2021">System Update</string>
<string id="2050">LCD/VFD</string>
<string id="2051">LCD Driver to use</string>
<string id="2060">HDD standby</string>
<string id="2061">Enable HDD standby</string>
<string id="2062">HDD standby timeout (minutes)</string>
<!-- Network -->
<string id="2100">Network</string>

View File

@ -13,6 +13,10 @@
<setting label="2050" type="lsep"/>
<setting type="sep" />
<setting id="LCD_DRIVER" type="labelenum" label="2051" values="none|irtrans|imon|imonlcd|mdm166a|MtxOrb|dm140|lis" sort="yes" default="none" />
<setting label="2060" type="lsep"/>
<setting type="sep" />
<setting id="HDD_STANDBY" type="bool" label="2061" default="false" />
<setting id="HDD_STANDBY_TIME" type="number" label="2062" default="15" visible="eq(-1,true)" />
</category>
<!-- Network -->

View File

@ -23,12 +23,17 @@
#
# runlevels: openelec, installer, textmode
# Standbytime in 5sec steps (180 = 15min)
STANDBY_TIME=180
if [ -f /var/config/settings.conf ]; then
. /var/config/settings.conf
fi
progress "Setup HDD standby"
(
(
if [ "$HDD_STANDBY" == "true" ] ; then
progress "Setup HDD standby"
[ -z "$HDD_STANDBY_TIME" ] && HDD_STANDBY_TIME=15
STANDBY_TIME=$[$HDD_STANDBY_TIME * 12]
for disk in /dev/sd?; do
hdparm -S $STANDBY_TIME $disk > /dev/null 2>&1
done
)&
fi
)&