svn commit: r200559 - in user/luigi/ipfw3-head: . cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common contrib/top etc etc/mtree etc/rc.d gnu/lib/libgcc lib lib/libexpat lib/...

Luigi Rizzo luigi at FreeBSD.org
Mon Dec 14 15:49:07 PST 2009


Author: luigi
Date: Mon Dec 14 23:49:06 2009
New Revision: 200559
URL: http://svn.freebsd.org/changeset/base/200559

Log:
  sync with head r200555

Added:
  user/luigi/ipfw3-head/sys/boot/common/md.c
     - copied unchanged from r200555, head/sys/boot/common/md.c
  user/luigi/ipfw3-head/tools/regression/kqueue/
     - copied from r200555, head/tools/regression/kqueue/
  user/luigi/ipfw3-head/tools/regression/usr.bin/comm/
     - copied from r200555, head/tools/regression/usr.bin/comm/
Deleted:
  user/luigi/ipfw3-head/usr.sbin/ndp/gnuc.h
Modified:
  user/luigi/ipfw3-head/Makefile.inc1
  user/luigi/ipfw3-head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
  user/luigi/ipfw3-head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
  user/luigi/ipfw3-head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
  user/luigi/ipfw3-head/etc/mtree/BSD.usr.dist
  user/luigi/ipfw3-head/etc/rc.d/named
  user/luigi/ipfw3-head/etc/termcap.small
  user/luigi/ipfw3-head/gnu/lib/libgcc/Makefile
  user/luigi/ipfw3-head/lib/Makefile
  user/luigi/ipfw3-head/lib/libexpat/libbsdxml.3
  user/luigi/ipfw3-head/lib/libpam/modules/pam_lastlog/Makefile
  user/luigi/ipfw3-head/lib/libpam/modules/pam_lastlog/pam_lastlog.c
  user/luigi/ipfw3-head/lib/libtacplus/libtacplus.3
  user/luigi/ipfw3-head/lib/libthr/thread/thr_umtx.c
  user/luigi/ipfw3-head/lib/libulog/ulog_login.c
  user/luigi/ipfw3-head/lib/libusb/libusb10.c
  user/luigi/ipfw3-head/lib/libutil/gr_util.c
  user/luigi/ipfw3-head/share/examples/Makefile
  user/luigi/ipfw3-head/share/man/man4/iwnfw.4
  user/luigi/ipfw3-head/share/man/man9/sleep.9
  user/luigi/ipfw3-head/share/man/man9/sleepqueue.9
  user/luigi/ipfw3-head/share/termcap/termcap.5
  user/luigi/ipfw3-head/share/termcap/termcap.src
  user/luigi/ipfw3-head/sys/amd64/amd64/vm_machdep.c
  user/luigi/ipfw3-head/sys/amd64/ia32/ia32_syscall.c
  user/luigi/ipfw3-head/sys/boot/common/Makefile.inc
  user/luigi/ipfw3-head/sys/boot/pc98/boot2/Makefile
  user/luigi/ipfw3-head/sys/boot/pc98/boot2/bios.S
  user/luigi/ipfw3-head/sys/boot/pc98/boot2/boot.c
  user/luigi/ipfw3-head/sys/boot/pc98/boot2/boot.h
  user/luigi/ipfw3-head/sys/boot/pc98/boot2/disk.c
  user/luigi/ipfw3-head/sys/boot/pc98/boot2/io.c
  user/luigi/ipfw3-head/sys/boot/pc98/boot2/serial_16550.S
  user/luigi/ipfw3-head/sys/boot/pc98/boot2/sys.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/changes.txt
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/compiler/aslcompile.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/debugger/dbutils.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/disassembler/dmwalk.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/dispatcher/dsmethod.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/dispatcher/dswload.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/events/evregion.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/events/evrgnini.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/events/evxface.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/events/evxfevnt.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/events/evxfregn.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/executer/exmutex.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/include/acnamesp.h
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/include/acobject.h
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/include/acoutput.h
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/include/acpixf.h
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/namespace/nsaccess.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/namespace/nsdump.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/namespace/nseval.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/namespace/nsnames.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/namespace/nspredef.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/namespace/nsrepair.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/namespace/nsrepair2.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/namespace/nsutils.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/namespace/nsxfeval.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/namespace/nsxfname.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/namespace/nsxfobj.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/parser/psxface.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/resources/rsxface.c
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/tools/acpiexec/aecommon.h
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/utilities/utcopy.c
  user/luigi/ipfw3-head/sys/dev/ata/ata-all.c
  user/luigi/ipfw3-head/sys/dev/ata/ata-all.h
  user/luigi/ipfw3-head/sys/dev/ata/ata-disk.c
  user/luigi/ipfw3-head/sys/dev/ata/atapi-cd.c
  user/luigi/ipfw3-head/sys/dev/ata/atapi-cd.h
  user/luigi/ipfw3-head/sys/dev/ata/chipsets/ata-acerlabs.c
  user/luigi/ipfw3-head/sys/dev/ata/chipsets/ata-amd.c
  user/luigi/ipfw3-head/sys/dev/ata/chipsets/ata-ite.c
  user/luigi/ipfw3-head/sys/dev/e1000/e1000_82543.c
  user/luigi/ipfw3-head/sys/dev/e1000/e1000_osdep.h
  user/luigi/ipfw3-head/sys/dev/fdc/fdc_acpi.c
  user/luigi/ipfw3-head/sys/dev/if_ndis/if_ndis.c
  user/luigi/ipfw3-head/sys/dev/vge/if_vge.c
  user/luigi/ipfw3-head/sys/dev/vge/if_vgereg.h
  user/luigi/ipfw3-head/sys/dev/vge/if_vgevar.h
  user/luigi/ipfw3-head/sys/dev/wpi/if_wpi.c
  user/luigi/ipfw3-head/sys/geom/part/g_part.c
  user/luigi/ipfw3-head/sys/geom/part/g_part.h
  user/luigi/ipfw3-head/sys/geom/part/g_part_gpt.c
  user/luigi/ipfw3-head/sys/i386/conf/NOTES
  user/luigi/ipfw3-head/sys/kern/kern_jail.c
  user/luigi/ipfw3-head/sys/kern/kern_lock.c
  user/luigi/ipfw3-head/sys/kern/kern_sx.c
  user/luigi/ipfw3-head/sys/kern/kern_timeout.c
  user/luigi/ipfw3-head/sys/kern/subr_sleepqueue.c
  user/luigi/ipfw3-head/sys/mips/adm5120/if_admsw.c
  user/luigi/ipfw3-head/sys/net/radix.c
  user/luigi/ipfw3-head/sys/net/radix.h
  user/luigi/ipfw3-head/sys/net/route.c
  user/luigi/ipfw3-head/sys/net/rtsock.c
  user/luigi/ipfw3-head/sys/netinet/raw_ip.c
  user/luigi/ipfw3-head/sys/netinet6/raw_ip6.c
  user/luigi/ipfw3-head/sys/nfsclient/bootp_subr.c
  user/luigi/ipfw3-head/sys/nfsclient/krpc_subr.c
  user/luigi/ipfw3-head/sys/nfsclient/nfs_vfsops.c
  user/luigi/ipfw3-head/sys/nfsclient/nfs_vnops.c
  user/luigi/ipfw3-head/sys/sys/_lockmgr.h
  user/luigi/ipfw3-head/sys/sys/bio.h
  user/luigi/ipfw3-head/sys/sys/gpt.h
  user/luigi/ipfw3-head/sys/sys/jail.h
  user/luigi/ipfw3-head/sys/sys/param.h
  user/luigi/ipfw3-head/sys/sys/sleepqueue.h
  user/luigi/ipfw3-head/tools/regression/usr.bin/Makefile
  user/luigi/ipfw3-head/usr.bin/calendar/calendar.c
  user/luigi/ipfw3-head/usr.bin/calendar/day.c
  user/luigi/ipfw3-head/usr.bin/calendar/ostern.c
  user/luigi/ipfw3-head/usr.bin/calendar/paskha.c
  user/luigi/ipfw3-head/usr.bin/comm/comm.1
  user/luigi/ipfw3-head/usr.bin/comm/comm.c
  user/luigi/ipfw3-head/usr.bin/lastcomm/pathnames.h
  user/luigi/ipfw3-head/usr.bin/make/arch.c
  user/luigi/ipfw3-head/usr.bin/make/dir.c
  user/luigi/ipfw3-head/usr.bin/make/for.c
  user/luigi/ipfw3-head/usr.bin/make/globals.h
  user/luigi/ipfw3-head/usr.bin/make/lst.c
  user/luigi/ipfw3-head/usr.bin/make/lst.h
  user/luigi/ipfw3-head/usr.bin/make/make.c
  user/luigi/ipfw3-head/usr.bin/make/str.c
  user/luigi/ipfw3-head/usr.bin/make/targ.c
  user/luigi/ipfw3-head/usr.bin/make/var.c
  user/luigi/ipfw3-head/usr.bin/mktemp/mktemp.c
  user/luigi/ipfw3-head/usr.bin/pr/egetopt.c
  user/luigi/ipfw3-head/usr.bin/talk/ctl_transact.c
  user/luigi/ipfw3-head/usr.bin/talk/display.c
  user/luigi/ipfw3-head/usr.bin/talk/get_addrs.c
  user/luigi/ipfw3-head/usr.bin/talk/get_iface.c
  user/luigi/ipfw3-head/usr.bin/talk/get_names.c
  user/luigi/ipfw3-head/usr.bin/talk/invite.c
  user/luigi/ipfw3-head/usr.bin/talk/look_up.c
  user/luigi/ipfw3-head/usr.bin/talk/talk.c
  user/luigi/ipfw3-head/usr.bin/talk/talk.h
  user/luigi/ipfw3-head/usr.bin/tset/extern.h
  user/luigi/ipfw3-head/usr.bin/tset/map.c
  user/luigi/ipfw3-head/usr.bin/tset/misc.c
  user/luigi/ipfw3-head/usr.bin/tset/set.c
  user/luigi/ipfw3-head/usr.bin/tset/term.c
  user/luigi/ipfw3-head/usr.bin/tset/tset.c
  user/luigi/ipfw3-head/usr.bin/tset/wrterm.c
  user/luigi/ipfw3-head/usr.bin/vis/foldit.c
  user/luigi/ipfw3-head/usr.bin/xinstall/xinstall.c
  user/luigi/ipfw3-head/usr.sbin/jls/jls.c
  user/luigi/ipfw3-head/usr.sbin/mergemaster/mergemaster.sh
  user/luigi/ipfw3-head/usr.sbin/ypserv/yp_main.c
  user/luigi/ipfw3-head/usr.sbin/ypserv/ypserv.8
