Module Name: src
Committed By: martin
Date: Tue May 1 09:01:46 UTC 2018
Modified Files:
src/usr.sbin/sysinst: disks.c
Log Message:
Simplify and get rid of external "grep" dependency which is not available
on all install meadia.
Sugested by kre.
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/sysinst/disks.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.13 src/usr.sbin/sysinst/disks.c:1.14
--- src/usr.sbin/sysinst/disks.c:1.13 Fri Jan 13 05:49:27 2017
+++ src/usr.sbin/sysinst/disks.c Tue May 1 09:01:45 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: disks.c,v 1.13 2017/01/13 05:49:27 christos Exp $ */
+/* $NetBSD: disks.c,v 1.14 2018/05/01 09:01:45 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -1480,11 +1480,12 @@ incoregpt(pm_devs_t *pm_cur, partinfo *l
static bool
is_gpt(const char *dev)
{
+
check_available_binaries();
if (!have_gpt)
return false;
- return !run_program(RUN_SILENT | RUN_ERROR_OK,
- "sh -c 'gpt show %s |grep -e Pri\\ GPT\\ table'", dev);
+ return run_program(RUN_SILENT | RUN_ERROR_OK,
+ "gpt -qr header %s", dev) == 0;
}