NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-sgimips/53583: sysinst in NetBSD/sgimips 8.0 doesn't install bootloader



>Number:         53583
>Category:       port-sgimips
>Synopsis:       sysinst in NetBSD/sgimips 8.0 doesn't install bootloader
>Confidential:   no
>Severity:       critical
>Priority:       low
>Responsible:    port-sgimips-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 07 17:00:00 +0000 2018
>Originator:     Izumi Tsutsui
>Release:        NetBSD 8.0
>Organization:
>Environment:
System: NetBSD sgimips 8.0 NetBSD 8.0 (GENERIC32_IP3x) #0: Tue Jul 17 14:59:51 UTC 2018 mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/sgimips/compile/GENERIC32_IP3x
Architecture: mipseb
Machine: sgimips
>Description:
It looks sysinst in NetBSD/sgimips 8.0 doesn't install bootloader properly.
See the following dmesg (installed into the disk where 5.2.3 was installed):
 http://dmesgd.nycbug.org/index.cgi?do=view&id=3734

---

                         Running power-on diagnostics...



                           Starting up the system...

               To perform system maintenance instead, press <Esc>

NetBSD/sgimips 5.2.3 Bootstrap, Revision 1.5
(builds%b48.netbsd.org@localhost, Sat Nov 15 21:56:41 UTC 2014)

devopen: pci(0)scsi(0)disk(1)rdisk(0)partition(0) type scsi file /netbsd
6745328+134272 [336160+326897]=0x731c90
phys segment: 0xc000 @ 0x2000
adding 0xc000 @ 0x2000 to freelist 0
phys segment: 0xd40000 @ 0x10000
adding 0x56000 @ 0x10000 to freelist 0
adding 0x5be000 @ 0x792000 to freelist 0
phys segment: 0xec00000 @ 0x1400000
adding 0xec00000 @ 0x1400000 to freelist 0
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
    2018 The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 8.0 (GENERIC32_IP3x) #0: Tue Jul 17 14:59:51 UTC 2018
	mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/sgimips/compile/GENERIC32_IP3x

---


Probably "instsys" variable should be initialized by uname(3) earlier
than current md_init_set_status()? (in md_init()?)
 https://nxr.netbsd.org/xref/src/usr.sbin/sysinst/arch/sgimips/md.c?r=1.4#70

---
struct utsname instsys;

void
md_init(void)
{
}

void
md_init_set_status(int flags)
{
	(void)flags;

	/*
	 * Get the name of the Install Kernel we are running under and
	 * enable the installation of the corresponding GENERIC kernel.
	 */
	uname(&instsys);
	if (strstr(instsys.version, "(INSTALL32_IP3x"))
		set_kernel_set(SET_KERNEL_2);
	else if (strstr(instsys.version, "(INSTALL32_IP2x"))
		set_kernel_set(SET_KERNEL_1);
	else if (strstr(instsys.version, "(GENERIC32_IP12"))
		set_kernel_set(SET_KERNEL_3);
}

 :

int
md_post_disklabel(void)
{
	if (strstr(instsys.version, "(INSTALL32_IP3x"))
		return run_program(RUN_DISPLAY,
		    "%s %s", "/usr/mdec/sgivol -f -w boot /usr/mdec/ip3xboot",
		    pm->diskdev);

	if (strstr(instsys.version, "(INSTALL32_IP2x")) {
		run_program(RUN_DISPLAY,
		  "%s %s", "/usr/mdec/sgivol -f -w aoutboot /usr/mdec/aoutboot",
		  pm->diskdev);
		return run_program(RUN_DISPLAY,
		  "%s %s", "/usr/mdec/sgivol -f -w boot /usr/mdec/ip2xboot",
		  pm->diskdev);
	}

	/* Presumably an IP12, we add the boot code later... */
	return 0;
}

---

>How-To-Repeat:
Install NetBSD/sgimips 8.0 via sysinst.

>Fix:

1) move a call of uname(&instsys) into md_init()
  -> note there is no ports that have valid ops in md_init()

2) use local auto variables for uname(3) instead of a current
   static instsys and call uname(3) in each function
   (md_init_set_status() and md_post_disklabe() so that
    we don't have to order of initialization)

Note hpcarm, sandpoint, and zaurus use sysctl(2) to get kernel name
to choose a proper kernel set.

---
Izumi Tsutsui



Home | Main Index | Thread Index | Old Index