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

Michael Tautschnig mt at alioth.debian.org
Fri Apr 15 12:18:17 UTC 2011


Author: mt
Date: 2011-04-15 12:18:08 +0000 (Fri, 15 Apr 2011)
New Revision: 6394

Added:
   branches/experimental/patches/setup-storage_fstab-device-comment
   branches/experimental/patches/setup-storage_si-units
Removed:
   branches/experimental/patches/grub-in-target
Modified:
   branches/experimental/patches/series
Log:
New setup-storage patches: comments at end of fstab lines, use of SI units

Patch grub-in-target isn't necessary anymore as its changes have been merged
into trunk in some or the other way


Deleted: branches/experimental/patches/grub-in-target
===================================================================
--- branches/experimental/patches/grub-in-target	2011-04-15 12:06:05 UTC (rev 6393)
+++ branches/experimental/patches/grub-in-target	2011-04-15 12:18:08 UTC (rev 6394)
@@ -1,33 +0,0 @@
-2010-10-16  Michael Tautschnig  <mt at debian.org>
-
-	* subroutines: bind-mount /proc and /dev into target. Thanks Michael Prokop
-		<mika at debian.org> for providing all the info and looking at other
-		references.
-	* examples/simple/files/boot/grub/menu.lst/postinst: Call grub-install within
-		chroot, which works with the above change (closes: #523617)
-Index: trunk/lib/subroutines
-===================================================================
---- trunk.orig/lib/subroutines
-+++ trunk/lib/subroutines
-@@ -494,6 +494,7 @@
- 	die "Internal error when calling /tmp/rebootCD."
-     fi
-     umount $FAI_ROOT/proc
-+    umount $FAI_ROOT/dev
-     umount -ar
-     exec reboot -dfi
- }
-@@ -818,6 +819,13 @@
-     [ -f $LOGDIR/crypttab ] && cp -p $LOGDIR/crypttab $FAI_ROOT/etc/crypttab
-     # make /var/lib/dpkg a ramdisk
-     mkramdisk -a
-+    # mount /dev and /proc on target otherwise grub-installer will fail
-+    mount -o bind /dev $FAI_ROOT/dev
-+    task_error 802 $?
-+    if [ ! -e $FAI_ROOT/proc/version ]; then
-+      mount -o bind /proc $FAI_ROOT/proc
-+      task_error 803 $?
-+    fi
- }
- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- ### BEGIN SUBROUTINE INFO

Modified: branches/experimental/patches/series
===================================================================
--- branches/experimental/patches/series	2011-04-15 12:06:05 UTC (rev 6393)
+++ branches/experimental/patches/series	2011-04-15 12:18:08 UTC (rev 6394)
@@ -14,9 +14,10 @@
 fcopy_symlinks
 setup-storage_cryptsetup-passphrase
 setup-storage_disklist-LOGDIR-defaults
-grub-in-target
 setup-storage_hardcode-63-sectors
 fcopy-unchanged-uid-gid
 setup-storage_man-page-fixes
 setup-storage_internals-cleanup
 make-fai-nfsroot_add-keys
+setup-storage_fstab-device-comment
+setup-storage_si-units

Added: branches/experimental/patches/setup-storage_fstab-device-comment
===================================================================
--- branches/experimental/patches/setup-storage_fstab-device-comment	                        (rev 0)
+++ branches/experimental/patches/setup-storage_fstab-device-comment	2011-04-15 12:18:08 UTC (rev 6394)
@@ -0,0 +1,19 @@
+2011-04-15  Michael Tautschnig  <mt at debian.org>
+
+	* setup-storage/Fstab.pm: Add comment denoting actual device in case of UUID
+		or LABEL being used as identifier.
+Index: trunk/lib/setup-storage/Fstab.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Fstab.pm
++++ trunk/lib/setup-storage/Fstab.pm
+@@ -64,6 +64,10 @@
+   $fstab_line[-1] = 0 if ($d_ref->{filesystem} eq "swap");
+   $fstab_line[-1] = 0 if ($d_ref->{filesystem} eq "tmpfs");
+ 
++  # add a comment denoting the actual device name in case of UUID or LABEL
++  push @fstab_line, "# device at install: $dev_name"
++    if ($name =~ /^(UUID|LABEL)=/);
++
+   # set the ROOT_PARTITION variable, if this is the mountpoint for /
+   $FAI::disk_var{ROOT_PARTITION} = $name
+     if ($d_ref->{mountpoint} eq "/");

