> To be clear, the old amd64/i386 installboot never updated /boot - it only 
> ever 
> patched biosboot and installed it into the PBR. It was entirely up to the 
> user (or the install script) to copy /usr/mdec/boot file to /boot - if you 
> used cp or cat the old PBR may have continued to work, but there was no 
> guarantee.

This improperly describes what the previous sequence did.

It did not "copy" the content to /boot. In fact, it "cat'd" it to the
existing file, thereby replacing the existing ffs blocks with new ffs
blocks.  The block numbers in use do not change (typically).  It is
not a published semantic of the ffs code, but...

Furthermore, this is not a new or surprising idiom; it has been used
all over the place in the past for bootblocks.

This mechanism is commonly used when the primary bootcode have a very
small space to remember where the secondary code is.  That is why the
primary loader has to (generally) be modified afterwards.  In the
common case, for re-installing bootblocks, they do land in the same
place, and ... thus, your change broke things for people.

Here's the old code, and the new code.

Index: install.md
===================================================================
RCS file: /cvs/src/distrib/i386/common/install.md,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -p -u -r1.56 -r1.57
--- install.md  16 Nov 2013 18:37:27 -0000      1.56
+++ install.md  20 Jan 2014 05:14:05 -0000      1.57
@@ -39,10 +39,7 @@ NCPU=$(sysctl -n hw.ncpufound)
 ((NCPU > 1)) && { DEFAULTSETS="bsd bsd.rd bsd.mp" ; SANESETS="bsd bsd.mp" ; }
 
 md_installboot() {
-       # LBA biosboot uses /boot's i-node number. Using 'cat' preserves that
-       # number, so multiboot setups (NTLDR) can work across upgrades.
-       cat /mnt/usr/mdec/boot >/mnt/boot
-       if ! /mnt/usr/mdec/installboot /mnt/boot /mnt/usr/mdec/biosboot ${1} ; 
then
+       if ! installboot -r /mnt ${1} ; then
                echo "\nFailed to install bootblocks."
                echo "You will not be able to boot OpenBSD from ${1}."
                exit

Reply via email to