[Fai-commit] r6227 - branches/experimental/patches

Michael Tautschnig mt at alioth.debian.org
Fri Dec 3 22:22:15 UTC 2010


Author: mt
Date: 2010-12-03 22:22:15 +0000 (Fri, 03 Dec 2010)
New Revision: 6227

Added:
   branches/experimental/patches/setup-storage_boot-device
   branches/experimental/patches/setup-storage_no-decimal
Modified:
   branches/experimental/patches/grub-pc
   branches/experimental/patches/series
   branches/experimental/patches/setup-storage_cryptsetup-passphrase
   branches/experimental/patches/setup-storage_disklist-LOGDIR-defaults
   branches/experimental/patches/setup-storage_no-cylinder-boundaries
   branches/experimental/patches/setup-storage_no-empty-config
   branches/experimental/patches/setup-storage_preserve-format-all
Log:
- split out $BOOT_DEVICE handling changes from grub-pc patch into
  setup-storage_boot-device and add several improvements; do not resolve
  RAID/LVM to underlying disk drives
- Clarify documentation of sizespec (integers, no decimal numbers)


Modified: branches/experimental/patches/grub-pc
===================================================================
--- branches/experimental/patches/grub-pc	2010-11-30 22:43:05 UTC (rev 6226)
+++ branches/experimental/patches/grub-pc	2010-12-03 22:22:15 UTC (rev 6227)
@@ -1,12 +1,7 @@
 2010-04-28  Michael Tautschnig  <mt at debian.org>
 
 	* simple example: Added class GRUB_PC that installs and uses grub-pc instead
-		of grub, following the suggestions of Jean Spirat <jeanspirat at squirk.org>.
-		Thanks Waldemar Brodkorb <fai at waldemar-brodkorb.de> for more info and
-		debugging.
-	* setup-storage/Fstab.pm: BOOT_DEVICE contains physical disks only; logical
-		volumes and RAID volumes are resolved to underlying disks.
-	* setup-storage.8: Documented this new behavior
+		of grub
 	* Makefile: Make sure that all example scripts are executable
 Index: trunk/Makefile
 ===================================================================
@@ -37,37 +32,6 @@
  PACKAGES aptitude LILO
 -lilo grub-
 +lilo grub- grub-pc-
-Index: trunk/examples/simple/scripts/GRUB_PC/10-setup
-===================================================================
---- trunk.orig/examples/simple/scripts/GRUB_PC/10-setup
-+++ trunk/examples/simple/scripts/GRUB_PC/10-setup	
-@@ -3,10 +3,21 @@
- 
- error=0 ; trap "error=$((error|1))" ERR
- 
--$ROOTCMD grub-mkdevicemap -n -m /boot/grub/device.map
--$ROOTCMD grub-mkconfig -o /boot/grub/grub.cfg
--GROOT=$($ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE)
--$ROOTCMD grub-install --no-floppy "$GROOT"
--echo "Grub installed on $BOOT_DEVICE = $GROOT"
-+set -a
-+
-+# during softupdate use this file
-+[ -r $LOGDIR/disk_var.sh ] && . $LOGDIR/disk_var.sh
-+
-+[ -z "$BOOT_DEVICE" ]    && exit 701
-+
-+$ROOTCMD grub-mkdevicemap --no-floppy
-+
-+for device in $BOOT_DEVICE; do
-+  GROOT=$($ROOTCMD grub-probe -tdrive -d $device)
-+  $ROOTCMD grub-install --no-floppy --modules="lvm raid" "$GROOT"
-+  echo "Grub installed on $device = $GROOT"
-+done
-+
-+$ROOTCMD update-grub
- 
- exit $error
 Index: trunk/examples/simple/class/50-host-classes
 ===================================================================
 --- trunk.orig/examples/simple/class/50-host-classes
@@ -87,180 +51,3 @@
 +
 +{ ifclass I386 || ifclass AMD64; } && ! ifclass GRUB_PC && echo GRUB
 +exit 0
