[Fai-commit] r6640 - branches/experimental/patches
Michael Tautschnig
mt at alioth.debian.org
Wed Aug 31 19:29:43 UTC 2011
Author: mt
Date: 2011-08-31 19:29:43 +0000 (Wed, 31 Aug 2011)
New Revision: 6640
Added:
branches/experimental/patches/setup-storage_wipefs
Modified:
branches/experimental/patches/bugfix-498412
branches/experimental/patches/fix-eval_cmdline
branches/experimental/patches/logtail
branches/experimental/patches/make-fai-nfsroot_add-keys
branches/experimental/patches/series
Log:
setup-storage: use wipefs to remove existing signatures
Updated other patches to match current trunk
Modified: branches/experimental/patches/bugfix-498412
===================================================================
--- branches/experimental/patches/bugfix-498412 2011-08-31 08:15:28 UTC (rev 6639)
+++ branches/experimental/patches/bugfix-498412 2011-08-31 19:29:43 UTC (rev 6640)
@@ -303,8 +303,8 @@
-Recommends: debconf-utils, cfengine2
+Recommends: debconf-utils, cfengine2, libgraph-perl
Suggests: logtail
- Conflicts: fai, fai-kernels
- Replaces: fai
+ Description: Fully Automatic Installation client package
+ FAI is a non-interactive system to install, customize and manage
Index: trunk/debian/fai-client.install
===================================================================
--- trunk.orig/debian/fai-client.install
Modified: branches/experimental/patches/fix-eval_cmdline
===================================================================
--- branches/experimental/patches/fix-eval_cmdline 2011-08-31 08:15:28 UTC (rev 6639)
+++ branches/experimental/patches/fix-eval_cmdline 2011-08-31 19:29:43 UTC (rev 6640)
@@ -7,29 +7,18 @@
===================================================================
--- trunk.orig/lib/subroutines
+++ trunk/lib/subroutines
-@@ -665,18 +665,22 @@
+@@ -704,12 +704,16 @@
+
echo -n "Kernel currently running: "
uname -rsmo
- echo -n "Kernel parameters: "; cat /proc/cmdline
-- for word in $(cat /proc/cmdline) ; do
-- case $word in
-- FAI_CLASSES=*)
-- eval "$word"
-- for class in ${FAI_CLASSES//,/ }; do
-- echo $class >>/tmp/l
-- done
+- echo -n "Kernel parameters: "; cat /proc/cmdline
+ eval "cmdline=($(</proc/cmdline))"
+ echo "Kernel parameters: ${cmdline[*]}"
+ shopt -s extglob
+- for word in $(cat /proc/cmdline) ; do
+ for word in "${cmdline[@]}"; do
-+ case $word in
-+ FAI_CLASSES=*)
-+ word=${word#*=}
-+ eval "classes=(${word//,/ })"
-+ printf '%s\n' "${classes[@]}" >>/tmp/l
- unset FAI_CLASSES
- ;;
-
- [a-zA-Z]*=*)
+ case $word in
+ *([a-zA-Z0-9_])=*)
- eval "export $word"
+ varname=${word%%=*}
+ word=${word#*=}
Modified: branches/experimental/patches/logtail
===================================================================
--- branches/experimental/patches/logtail 2011-08-31 08:15:28 UTC (rev 6639)
+++ branches/experimental/patches/logtail 2011-08-31 19:29:43 UTC (rev 6640)
@@ -6,7 +6,7 @@
===================================================================
--- trunk.orig/bin/fai
+++ trunk/bin/fai
-@@ -291,6 +291,9 @@
+@@ -289,6 +289,9 @@
mkdir -p $LOGDIR
ln -snf $action-$fai_rundate $LOGDIR/../last-$action
ln -snf $action-$fai_rundate $LOGDIR/../last
@@ -25,14 +25,14 @@
Depends: perl, file, libapt-pkg-perl, iproute
Recommends: debconf-utils, cfengine2
+Suggests: logtail
- Conflicts: fai, fai-kernels
- Replaces: fai
Description: Fully Automatic Installation client package
+ FAI is a non-interactive system to install, customize and manage
+ Linux systems and software configurations on computers as well as
Index: trunk/lib/subroutines
===================================================================
--- trunk.orig/lib/subroutines
+++ trunk/lib/subroutines
-@@ -83,7 +83,11 @@
+@@ -119,7 +119,11 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
save_dmesg() {
@@ -45,7 +45,7 @@
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
umount_csspace() {
-@@ -445,6 +449,7 @@
+@@ -481,6 +485,7 @@
task_savelog() {
mkdir -p $FAI_ROOT/var/{lib,log}/fai
Modified: branches/experimental/patches/make-fai-nfsroot_add-keys
===================================================================
--- branches/experimental/patches/make-fai-nfsroot_add-keys 2011-08-31 08:15:28 UTC (rev 6639)
+++ branches/experimental/patches/make-fai-nfsroot_add-keys 2011-08-31 19:29:43 UTC (rev 6640)
@@ -7,10 +7,10 @@
===================================================================
--- trunk.orig/bin/make-fai-nfsroot
+++ trunk/bin/make-fai-nfsroot
-@@ -402,6 +402,15 @@
- mount -t proc /proc $NFSROOT/proc
- mount -t sysfs /sys $NFSROOT/sys
+@@ -394,6 +394,15 @@
mount -t devpts devpts $NFSROOT/dev/pts
+ /usr/lib/fai/mkramdisk $NFSROOT/var/lib/dpkg
+ mkdir $NFSROOT/etc/mdadm; touch $NFSROOT/etc/mdadm/mdadm.conf # stop mdadm from calling mkconf
+
+ # add any 3rd party repository keys that you may need installed into the NFSROOT
+ if [ -d $cfdir/apt/keys-added ]; then
@@ -27,7 +27,7 @@
===================================================================
--- trunk.orig/man/make-fai-nfsroot.8
+++ trunk/man/make-fai-nfsroot.8
-@@ -165,6 +165,10 @@
+@@ -103,6 +103,10 @@
Copy this file to the NFSROOT.
.PD 0
.TP
Modified: branches/experimental/patches/series
===================================================================
--- branches/experimental/patches/series 2011-08-31 08:15:28 UTC (rev 6639)
+++ branches/experimental/patches/series 2011-08-31 19:29:43 UTC (rev 6640)
@@ -22,3 +22,4 @@
setup-storage_align-first-part-preserve
setup-storage_udevsettle-before-vol-id
setup-storage_gpt-100-bugfix
+setup-storage_wipefs
Added: branches/experimental/patches/setup-storage_wipefs
===================================================================
--- branches/experimental/patches/setup-storage_wipefs (rev 0)
+++ branches/experimental/patches/setup-storage_wipefs 2011-08-31 19:29:43 UTC (rev 6640)
@@ -0,0 +1,95 @@
+2011-08-31 Michael Tautschnig <mt at debian.org>
+
+ * setup-storage/Commands.pm: Use wipefs to purge RAID and other signatures
+ from devices before removing/reusing them.
+ * setup-storage.8: Remove now obsolete RAID caveat.
+Index: trunk/lib/setup-storage/Commands.pm
+===================================================================
+--- trunk.orig/lib/setup-storage/Commands.pm
++++ trunk/lib/setup-storage/Commands.pm
+@@ -664,8 +664,11 @@
+ }
+ }
+
+- &FAI::push_command( "lvremove -f $vg/$lv",
++ &FAI::push_command( "wipefs -a $vg/$lv",
+ "vgchange_a_n_VG_$vg$pre_deps_cl",
++ "wipefs_$vg/$lv");
++ &FAI::push_command( "lvremove -f $vg/$lv",
++ "wipefs_$vg/$lv",
+ "lv_rm_$vg/$lv,self_cleared_/dev/$vg/$lv");
+ $vg_setup_pre .= ",lv_rm_$vg/$lv";
+ }
+@@ -686,8 +689,11 @@
+ join(",self_cleared_", @{ $FAI::current_dev_children{"/dev/$vg/$lv"} })
+ if (defined($FAI::current_dev_children{"/dev/$vg/$lv"}) &&
+ scalar(@{ $FAI::current_dev_children{"/dev/$vg/$lv"} }));
+- &FAI::push_command( "lvremove -f $vg/$lv",
++ &FAI::push_command( "wipefs -a $vg/$lv",
+ "vgchange_a_n_VG_$vg$pre_deps_cl",
++ "wipefs_$vg/$lv");
++ &FAI::push_command( "lvremove -f $vg/$lv",
++ "wipefs_$vg/$lv",
+ "lv_rm_$vg/$lv,self_cleared_/dev/$vg/$lv");
+ $vg_destroy_pre .= ",lv_rm_$vg/$lv";
+ }
+@@ -697,8 +703,15 @@
+ my $devices = "";
+ $devices .= " " . &FAI::enc_name($_) foreach
+ (@{ $FAI::current_lvm_config{$vg}{physical_volumes} });
++ ($devices =~ /^\s*$/) and &FAI::internal_error("Empty PV device set");
+ $FAI::debug and print "Erased devices:$devices\n";
+- &FAI::push_command( "pvremove $devices", "vg_removed_$vg", "pv_sigs_removed_$vg" );
++ &FAI::push_command( "pvremove $devices", "vg_removed_$vg", "pvremove_$vg");
++ my $post_wipe = "pvremove_$vg";
++ foreach my $d (split (" ", $devices)) {
++ $post_wipe .= ",pv_sigs_removed_wipe_${d}_$vg";
++ &FAI::push_command( "wipefs -a $d", "pvremove_$vg", "pv_sigs_removed_wipe_${d}_$vg");
++ }
++ &FAI::push_command( "true", $post_wipe, "pv_sigs_removed_$vg" );
+ return 1;
+ }
+
+@@ -961,7 +974,7 @@
+ # A new disk label may only be written if no partitions need to be
+ # preserved
+ (($label eq $FAI::current_config{$disk}{disklabel})
+- || (scalar (@to_preserve) == 0))
++ || (scalar (@to_preserve) == 0))
+ or die "Can't change disklabel, partitions are to be preserved\n";
+
+ # write the disklabel to drop the previous partition table
+@@ -971,6 +984,16 @@
+ join(",self_cleared_", @{ $FAI::current_dev_children{$c} })
+ if (defined($FAI::current_dev_children{$c}) &&
+ scalar(@{ $FAI::current_dev_children{$c} }));
++ my ($i_p_d, $d, $part_no) = &FAI::phys_dev($c);
++ ($i_p_d && $d eq $disk) or &FAI::internal_error("Invalid dev children entry");
++ my $wipe_cmd = "wipefs -a $c";
++ foreach my $part_id (@to_preserve) {
++ # get the existing id
++ my $mapped_id = $FAI::configs{$config}{partitions}{$part_id}{maps_to_existing};
++ $wipe_cmd = "true" if ($mapped_id == $part_no);
++ }
++ &FAI::push_command($wipe_cmd, "exist_$disk$pre_deps", "wipefs_$c");
++ $pre_deps .= ",wipefs_$c";
+ }
+ &FAI::push_command( ($needs_resize ? "parted -s $disk mklabel $label" : "true"),
+ "exist_$disk$pre_deps", "cleared1_$disk" );
+Index: trunk/man/setup-storage.8
+===================================================================
+--- trunk.orig/man/setup-storage.8
++++ trunk/man/setup-storage.8
+@@ -675,12 +675,6 @@
+
+ .SH CAVEATS
+ .IP \(bu
+-Partition UUID cannot be obtained: In case a partition was previously used as
+-part of a software RAID volume and now is intended as swap space, udev fails
+-when asked for a UUID. This happens because mkswap does not overwrite the
+-previous RAID superblock. You can remove it using mdadm \-\-zero-superblock
+-<device>.
+-.IP \(bu
+ Machine does not boot because not partition is marked as bootable: If the
+ bootable option is not specified, not partition will be marked as such. Modern
+ BIOSes don't seem to require such markers anymore, but for some systems it may
More information about the Fai-commit
mailing list