Module Name: src
Committed By: martin
Date: Fri Nov 9 15:20:36 UTC 2018
Modified Files:
src/usr.sbin/sysinst: disks.c target.c
Log Message:
Fix test for active root partition when booting from a wedge
To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/sysinst/disks.c
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/target.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.22 src/usr.sbin/sysinst/disks.c:1.23
--- src/usr.sbin/sysinst/disks.c:1.22 Thu Nov 8 20:29:37 2018
+++ src/usr.sbin/sysinst/disks.c Fri Nov 9 15:20:36 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: disks.c,v 1.22 2018/11/08 20:29:37 martin Exp $ */
+/* $NetBSD: disks.c,v 1.23 2018/11/09 15:20:36 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -619,7 +619,8 @@ get_disks_helper(void *arg, const char *
* Exclude a disk mounted as root partition,
* in case of install-image on a USB memstick.
*/
- if (is_active_rootpart(state->dd->dd_name, 0))
+ if (is_active_rootpart(state->dd->dd_name,
+ state->dd->dd_no_part ? -1 : 0))
return true;
if (!state->dd->dd_no_part) {
Index: src/usr.sbin/sysinst/target.c
diff -u src/usr.sbin/sysinst/target.c:1.3 src/usr.sbin/sysinst/target.c:1.4
--- src/usr.sbin/sysinst/target.c:1.3 Sun Oct 18 09:21:55 2015
+++ src/usr.sbin/sysinst/target.c Fri Nov 9 15:20:36 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: target.c,v 1.3 2015/10/18 09:21:55 martin Exp $ */
+/* $NetBSD: target.c,v 1.4 2018/11/09 15:20:36 martin Exp $ */
/*
* Copyright 1997 Jonathan Stone
@@ -71,7 +71,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: target.c,v 1.3 2015/10/18 09:21:55 martin Exp $");
+__RCSID("$NetBSD: target.c,v 1.4 2018/11/09 15:20:36 martin Exp $");
#endif
/*
@@ -186,8 +186,12 @@ is_active_rootpart(const char *dev, int
if (strcmp(dev, rootdev) != 0)
return 0;
+ if (ptn < 0)
+ return 1; /* device only check, or wedge */
+
mib[1] = KERN_ROOT_PARTITION;
varlen = sizeof rootptn;
+ rootptn = -1;
if (sysctl(mib, 2, &rootptn, &varlen, NULL, 0) < 0)
return 1;