summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94>2008-05-09 14:28:37 +0000
committertv <tv@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94>2008-05-09 14:28:37 +0000
commitaea98e9ff61f04e7e57fc77cecaada4456d48324 (patch)
tree5923a79327b243ad4c587068deea0a4cbaf622fb
parent95a41bc1c63daeb8a20722671ae753b617b8e617 (diff)
downloaddraksnapshot-aea98e9ff61f04e7e57fc77cecaada4456d48324.tar
draksnapshot-aea98e9ff61f04e7e57fc77cecaada4456d48324.tar.gz
draksnapshot-aea98e9ff61f04e7e57fc77cecaada4456d48324.tar.bz2
draksnapshot-aea98e9ff61f04e7e57fc77cecaada4456d48324.tar.xz
draksnapshot-aea98e9ff61f04e7e57fc77cecaada4456d48324.zip
(firstCheck) exclude root fs from found USB discs
git-svn-id: http://svn.mandriva.com/svn/soft/draksnapshot/trunk@242420 99302b65-d5f7-0310-b3dd-f8cd6f4e3d94
-rw-r--r--NEWS1
-rwxr-xr-xdraksnapshot-applet18
2 files changed, 19 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 8ebf685..99d8798 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
- applet:
o do not crash if notify deamon failed on ->show (#40031)
+ o exclude root fs from found USB discs:
Version 0.9 - 3 April 2008, Thierry Vignaud
diff --git a/draksnapshot-applet b/draksnapshot-applet
index 6e6265b..a44a1ba 100755
--- a/draksnapshot-applet
+++ b/draksnapshot-applet
@@ -170,6 +170,24 @@ sub configure() {
sub firstCheck() {
my @discs = grep { $_->{usb_bus} && detect_devices::may_be_a_hd($_) } detect_devices::getSCSI();
+
+ # find root fs:
+ my $root;
+ foreach (cat_("/etc/mtab"), cat_("/proc/mounts")) {
+ my ($dev, $mntpoint) = split;
+ if ($mntpoint eq '/') {
+ $root = $dev;
+ last;
+ }
+ }
+
+ # we just want the basename of the root disc:
+ $root =~ s!.*/!!;
+ $root =~ s!\d*$!!;
+
+ # exclude root fs from found USB discs:
+ @discs = grep { $_ ne $root } map { $_->{device} } @discs;
+
go2State(@discs ? 'disk_found' : 'okay');
}