inq-team/einarc — pull request #7 by elops (2014-06-02 09:11:56+00:00)
Title: Fixes logical drive mapping

based on data collected in https://github.com/elops/einarc_adaptec_tester
I found that for Adaptec controllers only reliable way to establish co-relation
between logical and physical is disk serial number.

logical listing (ld) is formated like
-------------------------------------------------------------
* arcconf getconfig 1 ld

Type 1 (key here is Enclosure,Slot possilby controller if one has multiple)

Group 0, Segment 0 : Present (Controller:1,Enclosure:0,Slot:8) WD-WMAW30289850

Type 2 (key here is Channel,Device possibly Controller if one has multiple)

Group 0, Segment 0 : Present (Controller:1,Channel:0,Device:8) Z1X1DK0B

Type 3 (key here is Connector,Device possibly Controller if one has multiple)

Group 0, Segment 0 : Present (Controller:1,Connector:1,Device:0) Z1N3399Y0000C31537JM

Type 4 (numbers in brackets are Device,Channel)

Group 0, Segment 0 : Present (0,0) WD-WMAW30562480

physical listing (pd) only consistent representation for each disk is line like this
----------------------------------------------
* arcconf getconfig 1 pd
...

Reported Channel,Device(T:L) : 0,8(8:0)

Problem is sometimes ld output maps to pd output; sometimes it does not (in case of ld type1, type3)
so to resolve mapping this fix uses disk serial to establish co-relation.