| 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 |
| 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; |
| 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 |
| 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){ |
| 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 |
} |
} |