| 1 |
#!/usr/bin/perl -w
|
| 2 |
|
| 3 |
use strict;
|
| 4 |
|
| 5 |
################################################################################
|
| 6 |
#
|
| 7 |
# @file shdd2
|
| 8 |
#
|
| 9 |
# @brief The main function of setup harddisks 2 - the tool to configure the
|
| 10 |
# partitioning from within FAI.
|
| 11 |
#
|
| 12 |
# This is an implementation from scratch to properly support LVM and RAID. The
|
| 13 |
# input format is documented in @ref shdd2-parser
|
| 14 |
#
|
| 15 |
# $Id$
|
| 16 |
#
|
| 17 |
# @author Christian Kern, Michael Tautschnig
|
| 18 |
# @date Sun Jul 23 16:09:36 CEST 2006
|
| 19 |
#
|
| 20 |
################################################################################
|
| 21 |
|
| 22 |
package FAI;
|
| 23 |
|
| 24 |
# include all subparts
|
| 25 |
require "shdd2-init";
|
| 26 |
require "shdd2-lib";
|
| 27 |
require "shdd2-parser";
|
| 28 |
require "shdd2-sizes";
|
| 29 |
require "shdd2-commands";
|
| 30 |
require "shdd2-fstab";
|
| 31 |
require "shdd2-exec";
|
| 32 |
|
| 33 |
# start the parsing - thereby $FAI::configs is filled
|
| 34 |
&FAI::run_parser;
|
| 35 |
|
| 36 |
# read the sizes and partition tables of all disks listed in $FAI::disks
|
| 37 |
&FAI::get_current_disks;
|
| 38 |
|
| 39 |
# compute the new partition sizes
|
| 40 |
&FAI::compute_sizes;
|
| 41 |
|
| 42 |
# TODO - debugging only: print the current contents of $FAI::configs
|
| 43 |
&FAI::print_hash( \%FAI::configs );
|
| 44 |
|
| 45 |
# generate the command script
|
| 46 |
&FAI::build_commands;
|
| 47 |
|
| 48 |
# TODO - debugging only: print the command script
|
| 49 |
foreach my $cmd (@FAI::commands)
|
| 50 |
{
|
| 51 |
print $cmd . "\n";
|
| 52 |
# &FAI::execute_command($cmd);
|
| 53 |
}
|
| 54 |
|
| 55 |
# generate the proposed fstab contents
|
| 56 |
my @fstab = &FAI::generate_fstab( \%FAI::configs );
|
| 57 |
# TODO - debugging only; print fstab
|
| 58 |
foreach my $line (@fstab)
|
| 59 |
{
|
| 60 |
printf "$line\n";
|
| 61 |
}
|
| 62 |
|