On Sat, Apr 06, 2002 at 12:35:06PM +0200, Pixel wrote: > > the pb is the architecture of diskdrake won't accept un-partitionned drives.
OK. > having those drives ignored would be easy... Well that is the direction I will go first in trying to get my box upgraded. > well, not quite so. It tries to detect the partition table format. Making it > ignore those drives would not be hard. I have hacked this up so far (untested yet), to get drakx past the point of just repeating the "unknown partition" error message with hda: diff --exclude *.dist -Nur /mnt/cooker/8.2/8.2-tree/Mandrake/mdkinst/usr/bin/perl-install/partition_table.pm /mnt/cooker/8.2/8.2-test/Mandrake/mdkinst/usr/bin/perl-install/partition_table.pm --- /mnt/cooker/8.2/8.2-tree/Mandrake/mdkinst/usr/bin/perl-install/partition_table.pm Sat Mar 16 07:30:29 2002 +++ /mnt/cooker/8.2/8.2-test/Mandrake/mdkinst/usr/bin/perl-install/partition_table.pm + Fri Apr 5 21:08:39 2002 @@ -455,8 +455,8 @@ if_(arch() =~ /^ia64/, 'gpt'), arch() =~ /^sparc/ ? ('sun', 'bsd', 'unknown') : ('dos', 'bsd', 'sun', 'mac', 'unknown'), ); - foreach ('empty', @parttype) { - /unknown/ and die "unknown partition table format"; + foreach ('empty', 'lvm', @parttype) { + /unknown/ and die "unknown partition table format on disk " . $hd->{file}; eval { require("partition_table_$_.pm"); bless $hd, "partition_table_$_"; diff --exclude *.dist -Nur /mnt/cooker/8.2/8.2-tree/Mandrake/mdkinst/usr/bin/perl-install/partition_table_lvm.pm /mnt/cooker/8.2/8.2-test/Mandrake/mdkinst/usr/bin/perl-install/partition_table_lvm.pm --- /mnt/cooker/8.2/8.2-tree/Mandrake/mdkinst/usr/bin/perl-install/partition_table_lvm.pm Wed Dec 31 19:00:00 1969 +++ +/mnt/cooker/8.2/8.2-test/Mandrake/mdkinst/usr/bin/perl-install/partition_table_lvm.pm + Fri Apr 5 21:05:22 2002 @@ -0,0 +1,103 @@ +package partition_table_lvm; # $Id: partition_table_lvm.pm,v 1.7 2001/10/19 11:23:35 +prigaux Exp $ + + + + + +@ISA = qw(partition_table_raw); + +use common; +use partition_table_raw; +use partition_table; +use c; + +my @fields = qw(active start_head start_sec start_cyl type end_head end_sec end_cyl +start size); +#my $format = "C8 V2"; +my $magic = "HM\1\0"; +#my $nb_primary = 4; + +#my $offset = $common::SECTORSIZE - length($magic) - $nb_primary * +common::psizeof($format); +my $offset = 0; + +#sub hasExtended { 1 } +sub hasExtended { 0 } + +sub compute_CHS($$) { + my ($hd, $e) = @_; + my @l = qw(cyl head sec); + @$e{map { "start_$_" } @l} = $e->{start} || $e->{type} ? CHS2rawCHS($hd, +sector2CHS($hd, $e->{start})) : (0,0,0); + @$e{map { "end_$_" } @l} = $e->{start} || $e->{type} ? CHS2rawCHS($hd, +sector2CHS($hd, $e->{start} + $e->{size} - 1)) : (0,0,0); + 1; +} + +sub CHS2rawCHS { + my ($hd, $c, $h, $s) = @_; + if ($c > 1023) { + + $c = 1023; + $h = $hd->{geom}{heads} - 1; + $s = $hd->{geom}{sectors}; + } + ($c & 0xff, $h, $s | ($c >> 2 & 0xc0)); +} + +# returns (cylinder, head, sector) +sub sector2CHS { + my ($hd, $start) = @_; + my ($s, $h); + ($start, $s) = divide($start, $hd->{geom}{sectors}); + ($start, $h) = divide($start, $hd->{geom}{heads}); + ($start, $h, $s + 1); +} + +sub read { + my ($hd, $sector) = @_; + my $tmp; + + local *F; partition_table_raw::openit($hd, *F) or die "failed to open device"; + c::lseek_sector(fileno(F), $sector, $offset) or die "reading of partition in +sector $sector failed"; + +# my @pt = map { +# sysread F, $tmp, psizeof($format) or die "error while reading partition table +in sector $sector"; +# my %h; @h{@fields} = unpack $format, $tmp; +# \%h; +# } (1..$nb_primary); + + + sysread F, $tmp, length $magic or die "error reading magic number on disk " . +$hd->{file}; + $tmp eq $magic or die "bad magic number on disk ". $hd->{file}; + +# [ @pt ]; + [ ]; + +} + +# write the partition table (and extended ones) +# for each entry, it uses fields: start, size, type, active +sub write($$$;$) { + my ($hd, $sector, $pt) = @_; + + die "should not be writing lvm partitions!!"; +# local *F; +# if ($::testing) { +# my $file = "/tmp/partition_table_$hd->{device}"; +# open F, ">$file" or die "error opening test file $file"; +# } else { +# partition_table_raw::openit($hd, *F, 2) or die "error opening device +$hd->{device} for writing"; +# c::lseek_sector(fileno(F), $sector, $offset) or return 0; +# } +# +# @$pt == $nb_primary or die "partition table does not have $nb_primary entries"; +# foreach (@$pt) { +# compute_CHS($hd, $_); +# local $_->{start} = $_->{local_start} || 0; +# $_->{active} ||= 0; $_->{type} ||= 0; $_->{size} ||= 0; +# syswrite F, pack($format, @$_{@fields}), psizeof($format) or return 0; +# } +# syswrite F, $magic, length $magic or return 0; +# 1; +} + +sub clear_raw { { raw => [ ({}) x $nb_primary ] } } + +1; Is there any way to restart drakx during an installation/upgrade? My media is located on a NFS server, so making changes to perl-install is quite simple but I have to restart the whole installation process in order to get drakx to see the changes I made. If I could restart the installer without having to reboot it would be much of a time saver. b. -- Brian J. Murrell
msg62090/pgp00000.pgp
Description: PGP signature