From owner-svn-src-user@freebsd.org Fri Jan 15 02:58:24 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6746A83540 for ; Fri, 15 Jan 2016 02:58:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A9A21DEE; Fri, 15 Jan 2016 02:58:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0F2wNLD050825; Fri, 15 Jan 2016 02:58:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0F2wKPN050797; Fri, 15 Jan 2016 02:58:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601150258.u0F2wKPN050797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 15 Jan 2016 02:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r294069 - in user/ngie/stable-10-libnv: . contrib/llvm/patches contrib/llvm/tools/clang/tools/driver crypto/openssh etc gnu/usr.bin/groff/tmac include lib/clang lib/libpmc release relea... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 02:58:24 -0000 Author: ngie Date: Fri Jan 15 02:58:20 2016 New Revision: 294069 URL: https://svnweb.freebsd.org/changeset/base/294069 Log: MFstable/10 @ r294068 Added: user/ngie/stable-10-libnv/sys/dev/bxe/bxe_dump.h - copied unchanged from r294068, stable/10/sys/dev/bxe/bxe_dump.h user/ngie/stable-10-libnv/sys/dev/bxe/bxe_ioctl.h - copied unchanged from r294068, stable/10/sys/dev/bxe/bxe_ioctl.h user/ngie/stable-10-libnv/sys/dev/sfxge/common/ef10_impl.h - copied unchanged from r294068, stable/10/sys/dev/sfxge/common/ef10_impl.h user/ngie/stable-10-libnv/sys/dev/sfxge/common/medford_impl.h - copied unchanged from r294068, stable/10/sys/dev/sfxge/common/medford_impl.h user/ngie/stable-10-libnv/sys/dev/sfxge/common/medford_nic.c - copied unchanged from r294068, stable/10/sys/dev/sfxge/common/medford_nic.c user/ngie/stable-10-libnv/usr.bin/clang/clang/CC.sh - copied unchanged from r294068, stable/10/usr.bin/clang/clang/CC.sh user/ngie/stable-10-libnv/usr.sbin/sesutil/eltsub.c - copied unchanged from r294068, stable/10/usr.sbin/sesutil/eltsub.c user/ngie/stable-10-libnv/usr.sbin/sesutil/eltsub.h - copied unchanged from r294068, stable/10/usr.sbin/sesutil/eltsub.h Deleted: user/ngie/stable-10-libnv/contrib/llvm/patches/patch-r257109-add-CC-aliases.diff Modified: user/ngie/stable-10-libnv/Makefile user/ngie/stable-10-libnv/contrib/llvm/tools/clang/tools/driver/driver.cpp user/ngie/stable-10-libnv/crypto/openssh/readconf.c user/ngie/stable-10-libnv/etc/Makefile user/ngie/stable-10-libnv/gnu/usr.bin/groff/tmac/mdoc.local.in user/ngie/stable-10-libnv/include/limits.h user/ngie/stable-10-libnv/lib/clang/clang.build.mk user/ngie/stable-10-libnv/lib/libpmc/pmc.h user/ngie/stable-10-libnv/release/doc/en_US.ISO8859-1/errata/article.xml user/ngie/stable-10-libnv/release/doc/share/xml/errata.xml user/ngie/stable-10-libnv/release/doc/share/xml/security.xml user/ngie/stable-10-libnv/release/release.sh user/ngie/stable-10-libnv/share/man/man4/sfxge.4 user/ngie/stable-10-libnv/share/mk/local.sys.mk user/ngie/stable-10-libnv/share/mk/sys.mk user/ngie/stable-10-libnv/sys/amd64/linux32/linux32_proto.h user/ngie/stable-10-libnv/sys/amd64/linux32/linux32_systrace_args.c user/ngie/stable-10-libnv/sys/amd64/linux32/syscalls.master user/ngie/stable-10-libnv/sys/boot/forth/loader.conf user/ngie/stable-10-libnv/sys/boot/forth/menu-commands.4th user/ngie/stable-10-libnv/sys/boot/forth/menu.rc user/ngie/stable-10-libnv/sys/boot/forth/support.4th user/ngie/stable-10-libnv/sys/boot/i386/loader/main.c user/ngie/stable-10-libnv/sys/boot/userboot/userboot/main.c user/ngie/stable-10-libnv/sys/boot/zfs/libzfs.h user/ngie/stable-10-libnv/sys/boot/zfs/zfs.c user/ngie/stable-10-libnv/sys/boot/zfs/zfsimpl.c user/ngie/stable-10-libnv/sys/compat/linux/linux_futex.c user/ngie/stable-10-libnv/sys/compat/linux/linux_misc.c user/ngie/stable-10-libnv/sys/conf/files.amd64 user/ngie/stable-10-libnv/sys/conf/newvers.sh user/ngie/stable-10-libnv/sys/dev/bxe/bxe.c user/ngie/stable-10-libnv/sys/dev/bxe/bxe.h user/ngie/stable-10-libnv/sys/dev/bxe/bxe_stats.c user/ngie/stable-10-libnv/sys/dev/bxe/bxe_stats.h user/ngie/stable-10-libnv/sys/dev/bxe/ecore_init.h user/ngie/stable-10-libnv/sys/dev/drm2/i915/i915_gem.c user/ngie/stable-10-libnv/sys/dev/e1000/if_igb.c user/ngie/stable-10-libnv/sys/dev/e1000/if_igb.h user/ngie/stable-10-libnv/sys/dev/hwpmc/hwpmc_mod.c user/ngie/stable-10-libnv/sys/dev/hyperv/include/hyperv.h user/ngie/stable-10-libnv/sys/dev/hyperv/vmbus/hv_channel_mgmt.c user/ngie/stable-10-libnv/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c user/ngie/stable-10-libnv/sys/dev/hyperv/vmbus/hv_vmbus_priv.h user/ngie/stable-10-libnv/sys/dev/ixgbe/if_ix.c user/ngie/stable-10-libnv/sys/dev/ixgbe/if_ixv.c user/ngie/stable-10-libnv/sys/dev/ixgbe/ix_txrx.c user/ngie/stable-10-libnv/sys/dev/ixgbe/ixgbe.h user/ngie/stable-10-libnv/sys/dev/ixgbe/ixgbe_mbx.h user/ngie/stable-10-libnv/sys/dev/ixgbe/ixgbe_vf.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/ef10_tlv_layout.h user/ngie/stable-10-libnv/sys/dev/sfxge/common/efsys.h user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx.h user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_bootcfg.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_check.h user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_crc32.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_ev.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_filter.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_hash.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_impl.h user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_intr.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_mac.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_mcdi.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_mcdi.h user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_mon.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_nic.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_nvram.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_phy.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_port.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_regs_ef10.h user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_regs_mcdi.h user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_rx.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_sram.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_tx.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_types.h user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_vpd.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/efx_wol.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/hunt_ev.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/hunt_filter.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/hunt_impl.h user/ngie/stable-10-libnv/sys/dev/sfxge/common/hunt_intr.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/hunt_mac.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/hunt_mcdi.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/hunt_nic.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/hunt_nvram.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/hunt_phy.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/hunt_rx.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/hunt_sram.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/hunt_tx.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/hunt_vpd.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/mcdi_mon.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/mcdi_mon.h user/ngie/stable-10-libnv/sys/dev/sfxge/common/siena_flash.h user/ngie/stable-10-libnv/sys/dev/sfxge/common/siena_impl.h user/ngie/stable-10-libnv/sys/dev/sfxge/common/siena_mac.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/siena_mcdi.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/siena_nic.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/siena_nvram.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/siena_phy.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/siena_sram.c user/ngie/stable-10-libnv/sys/dev/sfxge/common/siena_vpd.c user/ngie/stable-10-libnv/sys/dev/sfxge/sfxge.c user/ngie/stable-10-libnv/sys/dev/sfxge/sfxge.h user/ngie/stable-10-libnv/sys/dev/sfxge/sfxge_mcdi.c user/ngie/stable-10-libnv/sys/dev/sfxge/sfxge_tx.c user/ngie/stable-10-libnv/sys/dev/sfxge/sfxge_tx.h user/ngie/stable-10-libnv/sys/fs/ext2fs/ext2_vfsops.c user/ngie/stable-10-libnv/sys/i386/linux/syscalls.master user/ngie/stable-10-libnv/sys/kern/kern_ktr.c user/ngie/stable-10-libnv/sys/kern/kern_prot.c user/ngie/stable-10-libnv/sys/modules/if_gif/Makefile user/ngie/stable-10-libnv/sys/modules/sfxge/Makefile user/ngie/stable-10-libnv/sys/netinet/tcp_output.c user/ngie/stable-10-libnv/sys/netinet6/sctp6_usrreq.c user/ngie/stable-10-libnv/sys/sparc64/include/ktr.h user/ngie/stable-10-libnv/sys/sparc64/sparc64/exception.S user/ngie/stable-10-libnv/sys/sparc64/sparc64/mp_exception.S user/ngie/stable-10-libnv/sys/sparc64/sparc64/pmap.c user/ngie/stable-10-libnv/sys/sparc64/sparc64/swtch.S user/ngie/stable-10-libnv/sys/sys/pmc.h user/ngie/stable-10-libnv/sys/sys/ucred.h user/ngie/stable-10-libnv/tools/build/mk/OptionalObsoleteFiles.inc user/ngie/stable-10-libnv/tools/regression/geom_concat/conf.sh user/ngie/stable-10-libnv/tools/regression/geom_mirror/conf.sh user/ngie/stable-10-libnv/tools/regression/geom_raid3/conf.sh user/ngie/stable-10-libnv/tools/regression/geom_shsec/conf.sh user/ngie/stable-10-libnv/tools/regression/geom_stripe/conf.sh user/ngie/stable-10-libnv/tools/regression/geom_subr.sh user/ngie/stable-10-libnv/usr.bin/cap_mkdb/cap_mkdb.c user/ngie/stable-10-libnv/usr.bin/clang/clang/Makefile user/ngie/stable-10-libnv/usr.bin/truss/syscall.h user/ngie/stable-10-libnv/usr.bin/truss/syscalls.c user/ngie/stable-10-libnv/usr.sbin/pmcstat/pmcpl_gprof.c user/ngie/stable-10-libnv/usr.sbin/pmcstat/pmcstat.8 user/ngie/stable-10-libnv/usr.sbin/pmcstat/pmcstat.c user/ngie/stable-10-libnv/usr.sbin/pmcstat/pmcstat.h user/ngie/stable-10-libnv/usr.sbin/services_mkdb/services_mkdb.c user/ngie/stable-10-libnv/usr.sbin/sesutil/Makefile user/ngie/stable-10-libnv/usr.sbin/sesutil/sesutil.8 user/ngie/stable-10-libnv/usr.sbin/sesutil/sesutil.c Directory Properties: user/ngie/stable-10-libnv/ (props changed) Modified: user/ngie/stable-10-libnv/Makefile ============================================================================== --- user/ngie/stable-10-libnv/Makefile Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/Makefile Fri Jan 15 02:58:20 2016 (r294069) @@ -203,7 +203,7 @@ _TARGET_ARCH?= ${MACHINE_ARCH} # The user can define ALWAYS_CHECK_MAKE to have this check performed # for all targets. # -.if defined(ALWAYS_CHECK_MAKE) +.if defined(ALWAYS_CHECK_MAKE) || !defined(.PARSEDIR) ${TGTS}: upgrade_checks .else buildworld: upgrade_checks @@ -358,7 +358,7 @@ MMAKE= ${MMAKEENV} ${MAKE} \ -D_UPGRADING \ -DNOMAN -DNO_MAN -DNOSHARED -DNO_SHARED \ -DNO_CPU_CFLAGS -DNO_WERROR \ - DESTDIR= MK_TESTS=no PROGNAME=${MYMAKE:T} + DESTDIR= -DNO_TESTS PROGNAME=${MYMAKE:T} make bmake: .PHONY @echo Modified: user/ngie/stable-10-libnv/contrib/llvm/tools/clang/tools/driver/driver.cpp ============================================================================== --- user/ngie/stable-10-libnv/contrib/llvm/tools/clang/tools/driver/driver.cpp Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/contrib/llvm/tools/clang/tools/driver/driver.cpp Fri Jan 15 02:58:20 2016 (r294069) @@ -215,14 +215,12 @@ static void ParseProgName(SmallVectorImp } suffixes [] = { { "clang", 0 }, { "clang++", "--driver-mode=g++" }, - { "clang-CC", "--driver-mode=g++" }, { "clang-c++", "--driver-mode=g++" }, { "clang-cc", 0 }, { "clang-cpp", "--driver-mode=cpp" }, { "clang-g++", "--driver-mode=g++" }, { "clang-gcc", 0 }, { "clang-cl", "--driver-mode=cl" }, - { "CC", "--driver-mode=g++" }, { "cc", 0 }, { "cpp", "--driver-mode=cpp" }, { "cl" , "--driver-mode=cl" }, Modified: user/ngie/stable-10-libnv/crypto/openssh/readconf.c ============================================================================== --- user/ngie/stable-10-libnv/crypto/openssh/readconf.c Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/crypto/openssh/readconf.c Fri Jan 15 02:58:20 2016 (r294069) @@ -1643,7 +1643,7 @@ initialize_options(Options * options) options->tun_remote = -1; options->local_command = NULL; options->permit_local_command = -1; - options->use_roaming = -1; + options->use_roaming = 0; options->visual_host_key = -1; options->ip_qos_interactive = -1; options->ip_qos_bulk = -1; @@ -1825,8 +1825,7 @@ fill_default_options(Options * options) options->tun_remote = SSH_TUNID_ANY; if (options->permit_local_command == -1) options->permit_local_command = 0; - if (options->use_roaming == -1) - options->use_roaming = 1; + options->use_roaming = 0; if (options->visual_host_key == -1) options->visual_host_key = 0; if (options->ip_qos_interactive == -1) Modified: user/ngie/stable-10-libnv/etc/Makefile ============================================================================== --- user/ngie/stable-10-libnv/etc/Makefile Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/etc/Makefile Fri Jan 15 02:58:20 2016 (r294069) @@ -86,10 +86,6 @@ BIN1+= apmd.conf BIN1+= auto_master .endif -.if ${MK_BSNMP} != "no" -BIN1+= snmpd.config -.endif - .if ${MK_FREEBSD_UPDATE} != "no" BIN1+= freebsd-update.conf .endif @@ -218,6 +214,11 @@ distribution: ${BIN2} ${DESTDIR}/etc; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ master.passwd nsmb.conf opieaccess ${DESTDIR}/etc; +.if ${MK_BSNMP} != "no" + cd ${.CURDIR}; \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ + snmpd.config ${DESTDIR}/etc; +.endif .if ${MK_AT} == "no" sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab .endif Modified: user/ngie/stable-10-libnv/gnu/usr.bin/groff/tmac/mdoc.local.in ============================================================================== --- user/ngie/stable-10-libnv/gnu/usr.bin/groff/tmac/mdoc.local.in Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/gnu/usr.bin/groff/tmac/mdoc.local.in Fri Jan 15 02:58:20 2016 (r294069) @@ -50,7 +50,7 @@ .ds doc-str-Lb-libstdthreads C11 Threads Library (libstdthreads, \-lstdthreads) . .\" Default .Os value -.ds doc-default-operating-system FreeBSD\~10.2 +.ds doc-default-operating-system FreeBSD\~10.3 . .\" FreeBSD releases not found in doc-common .ds doc-operating-system-FreeBSD-7.4 7.4 @@ -62,6 +62,7 @@ .ds doc-operating-system-FreeBSD-10.0 10.0 .ds doc-operating-system-FreeBSD-10.1 10.1 .ds doc-operating-system-FreeBSD-10.2 10.2 +.ds doc-operating-system-FreeBSD-10.3 10.3 .ds doc-operating-system-FreeBSD-11.0 11.0 . .\" Definitions for other *BSDs not (yet) in doc-common Modified: user/ngie/stable-10-libnv/include/limits.h ============================================================================== --- user/ngie/stable-10-libnv/include/limits.h Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/include/limits.h Fri Jan 15 02:58:20 2016 (r294069) @@ -59,11 +59,13 @@ #define _POSIX_TZNAME_MAX 3 #endif +#if __POSIX_VISIBLE >= 200112 #define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */ #define BC_DIM_MAX 2048 /* max array elements in bc(1) */ #define BC_SCALE_MAX 99 /* max scale value in bc(1) */ #define BC_STRING_MAX 1000 /* max const string length in bc(1) */ -#define COLL_WEIGHTS_MAX 0 /* max weights for order keyword */ +#define CHARCLASS_NAME_MAX 14 /* max character class name size */ +#define COLL_WEIGHTS_MAX 10 /* max weights for order keyword */ #define EXPR_NEST_MAX 32 /* max expressions nested in expr(1) */ #define LINE_MAX 2048 /* max bytes in an input line */ #define RE_DUP_MAX 255 /* max RE's in interval notation */ @@ -72,11 +74,14 @@ #define _POSIX2_BC_DIM_MAX 2048 #define _POSIX2_BC_SCALE_MAX 99 #define _POSIX2_BC_STRING_MAX 1000 +#define _POSIX2_CHARCLASS_NAME_MAX 14 +#define _POSIX2_COLL_WEIGHTS_MAX 2 #define _POSIX2_EQUIV_CLASS_MAX 2 #define _POSIX2_EXPR_NEST_MAX 32 #define _POSIX2_LINE_MAX 2048 #define _POSIX2_RE_DUP_MAX 255 #endif +#endif #if __POSIX_VISIBLE >= 199309 #define _POSIX_AIO_LISTIO_MAX 2 @@ -110,8 +115,6 @@ #define _POSIX_TRACE_SYS_MAX 8 #define _POSIX_TRACE_USER_EVENT_MAX 32 #define _POSIX_TTY_NAME_MAX 9 -#define _POSIX2_CHARCLASS_NAME_MAX 14 -#define _POSIX2_COLL_WEIGHTS_MAX 2 #define _POSIX_RE_DUP_MAX _POSIX2_RE_DUP_MAX #endif Modified: user/ngie/stable-10-libnv/lib/clang/clang.build.mk ============================================================================== --- user/ngie/stable-10-libnv/lib/clang/clang.build.mk Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/lib/clang/clang.build.mk Fri Jan 15 02:58:20 2016 (r294069) @@ -27,8 +27,8 @@ TARGET_ABI= gnueabi TARGET_ABI= unknown .endif -TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd10.2 -BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd10.2 +TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd10.3 +BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd10.3 CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" \ -DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\" \ -DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\" Modified: user/ngie/stable-10-libnv/lib/libpmc/pmc.h ============================================================================== --- user/ngie/stable-10-libnv/lib/libpmc/pmc.h Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/lib/libpmc/pmc.h Fri Jan 15 02:58:20 2016 (r294069) @@ -36,14 +36,15 @@ * Driver statistics. */ struct pmc_driverstats { - int pm_intr_ignored; /* #interrupts ignored */ - int pm_intr_processed; /* #interrupts processed */ - int pm_intr_bufferfull; /* #interrupts with ENOSPC */ - int pm_syscalls; /* #syscalls */ - int pm_syscall_errors; /* #syscalls with errors */ - int pm_buffer_requests; /* #buffer requests */ - int pm_buffer_requests_failed; /* #failed buffer requests */ - int pm_log_sweeps; /* #sample buffer processing passes */ + unsigned int pm_intr_ignored; /* #interrupts ignored */ + unsigned int pm_intr_processed; /* #interrupts processed */ + unsigned int pm_intr_bufferfull; /* #interrupts with ENOSPC */ + unsigned int pm_syscalls; /* #syscalls */ + unsigned int pm_syscall_errors; /* #syscalls with errors */ + unsigned int pm_buffer_requests; /* #buffer requests */ + unsigned int pm_buffer_requests_failed; /* #failed buffer requests */ + unsigned int pm_log_sweeps; /* #sample buffer processing + passes */ }; /* Modified: user/ngie/stable-10-libnv/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- user/ngie/stable-10-libnv/release/doc/en_US.ISO8859-1/errata/article.xml Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/release/doc/en_US.ISO8859-1/errata/article.xml Fri Jan 15 02:58:20 2016 (r294069) @@ -19,7 +19,7 @@ $FreeBSD$ - 2015 + 2016 The &os; Documentation Project Modified: user/ngie/stable-10-libnv/release/doc/share/xml/errata.xml ============================================================================== --- user/ngie/stable-10-libnv/release/doc/share/xml/errata.xml Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/release/doc/share/xml/errata.xml Fri Jan 15 02:58:20 2016 (r294069) @@ -89,6 +89,29 @@ Applications exiting due to segmentation violation on a correct memory address. + + + FreeBSD-EN-16:01.filemon + 14 January 2016 + bmake and + &man.filemon.4; stability issues. + + + + FreeBSD-EN-16:02.pf + 14 January 2016 + Invalid TCP checksum issue. + + + + FreeBSD-EN-16:03.yplib + 14 January 2016 + YP/NIS library + bug. + Modified: user/ngie/stable-10-libnv/release/doc/share/xml/security.xml ============================================================================== --- user/ngie/stable-10-libnv/release/doc/share/xml/security.xml Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/release/doc/share/xml/security.xml Fri Jan 15 02:58:20 2016 (r294069) @@ -53,6 +53,52 @@ 5 December 2015 Multiple vulnerabilities + + + FreeBSD-SA-16:01.sctp + 15 January 2016 + ICMPv6 error message vulnerability + + + + FreeBSD-SA-16:02.ntp + 15 January 2016 + Panic threshold bypass + vulnerability + + + + FreeBSD-SA-16:03.linux + 15 January 2016 + Incorrect futex + handling + + + + FreeBSD-SA-16:04.linux + 15 January 2016 + &man.setgroups.2; system call + vulnerability + + + + FreeBSD-SA-16:05.tcp + 15 January 2016 + MD5 signature denial of service + + + + FreeBSD-SA-16:06.bsnmpd + 15 January 2016 + Insecure default configuration file + permissions + Modified: user/ngie/stable-10-libnv/release/release.sh ============================================================================== --- user/ngie/stable-10-libnv/release/release.sh Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/release/release.sh Fri Jan 15 02:58:20 2016 (r294069) @@ -275,6 +275,7 @@ extra_chroot_setup() { PBUILD_FLAGS="${PBUILD_FLAGS} OSREL=${REVISION}" chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \ ${PBUILD_FLAGS} OPTIONS_UNSET="FOP IGOR" \ + FORCE_PKG_REGISTER=1 \ install clean distclean fi fi Modified: user/ngie/stable-10-libnv/share/man/man4/sfxge.4 ============================================================================== --- user/ngie/stable-10-libnv/share/man/man4/sfxge.4 Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/share/man/man4/sfxge.4 Fri Jan 15 02:58:20 2016 (r294069) @@ -148,6 +148,14 @@ Number of packets with payload that must before a connection is eligible for LRO. The idea is we should avoid coalescing segments when the sender is recovering from loss, because reducing the ACK rate can damage performance. +.It Va hw.sfxge.mcdi_logging +Enable logging of MCDI protocol messages (only available if enabled at compile-time). +.It Va hw.sfxge.N.mcdi_logging +Enable or disable logging of MCDI protocol messages on a per-port basis. The default for each +port will be the value of +.Va hw.sfxge.mcdi_logging. +The logging may also be enabled or disabled after the driver is loaded using the sysctl +.Va dev.sfxge.%d.mcdi_logging. .El .Sh SUPPORT For general information and support, Modified: user/ngie/stable-10-libnv/share/mk/local.sys.mk ============================================================================== --- user/ngie/stable-10-libnv/share/mk/local.sys.mk Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/share/mk/local.sys.mk Fri Jan 15 02:58:20 2016 (r294069) @@ -3,7 +3,7 @@ .if defined(.PARSEDIR) SRCTOP:= ${.PARSEDIR:tA:H:H} .else -SRCTOP:= ${.MAKE.MAKEFILES:M*/local.sys.mk:H:H:H} +SRCTOP:= ${.MAKEFILE_LIST:M*/local.sys.mk:H:H:H} .endif .if ${.CURDIR} == ${SRCTOP} Modified: user/ngie/stable-10-libnv/share/mk/sys.mk ============================================================================== --- user/ngie/stable-10-libnv/share/mk/sys.mk Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/share/mk/sys.mk Fri Jan 15 02:58:20 2016 (r294069) @@ -144,6 +144,8 @@ OBJCFLAGS ?= ${OBJCINCLUDES} ${CFLAGS} - OBJCOPY ?= objcopy +OBJDUMP ?= objdump + PC ?= pc PFLAGS ?= Modified: user/ngie/stable-10-libnv/sys/amd64/linux32/linux32_proto.h ============================================================================== --- user/ngie/stable-10-libnv/sys/amd64/linux32/linux32_proto.h Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/sys/amd64/linux32/linux32_proto.h Fri Jan 15 02:58:20 2016 (r294069) @@ -1023,7 +1023,7 @@ struct linux_set_robust_list_args { }; struct linux_get_robust_list_args { char pid_l_[PADL_(l_int)]; l_int pid; char pid_r_[PADR_(l_int)]; - char head_l_[PADL_(struct linux_robust_list_head *)]; struct linux_robust_list_head * head; char head_r_[PADR_(struct linux_robust_list_head *)]; + char head_l_[PADL_(struct linux_robust_list_head **)]; struct linux_robust_list_head ** head; char head_r_[PADR_(struct linux_robust_list_head **)]; char len_l_[PADL_(l_size_t *)]; l_size_t * len; char len_r_[PADR_(l_size_t *)]; }; struct linux_splice_args { Modified: user/ngie/stable-10-libnv/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- user/ngie/stable-10-libnv/sys/amd64/linux32/linux32_systrace_args.c Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/sys/amd64/linux32/linux32_systrace_args.c Fri Jan 15 02:58:20 2016 (r294069) @@ -2122,7 +2122,7 @@ systrace_args(int sysnum, void *params, case 312: { struct linux_get_robust_list_args *p = params; iarg[0] = p->pid; /* l_int */ - uarg[1] = (intptr_t) p->head; /* struct linux_robust_list_head * */ + uarg[1] = (intptr_t) p->head; /* struct linux_robust_list_head ** */ uarg[2] = (intptr_t) p->len; /* l_size_t * */ *n_args = 3; break; @@ -5551,7 +5551,7 @@ systrace_entry_setargdesc(int sysnum, in p = "l_int"; break; case 1: - p = "struct linux_robust_list_head *"; + p = "struct linux_robust_list_head **"; break; case 2: p = "l_size_t *"; Modified: user/ngie/stable-10-libnv/sys/amd64/linux32/syscalls.master ============================================================================== --- user/ngie/stable-10-libnv/sys/amd64/linux32/syscalls.master Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/sys/amd64/linux32/syscalls.master Fri Jan 15 02:58:20 2016 (r294069) @@ -520,8 +520,8 @@ ; linux 2.6.17: 311 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \ l_size_t len); } -312 AUE_NULL STD { int linux_get_robust_list(l_int pid, struct linux_robust_list_head *head, \ - l_size_t *len); } +312 AUE_NULL STD { int linux_get_robust_list(l_int pid, \ + struct linux_robust_list_head **head, l_size_t *len); } 313 AUE_NULL STD { int linux_splice(void); } 314 AUE_NULL STD { int linux_sync_file_range(void); } 315 AUE_NULL STD { int linux_tee(void); } Modified: user/ngie/stable-10-libnv/sys/boot/forth/loader.conf ============================================================================== --- user/ngie/stable-10-libnv/sys/boot/forth/loader.conf Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/sys/boot/forth/loader.conf Fri Jan 15 02:58:20 2016 (r294069) @@ -73,6 +73,7 @@ entropy_cache_type="/boot/entropy" #password="" # Prevent changes to boot options #bootlock_password="" # Prevent booting (see check-password.4th(8)) #geom_eli_passphrase_prompt="NO" # Prompt for geli(8) passphrase to mount root +bootenv_autolist="YES" # Auto populate the list of ZFS Boot Environments #beastie_disable="NO" # Turn the beastie boot menu on and off #kernels="kernel kernel.old" # Kernels to display in the boot menu #loader_logo="orbbw" # Desired logo: orbbw, orb, fbsdbw, beastiebw, beastie, none Modified: user/ngie/stable-10-libnv/sys/boot/forth/menu-commands.4th ============================================================================== --- user/ngie/stable-10-libnv/sys/boot/forth/menu-commands.4th Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/sys/boot/forth/menu-commands.4th Fri Jan 15 02:58:20 2016 (r294069) @@ -351,4 +351,68 @@ also menu-namespace also menu-command-he 2 goto_menu ; +\ +\ Set boot environment defaults +\ + +: init_bootenv ( -- ) + s" set menu_caption[1]=${bemenu_current}${vfs.root.mountfrom}" evaluate + s" set ansi_caption[1]=${beansi_current}${vfs.root.mountfrom}" evaluate + s" set menu_caption[2]=${bemenu_bootfs}${zfs_be_active}" evaluate + s" set ansi_caption[2]=${beansi_bootfs}${zfs_be_active}" evaluate + s" set menu_caption[3]=${bemenu_page}${zfs_be_currpage}${bemenu_pageof}${zfs_be_pages}" evaluate + s" set ansi_caption[3]=${beansi_page}${zfs_be_currpage}${bemenu_pageof}${zfs_be_pages}" evaluate +; + +\ +\ Redraw the entire screen. A long BE name can corrupt the menu +\ + +: be_draw_screen + clear \ Clear the screen (in screen.4th) + print_version \ print version string (bottom-right; see version.4th) + draw-beastie \ Draw FreeBSD logo at right (in beastie.4th) + draw-brand \ Draw brand.4th logo at top (in brand.4th) + menu-init \ Initialize menu and draw bounding box (in menu.4th) +; + +\ +\ Select a boot environment +\ + +: set_bootenv ( N -- N TRUE ) + dup s" set vfs.root.mountfrom=${bootenv_root[E]}" 38 +c! evaluate + s" set currdev=${vfs.root.mountfrom}:" evaluate + s" unload" evaluate + free-module-options + s" /boot/defaults/loader.conf" read-conf + s" /boot/loader.conf" read-conf + s" /boot/loader.conf.local" read-conf + init_bootenv + be_draw_screen + menu-redraw + TRUE +; + +\ +\ Switch to the next page of boot environments +\ + +: set_be_page ( N -- N TRUE ) + s" zfs_be_currpage" getenv dup -1 = if + drop s" 1" + else + 0 s>d 2swap + >number ( ud caddr/u -- ud' caddr'/u' ) \ convert string to numbers + 2drop \ drop the string + 1 um/mod ( ud u1 -- u2 u3 ) \ convert double ud' to single u3' and remainder u2 + swap drop ( ud2 u3 -- u3 ) \ drop the remainder u2 + 1+ \ increment the page number + s>d <# #s #> \ convert back to a string + then + s" zfs_be_currpage" setenv + s" reloadbe" evaluate + 3 goto_menu +; + only forth definitions Modified: user/ngie/stable-10-libnv/sys/boot/forth/menu.rc ============================================================================== --- user/ngie/stable-10-libnv/sys/boot/forth/menu.rc Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/sys/boot/forth/menu.rc Fri Jan 15 02:58:20 2016 (r294069) @@ -68,6 +68,13 @@ set mainmenu_command[6]="2 goto_menu" set mainmenu_keycode[6]=111 set mainansi_caption[6]="Configure Boot ^[1mO^[mptions..." +s" currdev" getenv dup 0> [if] drop 4 s" zfs:" compare 0= [if] + set mainmenu_caption[7]="Select Boot [E]nvironment..." + set mainmenu_command[7]="3 goto_menu" + set mainmenu_keycode[7]=101 + set mainansi_caption[7]="Select Boot ^[1mE^[37mnvironment..." +[then] [else] drop [then] + \ \ BOOT OPTIONS MENU \ @@ -119,6 +126,37 @@ set optionsmenu_keycode[6]=118 set optionsansi_caption[6]="^[1mV^[merbose..... ^[34;1mOff^[m" set optionstoggled_ansi[6]="^[1mV^[merbose..... ^[32;7mOn^[m" +\ +\ BOOT ENVIRONMENT MENU +\ + +set menuset_name3="bootenv" + +set bemenu_current="Active: " +set beansi_current="^[1m${bemenu_current}^[m" +set bemenu_bootfs="bootfs: " +set beansi_bootfs="^[1m${bemenu_bootfs}^[m" +set bemenu_page="[P]age: " +set beansi_page="^[1mP^[mage: " +set bemenu_pageof=" of " +set beansi_pageof="${bemenu_pageof}" +set zfs_be_currpage=1 + +set bootenvmenu_init="init_bootenv" + +set bootenvmenu_command[1]="be_draw_screen 1 goto_menu" +set bootenvmenu_keycode[1]=8 + +set bootenvmenu_command[2]="set_bootenv" +set bootenvmenu_keycode[2]=97 +set bootenv_root[2]="${zfs_be_active}" + +set bootenvmenu_command[3]="set_be_page" +set bootenvmenu_keycode[3]=112 + +set bootenvmenu_options=4 +set bootenvmenu_optionstext="Boot Environments:" + \ Enable automatic booting (add ``autoboot_delay=N'' to loader.conf(5) to \ customize the timeout; default is 10-seconds) \ @@ -128,6 +166,21 @@ set menu_timeout_command="boot" \ try-include /boot/menu.rc.local +\ Initialize boot environment variables +\ +s" reloadbe" sfind ( xt|0 bool ) [if] + s" bootenv_autolist" getenv dup -1 = [if] + drop s" execute" evaluate \ Use evaluate to avoid passing + \ reloadbe an optional parameter + [else] + s" YES" compare-insensitive 0= [if] + s" execute" evaluate + [then] + [then] +[else] + drop ( xt=0 ) +[then] + \ Display the main menu (see `menu.4th') set menuset_initial=1 menuset-loadinitial Modified: user/ngie/stable-10-libnv/sys/boot/forth/support.4th ============================================================================== --- user/ngie/stable-10-libnv/sys/boot/forth/support.4th Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/sys/boot/forth/support.4th Fri Jan 15 02:58:20 2016 (r294069) @@ -930,6 +930,30 @@ only forth definitions also support-func repeat ; +: free-one-module { addr -- addr } + addr module.name strfree + addr module.loadname strfree + addr module.type strfree + addr module.args strfree + addr module.beforeload strfree + addr module.afterload strfree + addr module.loaderror strfree + addr +; + +: free-module-options + module_options @ + begin + ?dup + while + free-one-module + dup module.next @ + swap free-memory + repeat + 0 module_options ! + 0 last_module_option ! +; + only forth also support-functions definitions \ Variables used for processing multiple conf files Modified: user/ngie/stable-10-libnv/sys/boot/i386/loader/main.c ============================================================================== --- user/ngie/stable-10-libnv/sys/boot/i386/loader/main.c Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/sys/boot/i386/loader/main.c Fri Jan 15 02:58:20 2016 (r294069) @@ -69,6 +69,7 @@ static int isa_inb(int port); static void isa_outb(int port, int value); void exit(int code); #ifdef LOADER_ZFS_SUPPORT +static void init_zfs_bootenv(char *currdev); static void i386_zfs_probe(void); #endif @@ -291,12 +292,45 @@ extract_currdev(void) new_currdev.d_unit = 0; } +#ifdef LOADER_ZFS_SUPPORT + if (new_currdev.d_type == DEVT_ZFS) + init_zfs_bootenv(zfs_fmtdev(&new_currdev)); +#endif + env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev), i386_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&new_currdev), env_noset, env_nounset); } +#ifdef LOADER_ZFS_SUPPORT +static void +init_zfs_bootenv(char *currdev) +{ + char *beroot; + + if (strlen(currdev) == 0) + return; + if(strncmp(currdev, "zfs:", 4) != 0) + return; + /* Remove the trailing : */ + currdev[strlen(currdev) - 1] = '\0'; + setenv("zfs_be_active", currdev, 1); + setenv("zfs_be_currpage", "1", 1); + /* Do not overwrite if already set */ + setenv("vfs.root.mountfrom", currdev, 0); + /* Forward past zfs: */ + currdev = strchr(currdev, ':'); + currdev++; + /* Remove the last element (current bootenv) */ + beroot = strrchr(currdev, '/'); + if (beroot != NULL) + beroot[0] = '\0'; + beroot = currdev; + setenv("zfs_be_root", beroot, 1); +} +#endif + COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); static int @@ -350,6 +384,40 @@ command_lszfs(int argc, char *argv[]) command_errmsg = strerror(err); return (CMD_ERROR); } + + return (CMD_OK); +} + +COMMAND_SET(reloadbe, "reloadbe", "refresh the list of ZFS Boot Environments", + command_reloadbe); + +static int +command_reloadbe(int argc, char *argv[]) +{ + int err; + char *root; + + if (argc > 2) { + command_errmsg = "wrong number of arguments"; + return (CMD_ERROR); + } + + if (argc == 2) { + err = zfs_bootenv(argv[1]); + } else { + root = getenv("zfs_be_root"); + if (root == NULL) { + /* There does not appear to be a ZFS pool here, exit without error */ + return (CMD_OK); + } + err = zfs_bootenv(getenv("zfs_be_root")); + } + + if (err != 0) { + command_errmsg = strerror(err); + return (CMD_ERROR); + } + return (CMD_OK); } #endif Modified: user/ngie/stable-10-libnv/sys/boot/userboot/userboot/main.c ============================================================================== --- user/ngie/stable-10-libnv/sys/boot/userboot/userboot/main.c Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/sys/boot/userboot/userboot/main.c Fri Jan 15 02:58:20 2016 (r294069) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); static void userboot_zfs_probe(void); static int userboot_zfs_found; +static void init_zfs_bootenv(char *currdev); #endif #define USERBOOT_VERSION USERBOOT_VERSION_3 @@ -167,6 +168,7 @@ extract_currdev(void) zdev.d_type = zdev.d_dev->dv_type; dev = *(struct disk_devdesc *)&zdev; + init_zfs_bootenv(zfs_fmtdev(&dev)); } else #endif @@ -198,6 +200,32 @@ extract_currdev(void) #if defined(USERBOOT_ZFS_SUPPORT) static void +init_zfs_bootenv(char *currdev) +{ + char *beroot; + + if (strlen(currdev) == 0) + return; + if(strncmp(currdev, "zfs:", 4) != 0) + return; + /* Remove the trailing : */ + currdev[strlen(currdev) - 1] = '\0'; + setenv("zfs_be_active", currdev, 1); + setenv("zfs_be_currpage", "1", 1); + /* Do not overwrite if already set */ + setenv("vfs.root.mountfrom", currdev, 0); + /* Forward past zfs: */ + currdev = strchr(currdev, ':'); + currdev++; + /* Remove the last element (current bootenv) */ + beroot = strrchr(currdev, '/'); + if (beroot != NULL) + beroot[0] = '\0'; + beroot = currdev; + setenv("zfs_be_root", beroot, 1); +} + +static void userboot_zfs_probe(void) { char devname[32]; @@ -237,6 +265,38 @@ command_lszfs(int argc, char *argv[]) } return (CMD_OK); } + +COMMAND_SET(reloadbe, "reloadbe", "refresh the list of ZFS Boot Environments", + command_reloadbe); + +static int +command_reloadbe(int argc, char *argv[]) +{ + int err; + char *root; + + if (argc > 2) { + command_errmsg = "wrong number of arguments"; + return (CMD_ERROR); + } + + if (argc == 2) { + err = zfs_bootenv(argv[1]); + } else { + root = getenv("zfs_be_root"); + if (root == NULL) { + return (CMD_OK); + } + err = zfs_bootenv(root); + } + + if (err != 0) { + command_errmsg = strerror(err); + return (CMD_ERROR); + } + + return (CMD_OK); +} #endif /* USERBOOT_ZFS_SUPPORT */ COMMAND_SET(quit, "quit", "exit the loader", command_quit); Modified: user/ngie/stable-10-libnv/sys/boot/zfs/libzfs.h ============================================================================== --- user/ngie/stable-10-libnv/sys/boot/zfs/libzfs.h Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/sys/boot/zfs/libzfs.h Fri Jan 15 02:58:20 2016 (r294069) @@ -62,6 +62,9 @@ int zfs_parsedev(struct zfs_devdesc *dev char *zfs_fmtdev(void *vdev); int zfs_probe_dev(const char *devname, uint64_t *pool_guid); int zfs_list(const char *name); +int zfs_bootenv(const char *name); +int zfs_belist_add(const char *name); +int zfs_set_env(void); extern struct devsw zfs_dev; extern struct fs_ops zfs_fsops; Modified: user/ngie/stable-10-libnv/sys/boot/zfs/zfs.c ============================================================================== --- user/ngie/stable-10-libnv/sys/boot/zfs/zfs.c Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/sys/boot/zfs/zfs.c Fri Jan 15 02:58:20 2016 (r294069) @@ -48,6 +48,10 @@ __FBSDID("$FreeBSD$"); #include "zfsimpl.c" +/* Define the range of indexes to be populated with ZFS Boot Environments */ +#define ZFS_BE_FIRST 4 +#define ZFS_BE_LAST 8 + static int zfs_open(const char *path, struct open_file *f); static int zfs_write(struct open_file *f, void *buf, size_t size, size_t *resid); static int zfs_close(struct open_file *f); @@ -80,6 +84,16 @@ struct file { zap_leaf_phys_t *f_zap_leaf; /* zap leaf buffer */ }; +static int zfs_env_index; +static int zfs_env_count; + +SLIST_HEAD(zfs_be_list, zfs_be_entry) zfs_be_head = SLIST_HEAD_INITIALIZER(zfs_be_head); +struct zfs_be_list *zfs_be_headp; +struct zfs_be_entry { + const char *name; + SLIST_ENTRY(zfs_be_entry) entries; +} *zfs_be, *zfs_be_tmp; + /* * Open a file. */ @@ -691,6 +705,161 @@ zfs_list(const char *name) rv = zfs_lookup_dataset(spa, dsname, &objid); if (rv != 0) return (rv); - rv = zfs_list_dataset(spa, objid); + + return (zfs_list_dataset(spa, objid)); +} + +int +zfs_bootenv(const char *name) +{ + static char poolname[ZFS_MAXNAMELEN], *dsname, *root; + char becount[4]; + uint64_t objid; + spa_t *spa; + int len, rv, pages, perpage, currpage; + + if (name == NULL) + return (EINVAL); + if ((root = getenv("zfs_be_root")) == NULL) + return (EINVAL); + + if (strcmp(name, root) != 0) { + if (setenv("zfs_be_root", name, 1) != 0) + return (ENOMEM); + } + + SLIST_INIT(&zfs_be_head); + zfs_env_count = 0; + len = strlen(name); + dsname = strchr(name, '/'); + if (dsname != NULL) { + len = dsname - name; + dsname++; + } else + dsname = ""; + memcpy(poolname, name, len); + poolname[len] = '\0'; + + spa = spa_find_by_name(poolname); + if (!spa) + return (ENXIO); + rv = zfs_lookup_dataset(spa, dsname, &objid); + if (rv != 0) + return (rv); + rv = zfs_callback_dataset(spa, objid, zfs_belist_add); + + /* Calculate and store the number of pages of BEs */ + perpage = (ZFS_BE_LAST - ZFS_BE_FIRST + 1); + pages = (zfs_env_count / perpage) + ((zfs_env_count % perpage) > 0 ? 1 : 0); + snprintf(becount, 4, "%d", pages); + if (setenv("zfs_be_pages", becount, 1) != 0) + return (ENOMEM); + + /* Roll over the page counter if it has exceeded the maximum */ + currpage = strtol(getenv("zfs_be_currpage"), NULL, 10); + if (currpage > pages) { + if (setenv("zfs_be_currpage", "1", 1) != 0) + return (ENOMEM); + } + + /* Populate the menu environment variables */ + zfs_set_env(); + + /* Clean up the SLIST of ZFS BEs */ + while (!SLIST_EMPTY(&zfs_be_head)) { + zfs_be = SLIST_FIRST(&zfs_be_head); + SLIST_REMOVE_HEAD(&zfs_be_head, entries); + free(zfs_be); + } + return (rv); } + +int +zfs_belist_add(const char *name) +{ + + /* Add the boot environment to the head of the SLIST */ + zfs_be = malloc(sizeof(struct zfs_be_entry)); + zfs_be->name = name; + SLIST_INSERT_HEAD(&zfs_be_head, zfs_be, entries); + zfs_env_count++; + + return (0); +} + +int +zfs_set_env(void) +{ + char envname[32], envval[256]; + char *beroot, *pagenum; + int rv, page, ctr; + + beroot = getenv("zfs_be_root"); + if (beroot == NULL) { + return (1); + } + + pagenum = getenv("zfs_be_currpage"); + if (pagenum != NULL) { + page = strtol(pagenum, NULL, 10); + } else { + page = 1; + } + + ctr = 1; + rv = 0; + zfs_env_index = ZFS_BE_FIRST; + SLIST_FOREACH_SAFE(zfs_be, &zfs_be_head, entries, zfs_be_tmp) { + /* Skip to the requested page number */ + if (ctr <= ((ZFS_BE_LAST - ZFS_BE_FIRST + 1) * (page - 1))) { + ctr++; + continue; + } + + snprintf(envname, sizeof(envname), "bootenvmenu_caption[%d]", zfs_env_index); + snprintf(envval, sizeof(envval), "%s", zfs_be->name); + rv = setenv(envname, envval, 1); + if (rv != 0) { + break; + } + + snprintf(envname, sizeof(envname), "bootenvansi_caption[%d]", zfs_env_index); + rv = setenv(envname, envval, 1); + if (rv != 0){ + break; + } + + snprintf(envname, sizeof(envname), "bootenvmenu_command[%d]", zfs_env_index); + rv = setenv(envname, "set_bootenv", 1); + if (rv != 0){ + break; + } + + snprintf(envname, sizeof(envname), "bootenv_root[%d]", zfs_env_index); + snprintf(envval, sizeof(envval), "zfs:%s/%s", beroot, zfs_be->name); + rv = setenv(envname, envval, 1); + if (rv != 0){ + break; + } + + zfs_env_index++; + if (zfs_env_index > ZFS_BE_LAST) { + break; + } + + } + + for (; zfs_env_index <= ZFS_BE_LAST; zfs_env_index++) { + snprintf(envname, sizeof(envname), "bootenvmenu_caption[%d]", zfs_env_index); + (void)unsetenv(envname); + snprintf(envname, sizeof(envname), "bootenvansi_caption[%d]", zfs_env_index); + (void)unsetenv(envname); + snprintf(envname, sizeof(envname), "bootenvmenu_command[%d]", zfs_env_index); + (void)unsetenv(envname); + snprintf(envname, sizeof(envname), "bootenv_root[%d]", zfs_env_index); + (void)unsetenv(envname); + } + + return (rv); +} \ No newline at end of file Modified: user/ngie/stable-10-libnv/sys/boot/zfs/zfsimpl.c ============================================================================== --- user/ngie/stable-10-libnv/sys/boot/zfs/zfsimpl.c Fri Jan 15 02:33:47 2016 (r294068) +++ user/ngie/stable-10-libnv/sys/boot/zfs/zfsimpl.c Fri Jan 15 02:58:20 2016 (r294069) @@ -1473,7 +1473,7 @@ zap_lookup(const spa_t *spa, const dnode * the directory contents. */ static int -mzap_list(const dnode_phys_t *dnode) +mzap_list(const dnode_phys_t *dnode, int (*callback)(const char *)) { const mzap_phys_t *mz; const mzap_ent_phys_t *mze; @@ -1492,7 +1492,7 @@ mzap_list(const dnode_phys_t *dnode) mze = &mz->mz_chunk[i]; if (mze->mze_name[0]) //printf("%-32s 0x%jx\n", mze->mze_name, (uintmax_t)mze->mze_value); - printf("%s\n", mze->mze_name); + callback(mze->mze_name); } return (0); @@ -1503,7 +1503,7 @@ mzap_list(const dnode_phys_t *dnode) * the directory header. */ static int -fzap_list(const spa_t *spa, const dnode_phys_t *dnode) +fzap_list(const spa_t *spa, const dnode_phys_t *dnode, int (*callback)(const char *)) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; zap_phys_t zh = *(zap_phys_t *) zap_scratch; @@ -1566,13 +1566,21 @@ fzap_list(const spa_t *spa, const dnode_ value = fzap_leaf_value(&zl, zc); //printf("%s 0x%jx\n", name, (uintmax_t)value); - printf("%s\n", name); + callback((const char *)name); } } return (0); } +static int zfs_printf(const char *name) +{ + *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***