Added pattern recognition for HP RAID drives

svn path=/trunk/; revision=898
This commit is contained in:
Curtis Gedak 2008-09-12 20:57:12 +00:00
parent a21c25d287
commit 29c343848a
2 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2008-09-12 Curtis Gedak <gedakc@gmail.com>
* src/GParted_Core.cc: Added pattern recognition for HP RAID drives
- E.g., device = /dev/cciss/c0d0, partition = /dev/cciss/c0d0p1
2008-09-04 Curtis Gedak <gedakc@gmail.com>
* include/Utils.h,

View file

@ -136,6 +136,10 @@ void GParted_Core::set_devices( std::vector<Device> & devices )
{
device_paths .clear() ;
//Fixme: Remove code to read /proc/partitions when libparted bug 194 is fixed.
// This was a problem with no floppy drive yet BIOS indicated one existed.
// http://parted.alioth.debian.org/cgi-bin/trac.cgi/ticket/194
//
//try to find all available devices
std::ifstream proc_partitions( "/proc/partitions" ) ;
if ( proc_partitions )
@ -145,9 +149,13 @@ void GParted_Core::set_devices( std::vector<Device> & devices )
std::string device ;
while ( getline( proc_partitions, line ) )
{
//Whole disk devices are the ones we want.
//Device names without a trailing digit refer to the whole disk.
//These whole disk devices are the ones we want.
device = Utils::regexp_label(line, "^[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+([^0-9]+)$") ;
//Device names that end with a #[^p]# are HP Smart Array Devices (disks)
//E.g., device = /dev/cciss/c0d0, partition = /dev/cciss/c0d0p1
if ( device == "" )
device = Utils::regexp_label(line, "^[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+(.*[0-9]+[^p]{1}[0-9]+)$") ;
if ( device != "" )
{
//try to have libparted detect the device and add it to the list