From b8aadb85d5f1eabddb64eb1c073553c22040be97 Mon Sep 17 00:00:00 2001 From: abial Date: Tue, 15 Sep 1998 07:35:58 +0000 Subject: Change name of 'dm' to 'msg'. As Bruce noticed, it conflicts with dungeon master, if anyone would like to play it on picobsd floppy... :-) Noticed by: bde --- release/picobsd/isp/crunch1/crunch.conf | 6 +-- release/picobsd/net/crunch1/crunch.conf | 6 +-- release/picobsd/router/crunch1/crunch.conf | 25 ++-------- release/picobsd/tinyware/dm/README | 15 ------ release/picobsd/tinyware/dm/dm.c | 74 ------------------------------ release/picobsd/tinyware/msg/Makefile | 9 ++++ release/picobsd/tinyware/msg/README | 15 ++++++ release/picobsd/tinyware/msg/msg.c | 74 ++++++++++++++++++++++++++++++ 8 files changed, 108 insertions(+), 116 deletions(-) delete mode 100644 release/picobsd/tinyware/dm/README delete mode 100644 release/picobsd/tinyware/dm/dm.c create mode 100644 release/picobsd/tinyware/msg/Makefile create mode 100644 release/picobsd/tinyware/msg/README create mode 100644 release/picobsd/tinyware/msg/msg.c diff --git a/release/picobsd/isp/crunch1/crunch.conf b/release/picobsd/isp/crunch1/crunch.conf index 2e57298..78dc2c7 100644 --- a/release/picobsd/isp/crunch1/crunch.conf +++ b/release/picobsd/isp/crunch1/crunch.conf @@ -1,5 +1,5 @@ # -# $Id: crunch.conf,v 1.1.1.1 1998/08/27 17:38:42 abial Exp $ +# $Id: crunch.conf,v 1.2 1998/09/14 20:39:16 abial Exp $ # # NOTE: the string "/usr/src" will be automatically replaced with the # correct value set in 'build' script - you should change it there @@ -24,7 +24,7 @@ srcdirs /usr/src/usr.sbin srcdirs /usr/src/libexec progs ash test echo hostname ln login getty -progs inetd telnetd stty w dm kget snmpd natd +progs inetd telnetd stty w msg kget snmpd natd progs init fsck ifconfig df ps ns vm cat progs cp rm mkdir ls chmod chown progs sysctl route swapon pwd_mkdb dev_mkdb @@ -47,7 +47,7 @@ ln chown chgrp ln mount_msdos msdos ln mount_std procfs ln mount_std mount_procfs -ln dm dmesg +ln msg dmesg ln ns netstat # For snmpd diff --git a/release/picobsd/net/crunch1/crunch.conf b/release/picobsd/net/crunch1/crunch.conf index 6a94c42..9c1c4f8 100644 --- a/release/picobsd/net/crunch1/crunch.conf +++ b/release/picobsd/net/crunch1/crunch.conf @@ -1,5 +1,5 @@ # -# $Id: crunch.conf,v 1.1.1.1 1998/08/27 17:38:43 abial Exp $ +# $Id: crunch.conf,v 1.2 1998/09/14 20:39:24 abial Exp $ # # NOTE: the string "/usr/src" will be automatically replaced with the # correct value set in 'build' script - you should change it there @@ -24,7 +24,7 @@ srcdirs /usr/src/usr.sbin srcdirs /usr/src/libexec progs ash test echo hostname ln login getty stty -progs inetd telnetd w dm kget snmpd +progs inetd telnetd w msg kget snmpd progs init ifconfig df sps ns vm cat progs cp rm mknod chmod chown mkdir ls syslogd progs sysctl route pwd_mkdb dev_mkdb @@ -46,7 +46,7 @@ ln mount_msdos msdos ln mount_std procfs ln mount_std mount_procfs ln sps ps -ln dm dmesg +ln msg dmesg ln ns netstat ln chown chgrp diff --git a/release/picobsd/router/crunch1/crunch.conf b/release/picobsd/router/crunch1/crunch.conf index b6dfa31..967f5ae 100644 --- a/release/picobsd/router/crunch1/crunch.conf +++ b/release/picobsd/router/crunch1/crunch.conf @@ -1,19 +1,11 @@ # -# $Id: crunch.conf,v 1.1.1.1 1998/08/27 17:38:44 abial Exp $ +# $Id: crunch.conf,v 1.2 1998/09/14 20:39:34 abial Exp $ # # NOTE: the string "/usr/src" will be automatically replaced with the # correct value set in 'build' script - you should change it there # sources for kget & vm srcdirs ../../tinyware -# sources for ucd-snmp - they must be already patched & configured! -# The necessary steps are given below: -# * you have to symlink subdirectory agent -> snmpd -# * you have to properly construct an OBJS variable in snmpd/Makefile: -# OBJS=${MIBOBJS} ${AGENTOBJS} -# * we install a special version of MIB files - stripped of comments and -# descriptions. These MIBs are included here to save you the stripping. -#srcdirs /usr/ports/net/ucd-snmp/work/ucd-snmp-3.3.1 # other sources srcdirs /usr/src/bin srcdirs /usr/src/sbin/i386 @@ -24,12 +16,11 @@ srcdirs /usr/src/usr.sbin srcdirs /usr/src/libexec progs hostname cat kget -progs oinit ifconfig df sps ns vm dm -progs cp rm ls #syslogd +progs oinit ifconfig df sps ns vm msg +progs cp rm ls progs sysctl route progs mount umount progs kill natd -#progs mount_std snmpd progs pppd more progs ping traceroute routed ipfw @@ -39,18 +30,10 @@ progs ping traceroute routed ipfw #ln test [ #ln ash -sh #ln ash sh -# XXX Why? Some bug in crunchgen? -#ln newfs mfs -#ln mount_msdos msdos -#ln mount_std procfs -#ln mount_std mount_procfs ln sps ps ln ns netstat -ln dm dmesg -#ln chown chgrp +ln msg dmesg -# For snmpd -#libs /usr/ports/net/ucd-snmp/work/ucd-snmp-3.3.1/snmplib/libsnmp.a libs -lncurses -lmytinfo -lipx -lz -lpcap -lalias libs -ledit -lutil -lmd -lcrypt -lmp -lgmp -lm -lkvm libs -lgnuregex -ltelnet diff --git a/release/picobsd/tinyware/dm/README b/release/picobsd/tinyware/dm/README deleted file mode 100644 index a38101b..0000000 --- a/release/picobsd/tinyware/dm/README +++ /dev/null @@ -1,15 +0,0 @@ -1998.09.14, Warsaw - -This program replaces 'dmesg' utility, aand allows you to retrieve the -system's message buffer without resorting to such dirty tricks as normal -'dmesg' uses (using libkvm and /dev/kmem to directly read kernel -memory.. *shudder*). - -This utility uses sysctl(3) interface. The mib variable it uses was -recently added to the kernel sources, so if you don't mind patching your -kernel tree, contact me directly - the patches are very small and simple. - -Andrzej Bialecki - - -$Id$ diff --git a/release/picobsd/tinyware/dm/dm.c b/release/picobsd/tinyware/dm/dm.c deleted file mode 100644 index f3dc410..0000000 --- a/release/picobsd/tinyware/dm/dm.c +++ /dev/null @@ -1,74 +0,0 @@ -/*- - * Copyright (c) 1998 Andrzej Bialecki - * 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. - * - * $Id$ - */ - -/* - * Small replacement for 'dmesg'. It doesn't need libkvm nor /dev/kmem. - */ - - -#include -#include -#include - -int -main(int argc, char *argv[]) -{ - int len,i; - char *buf,*p; - char *mib="machdep.msgbuf"; - - /* We use sysctlbyname, because the oid is unknown (OID_AUTO) */ - - /* get the buffer size */ - i=sysctlbyname(mib,NULL,&len,NULL,NULL); - if(i) { - perror("buffer sizing"); - exit(-1); - } - buf=(char *)malloc(len*sizeof(char)); - i=sysctlbyname(mib,buf,&len,NULL,NULL); - if(i) { - perror("retrieving data"); - exit(-1); - } - p=buf; - i=0; - while(p<(buf+len)) { - switch(*p) { - case '\0': - /* skip initial NULLs */ - break; - default: - putchar(*p); - } - p++; - } - if(*--p!='\n') putchar('\n'); - free(buf); - exit(0); -} diff --git a/release/picobsd/tinyware/msg/Makefile b/release/picobsd/tinyware/msg/Makefile new file mode 100644 index 0000000..5de8c7c --- /dev/null +++ b/release/picobsd/tinyware/msg/Makefile @@ -0,0 +1,9 @@ +# $Id$ +# +PROG=msg +SRCS= msg.c +NOMAN=yes + +.include + + diff --git a/release/picobsd/tinyware/msg/README b/release/picobsd/tinyware/msg/README new file mode 100644 index 0000000..a38101b --- /dev/null +++ b/release/picobsd/tinyware/msg/README @@ -0,0 +1,15 @@ +1998.09.14, Warsaw + +This program replaces 'dmesg' utility, aand allows you to retrieve the +system's message buffer without resorting to such dirty tricks as normal +'dmesg' uses (using libkvm and /dev/kmem to directly read kernel +memory.. *shudder*). + +This utility uses sysctl(3) interface. The mib variable it uses was +recently added to the kernel sources, so if you don't mind patching your +kernel tree, contact me directly - the patches are very small and simple. + +Andrzej Bialecki + + +$Id$ diff --git a/release/picobsd/tinyware/msg/msg.c b/release/picobsd/tinyware/msg/msg.c new file mode 100644 index 0000000..f3dc410 --- /dev/null +++ b/release/picobsd/tinyware/msg/msg.c @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 1998 Andrzej Bialecki + * 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. + * + * $Id$ + */ + +/* + * Small replacement for 'dmesg'. It doesn't need libkvm nor /dev/kmem. + */ + + +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + int len,i; + char *buf,*p; + char *mib="machdep.msgbuf"; + + /* We use sysctlbyname, because the oid is unknown (OID_AUTO) */ + + /* get the buffer size */ + i=sysctlbyname(mib,NULL,&len,NULL,NULL); + if(i) { + perror("buffer sizing"); + exit(-1); + } + buf=(char *)malloc(len*sizeof(char)); + i=sysctlbyname(mib,buf,&len,NULL,NULL); + if(i) { + perror("retrieving data"); + exit(-1); + } + p=buf; + i=0; + while(p<(buf+len)) { + switch(*p) { + case '\0': + /* skip initial NULLs */ + break; + default: + putchar(*p); + } + p++; + } + if(*--p!='\n') putchar('\n'); + free(buf); + exit(0); +} -- cgit v1.1