gui/hdd_menu.cpp: disable 1min sleep option;

fix restore hotplug for mdev system


Origin commit data
------------------
Commit: 8020de8bfe
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2014-02-12 (Wed, 12 Feb 2014)
This commit is contained in:
[CST] Focus
2014-02-12 16:27:12 +04:00
parent 3375b332d5
commit 9fcec0d30d

View File

@@ -75,7 +75,7 @@ const CMenuOptionChooser::keyval HDD_FILESYS_OPTIONS[HDD_FILESYS_OPTION_COUNT] =
const CMenuOptionChooser::keyval HDD_SLEEP_OPTIONS[HDD_SLEEP_OPTION_COUNT] =
{
{ 0, LOCALE_OPTIONS_OFF },
{ 12, LOCALE_HDD_1MIN },
//{ 12, LOCALE_HDD_1MIN },
{ 60, LOCALE_HDD_5MIN },
{ 120, LOCALE_HDD_10MIN },
{ 240, LOCALE_HDD_20MIN },
@@ -277,6 +277,9 @@ int CHDDDestExec::exec(CMenuTarget* /*parent*/, const std::string&)
const char hdidle[] = "/sbin/hd-idle";
bool have_hdidle = !access(hdidle, X_OK);
if (g_settings.hdd_sleep < 60)
g_settings.hdd_sleep = 60;
if (have_hdidle) {
system("kill $(pidof hd-idle)");
int sleep_seconds = g_settings.hdd_sleep;
@@ -516,7 +519,11 @@ _remount:
}
f = fopen("/proc/sys/kernel/hotplug", "w");
if(f) {
#ifdef ASSUME_MDEV
fprintf(f, "/sbin/mdev\n");
#else
fprintf(f, "/sbin/hotplug\n");
#endif
fclose(f);
}