/[fai]/trunk/scripts/setup_harddisks
ViewVC logotype

Diff of /trunk/scripts/setup_harddisks

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1238 by lange, Tue Apr 9 07:49:17 2002 UTC revision 1239 by lange, Mon Apr 29 17:33:42 2002 UTC
# Line 37  Line 37 
37  # [-d]                     default: no DOS alignment  # [-d]                     default: no DOS alignment
38  #  #
39  #---------------------------------------------------  #---------------------------------------------------
40    # Last changes: 29.04.2002 by Thomas Lange add swaplist
41  # Last changes: 12.01.2002 by Thomas Lange  # Last changes: 12.01.2002 by Thomas Lange
42  # /dev/ida/ patch 12.01.2002 by Marc Martinez <lastxit+fai@technogeeks.org>  # /dev/ida/ patch 12.01.2002 by Marc Martinez <lastxit+fai@technogeeks.org>
43  # Last changes: 9.11.2001 by Thomas Lange  # Last changes: 9.11.2001 by Thomas Lange
# Line 138  $| = 1;                     # flush alwa Line 139  $| = 1;                     # flush alwa
139  # Variables  # Variables
140  #****************************************************  #****************************************************
141    
142  my $Version = "0.16fai";  my $Version = "0.17fai";
143    
144  my $megabyte = 1024 * 1024;    # guess  my $megabyte = 1024 * 1024;    # guess
145  # $gigabyte = 1024 * $megabyte;  # $gigabyte = 1024 * $megabyte;
# Line 178  my $NofNotMoPart = 0;      # number of n Line 179  my $NofNotMoPart = 0;      # number of n
179  my %DiskMountpoints = ();  # mountpoints of every disk. separated by spaces  my %DiskMountpoints = ();  # mountpoints of every disk. separated by spaces
180  my %MountpointPart = ();   # partition of every mountpoint. e.g. "hda2"  my %MountpointPart = ();   # partition of every mountpoint. e.g. "hda2"
181  my %PartMountpoint = ();   # mountpoint of every partition.  my %PartMountpoint = ();   # mountpoint of every partition.
182    my @swaplist;              # list of all swpa devices
183    
184  # size of partition/mountpoint  # size of partition/mountpoint
185  my %MPMinSize = ();        # minimum size of mountpoint in units  my %MPMinSize = ();        # minimum size of mountpoint in units
# Line 766  sub FormatDisks{ Line 768  sub FormatDisks{
768                  print "Make Swap Partition:\n";                  print "Make Swap Partition:\n";
769                  $command = "mkswap $mkswap_options";                  $command = "mkswap $mkswap_options";
770                  ($MPOptions{$mountpoint} =~ /(\-c)\b/i) && ($command .= " $1");                  ($MPOptions{$mountpoint} =~ /(\-c)\b/i) && ($command .= " $1");
771                    push @swaplist, "/dev/$device";
772                  $command .= " /dev/$device";                  $command .= " /dev/$device";
773                  print "  $command\n";                  print "  $command\n";
774                  if($test != 1){                  if($test != 1){
# Line 878  sub BuildfstabLine{ Line 881  sub BuildfstabLine{
881  #****************************************************  #****************************************************
882  sub WriteFAIVariables{  sub WriteFAIVariables{
883    
884      print "Write FAI variables to file $FAIOutputFile\n";    my $swaps;
885    
886      print "Write FAI variables to file $FAIOutputFile\n";
887      return if ($test == 1);      return if ($test == 1);
888      $swaps = join ' ',@swaplist;
889      open(FILE, ">$FAIOutputFile") || die "Unable to write file $FAIOutputFile\n";      open(FILE, ">$FAIOutputFile") || die "Unable to write file $FAIOutputFile\n";
890      print FILE << "EOM";      print FILE << "EOM";
891  BOOT_DEVICE=/dev/$BOOT_DEVICE  BOOT_DEVICE=/dev/$BOOT_DEVICE
892  ROOT_PARTITION=/dev/$MountpointPart{'/'}  ROOT_PARTITION=/dev/$MountpointPart{'/'}
893  BOOT_PARTITION=/dev/$BootPartition  BOOT_PARTITION=/dev/$BootPartition
894    SWAPLIST="$swaps"
895  EOM  EOM
896      close(FILE);      close(FILE);
897  }  }

Legend:
Removed from v.1238  
changed lines
  Added in v.1239

  ViewVC Help
Powered by ViewVC 1.1.5