How to handle large number of disk devices in "arbitrary" order?

Carsten Aulbert carsten at welcomes-you.com
Tue Nov 15 08:04:13 CET 2011


Hi

On Tuesday 15 November 2011 07:22:52 Carsten Aulbert wrote:
> 
> I suppose I'll have to dig into task_partition and the helper scripts in
> there.

that was easier than I thought:

From Parser.pm:

95-  # test, whether the device name starts with a / and prepend /dev/, if
96-  # appropriate
97-  ($disk =~ m{^/}) or $disk = "/dev/$disk";
98-  my @candidates = glob($disk);
99:  die "Failed to resolve $disk to a unique device name\n" if 
(scalar(@candidates) > 1);
100-  $disk = $candidates[0] if (scalar(@candidates) == 1);
101-  die "Device name $disk could not be substituted\n" if ($disk =~ m{[\*\?
\[\{\~]});
102-
103-  return $disk;

What would be the best way to fix this, as Perl's glob (File::Glob) does not 
seem to allow me to exclude something (i.e. a negative match), does it?

It should be easy to patch, i.e. to remove all elements with /-part[0-9]+$/ 
from @candidates, but I'd like to learn if there are other possiblities.

Cheers

Carsten


More information about the linux-fai mailing list