Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub do_x4500 {
- # X4500s have six Marvell SATA controllers
- my @pci = grep { chomp } `/usr/bin/lspci | grep Marvell | cut -f1 -d' '`;
- return if @pci != 6;
- # can only boot from controller 4, disk 0 and 4. (Solaris calls them c8t0 and c8t4)
- my $c = $pci[3];
- # find the disks
- opendir (my $dh, "/dev/disk/by-path") || exit 1;
- my @disks = sort grep { m/^pci-0000:$c-scsi-[04]:0:0:0$/ } readdir $dh;
- closedir $dh;
- # and find out where they go
- my (@targets) = map { (m{/([^/]+)$})[0] } map { readlink $_ } @disks;
- # XXX for the moment, just take the first one. later we should mirror them
- my ($target) = @targets;
- return $target;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement