#!/usr/bin/perl
print qq [
<b>WARNING</b>: If you choose to define your partitions here, you *must* do so in a 
way such that your entire disk is utilized.  Failure to do so will result in 
the installation aborting.  This is a known bug.  You can select a partition 
to fill up all remaining space by setting its max_size to 1000000000.  If you 
want to partition only a portion of your disk at this time you must go back 
and select "Manual Partitioning".</p>
];
print "<p><b>Leaving maximum size blank (or setting it equal to min) makes the partition a fixed size</b></p>\n";
print "<p>Default unit is (M)egabytes, also acceptable is (G)igabytes.</p>\n";
sub parts {
  my $def = shift;
  my @choices = qw (logical primary);
  foreach my $choice (@choices) {
    if ( $def eq $choice ) {
      print "<OPTION SELECTED>$choice";
    } else {
      print "<OPTION>$choice";
    } 
  }
  print "</SELECT>";
}
sub fstypes {
  my $def = shift;
  my @choices = qw (ext2 ext3 jfs reiserfs swap xfs);
  foreach my $choice (@choices) {
    if ( $def eq $choice ) {
      print "<OPTION SELECTED>$choice";
    } else {
      print "<OPTION>$choice";
    } 
  }
  print "</SELECT>";
}
print qq[
<INPUT TYPE="hidden" NAME="vars" VALUE="mount size max fstype part nosafe">
<TABLE BORDER=1>
  <TR><TH $thtag ROWSPAN=2><FONT $thfont>Mountpoint?</FONT></TH>
  <TH $thtag COLSPAN=4>Size/Type</FONT></TH>
</TR>
<TR>
  <TH $thtag><FONT $thfont>Min Size</FONT></TH>
  <TH $thtag><FONT $thfont>Max Size</FONT></TH>
  <TH $thtag><FONT $thfont>Filesys Type</FONT></TH>
  <TH $thtag><FONT $thfont>Partition Type</FONT></TH>
</TR>
<TR>
  <TD $tdtag><FONT $tdfont><INPUT NAME="mount1" SIZE=20 VALUE="swap"></FONT></TD>
  <TD $tdtag><FONT $tdfont><INPUT NAME="size1" SIZE=10 VALUE="256M"></FONT></TD>
  <TD $tdtag><FONT $tdfont><INPUT NAME="max1" SIZE=10 VALUE="512M"></FONT></TD>
  <TD $tdtag><FONT $tdfont><SELECT NAME="fstype1">];
  &fstypes('swap');
  print qq[</FONT></TD><TD $tdtag><FONT $tdfont><SELECT NAME="part1">];
  &parts('primary');
  print qq[</FONT></TD>
</TR>
<TR>
  <TD $tdtag><FONT $tdfont><INPUT NAME="mount0" SIZE=20 VALUE="/"></FONT></TD>
  <TD $tdtag><FONT $tdfont><INPUT NAME="size0" SIZE=10 VALUE="1G"></FONT></TD>
  <TD $tdtag><FONT $tdfont><INPUT NAME="max0" SIZE=10 VALUE="2G"></FONT></TD>
  <TD $tdtag><FONT $tdfont><SELECT NAME="fstype0">];
  &fstypes('ext3');
  print qq[</FONT></TD><TD $tdtag><FONT $tdfont><SELECT NAME="part0">];
  &parts('primary');
  print qq[</FONT></TD>
</TR>
];
    foreach my $i (2..7) {
      print qq[<TR>
  <TD $tdtag><FONT $tdfont><INPUT NAME="mount$i" SIZE=20></FONT></TD>
  <TD $tdtag><FONT $tdfont><INPUT NAME="size$i" SIZE=10></FONT></TD>
  <TD $tdtag><FONT $tdfont><INPUT NAME="max$i" SIZE=10></FONT></TD>
  <TD $tdtag><FONT $tdfont><SELECT NAME="fstype$i">];
  &fstypes('ext3');
  print qq[</FONT></TD><TD $tdtag><FONT $tdfont><SELECT NAME="part$i">];
  &parts('logical');
  print qq[</FONT></TD>
</TR>
];
}
print "</TABLE>\n";
