diff --git a/sbin/ccdconfig/Makefile b/sbin/ccdconfig/Makefile index cb2bc74eecb9..6d6e7e096ca0 100644 --- a/sbin/ccdconfig/Makefile +++ b/sbin/ccdconfig/Makefile @@ -4,4 +4,7 @@ PROG= ccdconfig WARNS?= 3 MAN= ccdconfig.8 +DPADD= ${LIBGEOM} +LDADD= -lgeom + .include diff --git a/sbin/ccdconfig/ccdconfig.c b/sbin/ccdconfig/ccdconfig.c index 19f5f1a0fcf6..4c877ff27f29 100644 --- a/sbin/ccdconfig/ccdconfig.c +++ b/sbin/ccdconfig/ccdconfig.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -426,9 +427,27 @@ static int dump_ccd(int argc, char **argv) { char *cp; + char const *errstr; int i, error, numccd, numconfiged = 0; struct ccdconf conf; int ccd; + struct gctl_req *grq; + + grq = gctl_get_handle(); + gctl_ro_param(grq, "verb", -1, "list"); + gctl_ro_param(grq, "class", -1, "CCD"); + cp = malloc(65536); + gctl_rw_param(grq, "output", 65536, cp); + if (verbose) + gctl_ro_param(grq, "verbose", -1, "yes"); + errstr = gctl_issue(grq); + if (errstr == NULL) { + printf("%s", cp); + return (0); + } else { + warnx("%s\nor possibly kernel and ccdconfig out of sync", + errstr); + } /* * Read the ccd configuration data from the kernel and dump