[Fai-commit] r4712 - people/michael/features/setup_harddisks_2/implementation

michael-guest at alioth.debian.org michael-guest at alioth.debian.org
Sun Nov 11 11:15:44 UTC 2007


Author: michael-guest
Date: 2007-11-11 11:15:43 +0000 (Sun, 11 Nov 2007)
New Revision: 4712

Modified:
   people/michael/features/setup_harddisks_2/implementation/shdd2-commands
Log:
added support for tune2fs


Modified: people/michael/features/setup_harddisks_2/implementation/shdd2-commands
===================================================================
--- people/michael/features/setup_harddisks_2/implementation/shdd2-commands	2007-11-11 10:54:45 UTC (rev 4711)
+++ people/michael/features/setup_harddisks_2/implementation/shdd2-commands	2007-11-11 11:15:43 UTC (rev 4712)
@@ -51,16 +51,28 @@
   defined( $partition->{"filesystem"} )
     or die "INTERNAL ERROR: filesystem is undefined\n";
 
-  if ( $partition->{"filesystem"} eq "-" ) {
-    return;
-  } elsif ( $partition->{"filesystem"} eq "swap" ) {
-    push @FAI::commands, "mkswap " . $partition->{"fs_options"} . " $device";
-  } else {
+  return if ( $partition->{"filesystem"} eq "-" );
+
+  my ($create_options)=$partition->{"fs_options"}=~m/.*createopts="([^"]+)".*/;
+  my ($tune_options)=$partition->{"fs_options"}=~m/.*tuneopts="([^"]+)".*/;
+  $create_options = $partition->{"fs_options"} unless $create_options;
+
+  if ( $partition->{"filesystem"} eq "swap" )
+  {
+    push @FAI::commands, "mkswap " . $create_options . " $device";
+  }
+  else
+  {
+    print STDERR "create_options: $create_options tune_options: $tune_options\n" if $FAI::debug;
     push @FAI::commands,
       "mkfs."
       . $partition->{"filesystem"} . " "
-      . $partition->{"fs_options"}
-      . " $device";
+      . $create_options
+      . " " . $device;
+    push @FAI::commands,
+      "tune2fs "
+      . $tune_options
+      . " " . $device if $tune_options;
   }
 }
 




More information about the Fai-commit mailing list