[Fai-commit] r5256 - people/michael/experimental/patches
mt at alioth.debian.org
mt at alioth.debian.org
Mon Feb 9 22:35:21 UTC 2009
Author: mt
Date: 2009-02-09 22:35:21 +0000 (Mon, 09 Feb 2009)
New Revision: 5256
Removed:
people/michael/experimental/patches/setup-storage_no-useless-udevsettle
Modified:
people/michael/experimental/patches/series
people/michael/experimental/patches/setup-storage_proper-partition-index
people/michael/experimental/patches/setup-storage_proper-vg-existance-handling
people/michael/experimental/patches/setup-storage_raid0-has-no-spares
Log:
fixed broken patches - somehow I managed to make one patch unpatch earlier ones
Modified: people/michael/experimental/patches/series
===================================================================
--- people/michael/experimental/patches/series 2009-02-09 21:26:43 UTC (rev 5255)
+++ people/michael/experimental/patches/series 2009-02-09 22:35:21 UTC (rev 5256)
@@ -13,7 +13,6 @@
setup-storage_force-disklabel
setup-storage_raid0-has-no-spares
setup-storage_proper-partition-index
-setup-storage_no-useless-udevsettle
aoe-support
setup-storage_bugfix-virtual
setup-storage_crypto-for-all-mountspecs
Deleted: people/michael/experimental/patches/setup-storage_no-useless-udevsettle
===================================================================
--- people/michael/experimental/patches/setup-storage_no-useless-udevsettle 2009-02-09 21:26:43 UTC (rev 5255)
+++ people/michael/experimental/patches/setup-storage_no-useless-udevsettle 2009-02-09 22:35:21 UTC (rev 5256)
@@ -1,111 +0,0 @@
-2009-02-06 Michael Tautschnig <mt at debian.org>
-
- * lib/setup-storage/Commands.pm: Got rid of all the calls to udevsettle that
- we don't need anymore (we call udevsettle after before executing each
- command anyway)
-Index: trunk/lib/setup-storage/Commands.pm
-===================================================================
---- trunk.orig/lib/setup-storage/Commands.pm
-+++ trunk/lib/setup-storage/Commands.pm
-@@ -218,26 +218,15 @@
- $pre_req .= ",exist_$d";
- }
- }
-- my $pre_req_no_comma = $pre_req;
-- $pre_req_no_comma =~ s/^,//;
-- # wait for udev to set up all devices
-- &FAI::push_command( "udevsettle --timeout=10", $pre_req_no_comma,
-- "settle_for_mdadm_create$id" );
-
- # create the command
-- if (0 == $id) {
-- $pre_req = "settle_for_mdadm_create$id$pre_req";
-- } else {
-- $pre_req = "settle_for_mdadm_create$id,exist_/dev/md" . ( $id - 1 ) . $pre_req;
-- }
-+ $pre_req = "exist_/dev/md" . ( $id - 1 ) . $pre_req if (0 < $id);
-+ $pre_req =~ s/^,//;
- &FAI::push_command(
- "yes | mdadm --create /dev/md$id --level=$level --force --run --raid-devices="
- . scalar(@eff_devs) . (scalar(@spares) !=0 ? " --spare-devices=" . scalar(@spares) : "") . " "
- . join(" ", @eff_devs) . " " . join(" ", @spares),
-- "$pre_req", "run_udev_/dev/md$id" );
--
-- &FAI::push_command( "udevsettle --timeout=10", "run_udev_/dev/md$id",
-- "exist_/dev/md$id" );
-+ "$pre_req", "exist_/dev/md$id" );
-
- # create the filesystem on the volume
- &FAI::build_mkfs_commands("/dev/md$id",
-@@ -428,9 +417,7 @@
-
- # create a new volume
- &FAI::push_command( "lvcreate -n $lv -L " . $lv_size->{eff_size} . " $vg",
-- "vg_enabled_$vg,$lv_rm_pre", "run_udev_/dev/$vg/$lv" );
-- &FAI::push_command( "udevsettle --timeout=10", "run_udev_/dev/$vg/$lv",
-- "exist_/dev/$vg/$lv" );
-+ "vg_enabled_$vg,$lv_rm_pre", "exist_/dev/$vg/$lv" );
-
- # create the filesystem on the volume
- &FAI::build_mkfs_commands("/dev/$vg/$lv",
-@@ -468,15 +455,12 @@
- }
- }
- $type_pre =~ s/^,//;
-- # wait for udev to set up all devices
-- &FAI::push_command( "udevsettle --timeout=10", "$type_pre",
-- "settle_for_vgchange_$vg" );
-
- # create the volume group or add/remove devices
- &FAI::create_volume_group($config);
- # enable the volume group
- &FAI::push_command( "vgchange -a y $vg",
-- "settle_for_vgchange_$vg,vg_created_$vg", "vg_enabled_$vg" );
-+ "$type_pre,vg_created_$vg", "vg_enabled_$vg" );
-
- # perform all necessary operations on the underlying logical volumes
- &FAI::setup_logical_volumes($config);
-@@ -651,15 +635,12 @@
- $part_nr++;
- $FAI::current_config{$disk}{partitions}{$mapped_id}{new_id} = $part_nr;
-
-- my $post = "run_udev_" . &FAI::make_device_name($disk, $part_nr);
-+ my $post = "exist_" . &FAI::make_device_name($disk, $part_nr);
- $post .= ",rebuilt_" . &FAI::make_device_name($disk, $part_nr) if
- $FAI::configs{$config}{partitions}{$part_id}{size}{resize};
- # build a parted command to create the partition
- &FAI::push_command( "parted -s $disk mkpart $part_type $fs ${start}B ${end}B",
- "cleared1_$disk", $post );
-- &FAI::push_command( "udevsettle --timeout=10", "run_udev_" .
-- &FAI::make_device_name($disk, $part_nr), "exist_" .
-- &FAI::make_device_name($disk, $part_nr) );
- }
- }
-
-@@ -775,12 +756,9 @@
- my $eff_size = $part->{size}->{eff_size};
-
- # wait for udev to set up all devices
-- &FAI::push_command( "udevsettle --timeout=10", "rebuilt_" .
-- &FAI::make_device_name($disk, $p) . $deps, "settle_for_resize_" .
-- &FAI::make_device_name($disk, $p) );
- &FAI::push_command( "yes | ntfsresize -s $eff_size " .
-- &FAI::make_device_name($disk, $p), "settle_for_resize_" .
-- &FAI::make_device_name($disk, $p), "ntfs_ready_for_rm_" .
-+ &FAI::make_device_name($disk, $p), "rebuilt_" .
-+ &FAI::make_device_name($disk, $p) . $deps, "ntfs_ready_for_rm_" .
- &FAI::make_device_name($disk, $p) );
- &FAI::push_command( "parted -s $disk rm $p", "ntfs_ready_for_rm_" .
- &FAI::make_device_name($disk, $p), "resized_" .
-@@ -836,10 +814,7 @@
- $pre = ",exist_" . &FAI::make_device_name($disk, $prev_id) if ($prev_id > -1);
- # build a parted command to create the partition
- &FAI::push_command( "parted -s $disk mkpart $part_type $fs ${start}B ${end}B",
-- "cleared2_$disk$pre", "run_udev_" . &FAI::make_device_name($disk, $part_id) );
-- &FAI::push_command( "udevsettle --timeout=10", "run_udev_" .
-- &FAI::make_device_name($disk, $part_id), "exist_" .
-- &FAI::make_device_name($disk, $part_id) );
-+ "cleared2_$disk$pre", "exist_" . &FAI::make_device_name($disk, $part_id) );
- $prev_id = $part_id;
- }
-
Modified: people/michael/experimental/patches/setup-storage_proper-partition-index
===================================================================
--- people/michael/experimental/patches/setup-storage_proper-partition-index 2009-02-09 21:26:43 UTC (rev 5255)
+++ people/michael/experimental/patches/setup-storage_proper-partition-index 2009-02-09 22:35:21 UTC (rev 5256)
@@ -6,7 +6,7 @@
===================================================================
--- trunk.orig/lib/setup-storage/Commands.pm
+++ trunk/lib/setup-storage/Commands.pm
-@@ -706,9 +706,9 @@
+@@ -688,9 +688,9 @@
$pre_all_resize .= ",exist_" . &FAI::make_device_name($disk, $p) unless
$part->{size}->{resize};
if ($part->{size}->{resize}) {
Modified: people/michael/experimental/patches/setup-storage_proper-vg-existance-handling
===================================================================
--- people/michael/experimental/patches/setup-storage_proper-vg-existance-handling 2009-02-09 21:26:43 UTC (rev 5255)
+++ people/michael/experimental/patches/setup-storage_proper-vg-existance-handling 2009-02-09 22:35:21 UTC (rev 5256)
@@ -7,62 +7,7 @@
===================================================================
--- trunk.orig/lib/setup-storage/Commands.pm
+++ trunk/lib/setup-storage/Commands.pm
-@@ -115,7 +115,7 @@
-
- # encryption requested, rewrite the device name
- my $enc_dev_name = $device;
-- $enc_dev_name =~ s#/#_#g;
-+ $enc_dev_name =~ "s#/#_#g";
- my $enc_dev_short_name = "crypt$enc_dev_name";
- $enc_dev_name = "/dev/mapper/$enc_dev_short_name";
- my $keyfile = "$ENV{LOGDIR}/$enc_dev_short_name";
-@@ -124,13 +124,11 @@
- &FAI::push_command(
- "head -c 2048 /dev/urandom | head -n 47 | tail -n 46 | od | tee $keyfile",
- "", "keyfile_$device" );
-+
- # prepare encryption
- &FAI::push_command(
-- "dd if=/dev/urandom of=$device",
-- "exist_$device", "random_init_$device" );
-- &FAI::push_command(
- "yes YES | cryptsetup luksFormat $device $keyfile -c aes-cbc-essiv:sha256 -s 256",
-- "random_init_$device,keyfile_$device", "crypt_format_$device" );
-+ "exist_$device,keyfile_$device", "crypt_format_$device" );
- &FAI::push_command(
- "cryptsetup luksOpen $device $enc_dev_short_name --key-file $keyfile",
- "crypt_format_$device", "encrypted_$device" );
-@@ -220,15 +218,26 @@
- $pre_req .= ",exist_$d";
- }
- }
-+ my $pre_req_no_comma = $pre_req;
-+ $pre_req_no_comma =~ s/^,//;
-+ # wait for udev to set up all devices
-+ &FAI::push_command( "udevsettle --timeout=10", $pre_req_no_comma,
-+ "settle_for_mdadm_create$id" );
-
- # create the command
-- $pre_req = "exist_/dev/md" . ( $id - 1 ) . $pre_req if (0 != $id);
-- $pre_req =~ s/^,//;
-+ if (0 == $id) {
-+ $pre_req = "settle_for_mdadm_create$id$pre_req";
-+ } else {
-+ $pre_req = "settle_for_mdadm_create$id,exist_/dev/md" . ( $id - 1 ) . $pre_req;
-+ }
- &FAI::push_command(
- "yes | mdadm --create /dev/md$id --level=$level --force --run --raid-devices="
- . scalar(@eff_devs) . " --spare-devices=" . scalar(@spares) . " "
- . join(" ", @eff_devs) . " " . join(" ", @spares),
-- "$pre_req", "exist_/dev/md$id" );
-+ "$pre_req", "run_udev_/dev/md$id" );
-+
-+ &FAI::push_command( "udevsettle --timeout=10", "run_udev_/dev/md$id",
-+ "exist_/dev/md$id" );
-
- # create the filesystem on the volume
- &FAI::build_mkfs_commands("/dev/md$id",
-@@ -274,8 +283,26 @@
+@@ -274,8 +274,26 @@
($config =~ /^VG_(.+)$/) and ($1 ne "--ANY--") or &FAI::internal_error("Invalid config $config");
my $vg = $1; # the actual volume group
@@ -90,77 +35,3 @@
# create all the devices
my @devices = keys %{ $FAI::configs{$config}{devices} };
&FAI::erase_lvm_signature(\@devices);
-@@ -401,7 +428,9 @@
-
- # create a new volume
- &FAI::push_command( "lvcreate -n $lv -L " . $lv_size->{eff_size} . " $vg",
-- "vg_enabled_$vg,$lv_rm_pre", "exist_/dev/$vg/$lv" );
-+ "vg_enabled_$vg,$lv_rm_pre", "run_udev_/dev/$vg/$lv" );
-+ &FAI::push_command( "udevsettle --timeout=10", "run_udev_/dev/$vg/$lv",
-+ "exist_/dev/$vg/$lv" );
-
- # create the filesystem on the volume
- &FAI::build_mkfs_commands("/dev/$vg/$lv",
-@@ -438,12 +467,16 @@
- $type_pre .= ",exist_$d"
- }
- }
-+ $type_pre =~ s/^,//;
-+ # wait for udev to set up all devices
-+ &FAI::push_command( "udevsettle --timeout=10", "$type_pre",
-+ "settle_for_vgchange_$vg" );
-
- # create the volume group or add/remove devices
- &FAI::create_volume_group($config);
- # enable the volume group
- &FAI::push_command( "vgchange -a y $vg",
-- "vg_created_$vg$type_pre", "vg_enabled_$vg" );
-+ "settle_for_vgchange_$vg,vg_created_$vg", "vg_enabled_$vg" );
-
- # perform all necessary operations on the underlying logical volumes
- &FAI::setup_logical_volumes($config);
-@@ -618,12 +651,15 @@
- $part_nr++;
- $FAI::current_config{$disk}{partitions}{$mapped_id}{new_id} = $part_nr;
-
-- my $post = "exist_" . &FAI::make_device_name($disk, $part_nr);
-+ my $post = "run_udev_" . &FAI::make_device_name($disk, $part_nr);
- $post .= ",rebuilt_" . &FAI::make_device_name($disk, $part_nr) if
- $FAI::configs{$config}{partitions}{$part_id}{size}{resize};
- # build a parted command to create the partition
- &FAI::push_command( "parted -s $disk mkpart $part_type $fs ${start}B ${end}B",
- "cleared1_$disk", $post );
-+ &FAI::push_command( "udevsettle --timeout=10", "run_udev_" .
-+ &FAI::make_device_name($disk, $part_nr), "exist_" .
-+ &FAI::make_device_name($disk, $part_nr) );
- }
- }
-
-@@ -738,9 +774,13 @@
- # ntfsresize requires device names
- my $eff_size = $part->{size}->{eff_size};
-
-+ # wait for udev to set up all devices
-+ &FAI::push_command( "udevsettle --timeout=10", "rebuilt_" .
-+ &FAI::make_device_name($disk, $p) . $deps, "settle_for_resize_" .
-+ &FAI::make_device_name($disk, $p) );
- &FAI::push_command( "yes | ntfsresize -s $eff_size " .
-- &FAI::make_device_name($disk, $p), "rebuilt_" .
-- &FAI::make_device_name($disk, $p) . $deps, "ntfs_ready_for_rm_" .
-+ &FAI::make_device_name($disk, $p), "settle_for_resize_" .
-+ &FAI::make_device_name($disk, $p), "ntfs_ready_for_rm_" .
- &FAI::make_device_name($disk, $p) );
- &FAI::push_command( "parted -s $disk rm $p", "ntfs_ready_for_rm_" .
- &FAI::make_device_name($disk, $p), "resized_" .
-@@ -796,7 +836,10 @@
- $pre = ",exist_" . &FAI::make_device_name($disk, $prev_id) if ($prev_id > -1);
- # build a parted command to create the partition
- &FAI::push_command( "parted -s $disk mkpart $part_type $fs ${start}B ${end}B",
-- "cleared2_$disk$pre", "exist_" . &FAI::make_device_name($disk, $part_id) );
-+ "cleared2_$disk$pre", "run_udev_" . &FAI::make_device_name($disk, $part_id) );
-+ &FAI::push_command( "udevsettle --timeout=10", "run_udev_" .
-+ &FAI::make_device_name($disk, $part_id), "exist_" .
-+ &FAI::make_device_name($disk, $part_id) );
- $prev_id = $part_id;
- }
-
Modified: people/michael/experimental/patches/setup-storage_raid0-has-no-spares
===================================================================
--- people/michael/experimental/patches/setup-storage_raid0-has-no-spares 2009-02-09 21:26:43 UTC (rev 5255)
+++ people/michael/experimental/patches/setup-storage_raid0-has-no-spares 2009-02-09 22:35:21 UTC (rev 5256)
@@ -8,14 +8,14 @@
===================================================================
--- trunk.orig/lib/setup-storage/Commands.pm
+++ trunk/lib/setup-storage/Commands.pm
-@@ -232,7 +232,7 @@
- }
+@@ -226,7 +226,7 @@
+ $pre_req =~ s/^,//;
&FAI::push_command(
"yes | mdadm --create /dev/md$id --level=$level --force --run --raid-devices="
- . scalar(@eff_devs) . " --spare-devices=" . scalar(@spares) . " "
+ . scalar(@eff_devs) . (scalar(@spares) !=0 ? " --spare-devices=" . scalar(@spares) : "") . " "
. join(" ", @eff_devs) . " " . join(" ", @spares),
- "$pre_req", "run_udev_/dev/md$id" );
+ "$pre_req", "exist_/dev/md$id" );
Index: trunk/lib/setup-storage/Parser.pm
===================================================================
More information about the Fai-commit
mailing list