[Fai-commit] r3580 -
people/michael/features/setup_harddisks_2/implementation
fai-commit at lists.alioth.debian.org
fai-commit at lists.alioth.debian.org
Fri Jul 21 21:15:53 UTC 2006
Author: michael-guest
Date: 2006-07-21 21:15:53 +0000 (Fri, 21 Jul 2006)
New Revision: 3580
Modified:
people/michael/features/setup_harddisks_2/implementation/shdd2-parser
Log:
Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-parser
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-parser 2006-07-21 17:39:37 UTC (rev 3579)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-parser 2006-07-21 21:15:53 UTC (rev 3580)
@@ -92,11 +92,14 @@
@FAI::disks = split(/\n/, $ENV{disklist});
%FAI::configs = ();
+$FAI::config_pointer;
$FAI::device = "";
$FAI::partition_primary_counter = 0;
$FAI::partition_logical_counter = 0;
+
+
my $Parser = Parse::RecDescent->new(q{
file: line(s?) /\Z/
line: <skip: qr/[ \t]*/> "\\n"
@@ -202,63 +205,50 @@
{
$FAI::configs{ $FAI::device }{ "virtual" } = 1;
}
- volume: type
+ volume: type mountpoint size filesystem mount_options fs_options
+ | 'vg' name size
{
- my $id = -1;
- if( $FAI::device =~ /^PHY_/ && $item[ 1 ] eq "primary" )
+ if( ! $FAI::device =~ /^VG_/ )
{
+ die "vg is invalid in a non LVM-context.\n";
+ }
+ # TODO create vg
+ }
+ type: 'primary'
+ {
+ ( $FAI::device =~ /^PHY_/ ) or die "wrong partition type";
+ {
( $FAI::partition_primary_counter < 4 || $FAI::configs{ $FAI::device }{ "disklabel" } ne "msdos" ) or die "Too many primary partitions\n";
$FAI::partition_primary_counter++;
- $id = $FAI::partition_primary_counter;
+ $FAI::configs{ $FAI::device }{ "partitions" }{ $FAI::partition_primary_counter }{ "size" } = (
+ "extended" => 0
+ );
+ $FAI::config_pointer = $FAI::configs{ $FAI::device }{ "partitions" }{ $FAI::partition_primary_counter };
}
- elsif( $FAI::device =~ /^PHY_/ && $item[ 1 ] eq "logical" && $FAI::configs{ $FAI::device }{ "disklabel" } eq "msdos" )
+ }
+ | 'logical'
+ {
+ ( $FAI::device =~ /^PHY_/ && $FAI::configs{ $FAI::device }{ "disklabel" } eq "msdos" ) or die "wrong partition type";
{
if( $FAI::partition_logical_counter == 0 )
{
( $FAI::partition_primary_counter < 4 ) or die "Too many primary partitions\n";
$FAI::partition_primary_counter++;
- # TODO create extended partition
+ $FAI::configs{ $FAI::device }{ "partitions" }{ $FAI::partition_primary_counter }{ "size" } = (
+ "extended" => 1
+ );
}
$FAI::partition_logical_counter++;
- $id = $FAI::partition_logical_counter + 4;
+ $FAI::configs{ $FAI::device }{ "partitions" }{ $FAI::partition_primary_counter + 4 }{ "size" } = (
+ "extended" => 0
+ );
}
- elsif( $FAI::device eq "RAID" && $item[ 1 ] =~ /^raid[0156|$/ )
- {
- # TODO some RAID stuff
- }
- elsif( $FAI::device =~ /^VG_/ && $item[ 1 ] =~ m{^[^/\s]+-[^/\s]+} )
- {
- # TODO LVM stuff
- }
- else
- {
- die "Type $item[ 1 ] is invalid in this context.\n";
- }
}
- mountpoint size filesystem mount_options fs_options
- | 'vg' name size
- {
- if( ! $FAI::device =~ /^VG_/ )
- {
- die "vg is invalid in a non LVM-context.\n";
- }
- # TODO create vg
- }
- type: 'primary'
- {
- $return = $item[ 1 ];
- }
- | 'logical'
- {
- $return = $item[ 1 ];
- }
| /^raid[0156]/
{
- $return = $item[ 1 ];
}
| m{^[^/\s]+-[^/\s]+}
{
- $return = $item[ 1 ];
}
mountpoint: '-'
| 'swap'
More information about the Fai-commit
mailing list