Module Name: src
Committed By: snj
Date: Mon May 7 04:06:31 UTC 2018
Modified Files:
src/usr.sbin/sysinst [netbsd-8]: partman.c
Log Message:
Pull up following revision(s) (requested by kre in ticket #801):
usr.sbin/sysinst/partman.c: 1.20-1.21
PR install/53220
Don't call pm_lvm_find() unless have_lvm
pm_lvm_find() assumes that data structs (lvms) has been allocated
for it to use, which doesn't happen if !have_lvm
This avoids a sysinst core dump when the lvm command is not installed
(such as when installing from the embedded RAM root filesys in an
INSTALL kernel.)
--
Change return type of pm_lvm_find() from int to void.
It always returns (returned) 0 which was ignored by the one call.
To generate a diff of this commit:
cvs rdiff -u -r1.15.6.2 -r1.15.6.3 src/usr.sbin/sysinst/partman.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/partman.c
diff -u src/usr.sbin/sysinst/partman.c:1.15.6.2 src/usr.sbin/sysinst/partman.c:1.15.6.3
--- src/usr.sbin/sysinst/partman.c:1.15.6.2 Mon May 7 03:51:01 2018
+++ src/usr.sbin/sysinst/partman.c Mon May 7 04:06:31 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: partman.c,v 1.15.6.2 2018/05/07 03:51:01 snj Exp $ */
+/* $NetBSD: partman.c,v 1.15.6.3 2018/05/07 04:06:31 snj Exp $ */
/*
* Copyright 2012 Eugene Lozovoy
@@ -1173,7 +1173,7 @@ pm_cgd_commit(void)
/* Add lvm logical volumes to pm list */
/* XXX: rewrite */
-static int
+static void
pm_lvm_find(void)
{
int i, ii, already_found;
@@ -1213,7 +1213,6 @@ pm_lvm_find(void)
memset(pm_new, 0, sizeof *pm_new);
}
}
- return 0;
}
static int
@@ -2609,7 +2608,8 @@ pm_upddevlist(menudesc *m, void *arg)
pm_i->found = 0;
/* Detect all present devices */
(void)find_disks("partman");
- pm_lvm_find();
+ if (have_lvm)
+ pm_lvm_find();
pm_clean();
if (m == NULL || arg == NULL)