Subject: bin/1753: ccdconfig doesn't recognize the option -M and -N.
To: None <gnats-bugs@gnats.netbsd.org>
From: enami tsugutomo <enami@sys.ptg.sony.co.jp>
List: netbsd-bugs
Date: 11/11/1995 10:16:15
>Number:         1753
>Category:       bin
>Synopsis:       ccdconfig doesn't recognize the option -M and -N.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 12 03:35:01 1995
>Last-Modified:
>Originator:     enami tsugutomo
>Organization:
	
>Release:        NetBSD-current around Nov 1 or 5.
>Environment:
System: NetBSD king-show 1.1_ALPHA NetBSD 1.1_ALPHA (KINGSHOW) #1: Sat Nov 11 09:23:30 JST 1995 enami@king-show:/usr/src/sys/arch/i386/compile/KINGSHOW i386


>Description:
	The command ccdconfig doesn't recognize the option -N (and
	may be -M) even if the manaul mentions about them.  Is this
	intentional?

>How-To-Repeat:
	In the following example, /netbsd doesn't config'ed with ccd
	but /netbsd.new has it, and the system boot with /netbsd.new now.
	/sbin/ccdconfig is original one and ./obj/ccdconfig is modified one.

king-show# ccdconfig -g
ccdconfig: ccd-related symbols not available
ccdconfig: 
king-show# ccdconfig -g -N /netbsd.new
ccdconfig: illegal option -- N
usage: ccdconfig [-cv] ccd ileave [flags] dev [...]
       ccdconfig -C [-v] [-f config_file]
       ccdconfig -u [-v] ccd [...]
       ccdconfig -U [-v] [-f config_file]
       ccdconfig -g [-M core] [-N system] [ccd [...]]
king-show# ./obj/ccdconfig -g -N /netbsd.new
ccd0            32      0       /dev/sd1e /dev/sd1h
king-show#

>Fix:
	Is this correct fix?
===================================================================
RCS file: RCS/ccdconfig.c,v
retrieving revision 1.1
diff -u -r1.1 ccdconfig.c
--- ccdconfig.c	1995/11/11 00:49:27	1.1
+++ ccdconfig.c	1995/11/11 00:50:00
@@ -107,7 +107,7 @@
 {
 	int ch, options = 0, action = CCD_CONFIG;
 
-	while ((ch = getopt(argc, argv, "cCf:guUv")) != -1) {
+	while ((ch = getopt(argc, argv, "cCf:gM:N:uUv")) != -1) {
 		switch (ch) {
 		case 'c':
 			action = CCD_CONFIG;
@@ -132,7 +132,7 @@
 			break;
 
 		case 'N':
-			core = optarg;
+			kernel = optarg;
 			break;
 
 		case 'u':
>Audit-Trail:
>Unformatted: