-
Notifications
You must be signed in to change notification settings - Fork 884
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3038 from stefansaraev/suspend
[RFC] disable suspend if booting from removable storage
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
.../sysutils/systemd/patches/systemd-11_disable-suspend-if-dev-.suspend_disabled-exist.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
From a8ad8aadc39820594f89d43aa0f8d527b256aa99 Mon Sep 17 00:00:00 2001 | ||
From: Stefan Saraev <stefan@saraev.ca> | ||
Date: Sat, 22 Mar 2014 13:40:55 +0200 | ||
Subject: [PATCH] disable suspend if /dev/.suspend_disabled exist | ||
|
||
--- | ||
src/shared/sleep-config.c | 4 ++++ | ||
1 file changed, 4 insertions(+) | ||
|
||
diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c | ||
index cf1cd40..f6ad307 100644 | ||
--- a/src/shared/sleep-config.c | ||
+++ b/src/shared/sleep-config.c | ||
@@ -256,6 +256,10 @@ int can_sleep(const char *verb) { | ||
streq(verb, "hibernate") || | ||
streq(verb, "hybrid-sleep")); | ||
|
||
+ // boo | ||
+ if (access("/dev/.suspend_disabled", F_OK) == 0) | ||
+ return false; | ||
+ | ||
r = parse_sleep_config(verb, &modes, &states); | ||
if (r < 0) | ||
return false; | ||
-- | ||
1.9.1 | ||
|
290fafc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, no suspend anymore on my acer revo which is booted from sdcard. this makes me sad.
poor me ...
290fafc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is your sdcard considered "removable" device? depends on the controller I guess. on RPi (integrated controller) it is NOT removable. usb sdcard readers are "removable". there is a very good reason for this PR..
290fafc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All sdcard readers on classic x86 pcs that I have seen were USB devices. so they are removable. In the old days when I first setup Openelec, I thougth it was a good idea to at least leave the system on the card and have /storage on the harddisk. so I could easily switch between versions.
I have no idea, how many users boot from sdcard.