Subject: port-i386/7608: i386 1.4 sysinst upgrade fall down go BOOM!
To: None <gnats-bugs@gnats.netbsd.org>
From: None <cgd@netbsd.org>
List: netbsd-bugs
Date: 05/18/1999 23:05:51
>Number:         7608
>Category:       port-i386
>Synopsis:       i386 1.4 sysinst upgrade fall down go BOOM!
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-i386-maintainer (NetBSD/i386 Portmaster)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 18 23:05:00 1999
>Last-Modified:
>Originator:     Chris G. Demetriou
>Organization:
Chris Demetriou - cgd@netbsd.org - http://www.netbsd.org/People/Pages/cgd.html
Disclaimer: Not speaking for NetBSD, just expressing my own opinion.
>Release:        NetBSD 1.4
>Environment:
System: NetBSD speedy 1.4 NetBSD 1.4 (SPEEDY) #18: Tue May 18 12:17:14 PDT 1999 cgd@speedy:/a/users/cgd/proj/netbsd/src-1-4-branch/sys/arch/i386/compile/SPEEDY i386

>Description:
	[ This bug filed under port-i386 because the thing that
	actually caused the crash may well be i386-specific.  However,
	some of the things necessary to completely fix the problem are
	mostly machine-independent. ]

	I tried using NetBSD/i386 1.4 sysinst to upgrade a ppro 200 system
	which has only NetBSD/i386 installed.

	sysinst blew up (Floating Point Exception, core dump) after
	installing the installation binaries on the hard disk and running
	installboot.  I ran sysinst with logging and scripting turned
	on, and the last thing in the script was:

/usr/mdec/installboot -v /usr/mdec/biosboot.sym /dev/rsd0a 

	and in the log was:

executing: /usr/mdec/installboot -v /usr/mdec/biosboot.sym /dev/rsd0a 
/usr/mdec/biosboot.sym: entry point 0x202000
proto bootblock size 41984
room for 10 filesystem blocks at 0x580
renamed /mnt/boot -> /mnt/boot.bak
Will load 67 blocks.
dblk: 4832, num: 16
dblk: 4848, num: 16
dblk: 4864, num: 16
dblk: 4880, num: 16
dblk: 4678, num: 3
BSD partition starts at sector 63
deleting /mnt/boot.bak

	Therefore, i'd guess that something it was trying to do after
	it installed the new boot block caused it to blow up.

	This had several bad side effects, aside from making upgrade
	via sysinst impossible:

	* it left the tty modes on the console tty screwed up, which was
	fixable easily enough (for someone who more or less knows the
	'right' default tty flags 8-), but worse

	* it copied the installation binaries to the hard disk, thereby
	rendering the existing filesystem unbootable.  (init would
	croak with signal 12 -- SIGSYS).

	The fdisk and disklabel information on the system's sole disk is:

24 [speedy] cgd % fdisk /dev/rsd0d
NetBSD disklabel disk geometry:
cylinders: 5172 heads: 10 sectors/track: 162 (1620 sectors/cylinder)

BIOS disk geometry:
cylinders: 522 heads: 255 sectors/track: 63 (16065 sectors/cylinder)

Partition table:
0: <UNUSED>
1: <UNUSED>
2: <UNUSED>
3: sysid 165 (FreeBSD or 386BSD or old NetBSD)
    start 63, size 8385867 (4094 MB), flag 0x80
        beg: cylinder    0, head   1, sector  1
        end: cylinder  521, head 254, sector 63
25 [speedy] cgd % disklabel sd0
disklabel: old BSD partition ID!
# /dev/rsd0d:
type: SCSI
disk: mydisk
label: 
flags:
bytes/sector: 512
sectors/track: 162
tracks/cylinder: 10
sectors/cylinder: 1620
cylinders: 5172
total sectors: 8378640
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0 

7 partitions:
#        size   offset     fstype   [fsize bsize   cpg]
  a:   532980       63     4.2BSD     1024  8192    16   # (Cyl.    0*- 329*)
  b:   532917   533043       swap                        # (Cyl.  329*- 657)
  c:  8378577       63     unused        0     0         # (Cyl.    0*- 5171)
  d:  8378640        0     unused        0     0         # (Cyl.    0 - 5171)
  e:  3146040  1065960     4.2BSD     1024  8192    16   # (Cyl.  658 - 2599)
  f:  2083320  4212000     4.2BSD     1024  8192    16   # (Cyl. 2600 - 3885)
  g:  2083320  6295320     4.2BSD     1024  8192    16   # (Cyl. 3886 - 5171)

	I can provide additional information if it would be helpful.

>How-To-Repeat:
	Probably try to use i386 1.4 sysinst to upgrade other disks...

>Fix:
	Unknown.  However, it has the following components:

	* when sysinst gets a fatal signal, catch it, print out relevant
	debugging information, and do what can be done to reset the tty
	modes before exiting.

	* If possible, don't copy the install binaries to the hard disk.
	On the i386, this was necessary in the past to facilitate floppy
	installation and/or use of tools on multiple floppies.  However,
	we're now running from ramdisk, and I don't see why it's necessary
	any longer.

	* Kill the particular bug that caused this crash, so that sysinst
	might be usable for upgrades.
>Audit-Trail:
>Unformatted: