CVS commit: src

2010-10-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Oct  4 13:45:29 UTC 2010

Modified Files:
src/distrib/shark/instkernel/instkernel: Makefile
src/etc/etc.shark: Makefile.inc

Log Message:
Copy ramdisk INSTALL.aout kernel into installation/instkernel in ${RELEASEDIR}
where it had been put and documented. Actually closes PR port-shark/41672.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/distrib/shark/instkernel/instkernel/Makefile
cvs rdiff -u -r1.11 -r1.12 src/etc/etc.shark/Makefile.inc

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

Modified files:

Index: src/distrib/shark/instkernel/instkernel/Makefile
diff -u src/distrib/shark/instkernel/instkernel/Makefile:1.20 src/distrib/shark/instkernel/instkernel/Makefile:1.21
--- src/distrib/shark/instkernel/instkernel/Makefile:1.20	Fri Nov  6 13:01:36 2009
+++ src/distrib/shark/instkernel/instkernel/Makefile	Mon Oct  4 13:45:28 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.20 2009/11/06 13:01:36 is Exp $
+#	$NetBSD: Makefile,v 1.21 2010/10/04 13:45:28 tsutsui Exp $
 
 .include bsd.own.mk
 .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib
@@ -18,6 +18,10 @@
 	-R .debug_aranges -R .ARM.attributes \
 	${.TARGET:R} ${.TARGET}
 
