summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-11-16 16:35:26 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-11-16 16:35:26 +0000
commitc61d24242661df10056834c624fdf355f790a2dc (patch)
tree3e0108c0c78267819493bd713b3c97b65e3783fb /perl-install
parent7871291e1db7370725c855a6d454a496f6e163ce (diff)
downloaddrakx-c61d24242661df10056834c624fdf355f790a2dc.tar
drakx-c61d24242661df10056834c624fdf355f790a2dc.tar.gz
drakx-c61d24242661df10056834c624fdf355f790a2dc.tar.bz2
drakx-c61d24242661df10056834c624fdf355f790a2dc.tar.xz
drakx-c61d24242661df10056834c624fdf355f790a2dc.zip
don't die in will_tell_kernel() when the device is weird, since it is normal when destroying a raw_lvm_PV
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/partition_table.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index 5402dc3d8..624e3c111 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -344,12 +344,17 @@ sub will_tell_kernel {
will_tell_kernel($hd, del => $o_part);
will_tell_kernel($hd, add => $o_part);
} else {
- my $part_number = sub { $o_part->{device} =~ /(\d+)$/ ? $1 : internal_error("bad device " . description($o_part)) };
+ my $part_number;
+ if ($o_part) {
+ ($part_number) = $o_part->{device} =~ /(\d+)$/ or
+ #- don't die, it occurs when we zero_MBR_and_dirty a raw_lvm_PV
+ log::l("ERROR: will_tell_kernel bad device " . description($o_part)), return;
+ }
my @para =
$action eq 'force_reboot' ? () :
- $action eq 'add' ? ($part_number->(), $o_part->{start}, $o_part->{size}) :
- $action eq 'del' ? $part_number->() :
+ $action eq 'add' ? ($part_number, $o_part->{start}, $o_part->{size}) :
+ $action eq 'del' ? $part_number :
internal_error("unknown action $action");
push @{$hd->{'will_tell_kernel' . ($o_delay || '')} ||= []}, [ $action, @para ];