-Index: trunk/lib/setup-storage/Fstab.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Fstab.pm
-+++ trunk/lib/setup-storage/Fstab.pm	
-@@ -129,6 +129,57 @@
-   }
- }
- 
-+################################################################################
-+#
-+# @brief Find the mount point for /boot
-+#
-+# @return mount point for /boot
-+#
-+################################################################################
-+sub find_boot_mnt_point {
-+  my $mnt_point;
-+
-+  # walk through all configured parts
-+  foreach my $c (keys %FAI::configs) {
-+
-+    if ($c =~ /^PHY_(.+)$/) {
-+      foreach my $p (keys %{ $FAI::configs{$c}{partitions} }) {
-+        my $this_mp = $FAI::configs{$c}{partitions}{$p}{mountpoint};
-+
-+        next if (!defined($this_mp));
-+
-+        return $this_mp if ($this_mp eq "/boot");
-+        $mnt_point = $this_mp if ($this_mp eq "/");
-+      }
-+    } elsif ($c =~ /^VG_(.+)$/) {
-+      next if ($1 eq "--ANY--");
-+      foreach my $l (keys %{ $FAI::configs{$c}{volumes} }) {
-+        my $this_mp = $FAI::configs{$c}{volumes}{$l}{mountpoint};
-+
-+        next if (!defined($this_mp));
-+
-+        return $this_mp if ($this_mp eq "/boot");
-+        $mnt_point = $this_mp if ($this_mp eq "/");
-+      }
-+    } elsif ($c eq "RAID" || $c eq "CRYPT") {
-+      foreach my $r (keys %{ $FAI::configs{$c}{volumes} }) {
-+        my $this_mp = $FAI::configs{$c}{volumes}{$r}{mountpoint};
-+
-+        next if (!defined($this_mp));
-+
-+        return $this_mp if ($this_mp eq "/boot");
-+        $mnt_point = $this_mp if ($this_mp eq "/");
-+      }
-+    } elsif ($c eq "TMPFS") {
-+      # not usable for /boot
-+      next;
-+    } else {
-+      &FAI::internal_error("Unexpected key $c");
-+    }
-+  }
-+
-+  return $mnt_point;
-+}
- 
- ################################################################################
- #
-@@ -149,6 +200,9 @@
-   # the file to be returned, a list of lines
-   my @fstab = ();
- 
-+  # mount point for /boot
-+  my $boot_mnt_point = &FAI::find_boot_mnt_point();
-+
-   # walk through all configured parts
-   # the order of entries is most likely wrong, it is fixed at the end
-   foreach my $c (keys %$config) {
-@@ -173,15 +227,11 @@
-         my $device_name = 0 == $p_ref->{number} ? $device :
-           &FAI::make_device_name($device, $p_ref->{number});
- 
--        # if the mount point is / or /boot, the variables should be set, unless
--        # they are already
--        if ($p_ref->{mountpoint} eq "/boot" || ($p_ref->{mountpoint} eq "/" && 
--              !defined ($FAI::disk_var{BOOT_PARTITION}))) {
--          # set the BOOT_DEVICE and BOOT_PARTITION variables, if necessary
-+        # if the mount point the /boot mount point, variables must be set
-+        if ($p_ref->{mountpoint} eq $boot_mnt_point) {
-+          # set the BOOT_DEVICE and BOOT_PARTITION variables
-           $FAI::disk_var{BOOT_PARTITION} = $device_name;
--          ($c =~ /^PHY_(.+)$/) or &FAI::internal_error("unexpected mismatch");
--          defined ($FAI::disk_var{BOOT_DEVICE}) and ($FAI::disk_var{BOOT_DEVICE} ne "") or
--            $FAI::disk_var{BOOT_DEVICE} = $1;
-+          $FAI::disk_var{BOOT_DEVICE} .= " $device";
-         }
- 
-         push @fstab, &FAI::create_fstab_line($p_ref,
-@@ -204,15 +254,13 @@
- 
-         my $device_name = "/dev/$device/$l";
- 
--        # according to http://grub.enbug.org/LVMandRAID, this should work...
--        # if the mount point is / or /boot, the variables should be set, unless
--        # they are already
--        if ($l_ref->{mountpoint} eq "/boot" || ($l_ref->{mountpoint} eq "/" && 
--              !defined ($FAI::disk_var{BOOT_PARTITION}))) {
--          # set the BOOT_DEVICE and BOOT_PARTITION variables, if necessary
--          $FAI::disk_var{BOOT_PARTITION} = $device_name;
--          defined ($FAI::disk_var{BOOT_DEVICE}) and ($FAI::disk_var{BOOT_DEVICE} ne "") or
--            $FAI::disk_var{BOOT_DEVICE} = $device_name;
-+        # if the mount point the /boot mount point, variables must be set
-+        if ($l_ref->{mountpoint} eq $boot_mnt_point) {
-+          # set BOOT_DEVICE to the underlying disks
-+          foreach my $dev (@{ $config->{$c}->{devices} }) {
-+            my ($i_p_d, $disk, $part_no) = &FAI::phys_dev($dev);
-+            $FAI::disk_var{BOOT_DEVICE} .= " $disk" if (1 == $i_p_d);
-+          }
-         }
- 
-         push @fstab, &FAI::create_fstab_line($l_ref,
-@@ -231,15 +279,13 @@
- 
-         my $device_name = "/dev/md$r";
- 
--        # according to http://grub.enbug.org/LVMandRAID, this should work...
--        # if the mount point is / or /boot, the variables should be set, unless
--        # they are already
--        if ($r_ref->{mountpoint} eq "/boot" || ($r_ref->{mountpoint} eq "/" && 
--              !defined ($FAI::disk_var{BOOT_PARTITION}))) {
--          # set the BOOT_DEVICE and BOOT_PARTITION variables, if necessary
--          $FAI::disk_var{BOOT_PARTITION} = "$device_name";
--          defined ($FAI::disk_var{BOOT_DEVICE}) and ($FAI::disk_var{BOOT_DEVICE} ne "") or
--            $FAI::disk_var{BOOT_DEVICE} = "$device_name";
-+        # if the mount point the /boot mount point, variables must be set
-+        if ($r_ref->{mountpoint} eq $boot_mnt_point) {
-+          # set BOOT_DEVICE to the underlying disks
-+          foreach my $dev (keys %{ $r_ref->{devices} }) {
-+            my ($i_p_d, $disk, $part_no) = &FAI::phys_dev($dev);
-+            $FAI::disk_var{BOOT_DEVICE} .= " $disk" if (1 == $i_p_d);
-+          }
-         }
- 
-         push @fstab, &FAI::create_fstab_line($r_ref,
-@@ -253,8 +299,7 @@
- 
-         my $device_name = &FAI::enc_name($c_ref->{device});
- 
--        ($c_ref->{mountpoint} eq "/boot" || ($c_ref->{mountpoint} eq "/" &&
--            !defined ($FAI::disk_var{BOOT_PARTITION}))) and
-+        ($c_ref->{mountpoint} eq $boot_mnt_point) and
-           die "Boot partition cannot be encrypted\n";
- 
-         push @fstab, &FAI::create_fstab_line($c_ref, $device_name, $device_name);
-@@ -289,7 +334,10 @@
-   $FAI::disk_var{SWAPLIST} =~ s/\s*$/"/;
- 
-   # cleanup the list of boot devices (remove leading space and add quotes)
--  $FAI::disk_var{BOOT_DEVICE} =~ s/^\s*/"/;
-+  my %boot_devs = ();
-+  @boot_devs{ split(' ', $FAI::disk_var{BOOT_DEVICE}) } = ();
-+  $FAI::disk_var{BOOT_DEVICE} = '"';
-+  $FAI::disk_var{BOOT_DEVICE} .= "$_ " foreach (keys %boot_devs);
-   $FAI::disk_var{BOOT_DEVICE} =~ s/\s*$/"/;
- 
-   # sort the lines in @fstab to enable all sub mounts
-Index: trunk/man/setup-storage.8
-===================================================================
---- trunk.orig/man/setup-storage.8
-+++ trunk/man/setup-storage.8	
-@@ -105,10 +105,9 @@
- .IR SWAPLIST ,
- .IR ROOT_PARTITION ,
- .IR BOOT_PARTITION
--and
-+(which is only set in case this resides on a disk drive) and
- .IR BOOT_DEVICE .
--The latter two will only be set in case they
--reside on a disk drive.
-+The latter is always resolved to the underlying disk drives.
- .SH SYNTAX
- This section describes the syntax of disk_config files
- 

Modified: branches/experimental/patches/series
===================================================================
--- branches/experimental/patches/series	2010-11-30 22:43:05 UTC (rev 6226)
+++ branches/experimental/patches/series	2010-12-03 22:22:15 UTC (rev 6227)
@@ -1,6 +1,7 @@
 setup-storage_exp-version
 logtail
 grub-pc
+setup-storage_boot-device
 bugfix-313397
 bugfix-479537
 setup-storage_no-cylinder-boundaries
@@ -22,3 +23,4 @@
 grub-in-target
 setup-storage_pvcreate-old-lvm
 setup-storage_hardcode-63-sectors
+setup-storage_no-decimal

Added: branches/experimental/patches/setup-storage_boot-device
===================================================================
--- branches/experimental/patches/setup-storage_boot-device	                        (rev 0)
+++ branches/experimental/patches/setup-storage_boot-device	2010-12-03 22:22:15 UTC (rev 6227)
@@ -0,0 +1,244 @@
+2010-12-03  Michael Tautschnig  <mt at debian.org>
+
+	* setup-storage/{Fstab.pm,Parser.pm}: Cleanup code for defining BOOT_DEVICE
+		(thanks Julien for doing most of the work).
+	* simple/scripts/GRUB_PC/10-setup: No need to deal with multiple devices
+		anymore, BOOT_DEVICE will always a be single value.
+	* setup-storage: Generate conditional definitions for disk_var.sh such that
+		variables will only be set if not previously defined by users.
+	* setup-storage.8: Properly document semantics of BOOT_DEVICE and disk_var.sh.
+
+Index: trunk/bin/setup-storage
+===================================================================
+--- trunk.orig/bin/setup-storage
++++ trunk/bin/setup-storage	
+@@ -218,14 +218,14 @@
+ 
+ # write variables to $LOGDIR/disk_var.sh
+ # debugging
+-$FAI::debug and print "$_=$FAI::disk_var{$_}\n"
++$FAI::debug and print "$_=\${$_:-$FAI::disk_var{$_}}\n"
+   foreach (keys %FAI::disk_var);
+ 
+ if ($FAI::no_dry_run)
+ {
+   open(DISK_VAR, ">$ENV{LOGDIR}/disk_var.sh")
+     or die "Unable to write to file $ENV{LOGDIR}/disk_var.sh\n";
+-  print DISK_VAR "$_=$FAI::disk_var{$_}\n" foreach (keys %FAI::disk_var);
++  print DISK_VAR "$_=\${$_:-$FAI::disk_var{$_}}\n" foreach (keys %FAI::disk_var);
+   close DISK_VAR;
+ }
+ 
+Index: trunk/lib/setup-storage/Fstab.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Fstab.pm
++++ trunk/lib/setup-storage/Fstab.pm	
+@@ -129,6 +129,57 @@
+   }
+ }
+ 
++################################################################################
++#
++# @brief Find the mount point for /boot
++#
++# @return mount point for /boot
++#
++################################################################################
++sub find_boot_mnt_point {
++  my $mnt_point;
++
++  # walk through all configured parts
++  foreach my $c (keys %FAI::configs) {
++
++    if ($c =~ /^PHY_(.+)$/) {
++      foreach my $p (keys %{ $FAI::configs{$c}{partitions} }) {
++        my $this_mp = $FAI::configs{$c}{partitions}{$p}{mountpoint};
++
++        next if (!defined($this_mp));
++
++        return $this_mp if ($this_mp eq "/boot");
++        $mnt_point = $this_mp if ($this_mp eq "/");
++      }
++    } elsif ($c =~ /^VG_(.+)$/) {
++      next if ($1 eq "--ANY--");
++      foreach my $l (keys %{ $FAI::configs{$c}{volumes} }) {
++        my $this_mp = $FAI::configs{$c}{volumes}{$l}{mountpoint};
++
++        next if (!defined($this_mp));
++
++        return $this_mp if ($this_mp eq "/boot");
++        $mnt_point = $this_mp if ($this_mp eq "/");
++      }
++    } elsif ($c eq "RAID" || $c eq "CRYPT") {
++      foreach my $r (keys %{ $FAI::configs{$c}{volumes} }) {
++        my $this_mp = $FAI::configs{$c}{volumes}{$r}{mountpoint};
++
++        next if (!defined($this_mp));
++
++        return $this_mp if ($this_mp eq "/boot");
++        $mnt_point = $this_mp if ($this_mp eq "/");
++      }
++    } elsif ($c eq "TMPFS") {
++      # not usable for /boot
++      next;
++    } else {
++      &FAI::internal_error("Unexpected key $c");
++    }
++  }
++
++  return $mnt_point;
++}
+ 
+ ################################################################################
+ #
+@@ -149,6 +200,9 @@
+   # the file to be returned, a list of lines
+   my @fstab = ();
+ 
++  # mount point for /boot
++  my $boot_mnt_point = &FAI::find_boot_mnt_point();
++
+   # walk through all configured parts
+   # the order of entries is most likely wrong, it is fixed at the end
+   foreach my $c (keys %$config) {
+@@ -173,15 +227,11 @@
+         my $device_name = 0 == $p_ref->{number} ? $device :
+           &FAI::make_device_name($device, $p_ref->{number});
+ 
+-        # if the mount point is / or /boot, the variables should be set, unless
+-        # they are already
+-        if ($p_ref->{mountpoint} eq "/boot" || ($p_ref->{mountpoint} eq "/" && 
+-              !defined ($FAI::disk_var{BOOT_PARTITION}))) {
+-          # set the BOOT_DEVICE and BOOT_PARTITION variables, if necessary
++        # if the mount point the /boot mount point, variables must be set
++        if ($p_ref->{mountpoint} eq $boot_mnt_point) {
++          # set the BOOT_DEVICE and BOOT_PARTITION variables
+           $FAI::disk_var{BOOT_PARTITION} = $device_name;
+-          ($c =~ /^PHY_(.+)$/) or &FAI::internal_error("unexpected mismatch");
+-          defined ($FAI::disk_var{BOOT_DEVICE}) and ($FAI::disk_var{BOOT_DEVICE} ne "") or
+-            $FAI::disk_var{BOOT_DEVICE} = $1;
++          $FAI::disk_var{BOOT_DEVICE} = $device;
+         }
+ 
+         push @fstab, &FAI::create_fstab_line($p_ref,
+@@ -204,16 +254,9 @@
+ 
+         my $device_name = "/dev/$device/$l";
+ 
+-        # according to http://grub.enbug.org/LVMandRAID, this should work...
+-        # if the mount point is / or /boot, the variables should be set, unless
+-        # they are already
+-        if ($l_ref->{mountpoint} eq "/boot" || ($l_ref->{mountpoint} eq "/" && 
+-              !defined ($FAI::disk_var{BOOT_PARTITION}))) {
+-          # set the BOOT_DEVICE and BOOT_PARTITION variables, if necessary
+-          $FAI::disk_var{BOOT_PARTITION} = $device_name;
+-          defined ($FAI::disk_var{BOOT_DEVICE}) and ($FAI::disk_var{BOOT_DEVICE} ne "") or
+-            $FAI::disk_var{BOOT_DEVICE} = $device_name;
+-        }
++        # if the mount point the /boot mount point, variables must be set
++        $FAI::disk_var{BOOT_DEVICE} = $device_name
++          if ($l_ref->{mountpoint} eq $boot_mnt_point);
+ 
+         push @fstab, &FAI::create_fstab_line($l_ref,
+           &FAI::get_fstab_key($device_name, $config->{"VG_--ANY--"}->{fstabkey}), $device_name);
+@@ -231,16 +274,9 @@
+ 
+         my $device_name = "/dev/md$r";
+ 
+-        # according to http://grub.enbug.org/LVMandRAID, this should work...
+-        # if the mount point is / or /boot, the variables should be set, unless
+-        # they are already
+-        if ($r_ref->{mountpoint} eq "/boot" || ($r_ref->{mountpoint} eq "/" && 
+-              !defined ($FAI::disk_var{BOOT_PARTITION}))) {
+-          # set the BOOT_DEVICE and BOOT_PARTITION variables, if necessary
+-          $FAI::disk_var{BOOT_PARTITION} = "$device_name";
+-          defined ($FAI::disk_var{BOOT_DEVICE}) and ($FAI::disk_var{BOOT_DEVICE} ne "") or
+-            $FAI::disk_var{BOOT_DEVICE} = "$device_name";
+-        }
++        # if the mount point the /boot mount point, variables must be set
++        $FAI::disk_var{BOOT_DEVICE} = $device_name
++          if ($r_ref->{mountpoint} eq $boot_mnt_point);
+ 
+         push @fstab, &FAI::create_fstab_line($r_ref,
+           &FAI::get_fstab_key($device_name, $config->{RAID}->{fstabkey}), $device_name);
+@@ -253,8 +289,7 @@
+ 
+         my $device_name = &FAI::enc_name($c_ref->{device});
+ 
+-        ($c_ref->{mountpoint} eq "/boot" || ($c_ref->{mountpoint} eq "/" &&
+-            !defined ($FAI::disk_var{BOOT_PARTITION}))) and
++        ($c_ref->{mountpoint} eq $boot_mnt_point) and
+           die "Boot partition cannot be encrypted\n";
+ 
+         push @fstab, &FAI::create_fstab_line($c_ref, $device_name, $device_name);
+@@ -265,8 +300,7 @@
+ 
+         next if ($c_ref->{mountpoint} eq "-");
+ 
+-        ($c_ref->{mountpoint} eq "/boot" || ($c_ref->{mountpoint} eq "/" &&
+-            !defined ($FAI::disk_var{BOOT_PARTITION}))) and
++        ($c_ref->{mountpoint} eq $boot_mnt_point) and
+           die "Boot partition cannot be a tmpfs\n";
+ 
+ 	if (($c_ref->{mount_options} =~ m/size=/) || ($c_ref->{mount_options} =~ m/nr_blocks=/)) {
+Index: trunk/lib/setup-storage/Parser.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Parser.pm
++++ trunk/lib/setup-storage/Parser.pm	
+@@ -557,7 +557,6 @@
+           $FAI::configs{$FAI::device}{bootable} = $1;
+           ($FAI::device =~ /^PHY_(.+)$/) or
+             &FAI::internal_error("unexpected device name");
+-          $FAI::disk_var{BOOT_DEVICE} .= " $1"; 
+         }
+         | 'virtual'
+         {
+Index: trunk/man/setup-storage.8
+===================================================================
+--- trunk.orig/man/setup-storage.8
++++ trunk/man/setup-storage.8	
+@@ -97,18 +97,19 @@
+ .SH FILES
+ If
+ \fBsetup-storage\fP
+-executes successfully an
++executes successfully, an
+ \fBfstab\fP(5)
+ file matching the specified configuration is generated as
+-$LOGDIR/fstab. Further $LOGDIR/disk_var.sh
+-is generated and may be sourced to get the variables
++$LOGDIR/fstab. Furthermore the file $LOGDIR/disk_var.sh
++is generated. This file defines the following variables, if not yet set:
+ .IR SWAPLIST ,
+ .IR ROOT_PARTITION ,
+ .IR BOOT_PARTITION
+-and
++(which is only set in case this resides on a disk drive), and
+ .IR BOOT_DEVICE .
+-The latter two will only be set in case they
+-reside on a disk drive.
++The latter two describe the partition and disk/RAID/LVM device hosting the mount
++point for /boot. If /boot has no extra mount point, / is used instead.
++You may source $LOGDIR/disk_var.sh to get the variables set.
+ .SH SYNTAX
+ This section describes the syntax of disk_config files
+ 
+Index: trunk/examples/simple/scripts/GRUB_PC/10-setup
+===================================================================
+--- trunk.orig/examples/simple/scripts/GRUB_PC/10-setup
++++ trunk/examples/simple/scripts/GRUB_PC/10-setup	
+@@ -12,11 +12,9 @@
+ 
+ $ROOTCMD grub-mkdevicemap --no-floppy
+ 
+-for device in $BOOT_DEVICE; do
+-  GROOT=$($ROOTCMD grub-probe -tdrive -d $device)
+-  $ROOTCMD grub-install --no-floppy --modules="lvm raid" "$GROOT"
+-  echo "Grub installed on $device = $GROOT"
+-done
++GROOT=$($ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE)
++$ROOTCMD grub-install --no-floppy --modules="lvm raid" "$GROOT"
++echo "Grub installed on $BOOT_DEVICE = $GROOT"
+ 
+ $ROOTCMD update-grub
+ 

Modified: branches/experimental/patches/setup-storage_cryptsetup-passphrase
===================================================================
--- branches/experimental/patches/setup-storage_cryptsetup-passphrase	2010-11-30 22:43:05 UTC (rev 6226)
+++ branches/experimental/patches/setup-storage_cryptsetup-passphrase	2010-12-03 22:22:15 UTC (rev 6227)
@@ -47,7 +47,7 @@
 ===================================================================
 --- trunk.orig/lib/setup-storage/Parser.pm
 +++ trunk/lib/setup-storage/Parser.pm	
-@@ -710,7 +710,7 @@
+@@ -709,7 +709,7 @@
            $FAI::partition_pointer = (\%FAI::configs)->{RAID}->{volumes}->{$vol_id};
          }
          mountpoint devices filesystem mount_options mdcreateopts
@@ -60,7 +60,7 @@
 ===================================================================
 --- trunk.orig/man/setup-storage.8
 +++ trunk/man/setup-storage.8	
-@@ -328,7 +328,11 @@
+@@ -330,7 +330,11 @@
  .br
           | luks
  .br
@@ -73,7 +73,7 @@
  .br
           | tmp
  .br
-@@ -600,9 +604,11 @@
+@@ -602,9 +606,11 @@
  reasons why a system may fail to boot.
  .IP \(bu
  Crypto support requires some site-specific changes: If you use cryptsetup

Modified: branches/experimental/patches/setup-storage_disklist-LOGDIR-defaults
===================================================================
--- branches/experimental/patches/setup-storage_disklist-LOGDIR-defaults	2010-11-30 22:43:05 UTC (rev 6226)
+++ branches/experimental/patches/setup-storage_disklist-LOGDIR-defaults	2010-12-03 22:22:15 UTC (rev 6227)
@@ -78,7 +78,7 @@
 -# write variables to $LOGDIR/disk_var.sh
 +# write variables to $FAI::DATADIR/disk_var.sh
  # debugging
- $FAI::debug and print "$_=$FAI::disk_var{$_}\n"
+ $FAI::debug and print "$_=\${$_:-$FAI::disk_var{$_}}\n"
    foreach (keys %FAI::disk_var);
  
  if ($FAI::no_dry_run)
@@ -87,7 +87,7 @@
 -    or die "Unable to write to file $ENV{LOGDIR}/disk_var.sh\n";
 +  open(DISK_VAR, ">$FAI::DATADIR/disk_var.sh")
 +    or die "Unable to write to file $FAI::DATADIR/disk_var.sh\n";
-   print DISK_VAR "$_=$FAI::disk_var{$_}\n" foreach (keys %FAI::disk_var);
+   print DISK_VAR "$_=\${$_:-$FAI::disk_var{$_}}\n" foreach (keys %FAI::disk_var);
    close DISK_VAR;
  }
 @@ -235,10 +237,10 @@
@@ -171,10 +171,10 @@
  .TP
  .B flag_initial
  This variable determines if partitions should be preserved when they
-@@ -108,6 +109,9 @@
- (which is only set in case this resides on a disk drive) and
- .IR BOOT_DEVICE .
- The latter is always resolved to the underlying disk drives.
+@@ -110,6 +111,9 @@
+ The latter two describe the partition and disk/RAID/LVM device hosting the mount
+ point for /boot. If /boot has no extra mount point, / is used instead.
+ You may source $LOGDIR/disk_var.sh to get the variables set.
 +Furthermore, if encryption was configured, a proper
 +\fBcrypttab\fP(5)
 +file plus keyfiles will be generated.

Modified: branches/experimental/patches/setup-storage_no-cylinder-boundaries
===================================================================
--- branches/experimental/patches/setup-storage_no-cylinder-boundaries	2010-11-30 22:43:05 UTC (rev 6226)
+++ branches/experimental/patches/setup-storage_no-cylinder-boundaries	2010-12-03 22:22:15 UTC (rev 6227)
@@ -127,7 +127,7 @@
 ===================================================================
 --- trunk.orig/lib/setup-storage/Parser.pm
 +++ trunk/lib/setup-storage/Parser.pm	
-@@ -591,6 +591,10 @@
+@@ -590,6 +590,10 @@
          {
            $FAI::configs{$FAI::device}{partitions}{$_}{size}{always_format} = 1 foreach (split(",", $1));
          }
@@ -142,7 +142,7 @@
 ===================================================================
 --- trunk.orig/man/setup-storage.8
 +++ trunk/man/setup-storage.8	
-@@ -282,6 +282,20 @@
+@@ -284,6 +284,20 @@
  .br
             */
  .br

Added: branches/experimental/patches/setup-storage_no-decimal
===================================================================
--- branches/experimental/patches/setup-storage_no-decimal	                        (rev 0)
+++ branches/experimental/patches/setup-storage_no-decimal	2010-12-03 22:22:15 UTC (rev 6227)
@@ -0,0 +1,22 @@
+2010-12-03  Michael Tautschnig  <mt at debian.org>
+
+	* setup-storage.8: Clarify that partition/volume sizes are integers, not
+		decimal numbers.
+Index: trunk/man/setup-storage.8
+===================================================================
+--- trunk.orig/man/setup-storage.8
++++ trunk/man/setup-storage.8	
+@@ -378,9 +378,11 @@
+ .br
+          /* size in kilo (KiB), mega (default, MiB), giga (GiB), tera (TiB),
+ .br
+-          * petabytes (PiB) or percentage of disk size or RAM size;
++          * petabytes (PiB) or percentage of disk size or RAM size; integers
++.br
++          * only, no decimal numbers.
+ .br          
+-          * in future releases KB, MB, GB, ... will be treated as 1000 instead
++          * In future releases KB, MB, GB, ... will be treated as 1000 instead
+ .br
+           * of 1024 (KiB, MiB, GiB, ...) multipliers */
+ 

Modified: branches/experimental/patches/setup-storage_no-empty-config
===================================================================
--- branches/experimental/patches/setup-storage_no-empty-config	2010-11-30 22:43:05 UTC (rev 6226)
+++ branches/experimental/patches/setup-storage_no-empty-config	2010-12-03 22:22:15 UTC (rev 6227)
@@ -20,7 +20,7 @@
 ===================================================================
 --- trunk.orig/lib/setup-storage/Parser.pm
 +++ trunk/lib/setup-storage/Parser.pm	
-@@ -1076,5 +1076,33 @@
+@@ -1075,5 +1075,33 @@
    defined $FAI::Parser->file($input) or die "Syntax error\n";
  }
  

Modified: branches/experimental/patches/setup-storage_preserve-format-all
===================================================================
--- branches/experimental/patches/setup-storage_preserve-format-all	2010-11-30 22:43:05 UTC (rev 6226)
+++ branches/experimental/patches/setup-storage_preserve-format-all	2010-12-03 22:22:15 UTC (rev 6227)
@@ -294,7 +294,7 @@
            $FAI::configs{$FAI::device}{preserveparts} = 1;
          }
          | /^disklabel:(msdos|gpt-bios|gpt)/
-@@ -587,9 +652,13 @@
+@@ -586,9 +651,13 @@
  
  	  $FAI::configs{$FAI::device} = dclone($FAI::configs{"PHY_" . $ref_dev});
  	}
@@ -310,7 +310,7 @@
          }
          | /^align-at:(\d+[kMGTPiB]*)/
          {
-@@ -614,12 +683,14 @@
+@@ -613,12 +682,14 @@
            $FAI::configs{RAID}{volumes}{$vol_id}{mode} = $1;
            # initialise the hash of devices
            $FAI::configs{RAID}{volumes}{$vol_id}{devices} = {};
@@ -329,7 +329,7 @@
            # set the reference to the current volume
            # the reference is used by all further processing of this config line
            $FAI::partition_pointer = (\%FAI::configs)->{RAID}->{volumes}->{$vol_id};
-@@ -697,13 +768,17 @@
+@@ -696,13 +767,17 @@
            # initialise the new hash
            defined($FAI::configs{$FAI::device}{volumes}{$2}) or
              $FAI::configs{$FAI::device}{volumes}{$2} = {};
@@ -355,7 +355,7 @@
 ===================================================================
 --- trunk.orig/man/setup-storage.8
 +++ trunk/man/setup-storage.8	
-@@ -156,25 +156,25 @@
+@@ -158,25 +158,25 @@
  
  lvmoption ::= /* empty */
  .br
@@ -386,7 +386,7 @@
  .br
             /* attempt to resize partitions */
  .br
-@@ -190,21 +190,21 @@
+@@ -192,21 +192,21 @@
  
  raidoption ::= /* empty */
  .br
@@ -412,7 +412,7 @@
  .br
             /* run mkfs on the volumes, even if marked as preserve */
  .br
-@@ -228,25 +228,25 @@
+@@ -230,25 +230,25 @@
  
  option ::= /* empty */
  .br




More information about the Fai-commit mailing list