diff options
author | Maarten Vanraes <alien@mageia.org> | 2016-08-06 14:46:53 +0200 |
---|---|---|
committer | Maarten Vanraes <alien@mageia.org> | 2016-08-07 17:13:14 +0200 |
commit | b63f536d4913967000aeda6a704340549bbe47f0 (patch) | |
tree | 738ce37a73166458d4f4ffc9a9242f462382162a | |
parent | 006398d5a14e325cd1f0f9a0fb61625533a7aec1 (diff) | |
download | manatools-b63f536d4913967000aeda6a704340549bbe47f0.tar manatools-b63f536d4913967000aeda6a704340549bbe47f0.tar.gz manatools-b63f536d4913967000aeda6a704340549bbe47f0.tar.bz2 manatools-b63f536d4913967000aeda6a704340549bbe47f0.tar.xz manatools-b63f536d4913967000aeda6a704340549bbe47f0.zip |
Mount: fix probing
-rw-r--r-- | lib/ManaTools/Shared/disk_backend/Plugin/Mount.pm | 14 |
1 files 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, '</proc/self/mountinfo' or return 0; @@ -366,6 +368,7 @@ override ('probe', sub { my $devpart = undef; # TODO: what about --bind mount points # TODO: keep in mind loopbacked files! + $self->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') : '<unknown>'); - # 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 |