NetBSD-Bugs archive

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

install/56354: sysinst fails to upgrade on miniroot (for sparc)



>Number:         56354
>Category:       install
>Synopsis:       sysinst fails to upgrade on miniroot (for sparc)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    install-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 09 17:50:00 +0000 2021
>Originator:     Izumi Tsutsui
>Release:        NetBSD 9.2
>Organization:
>Environment:
System: NetBSD legnum 9.2 NetBSD 9.2 (GENERIC) #0: Wed May 12 13:15:55 UTC 2021  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/sparc/compile/GENERIC sparc
Architecture: sparc, but possibly all with miniroot + sysinst
Machine: sparc
>Description:
On upgrade install of NetBSD 9.2, if the target machine has less than
32 MB (defined as TINY_RAM_SIZE) memory, sysinst silently refuses
to continue installation after selecting target disk.

do_upgrade() in src/usr.sbin/sysinst/upgrade.c calls set_swap_if_low_ram()
 https://nxr.netbsd.org/xref/src/usr.sbin/sysinst/upgrade.c?r=1.17#84
---
     65 	if (find_disks(msg_string(MSG_upgrade), !root_is_read_only()) < 0)
     66 		return;
     67 
 :
     83 
     84 	if (set_swap_if_low_ram(&install) < 0)
     85 		return;
---
after find_disks() and it returns silently if SWAP_ON for swpctl(2)
fails in set_swap() in src/usr.sbin/sysinst/disks.c:
 https://nxr.netbsd.org/xref/src/usr.sbin/sysinst/disks.c?r=1.74#1952
---
   1952 	rval = swapctl(SWAP_ON, swap_dev, 0);
   1953 	if (rval != 0) {
   1954 		swap_dev[0] = 0;
   1955 		return -1;
   1956 	}
---

So sysinst silently returns to the main manu and users cannot see
what's wrong.

>How-To-Repeat:
Upgrade install to NetBSD/sparc 9.2 using miniroot on <32MB RAM sparc.

>Fix:
Don't treat the failure of set_swap_if_low_ram() as fatal,
i.e. sysinst should just print warnings and continue?

Note do_install (i.e. new installation) doesn't check a return value of
the set_swap_if_low_ram():
 https://nxr.netbsd.org/xref/src/usr.sbin/sysinst/install.c?r=1.9.2.4#119
---
    118 	/* phase 3: now we may have a first chance to enable swap space */
    119 	set_swap_if_low_ram(install);
---

---
Izumi Tsutsui



Home | Main Index | Thread Index | Old Index