CVS commit: src/share/misc

2024-05-16 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Thu May 16 12:04:22 UTC 2024

Modified Files:
src/share/misc: bsd-family-tree

Log Message:
. Update the ASCII art timeline for the last two years
. In particular, add NetBSD 8.3 to timeline
. Add respective "publication dates" of those points in time
While here, also:
. Fix white space idiosyncracies and opt for https instead of http
. Track some changes made to the FreeBSD version of this file


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/share/misc/bsd-family-tree

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

Modified files:

Index: src/share/misc/bsd-family-tree
diff -u src/share/misc/bsd-family-tree:1.84 src/share/misc/bsd-family-tree:1.85
--- src/share/misc/bsd-family-tree:1.84	Sat Mar 30 19:34:46 2024
+++ src/share/misc/bsd-family-tree	Thu May 16 12:04:21 2024
@@ -411,62 +411,87 @@ FreeBSD 5.2   |  |  
  | |  |   |  ||  ||DragonFly 5.8
  | |  |   |  ||  |||
  | |  |   |  ||  ||DragonFly 5.6.3
- | |  |   |  ||   NetBSD  ||
- | |  |   |  ||8.2|DragonFly 5.8.1
- | |  |   |  ||   OpenBSD 6.7  |
- | |   FreeBSD|  ||   ||
- | | 11.4 |  ||   ||
- | |  |  ||   |DragonFly 5.8.2
- | |  |  ||   |DragonFly 5.8.3
- | |  |  |  NetBSD 9.1OpenBSD 6.8  |
- |  FreeBSD   |  ||   ||
- |   12.2   macOS||   ||
- | | 11  ||   ||
- | `--.   |  ||   ||
- ||   |  ||   ||
- *--FreeBSD   |   |  ||   ||
- |   13.0 |   |  |  NetBSD 9.2OpenBSD 6.9  DragonFly 6.0
- | |  |   |  ||   ||
- | |  |   |  ||   ||
- | |   FreeBSD  macOS||   OpenBSD 7.0  DragonFly 6.2.1
- | | 12.312  ||   ||
- | |  |  ||   ||
- | |  |  ||   OpenBSD 7.1  |
- |  FreeBSD   |  ||   ||
- |   13.1 |  ||   ||
- ||  ||   |DragonFly 6.2.2
- ||  |  NetBSD 9.3||
+ | |  |   |  ||NetBSD ||
+ | |  |   |  || 8.2   ||
+ | |  |   |  ||  ||DragonFly 5.8.1
+ | |  |   |  ||  |OpenBSD 6.7  |
+ | |   FreeBSD|  ||  |||
+ | | 11.4 |  ||  |||
+ | |  |  ||  ||DragonFly 5.8.2
+ | |  |  ||  ||DragonFly 5.8.3
+ | |  |  |  NetBSD   |OpenBSD 6.8  |
+ | |  |  |   9.1 |||
+ |  FreeBSD macOS||  |||
+ |   12.211  ||  |||
+ | |  |  ||  |||
+ | `--.   |  ||  |||
+ *--FreeBSD   |   |  ||  |||
+ |   13.0 |   |  |  NetBSD   |OpenBSD 6.9  DragonFly 6.0.0
+ | |  |   |  |   9.2 |||
+ | |  |   |  ||  ||DragonFly 6.0.1
+ | |   FreeBSD  macOS||  |OpenBSD 7.0  |
+ | | 12.312  ||  |||
+ | |  |   |  ||  ||DragonFly 6.2.1
+ | |  |   |  ||  |OpenBSD 7.1  |
+ |  FreeBSD   |   |  ||  |||
+ |   13.1 |   |  ||  |||
+ | |  |   |  ||  ||DragonFly 

CVS commit: src/share/misc

2024-05-16 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Thu May 16 12:04:22 UTC 2024

Modified Files:
src/share/misc: bsd-family-tree

Log Message:
. Update the ASCII art timeline for the last two years
. In particular, add NetBSD 8.3 to timeline
. Add respective "publication dates" of those points in time
While here, also:
. Fix white space idiosyncracies and opt for https instead of http
. Track some changes made to the FreeBSD version of this file


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/share/misc/bsd-family-tree

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



CVS commit: src/share/misc

2022-08-07 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sun Aug  7 22:43:28 UTC 2022

Modified Files:
src/share/misc: bsd-family-tree

Log Message:
Update what has been released by the BSD family during the last
two years; that is, since May 2020 after NetBSD 8.2 was registered
in this file.

Merge some additional information from the FreeBSD and DragonFly
versions that had several updates during this time. Added OpenBSD
and macos release dates for the same interval.

Where some release dates don't match exactly (release vs. announce
date) in the various bsd-family-tree files, assume the respective
flavor to be authoritive for its dates in this file.

Reviewed by: Sergey A. Osokin 


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/share/misc/bsd-family-tree

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

Modified files:

Index: src/share/misc/bsd-family-tree
diff -u src/share/misc/bsd-family-tree:1.82 src/share/misc/bsd-family-tree:1.83
--- src/share/misc/bsd-family-tree:1.82	Thu Jun 11 09:15:31 2020
+++ src/share/misc/bsd-family-tree	Sun Aug  7 22:43:28 2022
@@ -402,19 +402,42 @@ FreeBSD 5.2   |  |  
  | |  |   |  |   ||DragonFly 5.6.1
  | |   FreeBSD  macOS|   |||
  | | 11.3   10.15|   |||
