Subject: Re: recent boot.fs for 1.4?
To: None <M.Drochner@fz-juelich.de>
From: Robert V. Baron <rvb@cs.cmu.edu>
List: port-i386
Date: 07/09/1999 16:59:06
I wouldn't take Matthais's approach, but again I don't have a machine
to trash to test it.

It seems to me that the write_mbr() abstraction is bad.  It
should just write the mbr to disk.  Define a only_write_mbr() that
just writes and rewrite write_mbr to use only_write_mbr() and have
md_upgrade_mbrtype() call only_write_mbr().

Further, looking at write_mbr(), I see it calls
	convert_mbr_chs(...)
on EVERY partition.  This is WRONG; I don't want it messing with my
other (non-netbsd) partitions.
Finally,  convert_mbr_chs() does the calculation:
	if (tcyl >= 1024) {
                *cylp = *headp = *secp = 0xff;
                return;
        }
which I would also claim is wrong.  If the cylinder > 1024, the better
thing to do is clamp the cylinder at 1023 but do the head and sec
calculations.  

Matthias Drochner <drochner@zel459.zel.kfa-juelich.de> writes:

> cgd@netbsd.org said:
> > The problem that causes sysinst to croak when upgrading old
> > installations (1.3.2 and earlier, i dunno about 1.3.3) to 1.4.x has
> > _NOT_ been fixed. 
> 
> I'm not an insider wrt "sysinst", but I believe that I marginally
> understand what happens...
> Below are some patches which reflect what I think should be changed:
> -in mbr.c, the variable dosptyp_nbsd seems meaningless
>  (no functional change)
> -don't call md_upgrade_mbrtype() from md_pre_disklabel() - as I see
>  this is only called after edit_mbr() which already deals with the
>  mbr type
> -call md_bios_info() in md_upgrade_mbrtype() to get the geometry
>  information and check whether it succeeeded
> -ask before the mbr type is really updated - this also provides a
>  workaround if something goes wrong
> 
> Imho, the code shouldn't care about the geometry at all when
> upgrading, but this would be a more serious change.
> 
> I haven't tested the patches - don't have a disk installation.
> 
> best regards
> Matthias