From 035d7d1642de1e48515a619f16769dc8baf175f9 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Mon, 3 May 2010 13:33:22 +0000 Subject: get major/minor of device mapper correctly now that they are links --- perl-install/devices.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'perl-install/devices.pm') diff --git a/perl-install/devices.pm b/perl-install/devices.pm index a50d70953..719472cea 100644 --- a/perl-install/devices.pm +++ b/perl-install/devices.pm @@ -173,6 +173,16 @@ sub entry { } } } + # Try to access directly the device + # Now device mapper devices are links and do not appear in /proc or /sys + unless ($type) { + if (-e "/dev/$_") { + my (undef,undef,$mode,undef,undef,undef,$rdev,undef) = stat("/dev/$_"); + ($major, $minor) = unmakedev($rdev); + $type = $mode & c::S_IFMT(); + } + } + $type or internal_error("unknown device $_"); ($type, $major, $minor); } -- cgit v1.2.1