- |  FreeBSD   |  |   |OpenBSD 6.6  |
- |   12.1   macOS|   `---.||
- | |   10.15.1   |   ||DragonFly 5.6.2
- | |  |  *--NetBSD   |||
- | v  |  |   9.0 |||
- ||  |   |||
- ||  |   ||DragonFly 5.8
- ||  |   |||
- ||  |   ||DragonFly 5.6.3
- ||  |NetBSD  ||
- ||  | 8.2||
+ |  FreeBSD   |   |  |   |OpenBSD 6.6  |
+ |   12.1 | macOS|   `---.||
+ | |  |10.15.1   |   ||DragonFly 5.6.2
+ | |  |   |  *--NetBSD   |||
+ | |  |   |  |   9.0 |||
+ | |  |   |  ||  |||
+ | |  |   |  ||  ||DragonFly 5.8
+ | |  |   |  ||  |||
+ | |  |   |  ||  ||DragonFly 5.6.3
+ | |  |   |  ||   NetBSD  ||
+ | |  |   |  ||8.2|DragonFly 5.8.1
+ | |  |   |  ||   OpenBSD 6.7  |
+ | |   FreeBSD|  ||   ||
+ | | 11.4 |  ||   ||
+ | |  |  ||   |DragonFly 5.8.2
+ | |  |  ||   |DragonFly 5.8.3
+ | |  |  |  NetBSD 9.1OpenBSD 6.8  |
+ |  FreeBSD   |  ||   ||
+ |   12.2   macOS||   ||
+ | | 11  ||   ||
+ | `--.   |  ||   ||
+ ||   |  ||   ||
+ *--FreeBSD   |   |  ||   ||
+ |   13.0 |   |  |  NetBSD 9.2OpenBSD 6.9  DragonFly 6.0
+ | |  |   |  ||   ||
+ | |  |   |  ||   ||
+ | |   FreeBSD  macOS||   OpenBSD 7.0  DragonFly 6.2.1
+ | | 12.312  ||   ||
+ | |  |  ||   ||
+ | |  |  ||   OpenBSD 7.1  |
+ |  FreeBSD   |  ||   ||
+ |   13.1 |  ||   ||
+ ||  ||   |DragonFly 6.2.2
+ ||  |  NetBSD 9.3||
  ||  |||
-FreeBSD 13 -current   |  NetBSD -current   OpenBSD -current

CVS commit: src/share/misc

2022-08-07 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sun Aug  7 22:43:28 UTC 2022

Modified Files:
src/share/misc: bsd-family-tree

Log Message:
Update what has been released by the BSD family during the last
two years; that is, since May 2020 after NetBSD 8.2 was registered
in this file.

Merge some additional information from the FreeBSD and DragonFly
versions that had several updates during this time. Added OpenBSD
and macos release dates for the same interval.

Where some release dates don't match exactly (release vs. announce
date) in the various bsd-family-tree files, assume the respective
flavor to be authoritive for its dates in this file.

Reviewed by: Sergey A. Osokin 


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/share/misc/bsd-family-tree

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



CVS commit: src

2016-11-13 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sun Nov 13 14:47:46 UTC 2016

Modified Files:
src: build.sh

Log Message:
With driver modulization of if_loop.c through introduction of
sys/net/if_module.h, build.sh rumptest of -lrumpnet_virtif now also
requires -lrumpdev -lrumpvfs for if_loop.c:config_cfdriver_attach()
and kern_pmf.c:do_sys_sync().


To generate a diff of this commit:
cvs rdiff -u -r1.310 -r1.311 src/build.sh

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

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.310 src/build.sh:1.311
--- src/build.sh:1.310	Fri Jun  3 00:00:01 2016
+++ src/build.sh	Sun Nov 13 14:47:46 2016
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.310 2016/06/03 00:00:01 kre Exp $
+#	$NetBSD: build.sh,v 1.311 2016/11/13 14:47:46 ast Exp $
 #
 # Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1876,7 +1876,7 @@ createmakewrapper()
 	eval cat 

CVS commit: src

2016-11-13 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sun Nov 13 14:47:46 UTC 2016

Modified Files:
src: build.sh

Log Message:
With driver modulization of if_loop.c through introduction of
sys/net/if_module.h, build.sh rumptest of -lrumpnet_virtif now also
requires -lrumpdev -lrumpvfs for if_loop.c:config_cfdriver_attach()
and kern_pmf.c:do_sys_sync().


To generate a diff of this commit:
cvs rdiff -u -r1.310 -r1.311 src/build.sh

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



CVS commit: src/sys/sys

2016-10-08 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sat Oct  8 17:28:17 UTC 2016

Modified Files:
src/sys/sys: fstypes.h

Log Message:
white space


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/sys/fstypes.h

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



CVS commit: src/sys/sys

2016-10-08 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sat Oct  8 17:28:17 UTC 2016

Modified Files:
src/sys/sys: fstypes.h

Log Message:
white space


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/sys/fstypes.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/sys/fstypes.h
diff -u src/sys/sys/fstypes.h:1.33 src/sys/sys/fstypes.h:1.34
--- src/sys/sys/fstypes.h:1.33	Wed May  6 15:57:08 2015
+++ src/sys/sys/fstypes.h	Sat Oct  8 17:28:17 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstypes.h,v 1.33 2015/05/06 15:57:08 hannken Exp $	*/
+/*	$NetBSD: fstypes.h,v 1.34 2016/10/08 17:28:17 ast Exp $	*/
 
 /*
  * Copyright (c) 1989, 1991, 1993
@@ -267,7 +267,7 @@ typedef struct fhandle	fhandle_t;
 	"\20" \
 	"\13IMNT_ONWORKLIST" \
 	"\12IMNT_CAN_RWTORO" \
-"\11IMNT_MPSAFE" \
+	"\11IMNT_MPSAFE" \
 	"\10IMNT_HAS_TRANS" \
 	"\07IMNT_DTYPE" \
 	"\03IMNT_WANTRDWR" \



CVS commit: src/usr.sbin/service

2015-04-02 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Thu Apr  2 18:41:22 UTC 2015

Modified Files:
src/usr.sbin/service: service service.8

Log Message:
cosmetic change in man 8 service
use shell quoting in a safe way as suggested by Alan Barrett


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/service/service
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/service/service.8

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



CVS commit: src/usr.sbin/service

2015-04-02 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Thu Apr  2 18:41:22 UTC 2015

Modified Files:
src/usr.sbin/service: service service.8

Log Message:
cosmetic change in man 8 service
use shell quoting in a safe way as suggested by Alan Barrett


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/service/service
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/service/service.8

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/service/service
diff -u src/usr.sbin/service/service:1.5 src/usr.sbin/service/service:1.6
--- src/usr.sbin/service/service:1.5	Fri Mar 27 23:25:42 2015
+++ src/usr.sbin/service/service	Thu Apr  2 18:41:22 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-#$NetBSD: service,v 1.5 2015/03/27 23:25:42 ast Exp $
+#$NetBSD: service,v 1.6 2015/04/02 18:41:22 ast Exp $
 #service -- run or list system services
 #
 #  Taken from FreeBSD: releng/10.1/usr.sbin/service/service.sh 268098
@@ -50,9 +50,11 @@ _rc_files()
 {
 local _d _f
 for _d in ${rc_directories}; do
-if [ -d $_d ]; then
-for _f in $_d/*; do [ -f $_f -a -x $_f ]  echo $_f; done
-fi
+ if [ -d $_d ]; then
+ for _f in $_d/*; do
+ [ -f $_f -a -x $_f ]  echo $_f
+ done
+ fi
 done | xargs rcorder -s nostart ${rc_rcorder_flags} 2/dev/null
 return 0
 }

Index: src/usr.sbin/service/service.8
diff -u src/usr.sbin/service/service.8:1.3 src/usr.sbin/service/service.8:1.4
--- src/usr.sbin/service/service.8:1.3	Mon Mar 23 23:28:55 2015
+++ src/usr.sbin/service/service.8	Thu Apr  2 18:41:22 2015
@@ -1,4 +1,4 @@
-.\	$NetBSD: service.8,v 1.3 2015/03/23 23:28:55 ast Exp $
+.\	$NetBSD: service.8,v 1.4 2015/04/02 18:41:22 ast Exp $
 .\
 .\ Copyright (c) 2009 Douglas Barton
 .\ All rights reserved.
@@ -35,7 +35,7 @@
 .Op Fl elv
 .Nm
 .Op Fl ev
-.Ar rc_script_name Op Ar rc_script_name2 Op Ar ...
+.Ar rc_script_name1 Op Ar rc_script_name2 Op Ar ...
 .Nm
 .Op Fl v
 .Ar rc_script_name action



Re: CVS commit: src/usr.sbin/service

2015-03-31 Thread Adrian Steinmann
 Please could this be fixed to use shell quoting in a safe way.
OK, if that'll unstall the pullup-7.

Are you implying that the /etc/rc.d/ system supports space in filenames?

Adrian


CVS commit: src/usr.sbin/service

2015-03-27 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Fri Mar 27 23:25:42 UTC 2015

Modified Files:
src/usr.sbin/service: service

Log Message:
Integrate some feedback gleened from tech-userle...@netbsd.org:
Avoid ls -P so that script can also run pre-netbsd-7.
Make sure /etc/rc.conf.d configurations are supported.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/service/service

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



CVS commit: src/usr.sbin/service

2015-03-27 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Fri Mar 27 23:25:42 UTC 2015

Modified Files:
src/usr.sbin/service: service

Log Message:
Integrate some feedback gleened from tech-userle...@netbsd.org:
Avoid ls -P so that script can also run pre-netbsd-7.
Make sure /etc/rc.conf.d configurations are supported.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/service/service

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/service/service
diff -u src/usr.sbin/service/service:1.4 src/usr.sbin/service/service:1.5
--- src/usr.sbin/service/service:1.4	Mon Mar 23 23:28:55 2015
+++ src/usr.sbin/service/service	Fri Mar 27 23:25:42 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-#$NetBSD: service,v 1.4 2015/03/23 23:28:55 ast Exp $
+#$NetBSD: service,v 1.5 2015/03/27 23:25:42 ast Exp $
 #service -- run or list system services
 #
 #  Taken from FreeBSD: releng/10.1/usr.sbin/service/service.sh 268098
@@ -44,11 +44,15 @@ usage ()
 exit 1
 }
 
-rc_files()
+# list all files in rc_directories with absolute pathnames
+# written to be compatible with ls(1) from pre netbsd-7
+_rc_files()
 {
-local dir
-for dir in ${rc_directories}; do
-[ -d ${dir} ]  ls -P1 ${dir} 2/dev/null
+local _d _f
+for _d in ${rc_directories}; do
+if [ -d $_d ]; then
+for _f in $_d/*; do [ -f $_f -a -x $_f ]  echo $_f; done
+fi
 done | xargs rcorder -s nostart ${rc_rcorder_flags} 2/dev/null
 return 0
 }
@@ -75,12 +79,15 @@ if [ -n ${ENABLED} ]; then
 then
 flt=$( echo $* | sed -e 's; ;|;g' -e 's;^;egrep /(;' -e 's;$;)$;' )
 fi
-rc_files | $flt | while read file
+_rc_files | $flt | while read file
 do
 if grep -q ^rcvar $file; then
 eval $( grep ^name= $file )
 eval $( grep ^rcvar $file )
-checkyesno ${rcvar} 2/dev/null  echo ${file}
+if [ -n ${rcvar} ]; then
+load_rc_config ${rcvar}
+checkyesno ${rcvar} 2/dev/null  echo ${file}
+fi
 fi
 done
 exit 0
@@ -88,7 +95,7 @@ fi
 
 if [ -n ${LIST} ]; then
 [ -n ${VERBOSE} ]  echo rc_directories is ${rc_directories} 2
-rc_files
+_rc_files
 exit 0
 fi
 



Re: CVS commit: src

2015-03-24 Thread Adrian Steinmann
On Tue, Mar 24, 2015 at 02:05:19AM +0100, Joerg Sonnenberger wrote:
 On Mon, Mar 23, 2015 at 03:10:53PM +0100, Adrian Steinmann wrote:
  [Would chat count as discussion? The thing is long discussions and
  open-source only on the odd weekend makes for glacial progress.]
 
 Not really and I understand your pain. Keep up with the contributions :)

No problem, I have gotten (mostly pvt) positive feedback. Thanks for the
Schuss vor dem Bug I honestly appreciate it as input from my mentor!
FWIW I posted a post factum feedback to
https://mail-index.netbsd.org/tech-userlevel/2015/03/23/msg009051.html

Ast

PS FYI I have not given up on my pivot_root(9), I need to adapt it to
hannken's vnode cleanups and also investigate forced unmounts
http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=38760
as they are needed after the pivot. Finally, I need to add a test
suite based on rump (your input, not forgotten). I will socialize
the patch beforehand when it's ready.


Re: CVS commit: src

2015-03-23 Thread Adrian Steinmann
On Mon, Mar 23, 2015 at 02:43:11PM +0100, Joerg Sonnenberger wrote:
 To put everyone on equal grounds, where was this discussed? Please don't
 add tools without at least a small note to the appropiate lists in
 advance. I don't have anything against service(8) and believe it is a
Point taken. I will do so in the future. I suppose I could have
asked you (as my mentor).

I did indeed notice the blurb in the CVS checkin which said Does
this change DESTDIR? but at that point I was just too committed ;-)

Until now I have gotten only positive feedback (but yes, surprise)
because I didn't socialize it.

[Would chat count as discussion? The thing is long discussions and
open-source only on the odd weekend makes for glacial progress.]

FYI I also lodged a pullup-7 and I will remove the -f option
because it does not act on the invocation and is thus not
useful (i.e., less is more).

Ast

 On Sun, Mar 22, 2015 at 09:57:42AM +, Adrian Steinmann wrote:
  Module Name:src
  Committed By:   ast
  Date:   Sun Mar 22 09:57:42 UTC 2015
  
  Modified Files:
  src/distrib/sets/lists/base: mi
  src/distrib/sets/lists/man: mi
  src/usr.sbin: Makefile
  Added Files:
  src/usr.sbin/service: Makefile service service.8
  
  Log Message:
  Import a substantially modified service(8) command from FreeBSD to
  manage rc.d scripts.  This command is well known on most other Unixes
  and should help soften the learning curve for Unix admins coming
  to NetBSD.
 
 good addition, but let's follow some common rules.
 
 Joerg


CVS commit: src/usr.sbin/service

2015-03-23 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Mon Mar 23 23:28:55 UTC 2015

Modified Files:
src/usr.sbin/service: service service.8

Log Message:
Remove -f option as rc_fast is not set in invocation mode.
Do the load_rc_config *after* option parsing.
Catch conflicting -e + -l option specs.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/service/service
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/service/service.8

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/service/service
diff -u src/usr.sbin/service/service:1.3 src/usr.sbin/service/service:1.4
--- src/usr.sbin/service/service:1.3	Sun Mar 22 22:39:05 2015
+++ src/usr.sbin/service/service	Mon Mar 23 23:28:55 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-#$NetBSD: service,v 1.3 2015/03/22 22:39:05 wiz Exp $
+#$NetBSD: service,v 1.4 2015/03/23 23:28:55 ast Exp $
 #service -- run or list system services
 #
 #  Taken from FreeBSD: releng/10.1/usr.sbin/service/service.sh 268098
@@ -31,21 +31,17 @@
 
 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
-. /etc/rc.subr
-load_rc_config 'XXX'
-
 usage ()
 {
 local me=${0##*/}
 echo usage: ${me} [-elv]
 echo${me} [-ev] rc_script_name [rc_script_name2 [...]]
-echo${me} [-fv] rc_script_name action
+echo${me} [-v] rc_script_name action
 echo-e: List enabled scripts; check if given scripts are enabled
-echo-f: Set rc_fast=yes when running rc_script_name action
 echo-l: List all scripts in rcorder
 echo-v: Verbose (mention in which directory script is found)
 echo rc_directories is currently set to ${rc_directories}
-return 0
+exit 1
 }
 
 rc_files()
@@ -57,16 +53,20 @@ rc_files()
 return 0
 }
 
-while getopts elvf o; do
+while getopts elv o; do
 case $o in
+e) ENABLED=1 ;;
 l) LIST=1 ;;
 v) VERBOSE=1 ;;
-e) ENABLED=1 ;;
-f) rc_fast=yes ;;
-*) usage ; exit 1 ;;
+*) usage ;;
 esac
 done
-shift $(( ${OPTIND} - 1 ))
+shift $( expr $OPTIND - 1 )
+
+[ -n ${ENABLED} -a -n ${LIST} ]  usage
+
+. /etc/rc.subr
+load_rc_config :
 
 if [ -n ${ENABLED} ]; then
 [ -n ${VERBOSE} ]  echo rc_directories is ${rc_directories} 2
@@ -97,7 +97,6 @@ if [ $# -eq 2 ]; then
 arg=$2
 else
 usage
-exit 1
 fi
 
 for dir in ${rc_directories}; do

Index: src/usr.sbin/service/service.8
diff -u src/usr.sbin/service/service.8:1.2 src/usr.sbin/service/service.8:1.3
--- src/usr.sbin/service/service.8:1.2	Sun Mar 22 22:38:19 2015
+++ src/usr.sbin/service/service.8	Mon Mar 23 23:28:55 2015
@@ -1,4 +1,4 @@
-.\	$NetBSD: service.8,v 1.2 2015/03/22 22:38:19 wiz Exp $
+.\	$NetBSD: service.8,v 1.3 2015/03/23 23:28:55 ast Exp $
 .\
 .\ Copyright (c) 2009 Douglas Barton
 .\ All rights reserved.
@@ -37,7 +37,7 @@
 .Op Fl ev
 .Ar rc_script_name Op Ar rc_script_name2 Op Ar ...
 .Nm
-.Op Fl fv
+.Op Fl v
 .Ar rc_script_name action
 .Sh DESCRIPTION
 The
@@ -54,7 +54,7 @@ scripts,
 .Nm
 will set the same environment that is used at boot time.
 .Pp
-The following options are supported:
+The options are as follows:
 .Bl -tag -width F1
 .It Fl e
 List services that are enabled.
@@ -72,12 +72,6 @@ are specified, only those are checked.
 The
 .Ar rc_script_name
 arguments are always specified without a path prefix.
-.It Fl f
-Set
-.Sy rc_fast=yes
-to speed up the
-.Ev rc.d script; that is, run it as it is run during
-.Sq autoboot .
 .It Fl l
 List all files in
 .Pa /etc/rc.d
@@ -128,20 +122,23 @@ or any other argument supported by the
 These are typical usages of the
 .Nm
 command:
-.Pp
-.Dl # service sshd restart
-.Dl Stopping sshd.
-.Dl Starting sshd.
-.Pp
-.Dl $ service -v inetd status
-.Dl inetd is located in /etc/rc.d
-.Dl inetd is running as pid 1713.
-.Pp
-.Dl $ service -vfe ccd motd hostapd my_pkg
-.Dl rc_directories is /etc/rc.d /usr/pkg/etc/rc.d
-.Dl /etc/rc.d/ccd
-.Dl /usr/pkg/etc/rc.d/my_pkg
-.Dl /etc/rc.d/motd
+.Bd -literal
+# service sshd restart
+Stopping sshd.
+Starting sshd.
+.Ed
+.Bd -literal
+$ service -v inetd status
+inetd is located in /etc/rc.d
+inetd is running as pid 1713.
+.Ed
+.Bd -literal
+$ service -ve ccd motd hostapd my_pkg
+rc_directories is /etc/rc.d /usr/pkg/etc/rc.d
+/etc/rc.d/ccd
+/usr/pkg/etc/rc.d/my_pkg
+/etc/rc.d/motd
+.Ed
 .Pp
 In the last example,
 .Xr hostapd 8



CVS commit: src/usr.sbin/service

2015-03-23 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Mon Mar 23 23:28:55 UTC 2015

Modified Files:
src/usr.sbin/service: service service.8

Log Message:
Remove -f option as rc_fast is not set in invocation mode.
Do the load_rc_config *after* option parsing.
Catch conflicting -e + -l option specs.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/service/service
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/service/service.8

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



CVS commit: src/doc

2015-03-22 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sun Mar 22 12:48:18 UTC 2015

Modified Files:
src/doc: CHANGES

Log Message:
Mention import of service(8) command from FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.2055 -r1.2056 src/doc/CHANGES

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
diff -u src/doc/CHANGES:1.2055 src/doc/CHANGES:1.2056
--- src/doc/CHANGES:1.2055	Sat Mar 21 15:54:11 2015
+++ src/doc/CHANGES	Sun Mar 22 12:48:18 2015
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.2055 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.2056 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -140,3 +140,4 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	dtrace: Add syscall support [christos 20150307]
 	dtrace: Add lockstat support [riastradh, christos 20150308]
 	zoneinfo: Import tzdata2015b. [apb 20150321]
+	service(8): Import adapted script from FreeBSD [ast 20150322]



CVS commit: src/doc

2015-03-22 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sun Mar 22 12:48:18 UTC 2015

Modified Files:
src/doc: CHANGES

Log Message:
Mention import of service(8) command from FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.2055 -r1.2056 src/doc/CHANGES

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



CVS commit: src

2015-03-22 Thread Adrian Steinmann
:42 2015
@@ -0,0 +1,118 @@
+#!/bin/sh
+#$NetBSD: service,v 1.1 2015/03/22 09:57:42 ast Exp $
+#service -- run or list system services
+#
+#  Taken from FreeBSD: releng/10.1/usr.sbin/service/service.sh 268098
+#  Modified for NetBSD by Adrian Steinmann in March, 2015
+#
+#  Copyright (c) 2009 Douglas Barton
+#  All rights reserved.
+#
+#  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 AUTHOR 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 AUTHOR 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.
+
+export PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+. /etc/rc.subr
+load_rc_config 'XXX'
+
+usage ()
+{
+local me=${0##*/}
+echo Usage: ${me} [-vel]
+echo Usage: ${me} [-ve] rc_script_name [rc_script_name2 [...]]
+echo Usage: ${me} [-vf] rc_script_name action
+echo-l: List all scripts in rcorder
+echo-e: List enabled scripts; check if given scripts are enabled
+echo-f: Set rc_fast=yes when running rc_script_name action
+echo-v: Verbose (mention in which directory script is found)
+echo rc_directories is currently set to ${rc_directories}
+return 0
+}
+
+rc_files()
+{
+local dir
+for dir in ${rc_directories}; do
+[ -d ${dir} ]  ls -P1 ${dir} 2/dev/null
+done | xargs rcorder -s nostart ${rc_rcorder_flags} 2/dev/null
+return 0
+}
+
+while getopts elvf o; do
+case $o in
+l) LIST=1 ;;
+v) VERBOSE=1 ;;
+e) ENABLED=1 ;;
+f) rc_fast=yes ;;
+*) usage ; exit 1 ;;
+esac
+done
+shift $(( ${OPTIND} - 1 ))
+
+if [ -n ${ENABLED} ]; then
+[ -n ${VERBOSE} ]  echo rc_directories is ${rc_directories} 2
+flt=cat
+if [ $# -gt 0 ]
+then
+flt=$( echo $* | sed -e 's; ;|;g' -e 's;^;egrep /(;' -e 's;$;)$;' )
+fi
+rc_files | $flt | while read file
+do
+if grep -q ^rcvar $file; then
+eval $( grep ^name= $file )
+eval $( grep ^rcvar $file )
+checkyesno ${rcvar} 2/dev/null  echo ${file}
+fi
+done
+exit 0
+fi
+
+if [ -n ${LIST} ]; then
+[ -n ${VERBOSE} ]  echo rc_directories is ${rc_directories} 2
+rc_files
+exit 0
+fi
+
+if [ $# -eq 2 ]; then
+script=$1
+arg=$2
+else
+usage
+exit 1
+fi
+
+for dir in ${rc_directories}; do
+if [ -x ${dir}/${script} ]; then
+[ -n ${VERBOSE} ]  echo ${script} is located in ${dir} 2
+# run as in /etc/rc
+cd /
+umask 022
+exec env -i \
+HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin \
+${dir}/${script} ${arg}
+echo Failed to exec ${dir}/${script} ${arg} 2
+exit 255
+fi
+done
+
+echo ${script} does not exist in ${rc_directories} 2
+exit 1
Index: src/usr.sbin/service/service.8
diff -u /dev/null src/usr.sbin/service/service.8:1.1
--- /dev/null	Sun Mar 22 09:57:42 2015
+++ src/usr.sbin/service/service.8	Sun Mar 22 09:57:42 2015
@@ -0,0 +1,173 @@
+.\	$NetBSD: service.8,v 1.1 2015/03/22 09:57:42 ast Exp $
+.\
+.\ Copyright (c) 2009 Douglas Barton
+.\ All rights reserved.
+.\
+.\ 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 AUTHOR 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

CVS commit: src

2015-03-22 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sun Mar 22 09:57:42 UTC 2015

Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/man: mi
src/usr.sbin: Makefile
Added Files:
src/usr.sbin/service: Makefile service service.8

Log Message:
Import a substantially modified service(8) command from FreeBSD to
manage rc.d scripts.  This command is well known on most other Unixes
and should help soften the learning curve for Unix admins coming
to NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.1097 -r1.1098 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.1497 -r1.1498 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.269 -r1.270 src/usr.sbin/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/service/Makefile \
src/usr.sbin/service/service src/usr.sbin/service/service.8

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



CVS commit: src/usr.sbin/service

2015-03-22 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sun Mar 22 10:24:48 UTC 2015

Modified Files:
src/usr.sbin/service: service

Log Message:
Make the usage appear more standard.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/service/service

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



CVS commit: src/usr.sbin/service

2015-03-22 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sun Mar 22 10:24:48 UTC 2015

Modified Files:
src/usr.sbin/service: service

Log Message:
Make the usage appear more standard.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/service/service

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/service/service
diff -u src/usr.sbin/service/service:1.1 src/usr.sbin/service/service:1.2
--- src/usr.sbin/service/service:1.1	Sun Mar 22 09:57:42 2015
+++ src/usr.sbin/service/service	Sun Mar 22 10:24:48 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-#$NetBSD: service,v 1.1 2015/03/22 09:57:42 ast Exp $
+#$NetBSD: service,v 1.2 2015/03/22 10:24:48 ast Exp $
 #service -- run or list system services
 #
 #  Taken from FreeBSD: releng/10.1/usr.sbin/service/service.sh 268098
@@ -37,9 +37,9 @@ load_rc_config 'XXX'
 usage ()
 {
 local me=${0##*/}
-echo Usage: ${me} [-vel]
-echo Usage: ${me} [-ve] rc_script_name [rc_script_name2 [...]]
-echo Usage: ${me} [-vf] rc_script_name action
+echo usage: ${me} [-vel]
+echo${me} [-ve] rc_script_name [rc_script_name2 [...]]
+echo${me} [-vf] rc_script_name action
 echo-l: List all scripts in rcorder
 echo-e: List enabled scripts; check if given scripts are enabled
 echo-f: Set rc_fast=yes when running rc_script_name action



CVS commit: src/usr.sbin/installboot

2015-03-22 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sun Mar 22 09:45:50 UTC 2015

Modified Files:
src/usr.sbin/installboot: installboot.8

Log Message:
Appease various mandoc -Tlint warnings and update copyright while we're here


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/usr.sbin/installboot/installboot.8

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/installboot/installboot.8
diff -u src/usr.sbin/installboot/installboot.8:1.87 src/usr.sbin/installboot/installboot.8:1.88
--- src/usr.sbin/installboot/installboot.8:1.87	Mon Feb 24 07:23:44 2014
+++ src/usr.sbin/installboot/installboot.8	Sun Mar 22 09:45:50 2015
@@ -1,6 +1,6 @@
-.\	$NetBSD: installboot.8,v 1.87 2014/02/24 07:23:44 skrll Exp $
+.\	$NetBSD: installboot.8,v 1.88 2015/03/22 09:45:50 ast Exp $
 .\
-.\ Copyright (c) 2002-2012 The NetBSD Foundation, Inc.
+.\ Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 .\ All rights reserved.
 .\
 .\ This code is derived from software contributed to The NetBSD Foundation
@@ -104,7 +104,6 @@ Copy the secondary bootstrap (usually
 or
 .Pa /usr/mdec/boot )
 to the root directory of the target file system.
-.Pp
 .
 .It
 Use
@@ -131,7 +130,6 @@ single bootstrap file is used.
 The single bootstrap is installed like the primary bootstrap on
 other platforms:
 .Sy next68k .
-.Pp
 .El
 .Pp
 The options and arguments recognized by
@@ -432,7 +430,6 @@ overriding the result from
 Most
 .Nx
 ports will contain variations of the following files:
-.Pp
 .Bl -tag -width /usr/mdec/bootxx_ustarfs
 .
 .It Pa /usr/mdec/bootxx_ Ns Sy FSTYPE
@@ -751,7 +748,6 @@ which is used for the OpenFirmware to lo
 Install the bootstrap on to disk
 .Sq sd0 :
 .Dl Ic installboot /dev/rsd0c /usr/mdec/boot
-.Pp
 .
 .Ss Nx Ns Tn /pmax
 Install the Berkeley Fast File System primary bootstrap on to disk



CVS commit: src/usr.sbin/installboot

2015-03-22 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sun Mar 22 09:45:50 UTC 2015

Modified Files:
src/usr.sbin/installboot: installboot.8

Log Message:
Appease various mandoc -Tlint warnings and update copyright while we're here


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/usr.sbin/installboot/installboot.8

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



CVS commit: src/games

2014-10-02 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Thu Oct  2 21:36:37 UTC 2014

Modified Files:
src/games/factor: factor.6 factor.c
src/games/primes: Makefile pattern.c pr_tbl.c primes.6 primes.c
primes.h
Added Files:
src/games/primes: spsp.c

Log Message:
Imported and adapted from FreeBSD svn r272166 and r272207; this fixes
false positives for products of primes larger than 2^16. For example,
before this commit:

  $ /usr/games/primes 4295360521 4295360522
  4295360521
but
  $ /usr/games/factor 4295360521
  4295360521: 65539 65539

or
  $ /usr/games/primes 3825123056546413049 3825123056546413050
  3825123056546413049
yet
  $ /usr/games/factor 3825123056546413049
  3825123056546413049: 165479 23115459100831

or
  $ /usr/games/primes 18446744073709551577
  18446744073709551577
although
  $ /usr/games/factor 18446744073709551577
  18446744073709551577: 139646831 132095686967

Incidentally, the above examples show the smallest and largest cases that
were erroneously stated as prime in the range 2^32 .. 3825123056546413049
.. 2^64; the primes(6) program now stops at 3825123056546413050 as
primality tests on larger integers would be by brute force factorization.

In addition, special to the NetBSD version:
. for -d option, skip first difference when start is 65537 as it is incorrect
. corrected usage to mention both the existing -d as well as the new -h option

For original FreeBSD commit message by Colin Percival, see:
http://svnweb.freebsd.org/base?view=revisionrevision=272166


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/games/factor/factor.6
cvs rdiff -u -r1.26 -r1.27 src/games/factor/factor.c
cvs rdiff -u -r1.7 -r1.8 src/games/primes/Makefile src/games/primes/pr_tbl.c
cvs rdiff -u -r1.6 -r1.7 src/games/primes/pattern.c
cvs rdiff -u -r1.3 -r1.4 src/games/primes/primes.6
cvs rdiff -u -r1.19 -r1.20 src/games/primes/primes.c
cvs rdiff -u -r1.5 -r1.6 src/games/primes/primes.h
cvs rdiff -u -r0 -r1.1 src/games/primes/spsp.c

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

Modified files:

Index: src/games/factor/factor.6
diff -u src/games/factor/factor.6:1.12 src/games/factor/factor.6:1.13
--- src/games/factor/factor.6:1.12	Sat May 15 21:22:39 2010
+++ src/games/factor/factor.6	Thu Oct  2 21:36:37 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: factor.6,v 1.12 2010/05/15 21:22:39 joerg Exp $
+.\	$NetBSD: factor.6,v 1.13 2014/10/02 21:36:37 ast Exp $
 .\
 .\ Copyright (c) 1989, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -33,9 +33,7 @@
 .\	@(#)factor.6	8.1 (Berkeley) 5/31/93
 .\
 .\
-.\ By: Landon Curt Noll   cho...@toad.com,   ...!{sun,tolsoft}!hoptoad!chongo
-.\
-.\   chongo for a good prime call: 391581 * 2^216193 - 1 /\oo/\
+.\ By Landon Curt Noll, http://www.isthe.com/chongo/index.html /\oo/\
 .\
 .Dd May 15, 2010
 .Dt FACTOR 6
@@ -88,10 +86,7 @@ is compiled without OpenSSL it is limite
 .Vt unsigned long .
 .Sh DIAGNOSTICS
 Out of range or invalid input results in
-an appropriate error message
-being written to standard error.
-.\.Sh BUGS
-.\.Nm
-.\cannot handle the
-.\.Dq 10 most wanted
-.\factor list.
+an appropriate error message to standard error.
+.Sh AUTHORS
+Originally by
+.An Landon Curt Noll .

Index: src/games/factor/factor.c
diff -u src/games/factor/factor.c:1.26 src/games/factor/factor.c:1.27
--- src/games/factor/factor.c:1.26	Wed Nov  9 20:17:44 2011
+++ src/games/factor/factor.c	Thu Oct  2 21:36:37 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: factor.c,v 1.26 2011/11/09 20:17:44 drochner Exp $	*/
+/*	$NetBSD: factor.c,v 1.27 2014/10/02 21:36:37 ast Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -42,16 +42,14 @@ __COPYRIGHT(@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = @(#)factor.c	8.4 (Berkeley) 5/4/95;
 #else
-__RCSID($NetBSD: factor.c,v 1.26 2011/11/09 20:17:44 drochner Exp $);
+__RCSID($NetBSD: factor.c,v 1.27 2014/10/02 21:36:37 ast Exp $);
 #endif
 #endif /* not lint */
 
 /*
  * factor - factor a number into primes
  *
- * By: Landon Curt Noll   cho...@toad.com,   ...!{sun,tolsoft}!hoptoad!chongo
- *
- *   chongo for a good prime call: 391581 * 2^216193 - 1 /\oo/\
+ * By Landon Curt Noll, http://www.isthe.com/chongo/index.html /\oo/\
  *
  * usage:
  *	factor [number] ...
@@ -72,6 +70,7 @@ __RCSID($NetBSD: factor.c,v 1.26 2011/1
 #include stdio.h
 #include stdlib.h
 #include unistd.h
+#include inttypes.h
 
 #ifdef HAVE_OPENSSL
 #include openssl/bn.h
@@ -93,8 +92,7 @@ static int BN_dec2bn(BIGNUM **a, const c
  * We are able to sieve 2^32-1 because this byte table yields all primes
  * up to 65537 and 65537^2  2^32-1.
  */
-extern const ubig prime[];
-extern const ubig *pr_limit;		/* largest prime in the prime array */
+
 #if 0 /* debugging: limit table use to stress the pollard code */
 #define pr_limit prime[0]
 #endif
@@ -198,7 +196,7 @@ main(int argc, char *argv[])
 static void
 pr_fact(BIGNUM *val)
 {
-	const ubig *fact;		/* The factor 

CVS commit: src/games

2014-10-02 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Thu Oct  2 21:36:37 UTC 2014

Modified Files:
src/games/factor: factor.6 factor.c
src/games/primes: Makefile pattern.c pr_tbl.c primes.6 primes.c
primes.h
Added Files:
src/games/primes: spsp.c

Log Message:
Imported and adapted from FreeBSD svn r272166 and r272207; this fixes
false positives for products of primes larger than 2^16. For example,
before this commit:

  $ /usr/games/primes 4295360521 4295360522
  4295360521
but
  $ /usr/games/factor 4295360521
  4295360521: 65539 65539

or
  $ /usr/games/primes 3825123056546413049 3825123056546413050
  3825123056546413049
yet
  $ /usr/games/factor 3825123056546413049
  3825123056546413049: 165479 23115459100831

or
  $ /usr/games/primes 18446744073709551577
  18446744073709551577
although
  $ /usr/games/factor 18446744073709551577
  18446744073709551577: 139646831 132095686967

Incidentally, the above examples show the smallest and largest cases that
were erroneously stated as prime in the range 2^32 .. 3825123056546413049
.. 2^64; the primes(6) program now stops at 3825123056546413050 as
primality tests on larger integers would be by brute force factorization.

In addition, special to the NetBSD version:
. for -d option, skip first difference when start is 65537 as it is incorrect
. corrected usage to mention both the existing -d as well as the new -h option

For original FreeBSD commit message by Colin Percival, see:
http://svnweb.freebsd.org/base?view=revisionrevision=272166


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/games/factor/factor.6
cvs rdiff -u -r1.26 -r1.27 src/games/factor/factor.c
cvs rdiff -u -r1.7 -r1.8 src/games/primes/Makefile src/games/primes/pr_tbl.c
cvs rdiff -u -r1.6 -r1.7 src/games/primes/pattern.c
cvs rdiff -u -r1.3 -r1.4 src/games/primes/primes.6
cvs rdiff -u -r1.19 -r1.20 src/games/primes/primes.c
cvs rdiff -u -r1.5 -r1.6 src/games/primes/primes.h
cvs rdiff -u -r0 -r1.1 src/games/primes/spsp.c

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



CVS commit: src

2013-10-06 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sun Oct  6 21:05:50 UTC 2013

Modified Files:
src/bin/sh: expand.c
src/tests/bin/sh: t_expand.sh

Log Message:
Fix PR bin/48202 [non-critical/low]:
  sh +nounset and `for X; do` iteration fails if parameter set empty
by applying and testing FreeBSD's patch of Oct 24 2009 for this; see
  http://svnweb.freebsd.org/base/head/bin/sh/expand.c?r1=198453r2=198454
Also created an ATF test in tests/bin/sh/t_expand.sh for this error and
corrected a space-tabs problem there as well.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/bin/sh/expand.c
cvs rdiff -u -r1.1 -r1.2 src/tests/bin/sh/t_expand.sh

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

Modified files:

Index: src/bin/sh/expand.c
diff -u src/bin/sh/expand.c:1.89 src/bin/sh/expand.c:1.90
--- src/bin/sh/expand.c:1.89	Wed Oct  2 19:52:58 2013
+++ src/bin/sh/expand.c	Sun Oct  6 21:05:50 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: expand.c,v 1.89 2013/10/02 19:52:58 christos Exp $	*/
+/*	$NetBSD: expand.c,v 1.90 2013/10/06 21:05:50 ast Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = @(#)expand.c	8.5 (Berkeley) 5/15/95;
 #else
-__RCSID($NetBSD: expand.c,v 1.89 2013/10/02 19:52:58 christos Exp $);
+__RCSID($NetBSD: expand.c,v 1.90 2013/10/06 21:05:50 ast Exp $);
 #endif
 #endif /* not lint */
 
@@ -667,7 +667,7 @@ again: /* jump here after setting a vari
 	varlen = 0;
 	startloc = expdest - stackblock();
 
-	if (!set  uflag) {
+	if (!set  uflag  *var != '@'  *var != '*') {
 		switch (subtype) {
 		case VSNORMAL:
 		case VSTRIMLEFT:

Index: src/tests/bin/sh/t_expand.sh
diff -u src/tests/bin/sh/t_expand.sh:1.1 src/tests/bin/sh/t_expand.sh:1.2
--- src/tests/bin/sh/t_expand.sh:1.1	Sat Mar 17 16:33:11 2012
+++ src/tests/bin/sh/t_expand.sh	Sun Oct  6 21:05:50 2013
@@ -1,4 +1,4 @@
-# $NetBSD: t_expand.sh,v 1.1 2012/03/17 16:33:11 jruoho Exp $
+# $NetBSD: t_expand.sh,v 1.2 2013/10/06 21:05:50 ast Exp $
 #
 # Copyright (c) 2007, 2009 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -37,7 +37,7 @@ delim_argv() {
 		else
 			str=${str} $1
 		fi
-shift
+		shift
 	done
 	echo ${str}
 }
@@ -119,10 +119,24 @@ arithmetic_body() {
 	atf_check_equal '9223372036854775807' '$(((1  63) - 1))'
 }
 
+atf_test_case iteration_on_null_parameter
+iteration_on_null_parameter_head() {
+	atf_set descr Check iteration of \$@ in for loop when set to null; \
+	the error \sh: @: parameter not set\ is incorrect. \
+	PR bin/48202.
+}
+iteration_on_null_parameter_body() {
+	s1=`/bin/sh -uc 'N=; set -- ${N};   for X; do echo [$X]; done' 21`
+	s2=`/bin/sh -uc 'N=; set -- ${N:-}; for X; do echo [$X]; done' 21`
+	atf_check_equal ''   '$s1'
+	atf_check_equal '[]' '$s2'
+}
+
 atf_init_test_cases() {
 	atf_add_test_case dollar_at
 	atf_add_test_case dollar_at_with_text
 	atf_add_test_case strip
 	atf_add_test_case varpattern_backslashes
 	atf_add_test_case arithmetic
+	atf_add_test_case iteration_on_null_parameter
 }



CVS commit: src

2013-10-06 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sun Oct  6 21:05:50 UTC 2013

Modified Files:
src/bin/sh: expand.c
src/tests/bin/sh: t_expand.sh

Log Message:
Fix PR bin/48202 [non-critical/low]:
  sh +nounset and `for X; do` iteration fails if parameter set empty
by applying and testing FreeBSD's patch of Oct 24 2009 for this; see
  http://svnweb.freebsd.org/base/head/bin/sh/expand.c?r1=198453r2=198454
Also created an ATF test in tests/bin/sh/t_expand.sh for this error and
corrected a space-tabs problem there as well.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/bin/sh/expand.c
cvs rdiff -u -r1.1 -r1.2 src/tests/bin/sh/t_expand.sh

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



CVS commit: src/sbin/mount

2013-10-05 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sat Oct  5 08:06:35 UTC 2013

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

Log Message:
No code change: corrected spelling in comment, removed trailing white spaces.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sbin/mount/mount.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/mount/mount.c
diff -u src/sbin/mount/mount.c:1.98 src/sbin/mount/mount.c:1.99
--- src/sbin/mount/mount.c:1.98	Thu Jan 24 17:53:49 2013
+++ src/sbin/mount/mount.c	Sat Oct  5 08:06:35 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount.c,v 1.98 2013/01/24 17:53:49 christos Exp $	*/
+/*	$NetBSD: mount.c,v 1.99 2013/10/05 08:06:35 ast Exp $	*/
 
 /*
  * Copyright (c) 1980, 1989, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = @(#)mount.c	8.25 (Berkeley) 5/8/95;
 #else
-__RCSID($NetBSD: mount.c,v 1.98 2013/01/24 17:53:49 christos Exp $);
+__RCSID($NetBSD: mount.c,v 1.99 2013/10/05 08:06:35 ast Exp $);
 #endif
 #endif /* not lint */
 
@@ -85,7 +85,7 @@ static void	prmount(struct statvfs *);
 __dead static void	usage(void);
 
 
-/* Map from mount otions to printable formats. */
+/* Map from mount options to printable formats. */
 static const struct opt {
 	int o_opt;
 	int o_silent;
@@ -352,7 +352,7 @@ hasopt(const char *mntopts, const char *
 }
 
 static int
-mountfs(const char *vfstype, const char *spec, const char *name, 
+mountfs(const char *vfstype, const char *spec, const char *name,
 int flags, const char *options, const char *mntopts,
 int skipmounted, char *buf, size_t buflen)
 {
@@ -579,7 +579,7 @@ prmount(struct statvfs *sfp)
 	sfp-f_fstypename);
 
 	flags = sfp-f_flag  MNT_VISFLAGMASK;
-	for (f = 0, o = optnames; flags  o  
+	for (f = 0, o = optnames; flags  o 
 	optnames[sizeof(optnames)/sizeof(optnames[0])]; o++)
 		if (flags  o-o_opt) {
 			if (!o-o_silent || verbose)



CVS commit: src/lib/libc/sys

2013-10-05 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sat Oct  5 21:24:36 UTC 2013

Modified Files:
src/lib/libc/sys: utimes.2

Log Message:
Fixed spelling of 'appeared'.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/lib/libc/sys/utimes.2

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

Modified files:

Index: src/lib/libc/sys/utimes.2
diff -u src/lib/libc/sys/utimes.2:1.39 src/lib/libc/sys/utimes.2:1.40
--- src/lib/libc/sys/utimes.2:1.39	Sat Sep 14 10:41:18 2013
+++ src/lib/libc/sys/utimes.2	Sat Oct  5 21:24:36 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: utimes.2,v 1.39 2013/09/14 10:41:18 njoly Exp $
+.\	$NetBSD: utimes.2,v 1.40 2013/10/05 21:24:36 ast Exp $
 .\
 .\ Copyright (c) 1990, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -302,5 +302,5 @@ Birthtime setting support was added in
 .Fn futimens
 and
 .Fn utimensat
-functions calls appreared in
+functions calls appeared in
 .Nx 6.0 .



CVS commit: src/sbin/mount

2013-10-05 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sat Oct  5 08:06:35 UTC 2013

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

Log Message:
No code change: corrected spelling in comment, removed trailing white spaces.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sbin/mount/mount.c

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



CVS commit: src/lib/libc/sys

2013-10-05 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sat Oct  5 21:24:36 UTC 2013

Modified Files:
src/lib/libc/sys: utimes.2

Log Message:
Fixed spelling of 'appeared'.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/lib/libc/sys/utimes.2

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



CVS commit: src/distrib/utils/embedded/conf

2013-09-16 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Mon Sep 16 15:23:57 UTC 2013

Modified Files:
src/distrib/utils/embedded/conf: beagleboard.conf rpi.conf
rpi_inst.conf

Log Message:
After discussions with cristos regarding the previous commit, he
convinced me it was sufficient to define GZIP_CMD only in
distrib/utils/embedded/mkimage and not again in the config files
beagleboard.conf, rpi.conf, and rpi_inst.conf similar to how the
other variables $src, $release, $mnt, ... are only defined there.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/distrib/utils/embedded/conf/beagleboard.conf
cvs rdiff -u -r1.22 -r1.23 src/distrib/utils/embedded/conf/rpi.conf
cvs rdiff -u -r1.3 -r1.4 src/distrib/utils/embedded/conf/rpi_inst.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/beagleboard.conf
diff -u src/distrib/utils/embedded/conf/beagleboard.conf:1.16 src/distrib/utils/embedded/conf/beagleboard.conf:1.17
--- src/distrib/utils/embedded/conf/beagleboard.conf:1.16	Sat Sep 14 12:51:27 2013
+++ src/distrib/utils/embedded/conf/beagleboard.conf	Mon Sep 16 15:23:57 2013
@@ -1,10 +1,8 @@
-# $NetBSD: beagleboard.conf,v 1.16 2013/09/14 12:51:27 ast Exp $
+# $NetBSD: beagleboard.conf,v 1.17 2013/09/16 15:23:57 ast Exp $
 # BeagleBoard customization script used by mkimage
 #
 board=beagleboard
 
-GZIP_CMD=${TOOL_GZIP:-gzip} # ${GZIP} is special to gzip(1)
-
 . ${DIR}/conf/evbarm.conf
 
 bboard_kernelimg=bboard.ub

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.22 src/distrib/utils/embedded/conf/rpi.conf:1.23
--- src/distrib/utils/embedded/conf/rpi.conf:1.22	Sat Sep 14 12:51:27 2013
+++ src/distrib/utils/embedded/conf/rpi.conf	Mon Sep 16 15:23:57 2013
@@ -1,12 +1,10 @@
-# $NetBSD: rpi.conf,v 1.22 2013/09/14 12:51:27 ast Exp $
+# $NetBSD: rpi.conf,v 1.23 2013/09/16 15:23:57 ast Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
 board=rpi
 kernel=$src/sys/arch/evbarm/compile/RPI/netbsd-RPI.bin
 
-GZIP_CMD=${TOOL_GZIP:-gzip} # ${GZIP} is special to gzip(1)
-
 . ${DIR}/conf/evbarm.conf
 
 firmwaredir=$src/external/broadcom/rpi-firmware/dist

Index: src/distrib/utils/embedded/conf/rpi_inst.conf
diff -u src/distrib/utils/embedded/conf/rpi_inst.conf:1.3 src/distrib/utils/embedded/conf/rpi_inst.conf:1.4
--- src/distrib/utils/embedded/conf/rpi_inst.conf:1.3	Sat Sep 14 12:51:27 2013
+++ src/distrib/utils/embedded/conf/rpi_inst.conf	Mon Sep 16 15:23:57 2013
@@ -1,12 +1,10 @@
-# $NetBSD: rpi_inst.conf,v 1.3 2013/09/14 12:51:27 ast Exp $
+# $NetBSD: rpi_inst.conf,v 1.4 2013/09/16 15:23:57 ast Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
 board=rpi_inst
 kernel=$src/sys/arch/evbarm/compile/RPI/netbsd-RPI_INSTALL.bin
 
-GZIP_CMD=${TOOL_GZIP:-gzip} # ${GZIP} is special to gzip(1)
-
 image=$HOME/${board}.img
 
 specialdirs=/kern /proc



CVS commit: src/distrib/utils/embedded/conf

2013-09-16 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Mon Sep 16 15:23:57 UTC 2013

Modified Files:
src/distrib/utils/embedded/conf: beagleboard.conf rpi.conf
rpi_inst.conf

Log Message:
After discussions with cristos regarding the previous commit, he
convinced me it was sufficient to define GZIP_CMD only in
distrib/utils/embedded/mkimage and not again in the config files
beagleboard.conf, rpi.conf, and rpi_inst.conf similar to how the
other variables $src, $release, $mnt, ... are only defined there.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/distrib/utils/embedded/conf/beagleboard.conf
cvs rdiff -u -r1.22 -r1.23 src/distrib/utils/embedded/conf/rpi.conf
cvs rdiff -u -r1.3 -r1.4 src/distrib/utils/embedded/conf/rpi_inst.conf

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



Re: CVS commit: src/distrib/utils/embedded

2013-09-15 Thread Adrian Steinmann
On Sun, Sep 15, 2013 at 01:26:51PM +, Christos Zoulas wrote:
 In article 20130914125127.7648...@cvs.netbsd.org,
 Adrian Steinmann source-changes-d@NetBSD.org wrote:
 
 1. This is useless in the .conf files since mkimage sets it alreay.
 +GZIP_CMD=${TOOL_GZIP:-gzip} # ${GZIP} is special to gzip(1)
Well yes, but it is not said that this config file might eventually
be pulled in by something else not defining TOOL_GZIP. I could have
indeed left the naked gzip in there, but I would think that when
TOOL_GZIP is defined, it is what should be used.  In other words,
I thought about it a bit and found this to be the best choice.

 2. You might as well rename the rest of the variables _CMD for conistency.
I used distrib/sets/sets.subr as an example, which does this:

: ${AWK:=awk}
: ${CKSUM:=cksum}
: ${COMM:=comm}
: ${DATE:=date}
: ${DB:=db}
: ${EGREP:=egrep}
: ${ENV_CMD:=env}   # ${ENV} is special to sh(1), ksh(1), etc.
: ${FGREP:=fgrep}
: ${FIND:=find}
: ${GREP:=grep}
: ${GZIP_CMD:=gzip} # ${GZIP} is special to gzip(1)
: ${HOSTNAME_CMD:=hostname} # ${HOSTNAME} is special to bash(1)
: ${HOST_SH:=sh}
: ${IDENT:=ident}
: ${JOIN:=join}
: ${LS:=ls}
: ${MAKE:=make}
: ${MKTEMP:=mktemp}
: ${MTREE:=mtree}
: ${PASTE:=paste}
: ${PAX:=pax}
: ${PRINTF:=printf}
: ${SED:=sed}
: ${SORT:=sort}
: ${STAT:=stat}
: ${TSORT:=tsort}
: ${UNAME:=uname}
: ${WC:=wc}
: ${XARGS:=xargs}

Ast


Re: CVS commit: src/distrib/utils/embedded

2013-09-15 Thread Adrian Steinmann
On Sun, Sep 15, 2013 at 02:05:59PM -0400, Christos Zoulas wrote:
 On Sep 15,  5:59pm, a...@netbsd.org (Adrian Steinmann) wrote:
 -- Subject: Re: CVS commit: src/distrib/utils/embedded
 
 | On Sun, Sep 15, 2013 at 01:26:51PM +, Christos Zoulas wrote:
 |  In article 20130914125127.7648...@cvs.netbsd.org,
 |  Adrian Steinmann source-changes-d@NetBSD.org wrote:
 |  
 |  1. This is useless in the .conf files since mkimage sets it alreay.
 |  +GZIP_CMD=${TOOL_GZIP:-gzip} # ${GZIP} is special to gzip(1)
 | Well yes, but it is not said that this config file might eventually
 | be pulled in by something else not defining TOOL_GZIP. I could have
 | indeed left the naked gzip in there, but I would think that when
 | TOOL_GZIP is defined, it is what should be used.  In other words,
 | I thought about it a bit and found this to be the best choice.
 
 Yes, so go ahead and define all the other variables those scripts
 assume that are set, like release srcs etc. Preferably with a
 different definition than the one we have in mkimage to make
 debugging more interesting. There is a reason those are called .conf;
 they are not and they were not meant to be standalone -- by design.
 Duplicating definitions should be always the solution of last resort.

So you're suggesting I remove the

GZIP_CMD=${TOOL_GZIP:-gzip} # ${GZIP} is special to gzip(1)

line and just use

${TOOL_GZIP} -dc ${bbone_kernel}  ${mnt}/boot/${bbone_kernelimg}

further below in beagleboard.conf, rpi.conf, and rpi_inst.conf ?

By that logic we should have also used ${TOOL_GZIP} for gzip instead
of the ${GZIP} indirection in mkimage which started this thread and
was actually causing a problem.

Tell me what you think is best.

Thanks
Ast


CVS commit: src/distrib/utils/embedded

2013-09-14 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sat Sep 14 12:51:27 UTC 2013

Modified Files:
src/distrib/utils/embedded: mkimage
src/distrib/utils/embedded/conf: beagleboard.conf rpi.conf
rpi_inst.conf

Log Message:
Fix build release of evbarm which had been failing in mkimage
beagleboard_smp with the elusive message:

gzip: can't stat: gzip: No such file or directory

This was due to GZIP=gzip being defined in mkimage; we now use:

GZIP_CMD=${TOOL_GZIP:-gzip} # ${GZIP} is special to gzip(1)

as distrib/sets/sets.subr already does in these files as well:

distrib/utils/embedded/mkimage
distrib/utils/embedded/conf/beagleboard.conf
distrib/utils/embedded/conf/rpi.conf
distrib/utils/embedded/conf/rpi_inst.conf


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/distrib/utils/embedded/mkimage
cvs rdiff -u -r1.15 -r1.16 src/distrib/utils/embedded/conf/beagleboard.conf
cvs rdiff -u -r1.21 -r1.22 src/distrib/utils/embedded/conf/rpi.conf
cvs rdiff -u -r1.2 -r1.3 src/distrib/utils/embedded/conf/rpi_inst.conf

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.43 src/distrib/utils/embedded/mkimage:1.44
--- src/distrib/utils/embedded/mkimage:1.43	Thu Jun 27 14:51:30 2013
+++ src/distrib/utils/embedded/mkimage	Sat Sep 14 12:51:27 2013
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.43 2013/06/27 14:51:30 christos Exp $
+# $NetBSD: mkimage,v 1.44 2013/09/14 12:51:27 ast Exp $
 #
 # Copyright (c) 2013 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -39,9 +39,9 @@ PROG=$(basename $0)
 
 DISKLABEL=${TOOL_DISKLABEL:-disklabel}
 FDISK=${TOOL_FDISK:-fdisk}
-GZIP=${TOOL_GZIP:-gzip}
 MAKEFS=${TOOL_MAKEFS:-makefs}
 MTREE=${TOOL_MTREE:-mtree}
+GZIP_CMD=${TOOL_GZIP:-gzip} # ${GZIP} is special to gzip(1)
 
 src=/usr/src
 release=/usr/obj/evbarm/release
@@ -200,7 +200,7 @@ fi
 if $compress; then
 	echo ${bar} Compressing image ${bar}
 	rm -f ${image}.gz
-	${GZIP} -9 ${image}
+	${GZIP_CMD} -9 ${image}
 	image=${image}.gz
 fi
 

Index: src/distrib/utils/embedded/conf/beagleboard.conf
diff -u src/distrib/utils/embedded/conf/beagleboard.conf:1.15 src/distrib/utils/embedded/conf/beagleboard.conf:1.16
--- src/distrib/utils/embedded/conf/beagleboard.conf:1.15	Wed Aug 21 22:52:28 2013
+++ src/distrib/utils/embedded/conf/beagleboard.conf	Sat Sep 14 12:51:27 2013
@@ -1,8 +1,10 @@
-# $NetBSD: beagleboard.conf,v 1.15 2013/08/21 22:52:28 jmcneill Exp $
+# $NetBSD: beagleboard.conf,v 1.16 2013/09/14 12:51:27 ast Exp $
 # BeagleBoard customization script used by mkimage
 #
 board=beagleboard
 
+GZIP_CMD=${TOOL_GZIP:-gzip} # ${GZIP} is special to gzip(1)
+
 . ${DIR}/conf/evbarm.conf
 
 bboard_kernelimg=bboard.ub
@@ -48,7 +50,7 @@ EOF
 	echo ${bar} installing ${bboard_kernel} to /boot/${bboard_kernelimg} ${bar}
 	case ${bboard_kernel} in
 	*.gz)
-		gzip -dc ${bboard_kernel}  ${mnt}/boot/${bboard_kernelimg}
+		${GZIP_CMD} -dc ${bboard_kernel}  ${mnt}/boot/${bboard_kernelimg}
 		;;
 	*)
 		cp ${bboard_kernel} ${mnt}/boot/${bboard_kernelimg}
@@ -58,7 +60,7 @@ EOF
 	echo ${bar} installing ${bbone_kernel} to /boot/${bbone_kernelimg} ${bar}
 	case ${bbone_kernel} in
 	*.gz)
-		gzip -dc ${bbone_kernel}  ${mnt}/boot/${bbone_kernelimg}
+		${GZIP_CMD} -dc ${bbone_kernel}  ${mnt}/boot/${bbone_kernelimg}
 		;;
 	*)
 		cp ${bbone_kernel} ${mnt}/boot/${bbone_kernelimg}

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.21 src/distrib/utils/embedded/conf/rpi.conf:1.22
--- src/distrib/utils/embedded/conf/rpi.conf:1.21	Thu Aug  1 10:45:21 2013
+++ src/distrib/utils/embedded/conf/rpi.conf	Sat Sep 14 12:51:27 2013
@@ -1,10 +1,12 @@
-# $NetBSD: rpi.conf,v 1.21 2013/08/01 10:45:21 jmcneill Exp $
+# $NetBSD: rpi.conf,v 1.22 2013/09/14 12:51:27 ast Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
 board=rpi
 kernel=$src/sys/arch/evbarm/compile/RPI/netbsd-RPI.bin
 
+GZIP_CMD=${TOOL_GZIP:-gzip} # ${GZIP} is special to gzip(1)
+
 . ${DIR}/conf/evbarm.conf
 
 firmwaredir=$src/external/broadcom/rpi-firmware/dist

Index: src/distrib/utils/embedded/conf/rpi_inst.conf
diff -u src/distrib/utils/embedded/conf/rpi_inst.conf:1.2 src/distrib/utils/embedded/conf/rpi_inst.conf:1.3
--- src/distrib/utils/embedded/conf/rpi_inst.conf:1.2	Wed Mar 20 14:47:20 2013
+++ src/distrib/utils/embedded/conf/rpi_inst.conf	Sat Sep 14 12:51:27 2013
@@ -1,10 +1,12 @@
-# $NetBSD: rpi_inst.conf,v 1.2 2013/03/20 14:47:20 garbled Exp $
+# $NetBSD: rpi_inst.conf,v 1.3 2013/09/14 12:51:27 ast Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
 board=rpi_inst
 kernel=$src/sys/arch/evbarm/compile/RPI/netbsd-RPI_INSTALL.bin
 
+GZIP_CMD=${TOOL_GZIP:-gzip} # ${GZIP} is special to gzip(1)
+
 image=$HOME/${board}.img
 
 specialdirs=/kern /proc
@@ -105,7 +107,7 @@ EOF
 	echo ${bar} installing 

CVS commit: src/distrib/utils/embedded

2013-09-14 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sat Sep 14 12:51:27 UTC 2013

Modified Files:
src/distrib/utils/embedded: mkimage
src/distrib/utils/embedded/conf: beagleboard.conf rpi.conf
rpi_inst.conf

Log Message:
Fix build release of evbarm which had been failing in mkimage
beagleboard_smp with the elusive message:

gzip: can't stat: gzip: No such file or directory

This was due to GZIP=gzip being defined in mkimage; we now use:

GZIP_CMD=${TOOL_GZIP:-gzip} # ${GZIP} is special to gzip(1)

as distrib/sets/sets.subr already does in these files as well:

distrib/utils/embedded/mkimage
distrib/utils/embedded/conf/beagleboard.conf
distrib/utils/embedded/conf/rpi.conf
distrib/utils/embedded/conf/rpi_inst.conf


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/distrib/utils/embedded/mkimage
cvs rdiff -u -r1.15 -r1.16 src/distrib/utils/embedded/conf/beagleboard.conf
cvs rdiff -u -r1.21 -r1.22 src/distrib/utils/embedded/conf/rpi.conf
cvs rdiff -u -r1.2 -r1.3 src/distrib/utils/embedded/conf/rpi_inst.conf

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



Re: CVS commit: src/usr.sbin/postinstall

2012-09-22 Thread Adrian Steinmann
On Sat, Sep 22, 2012 at 12:33:03PM -0700, Jeff Rizzo wrote:
 On 9/22/12 2:20 AM, Adrian Steinmann wrote:
  Module Name:src
  Committed By:   ast
  Date:   Sat Sep 22 09:20:07 UTC 2012
 
  Modified Files:
  src/usr.sbin/postinstall: postinstall
 
  Log Message:
  Make sure that the to fix, run: ... instructions actually work 
  cut-and-paste
  By default postinstall has mode 644 so /bin/sh or similar needs to be 
  prepended
 
 
 Um, /usr/sbin/postinstall is 555 by default.  :)  I don't know that we 
 need to cater to uninstalled versions in the instructions.

Yes, it is installed with mode 555 in /usr/sbin/postinstall *but*
if one uses the src tarballs and then runs build.ch install=/ it
uses the /usr/src/...  postinstall (which is 755 from the CVS repo,
but 644 from the src.tgz) The maybe not-so-rare edge case when one
build from src.tgz instead of CVS thus issues faulty instructions.

That /usr/src/.../postinstall is used can be seen in /usr/src/Makefile:

_POSTINSTALL=   ${.CURDIR}/usr.sbin/postinstall/postinstall
_POSTINSTALL_ENV= \
AWK=${TOOL_AWK:Q}   \
DB=${TOOL_DB:Q} \
HOST_SH=${HOST_SH:Q}\
MAKE=${MAKE:Q}  \
PWD_MKDB=${TOOL_PWD_MKDB:Q} \
STAT=${TOOL_STAT:Q} 

postinstall-check: .PHONY
@echo=== Post installation checks ===
${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDI
R}/ check; if [ $$? -gt 1 ]; then exit 1; fi
@echo

postinstall-fix: .NOTMAIN .PHONY 
@echo=== Post installation fixes ===
${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDI
R}/ fix
@echo===


BTW, this is the diff, it is a here-is message:

RCS file: /cvsroot/src/usr.sbin/postinstall/postinstall,v
 ${0} ${SRC_ARGLIST} -d ${DEST_DIR:-/}$m fix${items_failed}
---
 ${HOST_SH} ${0} ${SRC_ARGLIST} -d ${DEST_DIR:-/}$m fix${items_failed}

Ast


CVS commit: src/usr.sbin/postinstall

2012-09-22 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sat Sep 22 09:20:07 UTC 2012

Modified Files:
src/usr.sbin/postinstall: postinstall

Log Message:
Make sure that the to fix, run: ... instructions actually work cut-and-paste
By default postinstall has mode 644 so /bin/sh or similar needs to be prepended


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/usr.sbin/postinstall/postinstall

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/postinstall/postinstall
diff -u src/usr.sbin/postinstall/postinstall:1.146 src/usr.sbin/postinstall/postinstall:1.147
--- src/usr.sbin/postinstall/postinstall:1.146	Wed Aug 15 16:21:41 2012
+++ src/usr.sbin/postinstall/postinstall	Sat Sep 22 09:20:06 2012
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.146 2012/08/15 16:21:41 apb Exp $
+# $NetBSD: postinstall,v 1.147 2012/09/22 09:20:06 ast Exp $
 #
 # Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -2069,7 +2069,7 @@ main()
 			[ $MACHINE = $(uname -m) ]  m= || m= -m $MACHINE
 			cat _Fix_me_
 To fix, run:
-${0} ${SRC_ARGLIST} -d ${DEST_DIR:-/}$m fix${items_failed}
+${HOST_SH} ${0} ${SRC_ARGLIST} -d ${DEST_DIR:-/}$m fix${items_failed}
 Note that this may overwrite local changes.
 _Fix_me_
 		fi



CVS commit: src/usr.sbin/postinstall

2012-09-22 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sat Sep 22 09:20:07 UTC 2012

Modified Files:
src/usr.sbin/postinstall: postinstall

Log Message:
Make sure that the to fix, run: ... instructions actually work cut-and-paste
By default postinstall has mode 644 so /bin/sh or similar needs to be prepended


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/usr.sbin/postinstall/postinstall

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



CVS commit: src/usr.sbin/installboot

2012-02-10 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sat Feb 11 07:27:25 UTC 2012

Modified Files:
src/usr.sbin/installboot: installboot.8

Log Message:
Use NetBSD 6.0 and not NetBSD 6 and sound less like a broken record.
Add note where the actual example is because that's where it's expected.
Part of earlier commit ok-ed by releng@


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/usr.sbin/installboot/installboot.8

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/installboot/installboot.8
diff -u src/usr.sbin/installboot/installboot.8:1.83 src/usr.sbin/installboot/installboot.8:1.84
--- src/usr.sbin/installboot/installboot.8:1.83	Fri Feb 10 16:25:47 2012
+++ src/usr.sbin/installboot/installboot.8	Sat Feb 11 07:27:25 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: installboot.8,v 1.83 2012/02/10 16:25:47 wiz Exp $
+.\	$NetBSD: installboot.8,v 1.84 2012/02/11 07:27:25 ast Exp $
 .\
 .\ Copyright (c) 2002-2012 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd February 9, 2012
+.Dd February 11, 2012
 .Dt INSTALLBOOT 8
 .Os
 .Sh NAME
@@ -460,9 +460,8 @@ Primary bootstrap for
 file systems
 (the
 .Ql traditional
-.Nx
 file system prior to
-.Nx 6 ) .
+.Nx 6.0 ) .
 Use
 .Xr dumpfs 8
 to confirm the file system format is
@@ -472,7 +471,7 @@ to confirm the file system format is
 Primary bootstrap for
 .Sy FFSv2
 file systems (the default file system for some platforms as of
-.Nx 6 ) .
+.Nx 6.0 ) .
 Use
 .Xr dumpfs 8
 to confirm the file system format is
@@ -634,7 +633,16 @@ setting the timeout to five seconds, aft
 bootstrap:
 .Dl Ic cp /usr/mdec/boot /boot
 .Dl Ic installboot -v -o timeout=5 /dev/rwd0a /usr/mdec/bootxx_ffsv2
-.
+.Bd -ragged -offset indent-two -compact
+.Em Note :
+Pre
+.Nx 6.0
+systems used
+.Sy FFSv1
+file systems on these platforms; double check with
+.Xr dumpfs 8
+to be sure to use the correct secondary bootstrap.
+.Ed
 .Pp
 Create a bootable CD-ROM with an ISO 9660
 file system for an i386 system with a serial console:



CVS commit: src/usr.sbin/installboot

2012-02-10 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Sat Feb 11 07:27:25 UTC 2012

Modified Files:
src/usr.sbin/installboot: installboot.8

Log Message:
Use NetBSD 6.0 and not NetBSD 6 and sound less like a broken record.
Add note where the actual example is because that's where it's expected.
Part of earlier commit ok-ed by releng@


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/usr.sbin/installboot/installboot.8

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



CVS commit: src

2012-02-09 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Thu Feb  9 18:35:44 UTC 2012

Modified Files:
src/distrib/utils/sysinst/arch/amd64: md.h
src/usr.sbin/installboot: installboot.8

Log Message:
Update the amd64 and i386 examples to use /usr/mdec/bootxx_ffsv2,
i.e. DEFAULT_UFS2 as src/distrib/utils/sysinst/bsddisklabel.c does
since post-NetBSD5.  This avoids rendering an i386 or amd64 system
unbootable if the given example is thoughtlessly cut-and-pasted on
a NetBSD6.x system (been there, done that ;-) Qualify the descriptions
of /usr/mdec/bootxx_ffsv{1,2} along those lines.

Fixed a small typo in comment of distrib/utils/sysinst/arch/amd64/md.h.

Ok by releng@


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/distrib/utils/sysinst/arch/amd64/md.h
cvs rdiff -u -r1.81 -r1.82 src/usr.sbin/installboot/installboot.8

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

Modified files:

Index: src/distrib/utils/sysinst/arch/amd64/md.h
diff -u src/distrib/utils/sysinst/arch/amd64/md.h:1.27 src/distrib/utils/sysinst/arch/amd64/md.h:1.28
--- src/distrib/utils/sysinst/arch/amd64/md.h:1.27	Mon Apr  4 08:30:17 2011
+++ src/distrib/utils/sysinst/arch/amd64/md.h	Thu Feb  9 18:35:44 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.27 2011/04/04 08:30:17 mbalmer Exp $	*/
+/*	$NetBSD: md.h,v 1.28 2012/02/09 18:35:44 ast Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -55,7 +55,7 @@
 /* use UFS2 by default for ffs */
 #define	DEFAULT_UFS2
 
-/* have support for booting form UFS2 */
+/* have support for booting from UFS2 */
 #define	HAVE_UFS2_BOOT
 
 /* allow using tmpfs for /tmp instead of mfs */

Index: src/usr.sbin/installboot/installboot.8
diff -u src/usr.sbin/installboot/installboot.8:1.81 src/usr.sbin/installboot/installboot.8:1.82
--- src/usr.sbin/installboot/installboot.8:1.81	Mon Jan  9 19:40:09 2012
+++ src/usr.sbin/installboot/installboot.8	Thu Feb  9 18:35:44 2012
@@ -1,6 +1,6 @@
-.\	$NetBSD: installboot.8,v 1.81 2012/01/09 19:40:09 skrll Exp $
+.\	$NetBSD: installboot.8,v 1.82 2012/02/09 18:35:44 ast Exp $
 .\
-.\ Copyright (c) 2002-2009 The NetBSD Foundation, Inc.
+.\ Copyright (c) 2002-2012 The NetBSD Foundation, Inc.
 .\ All rights reserved.
 .\
 .\ This code is derived from software contributed to The NetBSD Foundation
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd January 9, 2012
+.Dd February 9, 2012
 .Dt INSTALLBOOT 8
 .Os
 .Sh NAME
@@ -458,9 +458,12 @@ to get the media and filesytem propertie
 Primary bootstrap for
 .Sy FFSv1
 file systems
-(the traditional
+(the 
+.Ql traditional
 .Nx
-file system).
+file system prior to
+.Nx
+6).
 Use
 .Xr dumpfs 8
 to confirm the file system format is
@@ -469,7 +472,9 @@ to confirm the file system format is
 .It Pa /usr/mdec/bootxx_ffsv2
 Primary bootstrap for
 .Sy FFSv2
-file systems.
+file systems (the default file system for some platforms as of
+.Nx
+6).
 Use
 .Xr dumpfs 8
 to confirm the file system format is
@@ -623,12 +628,14 @@ already present in the SysVBFS partition
 .Dl Ic installboot /dev/rsd0c /usr/mdec/bootxx_bfs
 .
 .Ss Nx Ns Tn /i386 and Nx Ns Tn /amd64
-Install new boot blocks on an existing mounted root file system on
+Install new boot blocks on an existing
+.Sy FFSv2
+mounted root file system on
 .Sq wd0 ,
 setting the timeout to five seconds, after copying a new secondary
 bootstrap:
 .Dl Ic cp /usr/mdec/boot /boot
-.Dl Ic installboot -v -o timeout=5 /dev/rwd0a /usr/mdec/bootxx_ffsv1
+.Dl Ic installboot -v -o timeout=5 /dev/rwd0a /usr/mdec/bootxx_ffsv2
 .
 .Pp
 Create a bootable CD-ROM with an ISO 9660



CVS commit: src

2012-02-09 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Thu Feb  9 18:35:44 UTC 2012

Modified Files:
src/distrib/utils/sysinst/arch/amd64: md.h
src/usr.sbin/installboot: installboot.8

Log Message:
Update the amd64 and i386 examples to use /usr/mdec/bootxx_ffsv2,
i.e. DEFAULT_UFS2 as src/distrib/utils/sysinst/bsddisklabel.c does
since post-NetBSD5.  This avoids rendering an i386 or amd64 system
unbootable if the given example is thoughtlessly cut-and-pasted on
a NetBSD6.x system (been there, done that ;-) Qualify the descriptions
of /usr/mdec/bootxx_ffsv{1,2} along those lines.

Fixed a small typo in comment of distrib/utils/sysinst/arch/amd64/md.h.

Ok by releng@


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/distrib/utils/sysinst/arch/amd64/md.h
cvs rdiff -u -r1.81 -r1.82 src/usr.sbin/installboot/installboot.8

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



CVS commit: src/distrib/notes/common

2012-01-04 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Thu Jan  5 05:48:28 UTC 2012

Modified Files:
src/distrib/notes/common: main

Log Message:
Add ast@ to the list of NetBSD developers.


To generate a diff of this commit:
cvs rdiff -u -r1.482 -r1.483 src/distrib/notes/common/main

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.482 src/distrib/notes/common/main:1.483
--- src/distrib/notes/common/main:1.482	Tue Nov  1 02:04:43 2011
+++ src/distrib/notes/common/main	Thu Jan  5 05:48:27 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: main,v 1.482 2011/11/01 02:04:43 tcort Exp $
+.\	$NetBSD: main,v 1.483 2012/01/05 05:48:27 ast Exp $
 .\
 .\ Copyright (c) 1999-2008 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -1340,6 +1340,7 @@ If you're one of them, and would like to
 .It Ta T K Spindler Ta Mt dog...@netbsd.org
 .It Ta Matthew Sporleder Ta Mt m...@netbsd.org
 .It Ta Bill Squier Ta Mt g...@netbsd.org
+.It Ta Adrian Steinmann Ta Mt a...@netbsd.org
 .It Ta Bill Studenmund Ta Mt wrstu...@netbsd.org
 .It Ta Kevin Sullivan Ta Mt sulli...@netbsd.org
 .It Ta Kimmo Suominen Ta Mt k...@netbsd.org



CVS commit: src/distrib/notes/common

2012-01-04 Thread Adrian Steinmann
Module Name:src
Committed By:   ast
Date:   Thu Jan  5 05:48:28 UTC 2012

Modified Files:
src/distrib/notes/common: main

Log Message:
Add ast@ to the list of NetBSD developers.


To generate a diff of this commit:
cvs rdiff -u -r1.482 -r1.483 src/distrib/notes/common/main

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