summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-04-09 09:28:24 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-04-09 09:28:24 +0000
commitf9a642df536f4779ed37f2a090e31987f7e7d7ce (patch)
tree5a06e76f6566e6621939cd8f7f9c50368c64ff48
parent21821ebbb28f714e4f12d71eff0357e498fdb111 (diff)
downloaddrakx-f9a642df536f4779ed37f2a090e31987f7e7d7ce.tar
drakx-f9a642df536f4779ed37f2a090e31987f7e7d7ce.tar.gz
drakx-f9a642df536f4779ed37f2a090e31987f7e7d7ce.tar.bz2
drakx-f9a642df536f4779ed37f2a090e31987f7e7d7ce.tar.xz
drakx-f9a642df536f4779ed37f2a090e31987f7e7d7ce.zip
nicer debug "bag magic" error message (thanks to Brian J. Murrell)
-rw-r--r--perl-install/partition_table_bsd.pm4
-rw-r--r--perl-install/partition_table_dos.pm4
-rw-r--r--perl-install/partition_table_empty.pm4
-rw-r--r--perl-install/partition_table_gpt.pm2
-rw-r--r--perl-install/partition_table_mac.pm2
-rw-r--r--perl-install/partition_table_sun.pm2
6 files changed, 9 insertions, 9 deletions
diff --git a/perl-install/partition_table_bsd.pm b/perl-install/partition_table_bsd.pm
index cb6a8441e..aa9b9eb29 100644
--- a/perl-install/partition_table_bsd.pm
+++ b/perl-install/partition_table_bsd.pm
@@ -78,8 +78,8 @@ sub read($$) {
} $info{partitions} =~ /(.{$size})/g;
#- check magic number
- $info{magic} == $magic or die "bad magic number";
- $info{magic2} == $magic or die "bad magic number";
+ $info{magic} == $magic or die "bad magic number on disk $hd->{device}";
+ $info{magic2} == $magic or die "bad magic number on disk $hd->{device}";
[ @pt ], \%info;
}
diff --git a/perl-install/partition_table_dos.pm b/perl-install/partition_table_dos.pm
index 00ee589b9..ced50826f 100644
--- a/perl-install/partition_table_dos.pm
+++ b/perl-install/partition_table_dos.pm
@@ -62,8 +62,8 @@ sub read {
} (1..$nb_primary);
#- check magic number
- sysread F, $tmp, length $magic or die "error reading magic number";
- $tmp eq $magic or die "bad magic number";
+ sysread F, $tmp, length $magic or die "error reading magic number on disk $hd->{device}";
+ $tmp eq $magic or die "bad magic number on disk $hd->{device}";
[ @pt ];
}
diff --git a/perl-install/partition_table_empty.pm b/perl-install/partition_table_empty.pm
index b2cc545de..6c922ffb7 100644
--- a/perl-install/partition_table_empty.pm
+++ b/perl-install/partition_table_empty.pm
@@ -25,8 +25,8 @@ sub read($$) {
c::lseek_sector(fileno(F), $sector, 0) or die "reading of partition in sector $sector failed";
#- check magic number
- sysread F, $tmp, 512 or die "error reading magic number";
- $tmp eq substr($tmp, 0, 1) x 512 or die "bad magic number";
+ sysread F, $tmp, 512 or die "error reading magic number on disk $hd->{device}";
+ $tmp eq substr($tmp, 0, 1) x 512 or die "bad magic number on disk $hd->{device}";
partition_table_raw::zero_MBR($hd);
diff --git a/perl-install/partition_table_gpt.pm b/perl-install/partition_table_gpt.pm
index fe70009b0..d4c873851 100644
--- a/perl-install/partition_table_gpt.pm
+++ b/perl-install/partition_table_gpt.pm
@@ -106,7 +106,7 @@ sub read_header {
sysread $F, $tmp, psizeof($main_format) or die "error while reading partition table in sector $sector";
my %info; @info{@$main_fields} = unpack $main_format, $tmp;
- $info{magic} eq $magic or die "bad magic number";
+ $info{magic} eq $magic or die "bad magic number on disk $hd->{device}";
$info{myLBA} == $sector or die "myLBA is not the same";
$info{headerSize} == psizeof($main_format) or die "bad partition table header size";
$info{partitionEntrySize} == psizeof($partitionEntry_format) or die "bad partitionEntrySize";
diff --git a/perl-install/partition_table_mac.pm b/perl-install/partition_table_mac.pm
index 5c06b8a7e..4a094e92b 100644
--- a/perl-install/partition_table_mac.pm
+++ b/perl-install/partition_table_mac.pm
@@ -114,7 +114,7 @@ sub read($$) {
}
#- check magic number
- $info{bzSig} == $magic or die "bad magic number";
+ $info{bzSig} == $magic or die "bad magic number on disk $hd->{device}";
my $numparts;
c::lseek_sector(fileno(F), $sector, 516) or die "reading of partition in sector $sector failed";
diff --git a/perl-install/partition_table_sun.pm b/perl-install/partition_table_sun.pm
index 75025b503..e0cc05265 100644
--- a/perl-install/partition_table_sun.pm
+++ b/perl-install/partition_table_sun.pm
@@ -82,7 +82,7 @@ sub read($$) {
my %info; @info{@$main_fields} = unpack $main_format, $tmp;
#- check magic number
- $info{magic} == $magic or die "bad magic number";
+ $info{magic} == $magic or die "bad magic number on disk $hd->{device}";
#- check crc, csum contains the crc so result should be 0.
compute_crc($tmp) == 0 or die "bad checksum";