Directory Properties:
  user/luigi/ipfw3-head/   (props changed)
  user/luigi/ipfw3-head/cddl/contrib/opensolaris/   (props changed)
  user/luigi/ipfw3-head/contrib/bind9/   (props changed)
  user/luigi/ipfw3-head/contrib/cpio/   (props changed)
  user/luigi/ipfw3-head/contrib/csup/   (props changed)
  user/luigi/ipfw3-head/contrib/ee/   (props changed)
  user/luigi/ipfw3-head/contrib/expat/   (props changed)
  user/luigi/ipfw3-head/contrib/file/   (props changed)
  user/luigi/ipfw3-head/contrib/gdb/   (props changed)
  user/luigi/ipfw3-head/contrib/gdtoa/   (props changed)
  user/luigi/ipfw3-head/contrib/less/   (props changed)
  user/luigi/ipfw3-head/contrib/libpcap/   (props changed)
  user/luigi/ipfw3-head/contrib/ncurses/   (props changed)
  user/luigi/ipfw3-head/contrib/netcat/   (props changed)
  user/luigi/ipfw3-head/contrib/ntp/   (props changed)
  user/luigi/ipfw3-head/contrib/openbsm/   (props changed)
  user/luigi/ipfw3-head/contrib/openpam/   (props changed)
  user/luigi/ipfw3-head/contrib/pf/   (props changed)
  user/luigi/ipfw3-head/contrib/sendmail/   (props changed)
  user/luigi/ipfw3-head/contrib/tcpdump/   (props changed)
  user/luigi/ipfw3-head/contrib/tcsh/   (props changed)
  user/luigi/ipfw3-head/contrib/top/   (props changed)
  user/luigi/ipfw3-head/contrib/top/install-sh   (props changed)
  user/luigi/ipfw3-head/contrib/wpa/   (props changed)
  user/luigi/ipfw3-head/crypto/openssh/   (props changed)
  user/luigi/ipfw3-head/crypto/openssl/   (props changed)
  user/luigi/ipfw3-head/lib/libc/   (props changed)
  user/luigi/ipfw3-head/lib/libc/stdtime/   (props changed)
  user/luigi/ipfw3-head/lib/libutil/   (props changed)
  user/luigi/ipfw3-head/sbin/   (props changed)
  user/luigi/ipfw3-head/sbin/ipfw/   (props changed)
  user/luigi/ipfw3-head/share/zoneinfo/   (props changed)
  user/luigi/ipfw3-head/sys/   (props changed)
  user/luigi/ipfw3-head/sys/amd64/include/xen/   (props changed)
  user/luigi/ipfw3-head/sys/cddl/contrib/opensolaris/   (props changed)
  user/luigi/ipfw3-head/sys/contrib/dev/acpica/   (props changed)
  user/luigi/ipfw3-head/sys/contrib/pf/   (props changed)
  user/luigi/ipfw3-head/sys/dev/xen/xenpci/   (props changed)
  user/luigi/ipfw3-head/usr.bin/csup/   (props changed)
  user/luigi/ipfw3-head/usr.bin/procstat/   (props changed)
  user/luigi/ipfw3-head/usr.sbin/zic/   (props changed)

