my $LVS = "/sbin/lvs";
my $LSBLK = "/bin/lsblk";
+my sub strip_dev :prototype($) {
+ my ($devpath) = @_;
+ $devpath =~ s|^/dev/||;
+ return $devpath;
+}
+
sub check_bin {
my ($path) = @_;
return -x $path;
# we get cciss/c0d0 but need cciss!c0d0
$_ =~ s|cciss/|cciss!| for @$disks;
+ if ($include_partitions) {
+ # Proper blockdevice is needed for the regex, use parent for partitions.
+ for my $disk ($disks->@*) {
+ next if !is_partition("/dev/$disk");
+ $disk = strip_dev(get_blockdev("/dev/$disk"));
+ }
+ }
+
$disk_regex = "(?:" . join('|', @$disks) . ")";
}
return $partition;
}
-my sub strip_dev :prototype($) {
- my ($devpath) = @_;
- $devpath =~ s|^/dev/||;
- return $devpath;
-}
-
# Check if a disk or any of its partitions has a holder.
# Can also be called with a partition.
# Expected to be called with a result of verify_blockdev_path().