Added: branches/experimental/patches/setup-storage_si-units
===================================================================
--- branches/experimental/patches/setup-storage_si-units	                        (rev 0)
+++ branches/experimental/patches/setup-storage_si-units	2011-04-15 12:18:08 UTC (rev 6394)
@@ -0,0 +1,55 @@
+2011-04-15  Michael Tautschnig  <mt at debian.org>
+
+	* setup-storage/Parser.pm: Treat MiB differently from MB and friends as lvm2
+		does as of version 2.02.54. Use MiB for factor 1024 or MB for factor 1000.
+	* setup-storage.8: Reflect this change.
+Index: trunk/lib/setup-storage/Parser.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Parser.pm
++++ trunk/lib/setup-storage/Parser.pm
+@@ -354,19 +354,19 @@
+       return $val * $totalmem;
+   }
+ 
+-  ## don't warn for now, G/GiB/GB are all treated the same way
+-  ## ($val =~ /([kKMGTP])\s*$/) and
+-  ##   warn "Using $1 as size modifier is deprecated, please use $1iB or $1B
+-  ##   instead; in future releases these will be treated as different modifiers\n";
+-
+   # % is returned as is
+   if ($val =~ /^(\d+(\.\d+)?)%\s*$/) { 1; }
+   elsif ($val =~ /^(\d+(\.\d+)?)B\s*$/) { $val = $1 * (1 / 1024) * (1 / 1024); }
+-  elsif ($val =~ /^(\d+(\.\d+)?)[kK](i)?(B)?\s*$/) { $val = $1 * (1 / 1024); }
+-  elsif ($val =~ /^(\d+(\.\d+)?)M(i)?(B)?\s*$/) { $val = $1; }
+-  elsif ($val =~ /^(\d+(\.\d+)?)G(i)?(B)?\s*$/) { $val = $1 * 1024; }
+-  elsif ($val =~ /^(\d+(\.\d+)?)T(i)?(B)?\s*$/) { $val = $1 * (1024 * 1024); }
+-  elsif ($val =~ /^(\d+(\.\d+)?)P(i)?(B)?\s*$/) { $val = $1 * (1024 * 1024 * 1024); }
++  elsif ($val =~ /^(\d+(\.\d+)?)[kK](iB)?\s*$/) { $val = $1 * (1 / 1024); }
++  elsif ($val =~ /^(\d+(\.\d+)?)[kK]B\s*$/) { $val = $1 * (1000 / 1024) * (1 / 1024); }
++  elsif ($val =~ /^(\d+(\.\d+)?)M(iB)?\s*$/) { $val = $1; }
++  elsif ($val =~ /^(\d+(\.\d+)?)MB\s*$/) { $val = $1 * (1000 / 1024) * (1000 / 1024); }
++  elsif ($val =~ /^(\d+(\.\d+)?)G(iB)?\s*$/) { $val = $1 * 1024; }
++  elsif ($val =~ /^(\d+(\.\d+)?)GB\s*$/) { $val = $1 * 1000 * (1000 / 1024) * (1000 / 1024); }
++  elsif ($val =~ /^(\d+(\.\d+)?)T(iB)?\s*$/) { $val = $1 * (1024 * 1024); }
++  elsif ($val =~ /^(\d+(\.\d+)?)TB\s*$/) { $val = $1 * 1000 * 1000 * (1000 / 1024) * (1000 / 1024); }
++  elsif ($val =~ /^(\d+(\.\d+)?)P(iB)?\s*$/) { $val = $1 * (1024 * 1024 * 1024); }
++  elsif ($val =~ /^(\d+(\.\d+)?)PB\s*$/) { $val = $1 * 1000 * 1000 * 1000 * (1000 / 1024) * (1000 / 1024); }
+   else { &FAI::internal_error("convert_unit $val"); }
+ 
+   return $val;
+Index: trunk/man/setup-storage.8
+===================================================================
+--- trunk.orig/man/setup-storage.8
++++ trunk/man/setup-storage.8
+@@ -591,9 +591,9 @@
+ .br
+           * only, no decimal numbers.
+ .br          
+-          * In future releases KB, MB, GB, ... will be treated as 1000 instead
++          * Use KB, MB, GB, ... for a factor of 1000 instead of 1024 as
+ .br
+-          * of 1024 (KiB, MiB, GiB, ...) multipliers */
++          * multiplier */
+ 
+ 
+ size ::= <sizespec>(-(<sizespec>)?)?(:resize)?




More information about the Fai-commit mailing list