mirror of
https://github.com/linuxmint/timeshift.git
synced 2024-09-11 08:55:25 +03:00
Check /proc/cmdline for the live-session check.
Don't rely on the filesystem layout.
This commit is contained in:
parent
a185cefb5c
commit
a75436482e
@ -168,6 +168,8 @@ public class Main : GLib.Object{
|
|||||||
public string encrypted_home_dirs = "";
|
public string encrypted_home_dirs = "";
|
||||||
public bool encrypted_home_warning_shown = false;
|
public bool encrypted_home_warning_shown = false;
|
||||||
|
|
||||||
|
private int _live_system = -1;
|
||||||
|
|
||||||
public string encrypted_private_dirs = "";
|
public string encrypted_private_dirs = "";
|
||||||
public bool encrypted_private_warning_shown = false;
|
public bool encrypted_private_warning_shown = false;
|
||||||
|
|
||||||
@ -950,8 +952,19 @@ public class Main : GLib.Object{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public bool live_system(){
|
public bool live_system(){
|
||||||
//return true;
|
/* Initialize once block */
|
||||||
return (sys_root == null);
|
if (_live_system == -1) {
|
||||||
|
var cmdline = file_read("/proc/cmdline");
|
||||||
|
|
||||||
|
if (cmdline.contains("boot=casper") || cmdline.contains("boot=live")) {
|
||||||
|
log_msg ("Live Session detected, backup is disabled.");
|
||||||
|
_live_system = 1;
|
||||||
|
} else {
|
||||||
|
_live_system = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (_live_system == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// backup
|
// backup
|
||||||
|
Loading…
Reference in New Issue
Block a user