#!/usr/bin/perl -w #********************************************************************* # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # A copy of the GNU General Public License is available as # `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution # or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You # can also obtain it by writing to the Free Software Foundation, Inc., # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #********************************************************************* use strict; ################################################################################ # # @file shdd2 # # @brief The main function of setup harddisks 2 - the tool to configure the # partitioning from within FAI. # # This is an implementation from scratch to properly support LVM and RAID. The # input format is documented in @ref shdd2-parser # # $Id$ # # @author Christian Kern, Michael Tautschnig # @date Sun Jul 23 16:09:36 CEST 2006 # ################################################################################ package FAI; # include all subparts require "shdd2-init"; require "shdd2-lib"; require "shdd2-parser"; require "shdd2-sizes"; require "shdd2-commands"; require "shdd2-fstab"; require "shdd2-exec"; # start the parsing - thereby $FAI::configs is filled &FAI::run_parser; # read the sizes and partition tables of all disks listed in $FAI::disks &FAI::get_current_disks; # compute the new partition sizes &FAI::compute_sizes; # TODO - debugging only: print the current contents of $FAI::configs &FAI::print_hash( \%FAI::configs ); # generate the command script &FAI::build_commands; # TODO - debugging only: print the command script foreach my $cmd (@FAI::commands) { print $cmd . "\n"; # &FAI::execute_command($cmd); } # generate the proposed fstab contents my @fstab = &FAI::generate_fstab( \%FAI::configs ); # TODO - debugging only; print fstab printf "$_\n" foreach (@fstab);