\n";
print " | $text{'index_location'} | ";
print "$d->{'desc'} | \n";
print " | $text{'index_cylinders'} | ",
"$d->{'cylinders'} | \n";
if ($d->{'cylsize'}) {
print " | $text{'index_size'} | ",
"",&nice_size($d->{'cylinders'}*$d->{'cylsize'}),
" | \n";
}
if ($d->{'model'}) {
print " | $text{'index_model'} | ",
"$d->{'model'} | \n";
}
if (defined($d->{'scsiid'}) && defined($d->{'controller'})) {
print " | $text{'index_controller'} | ",
"$d->{'controller'} | \n";
print " | $text{'index_scsiid'} | ",
"$d->{'scsiid'} | \n";
}
if ($d->{'raid'}) {
print " | $text{'index_raid'} | ",
"$d->{'raid'} | \n";
}
# Show links to other modules
@links = ( );
if (($d->{'type'} eq 'ide' ||
$d->{'type'} eq 'scsi' && $d->{'model'} =~ /ATA/) && $ed) {
# Display link to IDE params form
push(@links, "$text{'index_hdparm'}");
}
if ($smart) {
# Display link to smart module
push(@links, "$text{'index_smart'}");
}
if (@links) {
print " | ",&ui_links_row(\@links),
" | \n";
}
print " | \n";
@parts = @{$d->{'parts'}};
foreach $p (@parts) {
if ($p->{'end'} > $d->{'cylinders'}-1) {
$d->{'cylinders'} = $p->{'end'}+1;
}
}
local $extended = 0;
local $usedpri = 0;
if (!@parts) {
print "$text{'index_none'} \n";
}
else {
print " ",
" | $text{'index_num'} | ",
"$text{'index_type'} | ",
"$text{'index_extent'} | ",
"$text{'index_start'} | ",
"$text{'index_end'} | ",
"$text{'index_use'} | ",
"$text{'index_free'} | \n";
foreach $p (@parts) {
print "\n";
if (!$ed) {
$lb = $la = "";
}
else {
$lb = "{'index'}&part=$p->{'index'}\">";
$la = "";
$extended++ if ($p->{'extended'});
}
print "| ",$lb,$p->{'number'},$la," | \n";
$usedpri++ if ($p->{'number'} <= 4);
print "",$lb,$p->{'extended'} ?
$text{'extended'} : &tag_name($p->{'type'}),
$la," | \n";
printf " ",
$extwidth*($p->{'start'} - 1) /
$d->{'cylinders'};
printf " ",
$p->{'extended'} ? "ext" : "use",
$extwidth*($p->{'end'} - $p->{'start'}) /
$d->{'cylinders'};
printf " ",
$extwidth*($d->{'cylinders'} - ($p->{'end'} - 1)) /
$d->{'cylinders'};
print " | $p->{'start'} | ",
"$p->{'end'} | \n";
@stat = &device_status($p->{'device'});
if ($stat[1] eq 'raid') {
print "$stat[0]\n";
}
elsif ($stat[1] eq 'lvm') {
if (&foreign_available("lvm")) {
print "VG $stat[0]\n";
}
else {
print "VG $stat[0]\n";
}
}
elsif ($stat[0] && !&foreign_available("mount")) {
print "$stat[0]\n";
}
elsif ($stat[0] && $stat[3] == -1) {
print "$stat[0]\n";
}
elsif ($stat[0]) {
print "$stat[0]\n";
}
print " | \n";
if (!$p->{'extended'} && $stat[2] &&
&indexof($p->{'type'}, @space_type) >= 0 &&
(@space = &disk_space($p->{'device'}, $stat[0])) &&
$space[0]) {
printf "%d %%\n", 100 * $space[1] / $space[0];
}
print " | \n";
}
print " \n";
}
# Show links for adding partitions
@edlinks = ( );
if ($usedpri != 4 && $ed) {
push(@edlinks, "{'index'}&new=1\">".
$text{'index_addpri'}."");
}
if ($extended && $ed) {
push(@edlinks, "{'index'}&new=2\">".
$text{'index_addlog'}."");
}
elsif ($usedpri != 4 && $ed) {
push(@edlinks, "{'index'}&new=3\">".
$text{'index_addext'}."");
}
print &ui_links_row(\@edlinks);
print " |
\n";
}
print "