From b63f536d4913967000aeda6a704340549bbe47f0 Mon Sep 17 00:00:00 2001 From: Maarten Vanraes Date: Sat, 6 Aug 2016 14:46:53 +0200 Subject: Mount: fix probing --- lib/ManaTools/Shared/disk_backend/Plugin/Mount.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/ManaTools/Shared/disk_backend/Plugin/Mount.pm b/lib/ManaTools/Shared/disk_backend/Plugin/Mount.pm index 1ff2b5d1..ddcf4bba 100644 --- a/lib/ManaTools/Shared/disk_backend/Plugin/Mount.pm +++ b/lib/ManaTools/Shared/disk_backend/Plugin/Mount.pm @@ -353,6 +353,8 @@ override ('changedpart', sub { #============================================================= override ('probe', sub { my $self = shift; + my $bd = $self->parent(); + $self->D('starting probe for %s', $self); # check current mounts and create a Mount for each one # TODO: find the in device (create if needed?) open F, 'D('try to find device %s', $fields[2]); my @parts = grep { $_->type() ne 'Mount' } $bd->findpartprop(undef, 'dev', $fields[2]); if (scalar(@parts) == 0) { $devpart = $bd->mkpart('UnknownBlockDevice', {plugin => $self, devicepath => $fields[4], loaded => undef, saved => undef}); @@ -377,19 +380,20 @@ override ('probe', sub { ## try to find filesystem # if not found, create an UnknownFS for it - $self->D('find dev %s with fstype %s (srcmount %s)', $fields[2], $fields[8], $fields[9]); + $self->D('find fs with dev %s with fstype %s (srcmount %s)', $fields[2], $fields[8], $fields[9]); my $fs = $devpart->trychild(ManaTools::Shared::disk_backend::Part->CurrentState, sub { my $self = shift; my $parameters = shift; my $dev = shift; my $fstype = shift; + $self->plugin()->D('identifying %s', $self); # only filesystems - return 0 if !$self->does('ManaTools::Shared::disk_backend::FileSystem'); - $self->plugin()->D('part is a FileSystem with type %s', $self->prop('fstype')); + return 0 if !$self->does('ManaTools::Shared::disk_backend::Mountable'); + $self->plugin()->D('part is Mountable with type %s', defined($self->prop('fstype')) ? $self->prop('fstype') : ''); - # needs to be this fstype - return 0 if ($self->prop('fstype') ne $fields[8]); + # fstype does not need to be matched + #return 0 if ($self->prop('fstype') ne $fields[8]); # TODO: need to check srcmount $fields[9] as well -- cgit v1.2.1