+release::	check_RELEASEDIR .WAIT netbsd-INSTALL.aout.gz
+	${RELEASE_INSTALL} netbsd-INSTALL.aout.gz \
+	${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/instkernel/netbsd.gz
+
 .include ${DISTRIBDIR}/common/Makefile.mdset
 
 .include bsd.prog.mk

Index: src/etc/etc.shark/Makefile.inc
diff -u src/etc/etc.shark/Makefile.inc:1.11 src/etc/etc.shark/Makefile.inc:1.12
--- src/etc/etc.shark/Makefile.inc:1.11	Fri Nov  6 12:31:44 2009
+++ src/etc/etc.shark/Makefile.inc	Mon Oct  4 13:45:28 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.11 2009/11/06 12:31:44 is Exp $
+#	$NetBSD: Makefile.inc,v 1.12 2010/10/04 13:45:28 tsutsui Exp $
 #
 #	etc.shark/Makefile.inc -- shark-specific etc Makefile targets
 #
@@ -10,3 +10,8 @@
 KERNEL_SUFFIXES=	aout
 
 BUILD_KERNELS=		INSTALL
+
+INSTALLATION_DIRS+=	installation/instkernel
+
+snap_md_post:
+	${MAKESUMS} -t ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/instkernel '*.gz'



CVS commit: src/distrib/notes

2010-10-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Oct  4 13:58:43 UTC 2010

Modified Files:
src/distrib/notes/common: contents
src/distrib/notes/sgimips: install

Log Message:
Follow rename of distribution kernels in binary/kernel:
 netbsd.ecoff-GENERIC32_IPXx.gz - netbsd-GENERIC32_IPXx.ecoff.gz


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/distrib/notes/common/contents
cvs rdiff -u -r1.9 -r1.10 src/distrib/notes/sgimips/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/contents
diff -u src/distrib/notes/common/contents:1.160 src/distrib/notes/common/contents:1.161
--- src/distrib/notes/common/contents:1.160	Wed Jun  9 17:37:23 2010
+++ src/distrib/notes/common/contents	Mon Oct  4 13:58:43 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: contents,v 1.160 2010/06/09 17:37:23 phx Exp $
+.\	$NetBSD: contents,v 1.161 2010/10/04 13:58:43 tsutsui Exp $
 .\
 .\ Copyright (c) 1999-2005 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -209,12 +209,12 @@
 .if \n[sgimips] \{\
 .			It Pa netbsd-GENERIC32_IP12.gz
 A kernel suitable for booting on R3000 Indigo, IRIS 4D/3x and similar machines.
-.			It Pa netbsd.ecoff-GENERIC32_IP12.gz
+.			It Pa netbsd-GENERIC32_IP12.ecoff.gz
 GENERIC32_IP2x targeted for being bootable on the above machines
 with PROMs that do not understand the ELF binary format.
 .			It Pa netbsd-GENERIC32_IP2x.gz
 A kernel suitable for booting on Indy, Indigo 2 and similar machines.
-.			It Pa netbsd.ecoff-GENERIC32_IP2x.gz
+.			It Pa netbsd-GENERIC32_IP2x.ecoff.gz
 GENERIC32_IP2x targeted for being bootable on older Indigo 2 and possibly
 Indy machines with PROMs that do not understand the ELF binary format.
 .			It Pa netbsd-GENERIC32_IP3x.gz
@@ -1933,7 +1933,7 @@
 directory:
 .
 .(tag netbsd-INSTALL32_IPxx.symbols.gz
-.It Pa netbsd.ecoff-GENERIC32_IPxx.gz
+.It Pa netbsd-GENERIC32_IPxx.ecoff.gz
 An ECOFF
 version of the 
 .Li GENERIC32_IPxx

Index: src/distrib/notes/sgimips/install
diff -u src/distrib/notes/sgimips/install:1.9 src/distrib/notes/sgimips/install:1.10
--- src/distrib/notes/sgimips/install:1.9	Wed Oct 29 17:01:50 2008
+++ src/distrib/notes/sgimips/install	Mon Oct  4 13:58:43 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: install,v 1.9 2008/10/29 17:01:50 tsutsui Exp $
+.\	$NetBSD: install,v 1.10 2010/10/04 13:58:43 tsutsui Exp $
 .\
 .\ Copyright (c) 1999-2002 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -157,12 +157,12 @@
 Because of differences in SGI hardware between different machines,
 the kernel load addresses differ.
 You will need GENERIC32_IP2x for the Indy and Indigo2,
-ecoff-GENERIC32_IP2x for the Indigo (and Indy/Indigo2 machines with old PROMs),
+GENERIC32_IP2x.ecoff for the Indigo (and Indy/Indigo2 machines with old PROMs),
 and GENERIC32_IP3x for the O2.
 .Pp
 .Dl server# Ic gzip -d -c netbsd-GENERIC32_IP2x.gz \*[Gt] /tftpboot/netbsd-sgimips
 or
-.Dl server# Ic gzip -d -c netbsd.ecoff-GENERIC32_IP2x.gz \*[Gt] /tftpboot/netbsd-sgimips
+.Dl server# Ic gzip -d -c netbsd-GENERIC32_IP2x.ecoff.gz \*[Gt] /tftpboot/netbsd-sgimips
 or
 .Dl server# Ic gzip -d -c netbsd-GENERIC32_IP2x.gz \*[Gt] /tftpboot/netbsd-sgimips
 .



CVS commit: src/etc

2010-10-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Oct  4 13:55:39 UTC 2010

Modified Files:
src/etc: Makefile

Log Message:
Change distribution filename for KERNEL_SETS kernels with KERNEL_SUFFIXES
in ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel/
from netbsd.aout-GENERIC.gz to netbsd-GENERIC.aout.gz or so
as src/distrib/common/Makefile.mdset does for mdroot ramdisk kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.381 -r1.382 src/etc/Makefile

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

Modified files:

Index: src/etc/Makefile
diff -u src/etc/Makefile:1.381 src/etc/Makefile:1.382
--- src/etc/Makefile:1.381	Sun Aug 22 18:56:20 2010
+++ src/etc/Makefile	Mon Oct  4 13:55:39 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.381 2010/08/22 18:56:20 rmind Exp $
+#	$NetBSD: Makefile,v 1.382 2010/10/04 13:55:39 tsutsui Exp $
 #	from: @(#)Makefile	8.7 (Berkeley) 5/25/95
 
 # Environment variables without default values:
@@ -599,7 +599,7 @@
 			for s in  $${kernsuffixes}; do \
 ks=$${kernel}$${s}; \
 [ ! -f $${ks} ]  continue; \
-knl_gz=${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel/$${ks}-${configfile:C/.*\///}.gz; \
+knl_gz=${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel/$${kernel}-${configfile:C/.*\///}$${s}.gz; \
 [ $${knl_gz} -nt $${ks} ]  continue; \
 rm -f $${knl_gz}; \
 echo gzip -c -9  $${kerndir}/$${ks}  $${knl_gz}; \



CVS commit: src/distrib/cats/instkernel

2010-10-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Oct  4 15:56:53 UTC 2010

Modified Files:
src/distrib/cats/instkernel: Makefile

Log Message:
Use consistent names for distribution RAMDISK kernels:
 netbsd.able-INSTALL.gz - netbsd-INSTALL.ABLE.gz
 netbsd.aout-INSTALL.gz - netbsd-INSTALL.aout.gz

XXX: Probably it's simpler to have default ELF (currently ABLE) kernels
XXX: and optional a.out ones for old firmware as sgimips does for ecoff ones.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/distrib/cats/instkernel/Makefile

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

Modified files:

Index: src/distrib/cats/instkernel/Makefile
diff -u src/distrib/cats/instkernel/Makefile:1.18 src/distrib/cats/instkernel/Makefile:1.19
--- src/distrib/cats/instkernel/Makefile:1.18	Thu Aug 20 14:43:06 2009
+++ src/distrib/cats/instkernel/Makefile	Mon Oct  4 15:56:53 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.18 2009/08/20 14:43:06 skrll Exp $
+#	$NetBSD: Makefile,v 1.19 2010/10/04 15:56:53 tsutsui Exp $
 
 .include bsd.own.mk
 .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib
@@ -6,19 +6,20 @@
 RAMDISKDIR!=	cd ${.CURDIR}/../ramdisk  ${PRINTOBJDIR}
 RAMDISK=	${RAMDISKDIR}/ramdisk.fs
 
-MDSETTARGETS=		INSTALL ${RAMDISK} netbsd.aout-INSTALL \
-			INSTALL.ABLE ${RAMDISK} netbsd.able-INSTALL
+MDSETTARGETS=		INSTALL ${RAMDISK} netbsd-INSTALL.aout \
+			INSTALL.ABLE ${RAMDISK} -
 MDSET_RELEASEDIR=	binary/kernel
 
 MDSET_NOSTRIP=		# defined
 
-MDSET_POST.netbsd.aout-INSTALL= \
+MDSET_POST.netbsd-INSTALL.aout= \
 ${OBJCOPY} -O a.out-arm-netbsd \
 	-R .debug_abbrev -R .debug_info -R .debug_line -R .debug_str \
 	-R .debug_frame -R .debug_loc -R .debug_pubnames -R .debug_aranges \
 	-R .ident -R .arm.atpcs -R .comment -R .note.netbsd.ident \
 	-R .ARM.attributes \
-	${.TARGET} ${.TARGET}
+	${.TARGET} ${.TARGET}.tmp ;\
+	mv ${.TARGET}.tmp ${.TARGET}
 
 .include ${DISTRIBDIR}/common/Makefile.mdset
 



CVS commit: src/sys/rump/dev/lib/libsysmon

2010-10-04 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Oct  4 15:57:27 UTC 2010

Modified Files:
src/sys/rump/dev/lib/libsysmon: component.c

Log Message:
Update error message - no funcitonal change.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/rump/dev/lib/libsysmon/component.c

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

Modified files:

Index: src/sys/rump/dev/lib/libsysmon/component.c
diff -u src/sys/rump/dev/lib/libsysmon/component.c:1.3 src/sys/rump/dev/lib/libsysmon/component.c:1.4
--- src/sys/rump/dev/lib/libsysmon/component.c:1.3	Tue Aug  3 19:55:17 2010
+++ src/sys/rump/dev/lib/libsysmon/component.c	Mon Oct  4 15:57:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: component.c,v 1.3 2010/08/03 19:55:17 pooka Exp $	*/
+/*	$NetBSD: component.c,v 1.4 2010/10/04 15:57:27 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: component.c,v 1.3 2010/08/03 19:55:17 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: component.c,v 1.4 2010/10/04 15:57:27 pgoyette Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -52,7 +52,7 @@
 
 	if ((error = config_init_component(cfdriver_ioconf_swwdog,
 	cfattach_ioconf_swwdog, cfdata_ioconf_swwdog)) != 0) {
-		printf(cannot attach sysmon: %d\n, error);
+		printf(cannot attach swwdog: %d\n, error);
 		return;
 	}
 



CVS commit: src

2010-10-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Oct  4 16:03:31 UTC 2010

Modified Files:
src/etc/etc.dreamcast: Makefile.inc
src/sys/arch/dreamcast/conf: Makefile.dreamcast.inc

Log Message:
Build a raw binary format GENERIC kernel and put it into distribution dir.
This would make it possible to create a bootable CD using root on gdrom
without toolchain (i.e. without whole src tree).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/etc/etc.dreamcast/Makefile.inc
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/dreamcast/conf/Makefile.dreamcast.inc

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

Modified files:

Index: src/etc/etc.dreamcast/Makefile.inc
diff -u src/etc/etc.dreamcast/Makefile.inc:1.3 src/etc/etc.dreamcast/Makefile.inc:1.4
--- src/etc/etc.dreamcast/Makefile.inc:1.3	Tue Jul 24 10:49:24 2007
+++ src/etc/etc.dreamcast/Makefile.inc	Mon Oct  4 16:03:30 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.3 2007/07/24 10:49:24 pavel Exp $
+#	$NetBSD: Makefile.inc,v 1.4 2010/10/04 16:03:30 tsutsui Exp $
 #
 #	etc.dreamcast/Makefile.inc -- dreamcast-specific etc Makefile targets
 #
@@ -7,5 +7,6 @@
 # to update the release documentation in distrib/notes/common/contents
 
 KERNEL_SETS=		GENERIC
+KERNEL_SUFFIXES=	bin
 
 BUILD_KERNELS=		GENERIC_MD

Index: src/sys/arch/dreamcast/conf/Makefile.dreamcast.inc
diff -u src/sys/arch/dreamcast/conf/Makefile.dreamcast.inc:1.10 src/sys/arch/dreamcast/conf/Makefile.dreamcast.inc:1.11
--- src/sys/arch/dreamcast/conf/Makefile.dreamcast.inc:1.10	Tue Jul  6 05:59:59 2010
+++ src/sys/arch/dreamcast/conf/Makefile.dreamcast.inc	Mon Oct  4 16:03:30 2010
@@ -1,6 +1,11 @@
-#	$NetBSD: Makefile.dreamcast.inc,v 1.10 2010/07/06 05:59:59 mrg Exp $
+#	$NetBSD: Makefile.dreamcast.inc,v 1.11 2010/10/04 16:03:30 tsutsui Exp $
 
 MACHINE_ARCH=sh3el
 
 TEXTADDR?=8c01
 LINKFORMAT=	-N
+
+SYSTEM_LD_TAIL_EXTRA+=;			\
+	echo ${OBJCOPY} -O binary $@ $...@.bin;\
+	${OBJCOPY} -O binary $@ $...@.bin;	\
+	chmod 755 $...@.bin



CVS commit: src/sys/nfs

2010-10-04 Thread Erik Berls
Module Name:src
Committed By:   cyber
Date:   Mon Oct  4 23:48:23 UTC 2010

Modified Files:
src/sys/nfs: nfs_boot.c nfs_bootdhcp.c nfsdiskless.h

Log Message:
Add support to honor MTU settings from DHCP during netboot.

Defines IP_MIN_MTU as 576.

Glanced over quickly by martin@ and jo...@.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/nfs/nfs_boot.c
cvs rdiff -u -r1.51 -r1.52 src/sys/nfs/nfs_bootdhcp.c
cvs rdiff -u -r1.29 -r1.30 src/sys/nfs/nfsdiskless.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/nfs/nfs_boot.c
diff -u src/sys/nfs/nfs_boot.c:1.79 src/sys/nfs/nfs_boot.c:1.80
--- src/sys/nfs/nfs_boot.c:1.79	Wed Mar  4 06:56:25 2009
+++ src/sys/nfs/nfs_boot.c	Mon Oct  4 23:48:22 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_boot.c,v 1.79 2009/03/04 06:56:25 nisimura Exp $	*/
+/*	$NetBSD: nfs_boot.c,v 1.80 2010/10/04 23:48:22 cyber Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1997 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_boot.c,v 1.79 2009/03/04 06:56:25 nisimura Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_boot.c,v 1.80 2010/10/04 23:48:22 cyber Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_nfs.h
@@ -91,6 +91,8 @@
 int nfs_boot_bootstatic = 1; /* BOOTSTATIC enabled (default) */
 #endif
 
+#define IP_MIN_MTU 576
+
 /* mountd RPC */
 static int md_mount(struct sockaddr_in *mdsin, char *path,
 	struct nfs_args *argp, struct lwp *l);
@@ -155,6 +157,12 @@
 		return (error);
 
 	/*
+	 * Set MTU if passed
+	 */
+	if (nd-nd_mtu = IP_MIN_MTU )
+		nfs_boot_setmtu(nd-nd_ifp, nd-nd_mtu, lwp);
+	
+	/*
 	 * If the gateway address is set, add a default route.
 	 * (The mountd RPCs may go across a gateway.)
 	 */
@@ -236,6 +244,48 @@
 	return (error);
 }
 
+void
+nfs_boot_setmtu(struct ifnet *ifp, int mtu, struct lwp *lwp)
+{
+	struct socket *so;
+	struct ifreq ireq;
+	int error;
+
+	memset(ireq, 0, sizeof(ireq));
+	memcpy(ireq.ifr_name, ifp-if_xname, IFNAMSIZ);
+
+	/*
+	 * Get a socket to use for various things in here.
+	 * After this, use goto out to cleanup and return.
+	 */
+	error = socreate(AF_INET, so, SOCK_DGRAM, 0, lwp, NULL);
+	if (error) {
+		printf(setmtu: socreate, error=%d\n, error);
+		return;
+	}
+
+	/*
+	 * Get structure, set the new MTU, push structure.
+	 */
+	error = ifioctl(so, SIOCGIFMTU, (void *)ireq, lwp);
+	if (error) {
+		printf(setmtu: GIFMTU, error=%d\n, error);
+		goto out;
+	}
+
+	ireq.ifr_mtu = mtu;
+
+	error = ifioctl(so, SIOCSIFMTU, ireq, lwp);
+	if (error) {
+		printf(setmtu: SIFMTU, error=%d\n, error);
+		goto out;
+	}
+
+out:
+	soclose(so);
+	return;
+}
+
 int
 nfs_boot_setaddress(struct ifnet *ifp, struct lwp *lwp,
 		uint32_t addr, uint32_t netmask, uint32_t braddr)

Index: src/sys/nfs/nfs_bootdhcp.c
diff -u src/sys/nfs/nfs_bootdhcp.c:1.51 src/sys/nfs/nfs_bootdhcp.c:1.52
--- src/sys/nfs/nfs_bootdhcp.c:1.51	Fri Jul 10 12:16:31 2009
+++ src/sys/nfs/nfs_bootdhcp.c	Mon Oct  4 23:48:22 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_bootdhcp.c,v 1.51 2009/07/10 12:16:31 roy Exp $	*/
+/*	$NetBSD: nfs_bootdhcp.c,v 1.52 2010/10/04 23:48:22 cyber Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1997 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_bootdhcp.c,v 1.51 2009/07/10 12:16:31 roy Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_bootdhcp.c,v 1.52 2010/10/04 23:48:22 cyber Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_nfs_boot.h
@@ -176,6 +176,8 @@
 #define TAG_DOMAIN_NAME		((unsigned char)  15)
 #define TAG_SWAP_SERVER		((unsigned char)  16)
 #define TAG_ROOT_PATH		((unsigned char)  17)
+/* RFC 2132 */
+#define TAG_INTERFACE_MTU	((unsigned char)  26)
 /* End of stuff from bootp.h */
 
 #ifdef NFS_BOOT_DHCP
@@ -203,6 +205,8 @@
 #define DHCPRELEASE 7
 #endif
 
+#define IP_MIN_MTU 576
+
 #ifdef NFS_BOOT_DHCP
 #define BOOTP_SIZE_MAX	(sizeof(struct bootp)+312-64)
 #else
@@ -453,13 +457,14 @@
 	int vcilen;
 	
 	*area++ = TAG_PARAM_REQ;
-	*area++ = 6;
+	*area++ = 7;
 	*area++ = TAG_SUBNET_MASK;
 	*area++ = TAG_GATEWAY;
 	*area++ = TAG_HOST_NAME;
 	*area++ = TAG_DOMAIN_NAME;
 	*area++ = TAG_ROOT_PATH;
 	*area++ = TAG_SWAP_SERVER;
+	*area++ = TAG_INTERFACE_MTU;
 
 	/* Insert a NetBSD Vendor Class Identifier option. */
 	snprintf(vci, sizeof(vci), %s:%s:kernel:%s, ostype, MACHINE,
@@ -699,6 +704,7 @@
 	char *myname;	/* my hostname */
 	char *mydomain;	/* my domainname */
 	char *rootpath;
+	uint16_t myinterfacemtu;
 	int mynamelen;
 	int mydomainlen;
 	int rootpathlen;
@@ -716,6 +722,8 @@
 	rootserver = bootp-bp_siaddr;
 	/* assume that server name field is not overloaded by default */
 	overloaded = 0;
+	/* MTU can't be less than IP_MIN_MTU, set to 0 to indicate unset */
+	myinterfacemtu = 0;
 
 	p = bootp-bp_vend[4];
 	limit = ((u_char*)bootp) + replylen;
@@ -776,6 +784,15 @@
 			rootpath = p;
 			rootpathlen = len;
 			break;
+		case TAG_INTERFACE_MTU:
+			if (len != 2) 

CVS commit: src/usr.sbin/envstat

2010-10-04 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Oct  5 00:14:55 UTC 2010

Modified Files:
src/usr.sbin/envstat: envstat.c

Log Message:
Some Integer-type sensors can have limits, so allow them to be displayed.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/usr.sbin/envstat/envstat.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.sbin/envstat/envstat.c
diff -u src/usr.sbin/envstat/envstat.c:1.79 src/usr.sbin/envstat/envstat.c:1.80
--- src/usr.sbin/envstat/envstat.c:1.79	Thu Aug 26 05:25:57 2010
+++ src/usr.sbin/envstat/envstat.c	Tue Oct  5 00:14:55 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: envstat.c,v 1.79 2010/08/26 05:25:57 jruoho Exp $ */
+/* $NetBSD: envstat.c,v 1.80 2010/10/05 00:14:55 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -27,7 +27,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: envstat.c,v 1.79 2010/08/26 05:25:57 jruoho Exp $);
+__RCSID($NetBSD: envstat.c,v 1.80 2010/10/05 00:14:55 pgoyette Exp $);
 #endif /* not lint */
 
 #include stdio.h
@@ -906,7 +906,48 @@
 		/* integers */
 		} else if (strcmp(sensor-type, Integer) == 0) {
 
-			(void)printf(:%10d, sensor-cur_value);
+			stype = none;
+
+			(void)printf(:%10d , sensor-cur_value);
+
+			ilen = 8;
+			if (statistics) {
+/* show statistics if flag set */
+(void)printf(%8u %8u %8u ,
+stats-max, stats-min, stats-avg);
+ilen += 2;
+			} else {
+if (sensor-critmax_value) {
+	(void)printf(%*u , (int)ilen,
+	sensor-critmax_value);
+	ilen = 8;
+} else
+	ilen += 9;
+
+if (sensor-warnmax_value) {
+	(void)printf(%*u , (int)ilen,
+	sensor-warnmax_value);
+	ilen = 8;
+} else
+	ilen += 9;
+
+if (sensor-warnmin_value) {
+	(void)printf(%*u , (int)ilen,
+	sensor-warnmin_value);
+	ilen = 8;
+} else
+	ilen += 9;
+
+if (sensor-critmin_value) {
+	(void)printf( %*u , (int)ilen,
+	sensor-critmin_value);
+	ilen = 8;
+} else
+	ilen += 9;
+
+			}
+
+			(void)printf(%*s, (int)ilen - 4, stype);
 
 		/* drives  */
 		} else if (strcmp(sensor-type, Drive) == 0) {



CVS commit: src/lib/libc/stdlib

2010-10-04 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Oct  5 02:23:39 UTC 2010

Modified Files:
src/lib/libc/stdlib: putenv.c

Log Message:
Avoid unnecessary malloc().  Since __findenv() kindly treats
equal sign as an end of string, we can pass the string of
form key=value to lookup key.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/stdlib/putenv.c

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/stdlib/putenv.c
diff -u src/lib/libc/stdlib/putenv.c:1.15 src/lib/libc/stdlib/putenv.c:1.16
--- src/lib/libc/stdlib/putenv.c:1.15	Sat Oct  2 16:56:03 2010
+++ src/lib/libc/stdlib/putenv.c	Tue Oct  5 02:23:38 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: putenv.c,v 1.15 2010/10/02 16:56:03 tron Exp $	*/
+/*	$NetBSD: putenv.c,v 1.16 2010/10/05 02:23:38 enami Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)putenv.c	8.2 (Berkeley) 3/27/94;
 #else
-__RCSID($NetBSD: putenv.c,v 1.15 2010/10/02 16:56:03 tron Exp $);
+__RCSID($NetBSD: putenv.c,v 1.16 2010/10/05 02:23:38 enami Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -54,28 +54,18 @@
 int
 putenv(char *str)
 {
-	char *name, *equal, *p;
-	size_t namelen;
+	char *p;
 	int offset;
 
 	_DIAGASSERT(str != NULL);
 
-	if ((equal = strchr(str, '=')) == NULL)
+	if (strchr(str, '=') == NULL)
 		return -1;
 
-	namelen = equal - str;
-	if ((name = malloc(namelen + 1)) == NULL)
+	if (rwlock_wrlock(__environ_lock) != 0)
 		return -1;
-	(void)memcpy(name, str, namelen);
-	name[namelen] = '\0';
 
-	if (rwlock_wrlock(__environ_lock) != 0) {
-		free(name);
-		return -1;
-	}
-
-	p = __findenv(name, offset);
-	free(name);
+	p = __findenv(str, offset);
 
 	if (__allocenv(offset) == -1)
 		goto bad;



CVS commit: src/usr.sbin/envstat

2010-10-04 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Oct  5 05:03:49 UTC 2010

Modified Files:
src/usr.sbin/envstat: config.c

Log Message:
Apply proper conversion (which is _no_ conversion) when setting limit
values for sensors of type ENVSYS_INTEGER.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/envstat/config.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.sbin/envstat/config.c
diff -u src/usr.sbin/envstat/config.c:1.9 src/usr.sbin/envstat/config.c:1.10
--- src/usr.sbin/envstat/config.c:1.9	Mon Feb 15 22:37:14 2010
+++ src/usr.sbin/envstat/config.c	Tue Oct  5 05:03:49 2010
@@ -1,4 +1,4 @@
-/* 	$NetBSD: config.c,v 1.9 2010/02/15 22:37:14 pgoyette Exp $	*/
+/* 	$NetBSD: config.c,v 1.10 2010/10/05 05:03:49 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2007 Juan Romero Pardines.
@@ -27,7 +27,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: config.c,v 1.9 2010/02/15 22:37:14 pgoyette Exp $);
+__RCSID($NetBSD: config.c,v 1.10 2010/10/05 05:03:49 pgoyette Exp $);
 #endif /* not lint */
 
 #include stdio.h
@@ -97,6 +97,7 @@
 void
 config_dict_add_prop(const char *key, char *value)
 {
+
 	if (!key || !value)
 		return;
 
@@ -682,7 +683,8 @@
 		num = prop_number_create_unsigned_integer(val);
 		free(strval);
 
-	} else if (prop_string_equals_cstring(obj, Fan)) {
+	} else if (prop_string_equals_cstring(obj, Fan) ||
+		   prop_string_equals_cstring(obj, Integer)) {
 		/* no conversion */
 		val = strtod(value, endptr);
 		if (*endptr != '\0')