Modified: user/luigi/ipfw3-head/Makefile.inc1
==============================================================================
--- user/luigi/ipfw3-head/Makefile.inc1	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/Makefile.inc1	Mon Dec 14 23:49:06 2009	(r200559)
@@ -1103,8 +1103,8 @@ _prebuild_libs=	${_kerberos5_lib_libasn1
 		lib/libkiconv lib/libkvm lib/libmd \
 		lib/ncurses/ncurses lib/ncurses/ncursesw \
 		lib/libopie lib/libpam ${_lib_libthr} \
-		lib/libradius lib/libsbuf lib/libtacplus lib/libutil \
-		${_lib_libypclnt} lib/libz lib/msun \
+		lib/libradius lib/libsbuf lib/libtacplus lib/libulog \
+		lib/libutil ${_lib_libypclnt} lib/libz lib/msun \
 		${_secure_lib_libcrypto} ${_secure_lib_libssh} \
 		${_secure_lib_libssl} lib/libdwarf lib/libproc
 

Modified: user/luigi/ipfw3-head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
==============================================================================
--- user/luigi/ipfw3-head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c	Mon Dec 14 23:49:06 2009	(r200559)
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -2457,7 +2457,7 @@ zfs_do_receive(int argc, char **argv)
 
 	bzero(&flags, sizeof (recvflags_t));
 	/* check options */
-	while ((c = getopt(argc, argv, ":dnvF")) != -1) {
+	while ((c = getopt(argc, argv, ":dnuvF")) != -1) {
 		switch (c) {
 		case 'd':
 			flags.isprefix = B_TRUE;
@@ -2465,6 +2465,9 @@ zfs_do_receive(int argc, char **argv)
 		case 'n':
 			flags.dryrun = B_TRUE;
 			break;
+		case 'u':
+			flags.nomount = B_TRUE;
+			break;
 		case 'v':
 			flags.verbose = B_TRUE;
 			break;

Modified: user/luigi/ipfw3-head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
==============================================================================
--- user/luigi/ipfw3-head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h	Mon Dec 14 23:49:06 2009	(r200559)
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -457,6 +457,9 @@ typedef struct recvflags {
 
 	/* byteswap flag is used internally; callers need not specify */
 	int byteswap : 1;
+
+	/* do not mount file systems as they are extracted (private) */
+	int nomount : 1;
 } recvflags_t;
 
 extern int zfs_receive(libzfs_handle_t *, const char *, recvflags_t,

Modified: user/luigi/ipfw3-head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
==============================================================================
--- user/luigi/ipfw3-head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c	Mon Dec 14 23:49:06 2009	(r200559)
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -2080,7 +2080,7 @@ zfs_receive(libzfs_handle_t *hdl, const 
 
 	err = zfs_receive_impl(hdl, tosnap, flags, infd, stream_avl, &top_zfs);
 
-	if (err == 0 && top_zfs) {
+	if (err == 0 && !flags.nomount && top_zfs) {
 		zfs_handle_t *zhp;
 		prop_changelist_t *clp;
 

Modified: user/luigi/ipfw3-head/etc/mtree/BSD.usr.dist
==============================================================================
--- user/luigi/ipfw3-head/etc/mtree/BSD.usr.dist	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/etc/mtree/BSD.usr.dist	Mon Dec 14 23:49:06 2009	(r200559)
@@ -230,6 +230,12 @@
                 ..
                 dyn_sysctl
                 ..
+                firmware
+                    fwconsumer
+                    ..
+                    fwimage
+                    ..
+                ..
                 syscall
                     module
                     ..

Modified: user/luigi/ipfw3-head/etc/rc.d/named
==============================================================================
--- user/luigi/ipfw3-head/etc/rc.d/named	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/etc/rc.d/named	Mon Dec 14 23:49:06 2009	(r200559)
@@ -12,10 +12,9 @@
 name="named"
 rcvar=named_enable
 
-command="/usr/sbin/named"
 extra_commands="reload"
 
-start_precmd="named_precmd"
+start_precmd="named_prestart"
 start_postcmd="named_poststart"
 reload_cmd="named_reload"
 stop_cmd="named_stop"
@@ -155,8 +154,17 @@ create_file () {
 	chmod 644 $1
 }
 
-named_precmd()
+named_prestart()
 {
+	command_args="-u ${named_uid:=root}"
+
+	if [ ! "$named_conf" = '/etc/namedb/named.conf' ]; then
+		case "$named_flags" in
+		-c*|*' -c'*) ;;		# No need to add it
+		*) command_args="-c $named_conf $command_args" ;;
+		esac
+	fi
+
 	local line nsip firstns
 
 	# Is the user using a sandbox?
@@ -170,11 +178,11 @@ named_precmd()
 
 	# Create an rndc.key file for the user if none exists
 	#
-	if [ -s "${named_chrootdir}/etc/namedb/rndc.conf" ]; then
-		return 0
-	fi
 	confgen_command="${command%/named}/rndc-confgen -a -b256 -u $named_uid \
 	    -c ${named_chrootdir}/etc/namedb/rndc.key"
+	if [ -s "${named_chrootdir}/etc/namedb/rndc.conf" ]; then
+		unset confgen_command
+	fi
 	if [ -s "${named_chrootdir}/etc/namedb/rndc.key" ]; then
 		case `stat -f%Su ${named_chrootdir}/etc/namedb/rndc.key` in
 		root|$named_uid) ;;
@@ -260,10 +268,11 @@ named_precmd()
 }
 
 load_rc_config $name
+
 # Updating the following variables requires that rc.conf be loaded first
 #
 required_dirs="$named_chrootdir"	# if it is set, it must exist
+required_files="${named_conf:=/etc/namedb/named.conf}"
 pidfile="${named_pidfile:-/var/run/named/pid}"
-command_args="-u ${named_uid:=root}"
 
 run_rc_command "$1"

Modified: user/luigi/ipfw3-head/etc/termcap.small
==============================================================================
--- user/luigi/ipfw3-head/etc/termcap.small	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/etc/termcap.small	Mon Dec 14 23:49:06 2009	(r200559)
@@ -312,7 +312,7 @@ xterm-basic|modern xterm common:\
 	:kD=\E[3~:kb=^H:ke=\E[?1l\E>:ks=\E[?1h\E=:le=^H:md=\E[1m:\
 	:me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:op=\E[39;49m:\
 	:rc=\E8:rs=\E[!p\E[?3;4l\E[4l\E>:sc=\E7:se=\E[27m:sf=^J:\
-	:so=\E[7m:sr=\EM:st=\EH:te=\E[?1049l:ti=\E[?1049h:\
+	:so=\E[7m:sr=\EM:st=\EH:\
 	:ue=\E[24m:up=\E[A:us=\E[4m:ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h:
 #
 # This is the only entry which you should have to customize, since "xterm"
@@ -320,3 +320,8 @@ xterm-basic|modern xterm common:\
 # color_xterm and rxvt.
 xterm|X11 terminal emulator:\
 	:tc=xterm-new:
+#
+# Add the capability to "clear the screen" after exiting vi, more/less, etc.
+xterm-clear:\
+	:te=\E[?1049l:ti=\E[?1049h:\
+	:tc=xterm-new:

Modified: user/luigi/ipfw3-head/gnu/lib/libgcc/Makefile
==============================================================================
--- user/luigi/ipfw3-head/gnu/lib/libgcc/Makefile	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/gnu/lib/libgcc/Makefile	Mon Dec 14 23:49:06 2009	(r200559)
@@ -297,7 +297,7 @@ CLEANFILES += cs-*.h option*
 
 #-----------------------------------------------------------------------
 #
-# Build additional static libgcc_eh[_p].a librarries.
+# Build symbol version map
 #
 SHLIB_MKMAP      = ${GCCDIR}/mkmap-symver.awk
 SHLIB_MKMAP_OPTS =
@@ -316,7 +316,7 @@ CLEANFILES +=	libgcc.map
 
 #-----------------------------------------------------------------------
 #
-# Build additional static libgcc_eh[_p].a librarries.
+# Build additional static libgcc_eh[_p].a libraries.
 #
 lib${LIB}_eh.a:	${EH_OBJS_T}
 	@${ECHO} building static ${LIB}_eh library

Modified: user/luigi/ipfw3-head/lib/Makefile
==============================================================================
--- user/luigi/ipfw3-head/lib/Makefile	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/lib/Makefile	Mon Dec 14 23:49:06 2009	(r200559)
@@ -21,6 +21,7 @@
 # librpcsvc must be built before libpam.
 # libsbuf must be built before libcam.
 # libtacplus must be built before libpam.
+# libulog must be built before libpam.
 # libutil must be built before libpam.
 # libypclnt must be built before libpam.
 # libgssapi must be built before librpcsec_gss
@@ -30,8 +31,8 @@
 SUBDIR=	${_csu} libc libbsm libauditd libcom_err libcrypt libelf libkvm msun \
 	libmd \
 	ncurses ${_libnetgraph} libradius librpcsvc libsbuf \
-	libtacplus libutil ${_libypclnt} libalias libarchive ${_libatm} \
-	libbegemot ${_libbluetooth} ${_libbsnmp} libbz2 \
+	libtacplus libulog libutil ${_libypclnt} libalias libarchive \
+	${_libatm} libbegemot ${_libbluetooth} ${_libbsnmp} libbz2 \
 	libcalendar libcam libcompat libdevinfo libdevstat libdisk \
 	libdwarf libedit libexpat libfetch libftpio libgeom ${_libgpib} \
 	${_libgssapi} ${_librpcsec_gss} libipsec \
@@ -40,8 +41,8 @@ SUBDIR=	${_csu} libc libbsm libauditd li
 	${_libpmc} libproc librt ${_libsdp} ${_libsm} ${_libsmb} \
 	${_libsmdb} \
 	${_libsmutil} libstand ${_libtelnet} ${_libthr} libthread_db libufs \
-	libugidfw libulog ${_libusbhid} ${_libusb} ${_libvgl} libwrap \
-	liby libz ${_bind}
+	libugidfw ${_libusbhid} ${_libusb} ${_libvgl} libwrap liby libz \
+	${_bind}
 
 .if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf)
 _csu=csu/${MACHINE_ARCH}-elf

Modified: user/luigi/ipfw3-head/lib/libexpat/libbsdxml.3
==============================================================================
--- user/luigi/ipfw3-head/lib/libexpat/libbsdxml.3	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/lib/libexpat/libbsdxml.3	Mon Dec 14 23:49:06 2009	(r200559)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"/
-.Dd May 5, 2008
+.Dd December 12, 2009
 .Dt LIBBSDXML 3
 .Os
 .Sh NAME
@@ -38,6 +38,15 @@ The
 .Nm
 library is a verbatim copy of the eXpat XML library version 2.0.1.
 .Pp
+The
+.Nm
+library is intended to use within the
+.Fx
+base system only.
+Use of the
+.Nm
+library for other purposes is not supported and discouraged.
+.Pp
 To avoid version and autoconfiguration issues, the library has been
 renamed to
 .Nm

Modified: user/luigi/ipfw3-head/lib/libpam/modules/pam_lastlog/Makefile
==============================================================================
--- user/luigi/ipfw3-head/lib/libpam/modules/pam_lastlog/Makefile	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/lib/libpam/modules/pam_lastlog/Makefile	Mon Dec 14 23:49:06 2009	(r200559)
@@ -28,7 +28,7 @@ LIB=	pam_lastlog
 SRCS=	pam_lastlog.c
 MAN=	pam_lastlog.8
 
-DPADD=	${LIBUTIL}
-LDADD=	-lutil
+DPADD=	${LIBULOG}
+LDADD=	-lulog
 
 .include <bsd.lib.mk>

Modified: user/luigi/ipfw3-head/lib/libpam/modules/pam_lastlog/pam_lastlog.c
==============================================================================
--- user/luigi/ipfw3-head/lib/libpam/modules/pam_lastlog/pam_lastlog.c	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/lib/libpam/modules/pam_lastlog/pam_lastlog.c	Mon Dec 14 23:49:06 2009	(r200559)
@@ -46,19 +46,9 @@ __FBSDID("$FreeBSD$");
 
 #define _BSD_SOURCE
 
-#include <sys/param.h>
-
-#include <fcntl.h>
-#include <libutil.h>
-#include <paths.h>
 #include <pwd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
 #include <time.h>
-#include <unistd.h>
-#include <utmp.h>
+#include <ulog.h>
 
 #define PAM_SM_SESSION
 
@@ -71,13 +61,11 @@ pam_sm_open_session(pam_handle_t *pamh, 
     int argc __unused, const char *argv[] __unused)
 {
 	struct passwd *pwd;
-	struct utmp utmp;
-	struct lastlog ll;
+	struct ulog_utmpx *utx;
 	time_t t;
 	const char *user;
 	const void *rhost, *tty;
-	off_t llpos;
-	int fd, pam_err;
+	int pam_err;
 
 	pam_err = pam_get_user(pamh, &user, NULL);
 	if (pam_err != PAM_SUCCESS)
@@ -101,72 +89,29 @@ pam_sm_open_session(pam_handle_t *pamh, 
 		pam_err = PAM_SERVICE_ERR;
 		goto err;
 	}
-	if (strncmp(tty, _PATH_DEV, strlen(_PATH_DEV)) == 0)
-		tty = (const char *)tty + strlen(_PATH_DEV);
-	if (*(const char *)tty == '\0')
-		return (PAM_SERVICE_ERR);
 
-	fd = open(_PATH_LASTLOG, O_RDWR|O_CREAT, 0644);
-	if (fd == -1) {
-		PAM_LOG("Failed to open %s", _PATH_LASTLOG);
-		goto file_err;
-	}
-
-	/*
-	 * Record session in lastlog(5).
-	 */
-	llpos = (off_t)(pwd->pw_uid * sizeof(ll));
-	if (lseek(fd, llpos, L_SET) != llpos)
-		goto file_err;
 	if ((flags & PAM_SILENT) == 0) {
-		if (read(fd, &ll, sizeof ll) == sizeof ll && ll.ll_time != 0) {
-			t = ll.ll_time;
-			if (*ll.ll_host != '\0')
-				pam_info(pamh, "Last login: %.*s from %.*s",
-				    24 - 5, ctime(&t),
-				    (int)sizeof(ll.ll_host), ll.ll_host);
-			else
-				pam_info(pamh, "Last login: %.*s on %.*s",
-				    24 - 5, ctime(&t),
-				    (int)sizeof(ll.ll_line), ll.ll_line);
+		if (ulog_setutxfile(UTXF_LASTLOG, NULL) != 0) {
+			PAM_LOG("Failed to open lastlog database");
+		} else {
+			utx = ulog_getutxuser(user);
+			if (utx != NULL && utx->ut_type == USER_PROCESS) {
+				t = utx->ut_tv.tv_sec;
+				if (*utx->ut_host != '\0')
+					pam_info(pamh, "Last login: %.*s from %s",
+					    24 - 5, ctime(&t), utx->ut_host);
+				else
+					pam_info(pamh, "Last login: %.*s on %s",
+					    24 - 5, ctime(&t), utx->ut_line);
+			}
+			ulog_endutxent();
 		}
-		if (lseek(fd, llpos, L_SET) != llpos)
-			goto file_err;
 	}
 
-	bzero(&ll, sizeof(ll));
-	ll.ll_time = time(NULL);
-
-	/* note: does not need to be NUL-terminated */
-	strncpy(ll.ll_line, tty, sizeof(ll.ll_line));
-	if (rhost != NULL && *(const char *)rhost != '\0')
-		/* note: does not need to be NUL-terminated */
-		strncpy(ll.ll_host, rhost, sizeof(ll.ll_host));
-
-	if (write(fd, (char *)&ll, sizeof(ll)) != sizeof(ll) || close(fd) != 0)
-		goto file_err;
-
-	PAM_LOG("Login recorded in %s", _PATH_LASTLOG);
-
-	/*
-	 * Record session in utmp(5) and wtmp(5).
-	 */
-	bzero(&utmp, sizeof(utmp));
-	utmp.ut_time = time(NULL);
-	/* note: does not need to be NUL-terminated */
-	strncpy(utmp.ut_name, user, sizeof(utmp.ut_name));
-	if (rhost != NULL && *(const char *)rhost != '\0')
-		strncpy(utmp.ut_host, rhost, sizeof(utmp.ut_host));
-	(void)strncpy(utmp.ut_line, tty, sizeof(utmp.ut_line));
-	login(&utmp);
+	ulog_login(tty, user, rhost);
 
 	return (PAM_SUCCESS);
 
-file_err:
-	syslog(LOG_ERR, "%s: %m", _PATH_LASTLOG);
-	if (fd != -1)
-		close(fd);
-	pam_err = PAM_SYSTEM_ERR;
 err:
 	if (openpam_get_option(pamh, "no_fail"))
 		return (PAM_SUCCESS);
@@ -174,7 +119,7 @@ err:
 }
 
 PAM_EXTERN int
-pam_sm_close_session(pam_handle_t *pamh __unused, int flags __unused,
+pam_sm_close_session(pam_handle_t *pamh, int flags __unused,
     int argc __unused, const char *argv[] __unused)
 {
 	const void *tty;
@@ -188,14 +133,7 @@ pam_sm_close_session(pam_handle_t *pamh 
 		pam_err = PAM_SERVICE_ERR;
 		goto err;
 	}
-	if (strncmp(tty, _PATH_DEV, strlen(_PATH_DEV)) == 0)
-		tty = (const char *)tty + strlen(_PATH_DEV);
-	if (*(const char *)tty == '\0')
-		return (PAM_SERVICE_ERR);
-	if (logout(tty) != 1)
-		syslog(LOG_ERR, "%s(): no utmp record for %s",
-		    __func__, (const char *)tty);
-	logwtmp(tty, "", "");
+	ulog_logout(tty);
 	return (PAM_SUCCESS);
 
  err:

Modified: user/luigi/ipfw3-head/lib/libtacplus/libtacplus.3
==============================================================================
--- user/luigi/ipfw3-head/lib/libtacplus/libtacplus.3	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/lib/libtacplus/libtacplus.3	Mon Dec 14 23:49:06 2009	(r200559)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 2, 1998
+.Dd December 11, 2009
 .Dt LIBTACPLUS 3
 .Os
 .Sh NAME

Modified: user/luigi/ipfw3-head/lib/libthr/thread/thr_umtx.c
==============================================================================
--- user/luigi/ipfw3-head/lib/libthr/thread/thr_umtx.c	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/lib/libthr/thread/thr_umtx.c	Mon Dec 14 23:49:06 2009	(r200559)
@@ -112,10 +112,13 @@ __thr_umutex_timedlock(struct umutex *mt
 int
 __thr_umutex_unlock(struct umutex *mtx, uint32_t id)
 {
+#ifndef __ia64__
+	/* XXX this logic has a race-condition on ia64. */
 	if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) == 0) {
 		atomic_cmpset_rel_32(&mtx->m_owner, id | UMUTEX_CONTESTED, UMUTEX_CONTESTED);
 		return _umtx_op_err(mtx, UMTX_OP_MUTEX_WAKE, 0, 0, 0);
 	}
+#endif /* __ia64__ */
 	return _umtx_op_err(mtx, UMTX_OP_MUTEX_UNLOCK, 0, 0, 0);
 }
 

Modified: user/luigi/ipfw3-head/lib/libulog/ulog_login.c
==============================================================================
--- user/luigi/ipfw3-head/lib/libulog/ulog_login.c	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/lib/libulog/ulog_login.c	Mon Dec 14 23:49:06 2009	(r200559)
@@ -48,7 +48,8 @@ ulog_login(const char *line, const char 
 	utx.ut_type = USER_PROCESS;
 	strncpy(utx.ut_line, line, sizeof utx.ut_line);
 	strncpy(utx.ut_user, user, sizeof utx.ut_user);
-	strncpy(utx.ut_host, host, sizeof utx.ut_host);
+	if (host != NULL)
+		strncpy(utx.ut_host, host, sizeof utx.ut_host);
 	gettimeofday(&utx.ut_tv, NULL);
 
 	ulog_pututxline(&utx);

Modified: user/luigi/ipfw3-head/lib/libusb/libusb10.c
==============================================================================
--- user/luigi/ipfw3-head/lib/libusb/libusb10.c	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/lib/libusb/libusb10.c	Mon Dec 14 23:49:06 2009	(r200559)
@@ -379,8 +379,6 @@ libusb_open_device_with_vid_pid(libusb_c
 	if ((i = libusb_get_device_list(ctx, &devs)) < 0)
 		return (NULL);
 
-	pdev = NULL;
-
 	for (j = 0; j < i; j++) {
 		pdev = devs[j]->os_priv;
 		pdesc = libusb20_dev_get_device_desc(pdev);
@@ -396,6 +394,8 @@ libusb_open_device_with_vid_pid(libusb_c
 			break;
 		}
 	}
+	if (j == i)
+		pdev = NULL;
 
 	libusb_free_device_list(devs, 1);
 	DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_open_device_width_vid_pid leave");

Modified: user/luigi/ipfw3-head/lib/libutil/gr_util.c
==============================================================================
--- user/luigi/ipfw3-head/lib/libutil/gr_util.c	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/lib/libutil/gr_util.c	Mon Dec 14 23:49:06 2009	(r200559)
@@ -117,8 +117,8 @@ gr_make(const struct group *gr)
 	/* Create the group line and fill it. */
 	if ((line = malloc(line_size)) == NULL)
 		return (NULL);
-	line_size = snprintf(line, line_size, group_line_format, gr->gr_name,
-	    gr->gr_passwd, (uintmax_t)gr->gr_gid);
+	snprintf(line, line_size, group_line_format, gr->gr_name, gr->gr_passwd,
+	    (uintmax_t)gr->gr_gid);
 	if (gr->gr_mem != NULL)
 		for (ndx = 0; gr->gr_mem[ndx] != NULL; ndx++) {
 			strcat(line, gr->gr_mem[ndx]);

Modified: user/luigi/ipfw3-head/share/examples/Makefile
==============================================================================
--- user/luigi/ipfw3-head/share/examples/Makefile	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/share/examples/Makefile	Mon Dec 14 23:49:06 2009	(r200559)
@@ -88,6 +88,12 @@ XFILES=	BSD_daemon/FreeBSD.pfa \
 	kld/dyn_sysctl/Makefile \
 	kld/dyn_sysctl/README \
 	kld/dyn_sysctl/dyn_sysctl.c \
+	kld/firmware/Makefile \
+	kld/firmware/README \
+	kld/firmware/fwconsumer/Makefile \
+	kld/firmware/fwconsumer/fw_consumer.c \
+	kld/firmware/fwimage/Makefile \
+	kld/firmware/fwimage/firmware.img \
 	kld/syscall/Makefile \
 	kld/syscall/module/Makefile \
 	kld/syscall/module/syscall.c \

Modified: user/luigi/ipfw3-head/share/man/man4/iwnfw.4
==============================================================================
--- user/luigi/ipfw3-head/share/man/man4/iwnfw.4	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/share/man/man4/iwnfw.4	Mon Dec 14 23:49:06 2009	(r200559)
@@ -60,4 +60,4 @@ It may be
 statically linked into the kernel, or loaded as a module.
 .Sh SEE ALSO
 .Xr iwn 4 ,
-.Xr firmware 8
+.Xr firmware 9

Modified: user/luigi/ipfw3-head/share/man/man9/sleep.9
==============================================================================
--- user/luigi/ipfw3-head/share/man/man9/sleep.9	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/share/man/man9/sleep.9	Mon Dec 14 23:49:06 2009	(r200559)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 4, 2008
+.Dd December 12, 2009
 .Os
 .Dt SLEEP 9
 .Sh NAME
@@ -97,6 +97,7 @@ when it resumes.
 should never be used, as it is for compatibility only.
 A new priority of 0 means to use the thread's current priority when
 it is made runnable again.
+.Pp
 If
 .Fa priority
 includes the
@@ -113,6 +114,17 @@ possible, and
 is returned if the system call should be interrupted by the signal
 (return
 .Er EINTR ) .
+If
+.Dv PBDRY
+flag is specified in addition to
+.Dv PCATCH ,
+then the sleeping thread is not stopped while sleeping upon delivery of
+.Dv SIGSTOP
+or other stop action.
+Instead, it is waken up, assuming that stop occurs on reaching a stop
+point when returning to usermode.
+The flag should be used when sleeping thread owns resources, for instance
+vnode locks, that should be freed timely.
 .Pp
 The parameter
 .Fa wmesg

Modified: user/luigi/ipfw3-head/share/man/man9/sleepqueue.9
==============================================================================
--- user/luigi/ipfw3-head/share/man/man9/sleepqueue.9	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/share/man/man9/sleepqueue.9	Mon Dec 14 23:49:06 2009	(r200559)
@@ -23,7 +23,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 13, 2007
+.Dd December 12, 2009
 .Dt SLEEPQUEUE 9
 .Os
 .Sh NAME
@@ -41,6 +41,7 @@
 .Nm sleepq_remove ,
 .Nm sleepq_signal ,
 .Nm sleepq_set_timeout ,
+.Nm sleepq_sleepcnt ,
 .Nm sleepq_timedwait ,
 .Nm sleepq_timedwait_sig ,
 .Nm sleepq_wait ,
@@ -77,6 +78,8 @@
 .Fn sleepq_signal "void *wchan" "int flags" "int pri" "int queue"
 .Ft void
 .Fn sleepq_set_timeout "void *wchan" "int timo"
+.Ft u_int
+.Fn sleepq_sleepcnt "void *wchan" "int queue"
 .Ft int
 .Fn sleepq_timedwait "void *wchan"
 .Ft int
@@ -195,12 +198,19 @@ A sleep queue used to implement
 .Xr pause 9 .
 .El
 .Pp
-There is currently only one optional flag:
+There are currently two optional flag:
 .Pp
 .Bl -tag -width ".Dv SLEEPQ_INTERRUPTIBLE" -compact
 .It Dv SLEEPQ_INTERRUPTIBLE
 The current thread is entering an interruptible sleep.
 .El
+.Bl -tag -width ".Dv SLEEPQ_STOP_ON_BDRY" -compact
+.It Dv SLEEPQ_STOP_ON_BDRY
+When thread is entering an interruptible sleep, do not stop it upon
+arrival of stop action, like
+.Dv SIGSTOP .
+Wake it up instead.
+.El
 .Pp
 A timeout on the sleep may be specified by calling
 .Fn sleepq_set_timeout
@@ -348,6 +358,14 @@ One possible use is waking up a specific
 channel.
 .Pp
 The
+.Fn sleepq_sleepcnt
+function offer a simple way to retrieve the number of threads sleeping for
+the specified
+.Fa queue ,
+given a
+.Fa wchan .
+.Pp
+The
 .Fn sleepq_abort ,
 .Fn sleepq_broadcast ,
 and

Modified: user/luigi/ipfw3-head/share/termcap/termcap.5
==============================================================================
--- user/luigi/ipfw3-head/share/termcap/termcap.5	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/share/termcap/termcap.5	Mon Dec 14 23:49:06 2009	(r200559)
@@ -53,7 +53,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 16, 1994
+.Dd December 13, 2009
 .Dt TERMCAP 5
 .Os
 .Sh NAME
@@ -1999,6 +1999,25 @@ Unfortunately, due to lack of a definiti
 only
 .Xr terminfo 5
 supports these capabilities.
+.Pp
+For the
+.Xr xterm 1
+terminal emulator the traditional behavior in
+.Fx
+when exiting a pager such as
+.Xr less 1
+or
+.Xr more 1 ,
+or an editor such as
+.Xr vi 1
+is
+.Em NOT
+to clear the screen after the program exits.
+If you prefer to clear the screen there are a number of
+.Dq xterm-clear
+entries that add this capability in the
+.Nm
+file that you can use directly, or as examples.
 .Ss Glitches and Braindamage
 Hazeltine terminals, which do not allow `~' characters to be displayed,
 should indicate
@@ -2105,6 +2124,7 @@ Hash database file containing terminal d
 .Xr tset 1 ,
 .Xr ul 1 ,
 .Xr vi 1 ,
+.Xr xterm 1 ,
 .Xr ncurses 3 ,
 .Xr printf 3 ,
 .Xr termcap 3 ,

Modified: user/luigi/ipfw3-head/share/termcap/termcap.src
==============================================================================
--- user/luigi/ipfw3-head/share/termcap/termcap.src	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/share/termcap/termcap.src	Mon Dec 14 23:49:06 2009	(r200559)
@@ -2800,7 +2800,12 @@ SW|screen-w|VT 100/ANSI X3.64 virtual te
 #
 #	I checked the limits using ncurses "captoinfo -CrTUvx", which prints
 #	the resolved length of each entry in a comment at the end - T.Dickey
+
+# Add the capability to "clear the screen" after exiting vi, more/less, etc.
 #
+xterm-clear:\
+	:te=\E[?1049l:ti=\E[?1049h:\
+	:tc=xterm-new:
 xterm-new|modern xterm:\
 	:*6=\EOF:@7=\EOF:F1=\E[23~:F2=\E[24~:K2=\EOE:Km=\E[M:\
 	:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\
@@ -2820,7 +2825,7 @@ xterm-basic|modern xterm common:\
 	:kD=\E[3~:kb=^H:ke=\E[?1l\E>:ks=\E[?1h\E=:le=^H:md=\E[1m:\
 	:me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:op=\E[39;49m:\
 	:rc=\E8:rs=\E[!p\E[?3;4l\E[4l\E>:sc=\E7:se=\E[27m:sf=^J:\
-	:so=\E[7m:sr=\EM:st=\EH:te=\E[?1049l:ti=\E[?1049h:\
+	:so=\E[7m:sr=\EM:st=\EH:\
 	:ue=\E[24m:up=\E[A:us=\E[4m:ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h:
 
 # The xterm-new description has all of the features, but is not completely
@@ -2886,6 +2891,12 @@ xterm-xmc|xterm alias 6:\
 #
 # An 8-bit description is doable with termcap, but there are probably no
 # termcap (or BSD curses) applications that are able to use it.
+#
+# Add the capability to "clear the screen" after exiting vi, more/less, etc.
+#
+xterm-8bit-clear:\
+	:te=\233?1049l:ti=\233?1049h:ue=\23324m:\
+	:tc=xterm-8bit:
 xterm-8bit|xterm terminal emulator 8-bit controls (X Window System):\
 	:am:km:mi:ms:xn:\
 	:co#80:it#8:li#24:\
@@ -2902,7 +2913,7 @@ xterm-8bit|xterm terminal emulator 8-bit
 	:ke=\233?1l\E>:kh=\2331~:kl=\217D:kr=\217C:ks=\233?1h\E=:\
 	:ku=\217A:le=^H:mb=\2335m:md=\2331m:me=\233m:mr=\2337m:\
 	:nd=\233C:rc=\E8:sc=\E7:se=\23327m:sf=^J:so=\2337m:sr=\215:\
-	:st=\210:ta=^I:te=\233?1049l:ti=\233?1049h:ue=\23324m:\
+	:st=\210:ta=^I:ue=\23324m:\
 	:up=\233A:us=\2334m:vb=\233?5h\233?5l:ve=\233?25l\233?25h:\
 	:vs=\233?12;25h:vi=\233?25l:
 #
@@ -2941,6 +2952,12 @@ xterm-ic|xterm-vi|xterm with insert char
 	:IC=\E[%d@:ei@:ic=\E[@:im@:tc=xterm:
 #
 # Compatible with the X11R6.3 xterm
+#
+# Add the capability to "clear the screen" after exiting vi, more/less, etc.
+#
+xterm-r6-clear:\
+	:te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:ue=\E[m:\
+	:tc=xterm-r6:
 xterm-r6|xterm-old|X11R6 xterm:\
 	:am:bs:km:mi:ms:pt:xn:\
 	:co#80:kn#20:li#24:\
@@ -2958,10 +2975,16 @@ xterm-r6|xterm-old|X11R6 xterm:\
 	:ke=\E[?1l\E>:kh=\E[1~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\
 	:ku=\EOA:md=\E[1m:me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:\
 	:rc=\E8:rs=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8:\
-	:sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:te=\E[2J\E[?47l\E8:\
-	:ti=\E7\E[?47h:ue=\E[m:up=\E[A:us=\E[4m:
+	:sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:\
+	:ue=\E[m:up=\E[A:us=\E[4m:
 #
 # Compatible with the R5 xterm
+#
+# Add the capability to "clear the screen" after exiting vi, more/less, etc.
+#
+xterm-r5-clear:\
+	:te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:ue=\E[m:\
+	:tc=xterm-r5:
 xterm-r5|X11R5 xterm X11R5:\
 	:am:bs:km:mi:ms:pt:xn:\
 	:co#80:kn#4:li#24:\
@@ -2974,8 +2997,8 @@ xterm-r5|X11R5 xterm X11R5:\
 	:ke=\E[?1l\E>:kh=\E[1~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\
 	:ku=\EOA:md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:rc=\E8:\
 	:rs=\E>\E[?1;3;4;5;6l\E[4l\E[?7h\E[m\E[r\E[2J\E[H:\
-	:sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:te=\E[2J\E[?47l\E8:\
-	:ti=\E7\E[?47h:ue=\E[m:up=\E[A:us=\E[4m:
+	:sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:\
+	:up=\E[A:us=\E[4m:
 #
 # Customization begins here.
 xterm-xfree86|xterm terminal emulator (XFree86):\

Modified: user/luigi/ipfw3-head/sys/amd64/amd64/vm_machdep.c
==============================================================================
--- user/luigi/ipfw3-head/sys/amd64/amd64/vm_machdep.c	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/sys/amd64/amd64/vm_machdep.c	Mon Dec 14 23:49:06 2009	(r200559)
@@ -330,10 +330,14 @@ cpu_set_syscall_retval(struct thread *td
 
 	case ERESTART:
 		/*
-		 * Reconstruct pc, we know that 'syscall' is 2 bytes.
+		 * Reconstruct pc, we know that 'syscall' is 2 bytes,
+		 * lcall $X,y is 7 bytes, int 0x80 is 2 bytes.
+		 * We saved this in tf_err.
 		 * We have to do a full context restore so that %r10
 		 * (which was holding the value of %rcx) is restored
 		 * for the next iteration.
+		 * r10 restore is only required for freebsd/amd64 processes,
+		 * but shall be innocent for any ia32 ABI.
 		 */
 		td->td_frame->tf_rip -= td->td_frame->tf_err;
 		td->td_frame->tf_r10 = td->td_frame->tf_rcx;

Modified: user/luigi/ipfw3-head/sys/amd64/ia32/ia32_syscall.c
==============================================================================
--- user/luigi/ipfw3-head/sys/amd64/ia32/ia32_syscall.c	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/sys/amd64/ia32/ia32_syscall.c	Mon Dec 14 23:49:06 2009	(r200559)
@@ -183,35 +183,7 @@ ia32_syscall(struct trapframe *frame)
 		AUDIT_SYSCALL_EXIT(error, td);
 	}
 
-	switch (error) {
-	case 0:
-		frame->tf_rax = td->td_retval[0];
-		frame->tf_rdx = td->td_retval[1];
-		frame->tf_rflags &= ~PSL_C;
-		break;
-
-	case ERESTART:
-		/*
-		 * Reconstruct pc, assuming lcall $X,y is 7 bytes,
-		 * int 0x80 is 2 bytes. We saved this in tf_err.
-		 */
-		frame->tf_rip -= frame->tf_err;
-		break;
-
-	case EJUSTRETURN:
-		break;
-
-	default:
- 		if (p->p_sysent->sv_errsize) {
- 			if (error >= p->p_sysent->sv_errsize)
-  				error = -1;	/* XXX */
-   			else
-  				error = p->p_sysent->sv_errtbl[error];
-		}
-		frame->tf_rax = error;
-		frame->tf_rflags |= PSL_C;
-		break;
-	}
+	cpu_set_syscall_retval(td, error);
 
 	/*
 	 * Traced syscall.

Modified: user/luigi/ipfw3-head/sys/boot/common/Makefile.inc
==============================================================================
--- user/luigi/ipfw3-head/sys/boot/common/Makefile.inc	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/sys/boot/common/Makefile.inc	Mon Dec 14 23:49:06 2009	(r200559)
@@ -23,6 +23,11 @@ SRCS+=	dev_net.c
 SRCS+=  bcache.c
 .endif
 
+.if defined(MD_IMAGE_SIZE)
+CFLAGS+= -DMD_IMAGE_SIZE=${MD_IMAGE_SIZE}
+SRCS+=	md.c
+.endif
+
 # Machine-independant ISA PnP
 .if defined(HAVE_ISABUS)
 SRCS+=	isapnp.c

Copied: user/luigi/ipfw3-head/sys/boot/common/md.c (from r200555, head/sys/boot/common/md.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/luigi/ipfw3-head/sys/boot/common/md.c	Mon Dec 14 23:49:06 2009	(r200559, copy of r200555, head/sys/boot/common/md.c)
@@ -0,0 +1,151 @@
+/*-
+ * Copyright (c) 2009 Marcel Moolenaar
+ * 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.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/endian.h>
+#include <sys/queue.h>
+#include <machine/stdarg.h>
+#include <stand.h>
+
+#include "bootstrap.h"
+
+#define	MD_BLOCK_SIZE	512
+
+#ifndef MD_IMAGE_SIZE
+#error Must be compiled with MD_IMAGE_SIZE defined
+#endif
+#if (MD_IMAGE_SIZE == 0 || MD_IMAGE_SIZE % MD_BLOCK_SIZE)
+#error Image size must be a multiple of 512.
+#endif
+
+/*
+ * Preloaded image gets put here.
+ * Applications that patch the object with the image can determine
+ * the size looking at the start and end markers (strings),
+ * so we want them contiguous.
+ */
+static struct {
+	u_char start[MD_IMAGE_SIZE];
+	u_char end[128];
+} md_image = {
+	.start = "MFS Filesystem goes here",
+	.end = "MFS Filesystem had better STOP here",
+};
+
+/* devsw I/F */
+static int md_init(void);
+static int md_strategy(void *, int, daddr_t, size_t, char *, size_t *);
+static int md_open(struct open_file *, ...);
+static int md_close(struct open_file *);
+static void md_print(int);
+
+struct devsw md_dev = {
+	"md",
+	DEVT_DISK,
+	md_init,
+	md_strategy,
+	md_open,
+	md_close,
+	noioctl,
+	md_print
+};
+
+static int
+md_init(void)
+{
+
+	return (0);
+}
+
+static int
+md_strategy(void *devdata, int rw, daddr_t blk, size_t size, char *buf,
+    size_t *rsize)
+{
+	struct devdesc *dev = (struct devdesc *)devdata;
+	size_t ofs;
+
+	if (dev->d_unit != 0)
+		return (ENXIO);
+
+	if (blk < 0 || blk >= (MD_IMAGE_SIZE / MD_BLOCK_SIZE))
+		return (EIO);
+
+	if (size % MD_BLOCK_SIZE)
+		return (EIO);
+
+	ofs = blk * MD_BLOCK_SIZE;
+	if ((ofs + size) > MD_IMAGE_SIZE)
+		size = MD_IMAGE_SIZE - ofs;
+
+	if (rsize != 0)
+		*rsize = size;
+
+	switch (rw) {
+	case F_READ:
+		bcopy(md_image.start + ofs, buf, size);
+		return (0);
+	case F_WRITE:
+		bcopy(buf, md_image.start + ofs, size);
+		return (0);
+	}
+
+	return (ENODEV);
+}
+
+static int
+md_open(struct open_file *f, ...)
+{
+	va_list ap;
+	struct devdesc *dev;
+
+	va_start(ap, f);
+	dev = va_arg(ap, struct devdesc *);
+	va_end(ap);
+
+	if (dev->d_unit != 0)
+		return (ENXIO);
+
+	return (0);
+}
+
+static int
+md_close(struct open_file *f)
+{
+	struct devdesc *dev;
+
+	dev = (struct devdesc *)(f->f_devdata);
+	return ((dev->d_unit != 0) ? ENXIO : 0);
+}
+
+static void
+md_print(int verbose)
+{
+
+	printf("MD (%u bytes)\n", MD_IMAGE_SIZE);
+}

Modified: user/luigi/ipfw3-head/sys/boot/pc98/boot2/Makefile
==============================================================================
--- user/luigi/ipfw3-head/sys/boot/pc98/boot2/Makefile	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/sys/boot/pc98/boot2/Makefile	Mon Dec 14 23:49:06 2009	(r200559)
@@ -28,6 +28,12 @@ CFLAGS+=	-DCOMCONSOLE=${BOOT_COMCONSOLE_
 BOOT_COMCONSOLE_SPEED?=9600
 CFLAGS+=	-DCOMSPEED=${BOOT_COMCONSOLE_SPEED}
 
+# Set machine type to PC98_SYSTEM_PARAMETER
+CFLAGS+=	-DSET_MACHINE_TYPE
+
+# Initialize the bi_bios_geom using the BIOS geometry
+CFLAGS+=	-DGET_BIOSGEOM
+
 # Enable code to take the default boot string from a fixed location on the
 # disk.  See nextboot(8) and README.386BSD for more info.
 #CFLAGS+=	-DNAMEBLOCK

Modified: user/luigi/ipfw3-head/sys/boot/pc98/boot2/bios.S
==============================================================================
--- user/luigi/ipfw3-head/sys/boot/pc98/boot2/bios.S	Mon Dec 14 22:55:20 2009	(r200558)
+++ user/luigi/ipfw3-head/sys/boot/pc98/boot2/bios.S	Mon Dec 14 23:49:06 2009	(r200559)
@@ -91,8 +91,6 @@ WITH THE USE OR PERFORMANCE OF THIS SOFT
 #include "asm.h"
 	.text
 
-#ifndef CDBOOT

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-user mailing list