Subject: toolchain/35370: installboot breaks with bootxx_cd9660 boot blocks
To: None <toolchain-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <dogcow@babymeat.com>
List: netbsd-bugs
Date: 01/07/2007 06:45:00
>Number:         35370
>Category:       toolchain
>Synopsis:       installboot breaks with bootxx_cd9660 boot blocks
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 07 06:45:00 +0000 2007
>Originator:     Tom Spindler
>Release:        NetBSD 4.99.5 2007-01-06
>Organization:
	
>Environment:
	
	
System: NetBSD mercury.babymeat.com 4.99.4 NetBSD 4.99.4 (MERCURY) #0: Fri Dec 1 16:14:27 PST 2006 dogcow@mercury.babymeat.com:/aux/mnt/obj/obj/usr/src/sys/arch/i386/compile/MERCURY i386
Architecture: i386
Machine: i386
>Description:
After version 1.23 of src/usr.sbin/installboot/arch/i386.c, building release
now fails:
/home/dogcow/work/nbobj/tools/bin/nbinstallboot  -t raw  -mi386  bootxx /home/do
gcow/work/nbobj/dd/usr/mdec/bootxx_cd9660
nbinstallboot: Reading `bootxx': short read, 2048 bytes (should be 8192)
nbinstallboot: Set bootstrap operation failed

*** Failed target:  prepare
*** Failed command: /home/dogcow/work/nbobj/tools/bin/nbinstallboot -t raw -mi38
6 bootxx /home/dogcow/work/nbobj/dd/usr/mdec/bootxx_cd9660
*** Error code 1

Stop.
nbmake: stopped in /home/dogcow/work/nbsrc/distrib/i386/cdroms/bootcd

This is because the bootxx_cd9660 bootblock is only 2048 bytes long, and
nbinstallboot is expecting 8k (the hardcoded sizeof(buf)).
	
>How-To-Repeat:
Try building release, or installbooting onto a cd9660 image.
	
>Fix:
	
Presumably, if you're going to be messing with non-512-byte sectors and/or
filesystems, you're going to need to know the size of the MBR or equiv. I'm
not expert enough to know what the right fix is, but I do know that it should
probably be located around lines 311-320 of .../installboot/arch/i386.c.l

>Unformatted: