mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 09:21:09 +02:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user