NetBSD Problem Report #33987

From  Wed Jul 12 18:08:34 2006
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id D06D963B896
	for <>; Wed, 12 Jul 2006 18:08:33 +0000 (UTC)
Message-Id: <>
Date: Wed, 12 Jul 2006 18:08:09 +0200 (CEST)
Subject: sysinst on sparc64 fails to install primary bootstrap loader
X-Send-Pr-Version: 3.95

>Number:         33987
>Category:       port-sparc64
>Synopsis:       sysinst on sparc64 fails to install primary bootstrap loader
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-sparc64-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 12 18:10:00 +0000 2006
>Closed-Date:    Wed Jul 12 21:37:13 +0000 2006
>Last-Modified:  Wed Jul 12 21:45:01 +0000 2006
>Originator:     Havard Eidnes
>Release:        NetBSD 3.99.21 3 Jul 2006
System: NetBSD 3.99.21 NetBSD 3.99.21 (GENERIC) #0: Fri Jul  7 15:42:53 CEST 2006 sparc64
Architecture: sparc64
Machine: sparc64
	After installing NetBSD on a system with wiped harddisks,
	attempts to reboot from the recently-installed system gives

{0} ok boot disk netbsd
Resetting ... 
Rebooting with command: boot disk netbsd
Boot device: /pci@1f,4000/scsi@3/disk@0,0  File and args: netbsd
The file just loaded does not appear to be executable.
Boot device: /pci@1f,4000/scsi@3/disk@0,0:a  File and args: 
The file just loaded does not appear to be executable.

	Manually installing the primary bootstrap loader with

# installboot /dev/rsd0c /usr/mdec/bootblk

	fixed the problem.  ('c' starts at same offset as 'a').

	A closer inspection of the sysinst session from the serial
	console gives some clue as to the problem.  Sysinst runs

/usr/mdec/binstall ffs /targetroot

	to install the boot code.  This resulted in the following
	error message:

installboot: File system `/dev/rsd0a' is of an unknown type

	and thus, no primary boot loader was installed.	

	Before installing the new boot code I net-booted again to
	inspect the disk label sysinst had placed on the hard drive,
	and it looked like this:

# disklabel sd0
# /dev/rsd0c:
type: unknown
disk: torbidinsu
bytes/sector: 512
sectors/track: 248
tracks/cylinder: 19
sectors/cylinder: 4712
cylinders: 7506
total sectors: 35368272
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

8 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:  25124384         0     4.2BSD   2048 16384 28216  # (Cyl.      0 -   5331)
 b:  10243888  25124384       swap                     # (Cyl.   5332 -   7505)
 c:  35368272         0     unused      0     0        # (Cyl.      0 -   7505)

	Modifying binstall to allow a test run in secure mode reveals
	what commands it would try to execute:

% /usr/mdec/binstall -t ffs /
Inspecting "/dev/sd0a on / type ffs (local)"
Boot device: /dev/rsd0a
Primary boot program: /usr/mdec/bootblk
Secondary boot program: //ofwboot
=> cp -p -f /usr/mdec/ofwboot //ofwboot
/usr/sbin/installboot -v -m sparc64 /dev/rsd0a /usr/mdec/bootblk ofwboot
=> /usr/sbin/installboot -v -m sparc64 /dev/rsd0a /usr/mdec/bootblk ofwboot

	(except -t to binstall turns on -v to installboot as well)

	Try to install -current on a sparc64 system with a wiped
	system disk, and watch it fail to install the primary boot

	The problem appears to be that installboot for the install
	image is compiled with SMALLPROG, which ends up defining
	the NO_STAGE2 option, and the list of fs types to match
	against in fstypes[] is thus left empty!

	This is from installboot's Makefile, where we when SMALLPROG
	is defined only end up adding sparc64.c to ARCH_FILES:

.if !defined(SMALLPROG) && !defined(ARCH_FILES)
ARCH_FILES=  alpha.c amiga.c ews4800mips.c hp300.c hp700.c i386.c
ARCH_FILES+= macppc.c news.c next68k.c pmax.c
ARCH_FILES+= sparc.c sparc64.c sun68k.c vax.c x68k.c
.if empty(ARCH_FILES)

	and since sparc64 is not in this match pattern:

.if empty(ARCH_FILES:C/(macppc|news|sparc|sun68k|x68k)/stg2/:Mstg2.c)
SRCS+= bbinfo.c

# fstypes are only needed for 'stage2' and then only from bbinfo.
SRCS+= ffs.c
SRCS+= ffs_bswap.c

	-DNO_STAGE2 gets added to CPPFLAGS.

	Now, I'm not entirely certain exactly how this is supposed to
	be fixed.  Perhaps by fixing the binstall script to not supply
	the name of the secondary boot loader (since it's installed by
	copying it to the root directory of the target file system
	anyway?), and presumably doesn't need to be given to
	installboot, at least not for sparc64?



State-Changed-From-To: open->closed
State-Changed-When: Wed, 12 Jul 2006 21:37:13 +0000
Should now be fixed with the recent change to the shared
sparc / sparc64 script.

From: Havard Eidnes <>
Subject: PR/33987 CVS commit: src/sys/arch/sparc/stand/binstall
Date: Wed, 12 Jul 2006 21:34:45 +0000 (UTC)

 Module Name:	src
 Committed By:	he
 Date:		Wed Jul 12 21:34:45 UTC 2006

 Modified Files:

 Log Message:
 Omit specifying the secondary bootloader on the installboot command line
 for sparc64 systems.  This should fix PR#33987.

 Also adapt to the way sparc64 32-bit kernels now report its CPU
 architecture -- these still need the sparc64 boot loader, but now
 report hw.machine = sparc.  Adapt by testing machdep.cpu_arch

 Hints from martin and mrg.

 To generate a diff of this commit:
 cvs rdiff -r1.14 -r1.15 src/sys/arch/sparc/stand/binstall/

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.