CVS commit: src/sys/netinet6

2022-06-14 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Jun 15 04:31:22 UTC 2022

Modified Files:
src/sys/netinet6: in6_pcb.h

Log Message:
in6p_hash isn't used, either.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/netinet6/in6_pcb.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet6/in6_pcb.h
diff -u src/sys/netinet6/in6_pcb.h:1.52 src/sys/netinet6/in6_pcb.h:1.53
--- src/sys/netinet6/in6_pcb.h:1.52	Tue Sep  8 14:12:57 2020
+++ src/sys/netinet6/in6_pcb.h	Wed Jun 15 04:31:22 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_pcb.h,v 1.52 2020/09/08 14:12:57 christos Exp $	*/
+/*	$NetBSD: in6_pcb.h,v 1.53 2022/06/15 04:31:22 knakahara Exp $	*/
 /*	$KAME: in6_pcb.h,v 1.45 2001/02/09 05:59:46 itojun Exp $	*/
 
 /*
@@ -79,7 +79,6 @@ struct icmp6_filter;
 
 struct	in6pcb {
 	struct inpcb_hdr in6p_head;
-#define in6p_hash	 in6p_head.inph_hash
 #define in6p_queue	 in6p_head.inph_queue
 #define in6p_af		 in6p_head.inph_af
 #define in6p_ppcb	 in6p_head.inph_ppcb



CVS commit: src/sys/netinet6

2022-06-14 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Jun 15 04:31:22 UTC 2022

Modified Files:
src/sys/netinet6: in6_pcb.h

Log Message:
in6p_hash isn't used, either.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/netinet6/in6_pcb.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/make

2022-06-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Jun 14 19:57:56 UTC 2022

Modified Files:
src/usr.bin/make: var.c

Log Message:
make: document parsing of short variable names, such as $i

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.1024 -r1.1025 src/usr.bin/make/var.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.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.1024 src/usr.bin/make/var.c:1.1025
--- src/usr.bin/make/var.c:1.1024	Tue Jun 14 19:43:02 2022
+++ src/usr.bin/make/var.c	Tue Jun 14 19:57:56 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.1024 2022/06/14 19:43:02 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.1025 2022/06/14 19:57:56 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -139,7 +139,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.1024 2022/06/14 19:43:02 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.1025 2022/06/14 19:57:56 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -4175,7 +4175,7 @@ ParseVarnameShort(char varname, const ch
 	const char *val;
 
 	if (!IsShortVarnameValid(varname, *pp)) {
-		(*pp)++;
+		(*pp)++;	/* only skip the '$' */
 		*out_false_res = VPR_ERR;
 		*out_false_val = var_Error;
 		return false;
