Bug#712572: fai-setup-storage: Fails to identify some drives in certain controller configurations

2013-08-27 Thread Thomas Lange
I just included your patch into the git master branch. Thanks a lot. It
will be part of FAI 4.1
-- 
regards Thomas


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#712572: fai-setup-storage: Fails to identify some drives in certain controller configurations

2013-06-17 Thread Alexandros Kosiaris
Package: fai-setup-storage
Severity: normal
Tags: patch

Dear Maintainer,

While trying to use fai to setup some HP Proliant DL 380 G7 servers with
two controllers, one with internal disks connected to it and one with
two selves of 15 disks each connected cascadingly to it it was noticed
that some drives would not be detected by setup-storage. Both
controllers are driven by cciss driver which shows up drives in a format
like: /dev/cciss/c0d0
While trying to figure out the problem I noticed that drive detection
relies on using some regular expressions to parse /proc/partitions. Those
were not matching drives with more than 1 digit (i.e. /dev/cciss/c0d12).
After ameliorating them with the provided patch (which also applies to
master in github) the problem was resolved and all drives were
succefully detected.

-- System Information:
Debian Release: 7.0
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
From dd3c48663ea8e712270f845e71aa5504aed55603 Mon Sep 17 00:00:00 2001
From: Alexandros Kosiaris akosia...@gmail.com
Date: Mon, 17 Jun 2013 13:46:37 +0300
Subject: [PATCH] Handle better some controllers drive detection

In some cases drives in some controllers would not be detected by fai
and would not be present during partitioning. Turns out this is caused
by some regular expressions not matching correctly some cases, for
example ccciss/c0d12.  Amending those regular expressions to fix that
---
 lib/fai-disk-info |2 +-
 lib/setup-storage/Init.pm |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/fai-disk-info b/lib/fai-disk-info
index 4b09e58..1ba4ebd 100755
--- a/lib/fai-disk-info
+++ b/lib/fai-disk-info
@@ -19,6 +19,6 @@ checkdisk() {
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 # echo a space separated list of devices and their block size
-egrep ' etherd/e[[:digit:]]+\.[[:digit:]]+\b| i2o/hd.\b| cciss/c.d.\b| ida/c.d.\b| rd/c.d.\b| hd.\b| sd[a-z]{1,2}\b|/disc\b| vd.\b| xvd.\b' /proc/partitions | checkdisk
+egrep ' etherd/e[[:digit:]]+\.[[:digit:]]+\b| i2o/hd.+\b| cciss/c.+d.+\b| ida/c.+d.+\b| rd/c.+d.+\b| hd.\b| sd[a-z]{1,2}\b|/disc\b| vd.\b| xvd.\b' /proc/partitions | checkdisk
 
 
diff --git a/lib/setup-storage/Init.pm b/lib/setup-storage/Init.pm
index 751efb2..d829916 100644
--- a/lib/setup-storage/Init.pm
+++ b/lib/setup-storage/Init.pm
@@ -236,7 +236,7 @@ sub phys_dev {
 return (1, /dev/$1, $2);
   }
   elsif ($dev =~
-m{^/dev/(cciss/c\dd\d|ida/c\dd\d|rd/c\dd\d|ataraid/d\d|etherd/e\d+\.\d+)(p(\d+))?$})
+m{^/dev/(cciss/c\d+d\d+|ida/c\d+d\d+|rd/c\d+d\d+|ataraid/d\d+|etherd/e\d+\.\d+)(p(\d+))?$})
   {
 defined($2) or return (1, /dev/$1, -1);
 return (1, /dev/$1, $3);
@@ -320,7 +320,7 @@ sub mark_encrypted {
 sub make_device_name {
   my ($dev, $p) = @_;
   $dev .= p if ($dev =~
-m{^/dev/(cciss/c\dd\d|ida/c\dd\d|rd/c\dd\d|ataraid/d\d|etherd/e\d+\.\d+)$});
+m{^/dev/(cciss/c\d+d\d+|ida/c\d+d\d+|rd/c\d+d\d+|ataraid/d\d+|etherd/e\d+\.\d+)$});
   if ((FAI::loopback_dev($dev))[0])
   {
 $p += (FAI::loopback_dev($dev))[1];
-- 
1.7.10.4