summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94>2008-09-29 15:54:47 +0000
committertv <tv@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94>2008-09-29 15:54:47 +0000
commit58c97661a8eea453963cb5de73320a9557ab1ef2 (patch)
treeb4302a6c7f8c7140b1f654091388ccc247fa0841
parent4a64725e5ae88e05fff9e538972fc5d07736f36d (diff)
downloaddraksnapshot-58c97661a8eea453963cb5de73320a9557ab1ef2.tar
draksnapshot-58c97661a8eea453963cb5de73320a9557ab1ef2.tar.gz
draksnapshot-58c97661a8eea453963cb5de73320a9557ab1ef2.tar.bz2
draksnapshot-58c97661a8eea453963cb5de73320a9557ab1ef2.tar.xz
draksnapshot-58c97661a8eea453963cb5de73320a9557ab1ef2.zip
(is_proper_device,firstCheck) use HAL in order to detect discs avaible
for backup, thus not detecting some internal SATA discs (#41107) git-svn-id: http://svn.mandriva.com/svn/soft/draksnapshot/trunk@247021 99302b65-d5f7-0310-b3dd-f8cd6f4e3d94
-rw-r--r--NEWS4
-rwxr-xr-xdraksnapshot-applet12
2 files changed, 13 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 2b43893..1ecc938 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+- applet:
+ o use HAL in order to detect discs avaible for backup,
+ thus not detecting some internal SATA discs (#41107)
+
Version 0.14 - 26 September 2008, Thierry Vignaud
- applet:
diff --git a/draksnapshot-applet b/draksnapshot-applet
index 655886c..a8b8082 100755
--- a/draksnapshot-applet
+++ b/draksnapshot-applet
@@ -208,13 +208,19 @@ sub configure() {
}
sub is_proper_device {
- my ($device) = @_;
- $device->QueryCapability('volume') && !$device->GetProperty('volume.is_disc') &&
+ my ($device, $o_is_first_check) = @_;
+ my $device_name = $device->QueryCapability('block') && $device->GetProperty('block.device');
+ return if !$device_name;
+ my $bool = $device->QueryCapability('volume') && !$device->GetProperty('volume.is_disc') &&
$device->GetProperty('volume.is_mounted');
+ return $o_is_first_check ? $bool && $device_name && cat_('/media/.hal-mtab') =~ m!^$device_name\s!sg : $bool;
}
sub firstCheck() {
- my @discs = grep { $_->{usb_bus} && detect_devices::may_be_a_hd($_) } detect_devices::getSCSI();
+ my $hal = $dbus->get_service($hal_dn);
+ my $manager = $hal->get_object($manager_path, $hal_manager);
+
+ my @discs = grep { is_proper_device($_, 1) } map { $hal->get_object($_, "$hal_dn.Device") } @{$manager->GetAllDevices};
# find root fs:
my $root;