@@ -4185,7 +4185,7 @@ ParseVarnameShort(char varname, const ch
 	name[1] = '\0';
 	v = VarFind(name, scope, true);
 	if (v != NULL) {
-		/* XXX: *pp should be incremented in this case as well. */
+		/* No need to advance *pp, the calling code handles this. */
 		*out_true_var = v;
 		return true;
 	}
@@ -4214,8 +4214,7 @@ ParseVarnameShort(char varname, const ch
 	 * If undefined expressions are allowed, this should rather
 	 * be VPR_UNDEF instead of VPR_OK.
 	 */
-	*out_false_res = emode == VARE_UNDEFERR
-	? VPR_UNDEF : VPR_OK;
+	*out_false_res = emode == VARE_UNDEFERR ? VPR_UNDEF : VPR_OK;
 	*out_false_val = val;
 	return false;
 }



CVS commit: src/usr.bin/make

2022-06-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Jun 14 19:57:56 UTC 2022

Modified Files:
src/usr.bin/make: var.c

Log Message:
make: document parsing of short variable names, such as $i

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.1024 -r1.1025 src/usr.bin/make/var.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/make

2022-06-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Jun 14 19:43:02 UTC 2022

Modified Files:
src/usr.bin/make: var.c

Log Message:
make: reduce indentation in ParseVarnameShort

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.1023 -r1.1024 src/usr.bin/make/var.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.bin/make

2022-06-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Jun 14 19:43:02 UTC 2022

Modified Files:
src/usr.bin/make: var.c

Log Message:
make: reduce indentation in ParseVarnameShort

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.1023 -r1.1024 src/usr.bin/make/var.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.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.1023 src/usr.bin/make/var.c:1.1024
--- src/usr.bin/make/var.c:1.1023	Tue Jun 14 19:37:11 2022
+++ src/usr.bin/make/var.c	Tue Jun 14 19:43:02 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.1023 2022/06/14 19:37:11 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.1024 2022/06/14 19:43:02 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -139,7 +139,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.1023 2022/06/14 19:37:11 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.1024 2022/06/14 19:43:02 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -4172,6 +4172,7 @@ ParseVarnameShort(char varname, const ch
 {
 	char name[2];
 	Var *v;
+	const char *val;
 
 	if (!IsShortVarnameValid(varname, *pp)) {
 		(*pp)++;
@@ -4183,41 +4184,40 @@ ParseVarnameShort(char varname, const ch
 	name[0] = varname;
 	name[1] = '\0';
 	v = VarFind(name, scope, true);
-	if (v == NULL) {
-		const char *val;
-		*pp += 2;
+	if (v != NULL) {
+		/* XXX: *pp should be incremented in this case as well. */
+		*out_true_var = v;
+		return true;
+	}
 
-		val = UndefinedShortVarValue(varname, scope);
-		if (val == NULL)
-			val = emode == VARE_UNDEFERR
-			? var_Error : varUndefined;
+	*pp += 2;
 
-		if (opts.strict && val == var_Error) {
-			Parse_Error(PARSE_FATAL,
-			"Variable \"%s\" is undefined", name);
-			*out_false_res = VPR_ERR;
-			*out_false_val = val;
-			return false;
-		}
+	val = UndefinedShortVarValue(varname, scope);
+	if (val == NULL)
+		val = emode == VARE_UNDEFERR ? var_Error : varUndefined;
 
-		/*
-		 * XXX: This looks completely wrong.
-		 *
-		 * If undefined expressions are not allowed, this should
-		 * rather be VPR_ERR instead of VPR_UNDEF, together with an
-		 * error message.
-		 *
-		 * If undefined expressions are allowed, this should rather
-		 * be VPR_UNDEF instead of VPR_OK.
-		 */
-		*out_false_res = emode == VARE_UNDEFERR
-		? VPR_UNDEF : VPR_OK;
+	if (opts.strict && val == var_Error) {
+		Parse_Error(PARSE_FATAL,
+		"Variable \"%s\" is undefined", name);
+		*out_false_res = VPR_ERR;
 		*out_false_val = val;
 		return false;
 	}
 
-	*out_true_var = v;
-	return true;
+	/*
+	 * XXX: This looks completely wrong.
+	 *
+	 * If undefined expressions are not allowed, this should
+	 * rather be VPR_ERR instead of VPR_UNDEF, together with an
+	 * error message.
+	 *
+	 * If undefined expressions are allowed, this should rather
+	 * be VPR_UNDEF instead of VPR_OK.
+	 */
+	*out_false_res = emode == VARE_UNDEFERR
+	? VPR_UNDEF : VPR_OK;
+	*out_false_val = val;
+	return false;
 }
 
 /* Find variables like @F or 

CVS commit: src/usr.bin/make

2022-06-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Jun 14 19:37:11 UTC 2022

Modified Files:
src/usr.bin/make: var.c

Log Message:
make: simplify return type of IsShortVarnameValid

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.1022 -r1.1023 src/usr.bin/make/var.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.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.1022 src/usr.bin/make/var.c:1.1023
--- src/usr.bin/make/var.c:1.1022	Sun Jun 12 13:37:32 2022
+++ src/usr.bin/make/var.c	Tue Jun 14 19:37:11 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.1022 2022/06/12 13:37:32 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.1023 2022/06/14 19:37:11 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -139,7 +139,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.1022 2022/06/12 13:37:32 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.1023 2022/06/14 19:37:11 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -4138,15 +4138,15 @@ ParseVarname(const char **pp, char start
 	*pp = p;
 }
 
-static VarParseResult
-ValidShortVarname(char varname, const char *start)
+static bool
+IsShortVarnameValid(char varname, const char *start)
 {
 	if (varname != '$' && varname != ':' && varname != '}' &&
 	varname != ')' && varname != '\0')
-		return VPR_OK;
+		return true;
 
 	if (!opts.strict)
-		return VPR_ERR;	/* XXX: Missing error message */
+		return false;	/* XXX: Missing error message */
 
 	if (varname == '$')
 		Parse_Error(PARSE_FATAL,
@@ -4157,7 +4157,7 @@ ValidShortVarname(char varname, const ch
 		Parse_Error(PARSE_FATAL,
 		"Invalid variable name '%c', at \"%s\"", varname, start);
 
-	return VPR_ERR;
+	return false;
 }
 
 /*
@@ -4172,12 +4172,10 @@ ParseVarnameShort(char varname, const ch
 {
 	char name[2];
 	Var *v;
-	VarParseResult vpr;
 
-	vpr = ValidShortVarname(varname, *pp);
-	if (vpr != VPR_OK) {
+	if (!IsShortVarnameValid(varname, *pp)) {
 		(*pp)++;
-		*out_false_res = vpr;
+		*out_false_res = VPR_ERR;
 		*out_false_val = var_Error;
 		return false;
 	}



CVS commit: src/usr.bin/make

2022-06-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Jun 14 19:37:11 UTC 2022

Modified Files:
src/usr.bin/make: var.c

Log Message:
make: simplify return type of IsShortVarnameValid

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.1022 -r1.1023 src/usr.bin/make/var.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/doc

2022-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun 14 10:42:20 UTC 2022

Modified Files:
src/doc [netbsd-9]: CHANGES-9.3

Log Message:
Tickets #1470 - #1472


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.105 -r1.1.2.106 src/doc/CHANGES-9.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-9.3
diff -u src/doc/CHANGES-9.3:1.1.2.105 src/doc/CHANGES-9.3:1.1.2.106
--- src/doc/CHANGES-9.3:1.1.2.105	Fri Jun 10 17:40:40 2022
+++ src/doc/CHANGES-9.3	Tue Jun 14 10:42:20 2022
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.3,v 1.1.2.105 2022/06/10 17:40:40 martin Exp $
+# $NetBSD: CHANGES-9.3,v 1.1.2.106 2022/06/14 10:42:20 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -1802,3 +1802,29 @@ libexec/ld.elf_so/arch/hppa/rtld_start.S
 	others get the right value if they're called before _start.
 	[skrll, ticket #1469]
 
+distrib/notes/alpha/hardware			1.20
+distrib/notes/common/postinstall		1.90 (patch)
+distrib/notes/mvme68k/install			1.24
+distrib/notes/sun3/install			1.17
+
+	Fix the title of the boot tape creation section.
+	Fix some links to HP alpha firmware.
+	Fix link to pkgsrc.tar.gz file.
+	[andvar, ticket #1470]
+
+distrib/notes/common/main			1.569 (patch)
+distrib/notes/sparc/contents			1.27,1.28 (patch)
+distrib/notes/sparc/install			1.59-1.61 (patch)
+
+	Remove floppy installation instructions from sparc documentation.
+	Nroff and typo fixes.
+	[andvar, ticket #1471]
+
+sys/lib/libkern/arch/hppa/Makefile.inc		1.13
+sys/lib/libkern/arch/hppa/milli.S		1.3
+sys/lib/libkern/arch/hppa/milli_extra.S		1.1
+
+	PR 56878: don't need $$sh_func_adrs.
+	Provide a (trivial) __canonicalize_funcptr_for_compare.
+	[skrll, ticket #1472]
+



CVS commit: [netbsd-9] src/doc

2022-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun 14 10:42:20 UTC 2022

Modified Files:
src/doc [netbsd-9]: CHANGES-9.3

Log Message:
Tickets #1470 - #1472


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.105 -r1.1.2.106 src/doc/CHANGES-9.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/lib/libkern/arch/hppa

2022-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun 14 10:41:19 UTC 2022

Modified Files:
src/sys/lib/libkern/arch/hppa [netbsd-9]: Makefile.inc milli.S
Added Files:
src/sys/lib/libkern/arch/hppa [netbsd-9]: milli_extra.S

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1472):

sys/lib/libkern/arch/hppa/Makefile.inc: revision 1.13
sys/lib/libkern/arch/hppa/milli.S: revision 1.3
sys/lib/libkern/arch/hppa/milli_extra.S: revision 1.1

Don't need $$sh_func_adrs

Provide a __canonicalize_funcptr_for_compare which only needs to return
the passed value as the kernel doesn't do PLABELS.
PR/56878 (hppa: kernel module lua fails to load)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.34.1 src/sys/lib/libkern/arch/hppa/Makefile.inc
cvs rdiff -u -r1.1 -r1.1.204.1 src/sys/lib/libkern/arch/hppa/milli.S
cvs rdiff -u -r0 -r1.1.2.2 src/sys/lib/libkern/arch/hppa/milli_extra.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/sys/lib/libkern/arch/hppa

2022-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun 14 10:41:19 UTC 2022

Modified Files:
src/sys/lib/libkern/arch/hppa [netbsd-9]: Makefile.inc milli.S
Added Files:
src/sys/lib/libkern/arch/hppa [netbsd-9]: milli_extra.S

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1472):

sys/lib/libkern/arch/hppa/Makefile.inc: revision 1.13
sys/lib/libkern/arch/hppa/milli.S: revision 1.3
sys/lib/libkern/arch/hppa/milli_extra.S: revision 1.1

Don't need $$sh_func_adrs

Provide a __canonicalize_funcptr_for_compare which only needs to return
the passed value as the kernel doesn't do PLABELS.
PR/56878 (hppa: kernel module lua fails to load)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.34.1 src/sys/lib/libkern/arch/hppa/Makefile.inc
cvs rdiff -u -r1.1 -r1.1.204.1 src/sys/lib/libkern/arch/hppa/milli.S
cvs rdiff -u -r0 -r1.1.2.2 src/sys/lib/libkern/arch/hppa/milli_extra.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/lib/libkern/arch/hppa/Makefile.inc
diff -u src/sys/lib/libkern/arch/hppa/Makefile.inc:1.12 src/sys/lib/libkern/arch/hppa/Makefile.inc:1.12.34.1
--- src/sys/lib/libkern/arch/hppa/Makefile.inc:1.12	Thu Mar 13 16:09:11 2014
+++ src/sys/lib/libkern/arch/hppa/Makefile.inc	Tue Jun 14 10:41:18 2022
@@ -1,7 +1,8 @@
-#	$NetBSD: Makefile.inc,v 1.12 2014/03/13 16:09:11 pooka Exp $
+#	$NetBSD: Makefile.inc,v 1.12.34.1 2022/06/14 10:41:18 martin Exp $
 
 SRCS+=	milli.S
 SRCS+=	bcopy.S memcpy.S memmove.S
+SRCS+=	milli_extra.S
 
 # XXX: spcopy does not really belong in libkern in the first place
 .ifndef RUMPKERNEL

Index: src/sys/lib/libkern/arch/hppa/milli.S
diff -u src/sys/lib/libkern/arch/hppa/milli.S:1.1 src/sys/lib/libkern/arch/hppa/milli.S:1.1.204.1
--- src/sys/lib/libkern/arch/hppa/milli.S:1.1	Thu Jun  6 20:03:39 2002
+++ src/sys/lib/libkern/arch/hppa/milli.S	Tue Jun 14 10:41:18 2022
@@ -1,4 +1,4 @@
-;	$NetBSD: milli.S,v 1.1 2002/06/06 20:03:39 fredette Exp $
+;	$NetBSD: milli.S,v 1.1.204.1 2022/06/14 10:41:18 martin Exp $
 ;
 ;	$OpenBSD: milli.S,v 1.5 2001/03/29 04:08:20 mickey Exp $
 ;
@@ -443,7 +443,6 @@ noshlibs:
 	be	0(sr0,r22)
 	stw	rp,-24(sp)
 	.procend
-#endif
 
 $$sh_func_adrs:
 	.proc
@@ -456,6 +455,7 @@ $$sh_func_adrs:
 	bv	r0(r31)
 	ldws	0(r26),ret1
 	.procend
+#endif
 
 temp: .EQU	r1
 

Added files:

Index: src/sys/lib/libkern/arch/hppa/milli_extra.S
diff -u /dev/null src/sys/lib/libkern/arch/hppa/milli_extra.S:1.1.2.2
--- /dev/null	Tue Jun 14 10:41:19 2022
+++ src/sys/lib/libkern/arch/hppa/milli_extra.S	Tue Jun 14 10:41:18 2022
@@ -0,0 +1,42 @@
+/*-
+ * Copyright (c) 2022 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nick Hudson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "machine/asm.h"
+
+
+#define	MILLI_ENTRY(x)	!\
+	.text ! .align 4!\
+	.export x, millicode ! .label x ! .proc		!\
+	.callinfo no_calls!\
+	.entry
+
+MILLI_ENTRY(__canonicalize_funcptr_for_compare)
+	bv	%r0(%sp)
+	 copy	%arg0, %ret0
+EXIT(__canonicalize_funcptr_for_compare)



CVS commit: [netbsd-9] src/distrib/notes

2022-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun 14 10:37:05 UTC 2022

Modified Files:
src/distrib/notes/common [netbsd-9]: main
src/distrib/notes/sparc [netbsd-9]: contents install

Log Message:
Pull up following revision(s) (requested by andvar in ticket #1471):

distrib/notes/common/main: revision 1.569 (via patch)
distrib/notes/sparc/install: revision 1.59-1.61 (via patch)
distrib/notes/sparc/contents: revision 1.27,1.28 (via patch)

Remove floppy installation instructions from sparc documentation.

Floppy generation was disabled before NetBSD 6.0 release due to size
constraints and unlikely to be restored soon or at all. PR port-sparc/56776.
ok martin.

Typo and nroff fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.551.2.11 -r1.551.2.12 src/distrib/notes/common/main
cvs rdiff -u -r1.23.4.3 -r1.23.4.4 src/distrib/notes/sparc/contents
cvs rdiff -u -r1.58.18.1 -r1.58.18.2 src/distrib/notes/sparc/install

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/notes/common/main
diff -u src/distrib/notes/common/main:1.551.2.11 src/distrib/notes/common/main:1.551.2.12
--- src/distrib/notes/common/main:1.551.2.11	Thu Nov 25 17:49:22 2021
+++ src/distrib/notes/common/main	Tue Jun 14 10:37:05 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: main,v 1.551.2.11 2021/11/25 17:49:22 martin Exp $
+.\"	$NetBSD: main,v 1.551.2.12 2022/06/14 10:37:05 martin Exp $
 .\"
 .\" Copyright (c) 1999-2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -206,10 +206,8 @@ If you have a CD-R, you can fetch the CD
 .\}
 .if \n[sparc] \{\
 Fetch a CD image,
-.Pa NetBSD-\*V-sparc.iso
-or the floppy disk images,
-.Pa sparc/install/floppy/disk1.gz No and Pa sparc/install/floppy/disk2 .
-You need either the pair of floppies or the CD to boot your system.
+.Pa NetBSD-\*V-sparc.iso .
+You need the CD to boot your system.
 .\}
 .if \n[sparc64] \{\
 This is either a CD image
@@ -234,7 +232,7 @@ When you boot the install
 .if \n[amd64] image or CD-ROM,
 .if \n[i386] image, CD-ROM or floppies,
 .if \n[macppc] kernel from floppies, hard drive, or CD-ROM,
-.if \n[sparc] floppies or CD-ROM,
+.if \n[sparc] CD-ROM,
 .if \n[sparc64] CD-ROM or installation kernel,
 the installation program
 can fetch these files for you (using, e.g., ftp)
@@ -314,8 +312,6 @@ If you are using the CD image, burn it n
 .It
 Make sure your sparc's CD-ROM drive is bootable.
 Burn the CD.
-Otherwise, write the floppy images directly to a pair of floppies
-(after uncompressing disk1.gz).
 .\}
 .if \n[sparc64] \{\
 .It
@@ -446,13 +442,6 @@ your model):
 .Dq Ic boot sd(,30,) ,
 or
 .Dq Ic boot cdrom .
-.Pp
-The command to boot from floppy is either
-.Dq Ic boot fd(,,1)
-or
-.Dq Ic boot floppy .
-The installer will prompt you to insert the second floppy when it is ready
-for it.
 .\}
 .if \n[sparc64] \{\
 The command to boot from CD is:

Index: src/distrib/notes/sparc/contents
diff -u src/distrib/notes/sparc/contents:1.23.4.3 src/distrib/notes/sparc/contents:1.23.4.4
--- src/distrib/notes/sparc/contents:1.23.4.3	Sun Dec  8 12:50:44 2019
+++ src/distrib/notes/sparc/contents	Tue Jun 14 10:37:05 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: contents,v 1.23.4.3 2019/12/08 12:50:44 martin Exp $
+.\"	$NetBSD: contents,v 1.23.4.4 2022/06/14 10:37:05 martin Exp $
 .\"
 .\" Copyright (c) 1999-2005 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -109,10 +109,6 @@ see below.
 .
 Netbootable RAM disk kernel and the file system in the RAM disk; see below.
 .
-.		It Pa floppy/
-.
-\*M boot and installation floppies; see below.
-.
 .		It Pa miniroot/
 .
 \*M miniroot file system image; see below.
@@ -184,7 +180,7 @@ system call and library manual pages.
 This distribution set contains debug information for
 all base system utilities.
 It is useful when reporting issues with binaries or during
-developement.
+development.
 This set is huge, if the target disk is small, do not install it.
 .
 .It Sy etc
@@ -317,7 +313,7 @@ The extra libraries and include files ne
 This distribution set contains debug information for
 all X11 binaries.
 It is useful when reporting issues with these binaries or during
-developement.
+development.
 This set is huge, if the target disk is small, do not install it.
 .
 .It Sy xfont

Index: src/distrib/notes/sparc/install
diff -u src/distrib/notes/sparc/install:1.58.18.1 src/distrib/notes/sparc/install:1.58.18.2
--- src/distrib/notes/sparc/install:1.58.18.1	Thu Nov 21 19:28:42 2019
+++ src/distrib/notes/sparc/install	Tue Jun 14 10:37:05 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: install,v 1.58.18.1 2019/11/21 19:28:42 martin Exp $
+.\"	$NetBSD: install,v 1.58.18.2 2022/06/14 10:37:05 martin Exp $
 .\"
 .\" Copyright (c) 1999-2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -39,8 +39,6 @@ image copied to your local disk's swap p
 If your Sparc is hooked up in a network, you may configure another
 .Ul
 machin

CVS commit: [netbsd-9] src/distrib/notes

2022-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun 14 10:37:05 UTC 2022

Modified Files:
src/distrib/notes/common [netbsd-9]: main
src/distrib/notes/sparc [netbsd-9]: contents install

Log Message:
Pull up following revision(s) (requested by andvar in ticket #1471):

distrib/notes/common/main: revision 1.569 (via patch)
distrib/notes/sparc/install: revision 1.59-1.61 (via patch)
distrib/notes/sparc/contents: revision 1.27,1.28 (via patch)

Remove floppy installation instructions from sparc documentation.

Floppy generation was disabled before NetBSD 6.0 release due to size
constraints and unlikely to be restored soon or at all. PR port-sparc/56776.
ok martin.

Typo and nroff fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.551.2.11 -r1.551.2.12 src/distrib/notes/common/main
cvs rdiff -u -r1.23.4.3 -r1.23.4.4 src/distrib/notes/sparc/contents
cvs rdiff -u -r1.58.18.1 -r1.58.18.2 src/distrib/notes/sparc/install

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-9] src/distrib/notes

2022-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun 14 10:27:33 UTC 2022

Modified Files:
src/distrib/notes/alpha [netbsd-9]: hardware
src/distrib/notes/common [netbsd-9]: postinstall
src/distrib/notes/mvme68k [netbsd-9]: install
src/distrib/notes/sun3 [netbsd-9]: install

Log Message:
Pull up following revision(s) (requested by andvar in ticket #1470):

distrib/notes/sun3/install: revision 1.17
distrib/notes/alpha/hardware: revision 1.20
distrib/notes/mvme68k/install: revision 1.24
distrib/notes/common/postinstall: revision 1.90 (via patch)

fix the title of the boot tape creation section.

some srm firmware (including legacy platforms) still available at hp ftp.
not sure if HPE selling firmware CDs, but it is definitely not Compaq anymore

fix link to pkgsrc.tar.gz file in postinstall section.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.19.8.1 src/distrib/notes/alpha/hardware
cvs rdiff -u -r1.83.2.3 -r1.83.2.4 src/distrib/notes/common/postinstall
cvs rdiff -u -r1.23 -r1.23.48.1 src/distrib/notes/mvme68k/install
cvs rdiff -u -r1.16 -r1.16.64.1 src/distrib/notes/sun3/install

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/notes/alpha/hardware
diff -u src/distrib/notes/alpha/hardware:1.19 src/distrib/notes/alpha/hardware:1.19.8.1
--- src/distrib/notes/alpha/hardware:1.19	Thu Jun 22 16:46:52 2017
+++ src/distrib/notes/alpha/hardware	Tue Jun 14 10:27:32 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: hardware,v 1.19 2017/06/22 16:46:52 flxd Exp $
+.\"	$NetBSD: hardware,v 1.19.8.1 2022/06/14 10:27:32 martin Exp $
 .
 .Nx*M
 \*V runs on most of the
@@ -23,8 +23,8 @@ only one type of console loaded at any o
 If your system comes up with the ARC firmware, it may be possible
 to switch it to SRM with a menu or
 to download SRM from
-.Lk ftp://gatekeeper.dec.com/pub/Digital/Alpha/firmware/index.html
-You may want to buy a firmware update CD from Compaq Computer Corporation.
+.Lk ftp://ftp.hp.com/pub/alphaserver/firmware
+You may want to buy a firmware update CD from Hewlett Packard Enterprise.
 .Pp
 More information on supported platforms and devices can be found on the
 \*M port web pages at

Index: src/distrib/notes/common/postinstall
diff -u src/distrib/notes/common/postinstall:1.83.2.3 src/distrib/notes/common/postinstall:1.83.2.4
--- src/distrib/notes/common/postinstall:1.83.2.3	Wed Nov 27 13:36:55 2019
+++ src/distrib/notes/common/postinstall	Tue Jun 14 10:27:32 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: postinstall,v 1.83.2.3 2019/11/27 13:36:55 msaitoh Exp $
+.\"	$NetBSD: postinstall,v 1.83.2.4 2022/06/14 10:27:32 martin Exp $
 .\"
 .\" Copyright (c) 1999-2004 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -369,7 +369,7 @@ post-installation configuration menu, th
 .Xr pkgsrc 7
 framework for compiling packages can be obtained by
 retrieving the file
-.Lk https://cdn.NetBSD.org/pub/pkgsrc/pkgsrc.tar.gz .
+.Lk https://cdn.NetBSD.org/pub/pkgsrc/stable/pkgsrc.tar.gz .
 It is typically extracted into
 .Pa /usr/pkgsrc
 (though other locations work fine) with the commands:

Index: src/distrib/notes/mvme68k/install
diff -u src/distrib/notes/mvme68k/install:1.23 src/distrib/notes/mvme68k/install:1.23.48.1
--- src/distrib/notes/mvme68k/install:1.23	Mon May 30 06:19:53 2011
+++ src/distrib/notes/mvme68k/install	Tue Jun 14 10:27:32 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: install,v 1.23 2011/05/30 06:19:53 wiz Exp $
+.\"	$NetBSD: install,v 1.23.48.1 2022/06/14 10:27:32 martin Exp $
 .\"
 .\" Copyright (c) 1999-2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -53,7 +53,7 @@ Create the
 .Nx*M
 \*V boot tape as described in the section
 entitled
-.Sx "Preparing a boot tape" .
+.Sx "Creating boot/install tapes" .
 Then, with the tape in the drive, type the following at the Bug prompt:
 .Pp
 .Dl 147-Bug\*[Gt] Ic "bo 5"
@@ -89,7 +89,7 @@ Loading: Operating System
 Volume: NBSD
 
 IPL loaded at:  $003F
-\*[Gt]\*[Gt] BSD MVME147 tapeboot [$Revision: 1.23 $]
+\*[Gt]\*[Gt] BSD MVME147 tapeboot [$Revision: 1.23.48.1 $]
 578616+422344+55540+[46032+51284]=0x11a6e4
 Start @ 0x8000 ...
 Copyright (c) 1996, 1997, 1998, 1999, 2000
@@ -435,7 +435,7 @@ For all board types, the boot messages a
 .Pp
 .(disp
 Start @ 0x8000 ...
-\*[Gt]\*[Gt] BSD MVME147 netboot (via sboot) [$Revision: 1.23 $]
+\*[Gt]\*[Gt] BSD MVME147 netboot (via sboot) [$Revision: 1.23.48.1 $]
 device: le0 attached to 08:00:3e:20:cb:87
 boot: client IP address: 192.168.1.4
 boot: client name: soapy

Index: src/distrib/notes/sun3/install
diff -u src/distrib/notes/sun3/install:1.16 src/distrib/notes/sun3/install:1.16.64.1
--- src/distrib/notes/sun3/install:1.16	Sat Sep  6 22:31:53 2008
+++ src/distrib/notes/sun3/install	Tue Jun 14 10:27:32 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: install,v 1.16 2008/09/06 22:31:53 tsutsui Exp $
+.\"	$NetBSD: install,v 1.16.64.1 2022/06/14 10:27:32 marti

CVS commit: [netbsd-9] src/distrib/notes

2022-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun 14 10:27:33 UTC 2022

Modified Files:
src/distrib/notes/alpha [netbsd-9]: hardware
src/distrib/notes/common [netbsd-9]: postinstall
src/distrib/notes/mvme68k [netbsd-9]: install
src/distrib/notes/sun3 [netbsd-9]: install

Log Message:
Pull up following revision(s) (requested by andvar in ticket #1470):

distrib/notes/sun3/install: revision 1.17
distrib/notes/alpha/hardware: revision 1.20
distrib/notes/mvme68k/install: revision 1.24
distrib/notes/common/postinstall: revision 1.90 (via patch)

fix the title of the boot tape creation section.

some srm firmware (including legacy platforms) still available at hp ftp.
not sure if HPE selling firmware CDs, but it is definitely not Compaq anymore

fix link to pkgsrc.tar.gz file in postinstall section.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.19.8.1 src/distrib/notes/alpha/hardware
cvs rdiff -u -r1.83.2.3 -r1.83.2.4 src/distrib/notes/common/postinstall
cvs rdiff -u -r1.23 -r1.23.48.1 src/distrib/notes/mvme68k/install
cvs rdiff -u -r1.16 -r1.16.64.1 src/distrib/notes/sun3/install

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/raidctl

2022-06-14 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun 14 08:06:18 UTC 2022

Modified Files:
src/sbin/raidctl: raidctl.8 raidctl.c

Log Message:
Implement "raidctl -t config-file"

This does the same config file parse  that -c/-C do, but only
that (hence no raidframe device is needed, or accepted).

Any syntax errors in the config file will be reported, nothing
else happens.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sbin/raidctl/raidctl.8
cvs rdiff -u -r1.77 -r1.78 src/sbin/raidctl/raidctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/raidctl/raidctl.8
diff -u src/sbin/raidctl/raidctl.8:1.78 src/sbin/raidctl/raidctl.8:1.79
--- src/sbin/raidctl/raidctl.8:1.78	Mon Aug  2 20:31:15 2021
+++ src/sbin/raidctl/raidctl.8	Tue Jun 14 08:06:18 2022
@@ -1,4 +1,4 @@
-.\" $NetBSD: raidctl.8,v 1.78 2021/08/02 20:31:15 oster Exp $
+.\" $NetBSD: raidctl.8,v 1.79 2022/06/14 08:06:18 kre Exp $
 .\"
 .\" Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -53,7 +53,7 @@
 .\" any improvements or extensions that they make and grant Carnegie the
 .\" rights to redistribute these changes.
 .\"
-.Dd August 2, 2021
+.Dd June 13, 2022
 .Dt RAIDCTL 8
 .Os
 .Sh NAME
@@ -127,6 +127,9 @@
 .Fl s Ar dev
 .Nm
 .Op Fl v
+.Fl t Ar config_file
+.Nm
+.Op Fl v
 .Fl U Ar unit Ar dev
 .Nm
 .Op Fl v
@@ -330,6 +333,11 @@ achieved in each of these areas.
 .It Fl s Ar dev
 Display the status of the RAIDframe device for each of the components
 and spares.
+.It Fl t Ar config_file
+Read and parse the
+.Ar config_file ,
+reporting any errors, then exit.
+No raidframe operations are performed.
 .It Fl U Ar unit Ar dev
 Set the
 .Dv last_unit

Index: src/sbin/raidctl/raidctl.c
diff -u src/sbin/raidctl/raidctl.c:1.77 src/sbin/raidctl/raidctl.c:1.78
--- src/sbin/raidctl/raidctl.c:1.77	Tue Jun 14 08:06:07 2022
+++ src/sbin/raidctl/raidctl.c	Tue Jun 14 08:06:18 2022
@@ -1,4 +1,4 @@
-/*  $NetBSD: raidctl.c,v 1.77 2022/06/14 08:06:07 kre Exp $   */
+/*  $NetBSD: raidctl.c,v 1.78 2022/06/14 08:06:18 kre Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: raidctl.c,v 1.77 2022/06/14 08:06:07 kre Exp $");
+__RCSID("$NetBSD: raidctl.c,v 1.78 2022/06/14 08:06:18 kre Exp $");
 #endif
 
 
@@ -64,6 +64,8 @@ __RCSID("$NetBSD: raidctl.c,v 1.77 2022/
 #include "rf_configure.h"
 #include "prog_ops.h"
 
+#define	CONFIGURE_TEST	1	/* must be different from any raidframe ioctl */
+
 void	do_ioctl(int, u_long, void *, const char *);
 static  void rf_configure(int, char*, int);
 static  const char *device_status(RF_DiskStatus_t);
@@ -133,9 +135,9 @@ main(int argc,char *argv[])
 	last_unit = 0;
 	openmode = O_RDWR;	/* default to read/write */
 
-	while ((ch = getopt(argc, argv, "a:A:Bc:C:f:F:g:GiI:l:LmM:r:R:sSpPuU:v"))
-	   != -1)
-		switch(ch) {
+	while ((ch = getopt(argc, argv,
+	"a:A:Bc:C:f:F:g:GiI:l:LmM:r:R:sSpPt:uU:v")) != -1)
+		switch (ch) {
 		case 'a':
 			action = RAIDFRAME_ADD_HOT_SPARE;
 			get_comp(component, optarg, sizeof(component));
@@ -253,6 +255,12 @@ main(int argc,char *argv[])
 			openmode = O_RDONLY;
 			num_options++;
 			break;
+		case 't':
+			action = CONFIGURE_TEST;
+			strlcpy(config_filename, optarg,
+			sizeof(config_filename));
+			num_options++;
+			break;
 		case 'u':
 			action = RAIDFRAME_SHUTDOWN;
 			num_options++;
@@ -276,7 +284,20 @@ main(int argc,char *argv[])
 	argc -= optind;
 	argv += optind;
 
-	if ((num_options > 1) || (argc == 0)) 
+	if (num_options > 1)
+		usage();
+
+	if (action == CONFIGURE_TEST) {
+		RF_Config_t cfg;
+
+		if (argc != 0)
+			usage();
+		if (rf_MakeConfig(config_filename, &cfg) != 0)
+			exit(1);
+		exit(0);;
+	}
+
+	if (argc != 1)
 		usage();
 
 	if (prog_init && prog_init() == -1)
@@ -1216,6 +1237,7 @@ usage(void)
 	fprintf(stderr, "   %s [-v] -r component dev\n", progname); 
 	fprintf(stderr, "   %s [-v] -S dev\n", progname);
 	fprintf(stderr, "   %s [-v] -s dev\n", progname);
+	fprintf(stderr, "   %s [-v] -t config_file\n", progname);
 	fprintf(stderr, "   %s [-v] -U unit dev\n", progname);
 	fprintf(stderr, "   %s [-v] -u dev\n", progname);
 	exit(1);



CVS commit: src/sbin/raidctl

2022-06-14 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun 14 08:06:18 UTC 2022

Modified Files:
src/sbin/raidctl: raidctl.8 raidctl.c

Log Message:
Implement "raidctl -t config-file"

This does the same config file parse  that -c/-C do, but only
that (hence no raidframe device is needed, or accepted).

Any syntax errors in the config file will be reported, nothing
else happens.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sbin/raidctl/raidctl.8
cvs rdiff -u -r1.77 -r1.78 src/sbin/raidctl/raidctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/raidctl

2022-06-14 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun 14 08:06:13 UTC 2022

Modified Files:
src/sbin/raidctl: rf_configure.c

Log Message:
Fix some config file parsing.

First, and what got me started on this set of cleanups, the queue
length in the "queue" section (START queue) is limited to what will
fit in a char without losing accuracy (I tried setting it to 200,
rather than the more common (universal?) 100 and found that the
value configured into the array was -56 instead.

Why the value needs to be passed through a char variable I have no
idea (it is an int in the filesystem raidframe headers) - but that's
the way it is done, and changing it would be an ABI change I believe
(and so need versioning to alter) and that isn't worth it for this
(or not now, IMO).

Instead check that the value in the char is the same value as was
read from the config file, and complain if not.   Those of you with
unsigned chars will be able to have queue lengths up to 255, the
rest of us are limited to 127.

While looking at that, I noticed some code that obviously fails to
understand that scanf("%s") will never return a string containing
spaces, and proceeded to attempt to remove trailing spaces from the
result ... amusingly, after having used the result for its intended
purpose (non existent trailing spaces unremoved), after which that
buffer was never used again.   That code is now gone (but for now,
just #if 0'd rather than actually deleted - it should be cleaned up
sometime).

Then I saw some other issues with how the config was parsed - a
simple (unbounded) scanf("%s") into a buffer, which hypothetically
might not be large enough (not a security issue really, raidctl has
no special privs, and it isn't likely that root could easily be
tricked into running it on a bogus config file - or not without
looking first anyway, and a huge long string would rather stand
out).   Bound the string length to something reasonable, and
assert() that the buffer is big enough to contain it.

Lastly, in the event of one particular detected error in the
config file, the code would write a warning, but then just go
ahead and use the bad data (or nothing perhaps) anyway - a
failure of logic flow (unlikely to have ever happened, everyone
seems to simply copy the sample config from the man page, and
make minor adjustments as needed).

If any of these changes make any difference to anyone (except
me with my attempt to make longer queues - for no particularly
well thought out reason), I'd be very surprised.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sbin/raidctl/rf_configure.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/raidctl/rf_configure.c
diff -u src/sbin/raidctl/rf_configure.c:1.35 src/sbin/raidctl/rf_configure.c:1.36
--- src/sbin/raidctl/rf_configure.c:1.35	Tue Jun 14 08:06:07 2022
+++ src/sbin/raidctl/rf_configure.c	Tue Jun 14 08:06:13 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_configure.c,v 1.35 2022/06/14 08:06:07 kre Exp $ */
+/*	$NetBSD: rf_configure.c,v 1.36 2022/06/14 08:06:13 kre Exp $ */
 
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
@@ -49,7 +49,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: rf_configure.c,v 1.35 2022/06/14 08:06:07 kre Exp $");
+__RCSID("$NetBSD: rf_configure.c,v 1.36 2022/06/14 08:06:13 kre Exp $");
 #endif
 
 
@@ -59,6 +59,7 @@ __RCSID("$NetBSD: rf_configure.c,v 1.35 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -212,29 +213,45 @@ rf_MakeConfig(char *configname, RF_Confi
 		warnx("[No disk queue discipline specified in config file %s. "
 		"Using %s.]", configname, cfgPtr->diskQueueType);
 	}
+else {
 
 	/*
 	 * the queue specifier line contains two entries: 1st char of first
 	 * word specifies queue to be used 2nd word specifies max num reqs
 	 * that can be outstanding on the disk itself (typically 1)
 	 */
-	if (sscanf(buf, "%s %d", buf1, &val) != 2) {
+	assert(64 < sizeof buf1);
+	if (sscanf(buf, "%64s %d", buf1, &val) != 2 || strlen(buf1) >= 60) {
 		warnx("Can't determine queue type and/or max outstanding "
-		"reqs from line: %*s", (int)(sizeof(buf) - 1), buf);
+		"reqs from line: %.*s", (int)(sizeof(buf) - 1), buf);
 		warnx("Using %s-%d", cfgPtr->diskQueueType,
 		cfgPtr->maxOutstandingDiskReqs);
 	} else {
+#if 0
 		char *ch;
+#endif
 		memcpy(cfgPtr->diskQueueType, buf1,
 		RF_MIN(sizeof(cfgPtr->diskQueueType), strlen(buf1) + 1));
+		cfgPtr->diskQueueType[sizeof cfgPtr->diskQueueType - 1] = '\0';
+
+#if 0	/* this indicates a lack of understanding of how scanf() works */
+	/* it was also pointless as buf1 data was (b4) never used again */
 		for (ch = buf1; *ch; ch++) {
 			if (*ch == ' ') {
 *ch = '\0';
 break;
 			}
 		}
+#endif
 		cfgPtr->maxOutstandingDiskReqs = val;
+		if (cfgPtr->maxOutstandingDiskReqs != val) {
+			warnx("Queue length for %s out of range"
+			" [%d interp as %d],

CVS commit: src/sbin/raidctl

2022-06-14 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun 14 08:06:13 UTC 2022

Modified Files:
src/sbin/raidctl: rf_configure.c

Log Message:
Fix some config file parsing.

First, and what got me started on this set of cleanups, the queue
length in the "queue" section (START queue) is limited to what will
fit in a char without losing accuracy (I tried setting it to 200,
rather than the more common (universal?) 100 and found that the
value configured into the array was -56 instead.

Why the value needs to be passed through a char variable I have no
idea (it is an int in the filesystem raidframe headers) - but that's
the way it is done, and changing it would be an ABI change I believe
(and so need versioning to alter) and that isn't worth it for this
(or not now, IMO).

Instead check that the value in the char is the same value as was
read from the config file, and complain if not.   Those of you with
unsigned chars will be able to have queue lengths up to 255, the
rest of us are limited to 127.

While looking at that, I noticed some code that obviously fails to
understand that scanf("%s") will never return a string containing
spaces, and proceeded to attempt to remove trailing spaces from the
result ... amusingly, after having used the result for its intended
purpose (non existent trailing spaces unremoved), after which that
buffer was never used again.   That code is now gone (but for now,
just #if 0'd rather than actually deleted - it should be cleaned up
sometime).

Then I saw some other issues with how the config was parsed - a
simple (unbounded) scanf("%s") into a buffer, which hypothetically
might not be large enough (not a security issue really, raidctl has
no special privs, and it isn't likely that root could easily be
tricked into running it on a bogus config file - or not without
looking first anyway, and a huge long string would rather stand
out).   Bound the string length to something reasonable, and
assert() that the buffer is big enough to contain it.

Lastly, in the event of one particular detected error in the
config file, the code would write a warning, but then just go
ahead and use the bad data (or nothing perhaps) anyway - a
failure of logic flow (unlikely to have ever happened, everyone
seems to simply copy the sample config from the man page, and
make minor adjustments as needed).

If any of these changes make any difference to anyone (except
me with my attempt to make longer queues - for no particularly
well thought out reason), I'd be very surprised.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sbin/raidctl/rf_configure.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/raidctl

2022-06-14 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun 14 08:06:07 UTC 2022

Modified Files:
src/sbin/raidctl: raidctl.c rf_configure.c

Log Message:
In the previous (and some earlier) version(s) of raidctl.c
the following comment appeared:

/*
 * After NetBSD 9, convert this to not output the numRow's value,
 * which is no longer required or ever used.
 */

We are after NetBSD 9 (well after).   The change requested in that
comment is made here, and the comment is thus removed.

A couple of places in rf_configure.c where a value for the "rows"
parameter was output in an error message (always simply as the
constant 0) have also been updated (those messages will no longer
include "row 0", which they always said previously).   One of them
was also slightly reworded to be clearer what problem it was
experiencing (when it said 'unable to get device file' it meant
it was unable to locate the name for the device in the config file,
not that it was found, and there was some other problem with it).


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sbin/raidctl/raidctl.c
cvs rdiff -u -r1.34 -r1.35 src/sbin/raidctl/rf_configure.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/raidctl/raidctl.c
diff -u src/sbin/raidctl/raidctl.c:1.76 src/sbin/raidctl/raidctl.c:1.77
--- src/sbin/raidctl/raidctl.c:1.76	Tue Jun 14 08:06:01 2022
+++ src/sbin/raidctl/raidctl.c	Tue Jun 14 08:06:07 2022
@@ -1,4 +1,4 @@
-/*  $NetBSD: raidctl.c,v 1.76 2022/06/14 08:06:01 kre Exp $   */
+/*  $NetBSD: raidctl.c,v 1.77 2022/06/14 08:06:07 kre Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: raidctl.c,v 1.76 2022/06/14 08:06:01 kre Exp $");
+__RCSID("$NetBSD: raidctl.c,v 1.77 2022/06/14 08:06:07 kre Exp $");
 #endif
 
 
@@ -637,14 +637,9 @@ rf_output_configuration(int fd, const ch
 	nspares = MIN(device_config.nspares,
 	__arraycount(device_config.spares));
 	
-	/*
-	 * After NetBSD 9, convert this to not output the numRow's value,
-	 * which is no longer required or ever used.
-	 */
 	printf("START array\n");
-	printf("# numRow numCol numSpare\n");
-	printf("%d %d %d\n", 1, device_config.cols,
-	device_config.nspares);
+	printf("# numCol numSpare\n");
+	printf("%d %d\n", device_config.cols, device_config.nspares);
 	printf("\n");
 
 	printf("START disks\n");

Index: src/sbin/raidctl/rf_configure.c
diff -u src/sbin/raidctl/rf_configure.c:1.34 src/sbin/raidctl/rf_configure.c:1.35
--- src/sbin/raidctl/rf_configure.c:1.34	Sun Sep  6 05:31:46 2020
+++ src/sbin/raidctl/rf_configure.c	Tue Jun 14 08:06:07 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_configure.c,v 1.34 2020/09/06 05:31:46 mrg Exp $ */
+/*	$NetBSD: rf_configure.c,v 1.35 2022/06/14 08:06:07 kre Exp $ */
 
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
@@ -49,7 +49,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: rf_configure.c,v 1.34 2020/09/06 05:31:46 mrg Exp $");
+__RCSID("$NetBSD: rf_configure.c,v 1.35 2022/06/14 08:06:07 kre Exp $");
 #endif
 
 
@@ -250,8 +250,8 @@ rf_MakeConfig(char *configname, RF_Confi
 
 		if (rf_get_next_nonblank_line(
 		buf, sizeof(buf), fp, NULL)) {
-			warnx("Config file error: unable to get device "
-			"file for disk at row %d col %d", 0, c);
+			warnx("Config file error: unable to find device "
+			"file name for disk at col %d", c);
 			retcode = -1;
 			goto out;
 		}
@@ -259,8 +259,8 @@ rf_MakeConfig(char *configname, RF_Confi
 		b = getfsspecname(b1, sizeof(b1), buf);
 		if (b == NULL) {
 			warnx("Config file error: warning: unable to "
-			"get device file for disk at row %d col "
-			"%d: %s", 0, c, b1);
+			"get device file for disk at col %d: %s",
+			c, b1);
 			b = buf;
 		}
 



CVS commit: src/sbin/raidctl

2022-06-14 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun 14 08:06:07 UTC 2022

Modified Files:
src/sbin/raidctl: raidctl.c rf_configure.c

Log Message:
In the previous (and some earlier) version(s) of raidctl.c
the following comment appeared:

/*
 * After NetBSD 9, convert this to not output the numRow's value,
 * which is no longer required or ever used.
 */

We are after NetBSD 9 (well after).   The change requested in that
comment is made here, and the comment is thus removed.

A couple of places in rf_configure.c where a value for the "rows"
parameter was output in an error message (always simply as the
constant 0) have also been updated (those messages will no longer
include "row 0", which they always said previously).   One of them
was also slightly reworded to be clearer what problem it was
experiencing (when it said 'unable to get device file' it meant
it was unable to locate the name for the device in the config file,
not that it was found, and there was some other problem with it).


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sbin/raidctl/raidctl.c
cvs rdiff -u -r1.34 -r1.35 src/sbin/raidctl/rf_configure.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/raidctl

2022-06-14 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun 14 08:06:02 UTC 2022

Modified Files:
src/sbin/raidctl: raidctl.c

Log Message:
Reorder the getopts() switch () (slightly) to sort the options.   NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sbin/raidctl/raidctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/raidctl

2022-06-14 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun 14 08:06:02 UTC 2022

Modified Files:
src/sbin/raidctl: raidctl.c

Log Message:
Reorder the getopts() switch () (slightly) to sort the options.   NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sbin/raidctl/raidctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/raidctl/raidctl.c
diff -u src/sbin/raidctl/raidctl.c:1.75 src/sbin/raidctl/raidctl.c:1.76
--- src/sbin/raidctl/raidctl.c:1.75	Tue Jun 14 08:05:55 2022
+++ src/sbin/raidctl/raidctl.c	Tue Jun 14 08:06:01 2022
@@ -1,4 +1,4 @@
-/*  $NetBSD: raidctl.c,v 1.75 2022/06/14 08:05:55 kre Exp $   */
+/*  $NetBSD: raidctl.c,v 1.76 2022/06/14 08:06:01 kre Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: raidctl.c,v 1.75 2022/06/14 08:05:55 kre Exp $");
+__RCSID("$NetBSD: raidctl.c,v 1.76 2022/06/14 08:06:01 kre Exp $");
 #endif
 
 
@@ -223,6 +223,16 @@ main(int argc,char *argv[])
 			while (i < 3)
 parityparams[i++] = 0;
 			break;
+		case 'p':
+			action = RAIDFRAME_CHECK_PARITY;
+			openmode = O_RDONLY;
+			num_options++;
+			break;
+		case 'P':
+			action = RAIDFRAME_CHECK_PARITY;
+			do_rewrite = 1;
+			num_options++;
+			break;
 		case 'r':
 			action = RAIDFRAME_REMOVE_HOT_SPARE;
 			get_comp(component, optarg, sizeof(component));
@@ -243,16 +253,6 @@ main(int argc,char *argv[])
 			openmode = O_RDONLY;
 			num_options++;
 			break;
-		case 'p':
-			action = RAIDFRAME_CHECK_PARITY;
-			openmode = O_RDONLY;
-			num_options++;
-			break;
-		case 'P':
-			action = RAIDFRAME_CHECK_PARITY;
-			do_rewrite = 1;
-			num_options++;
-			break;
 		case 'u':
 			action = RAIDFRAME_SHUTDOWN;
 			num_options++;



CVS commit: src/sbin/raidctl

2022-06-14 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun 14 08:05:56 UTC 2022

Modified Files:
src/sbin/raidctl: raidctl.c

Log Message:
KNF (whitespace & 80 column limits) - NFCI.

This is the first of a series of 5 commits in this
directory, all coming within minutes or now.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sbin/raidctl/raidctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/raidctl/raidctl.c
diff -u src/sbin/raidctl/raidctl.c:1.74 src/sbin/raidctl/raidctl.c:1.75
--- src/sbin/raidctl/raidctl.c:1.74	Mon Aug  2 20:31:15 2021
+++ src/sbin/raidctl/raidctl.c	Tue Jun 14 08:05:55 2022
@@ -1,4 +1,4 @@
-/*  $NetBSD: raidctl.c,v 1.74 2021/08/02 20:31:15 oster Exp $   */
+/*  $NetBSD: raidctl.c,v 1.75 2022/06/14 08:05:55 kre Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: raidctl.c,v 1.74 2021/08/02 20:31:15 oster Exp $");
+__RCSID("$NetBSD: raidctl.c,v 1.75 2022/06/14 08:05:55 kre Exp $");
 #endif
 
 
@@ -294,7 +294,7 @@ main(int argc,char *argv[])
 
 	raidID = DISKUNIT(st.st_rdev);
 
-	switch(action) {
+	switch (action) {
 	case RAIDFRAME_ADD_HOT_SPARE:
 		add_hot_spare(fd, component);
 		break;
@@ -490,7 +490,8 @@ rf_get_device_status(int fd)
 			} else {
 printf("%s status is: %s.  Skipping label.\n",
    device_config.spares[i].devname,
-   device_status(device_config.spares[i].status));
+   device_status(
+	   device_config.spares[i].status));
 			}		
 		}
 	}
@@ -966,7 +967,8 @@ check_parity(int fd, int do_rewrite, cha
  get started. */
 			if (verbose) {
 printf("Parity Re-write status:\n");
-do_meter(fd, RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT);
+do_meter(fd,
+RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT);
 			} else {
 do_ioctl(fd, 
 	 RAIDFRAME_CHECK_PARITYREWRITE_STATUS, 
@@ -975,13 +977,14 @@ check_parity(int fd, int do_rewrite, cha
 	 );
 while( percent_done < 100 ) {
 	sleep(3); /* wait a bit... */
-	do_ioctl(fd, RAIDFRAME_CHECK_PARITYREWRITE_STATUS, 
-		 &percent_done, "RAIDFRAME_CHECK_PARITYREWRITE_STATUS");
+	do_ioctl(fd,
+	   RAIDFRAME_CHECK_PARITYREWRITE_STATUS,
+		 &percent_done,
+"RAIDFRAME_CHECK_PARITYREWRITE_STATUS");
 }
 
 			}
-			   printf("%s: Parity Re-write complete\n",
-  dev_name);
+			printf("%s: Parity Re-write complete\n", dev_name);
 		} else {
 			/* parity is wrong, and is not being fixed.
 			   Exit w/ an error. */
@@ -1175,7 +1178,8 @@ get_time_string(char *string, size_t len
 #endif
 		
 		if (hours > 0) {
-			snprintf(hours_buffer,sizeof hours_buffer,"%02d:",hours);
+			snprintf(hours_buffer,sizeof hours_buffer,
+			"%02d:",hours);
 		} else {
 			snprintf(hours_buffer,sizeof hours_buffer,"   ");
 		}
@@ -1195,7 +1199,9 @@ usage(void)
 {
 	const char *progname = getprogname();
 
-	fprintf(stderr, "usage: %s [-v] -A [yes | no | softroot | hardroot] dev\n", progname);
+	fprintf(stderr,
+	"usage: %s [-v] -A [yes | no | softroot | hardroot] dev\n",
+	progname);
 	fprintf(stderr, "   %s [-v] -a component dev\n", progname);
 	fprintf(stderr, "   %s [-v] -B dev\n", progname);
 	fprintf(stderr, "   %s [-v] -C config_file dev\n", progname);



CVS commit: src/sbin/raidctl

2022-06-14 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun 14 08:05:56 UTC 2022

Modified Files:
src/sbin/raidctl: raidctl.c

Log Message:
KNF (whitespace & 80 column limits) - NFCI.

This is the first of a series of 5 commits in this
directory, all coming within minutes or now.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sbin/raidctl/raidctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.