MFC - tracking commit

This commit is contained in:
Mark Murray 2013-10-12 16:03:31 +00:00
commit 0e325afd7e
106 changed files with 3376 additions and 2624 deletions

View File

@ -329,7 +329,7 @@ TARGET_ABI= gnueabi
.else
TARGET_ABI= unknown
.endif
TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd10.0
TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0
XFLAGS+= -target ${TARGET_TRIPLE}
.endif
.endif

View File

@ -38,8 +38,27 @@
# xargs -n1 | sort | uniq -d;
# done
# 20131013: Removal of the ATF tools
OLD_FILES+=etc/atf/FreeBSD.conf
OLD_FILES+=etc/atf/atf-run.hooks
OLD_FILES+=etc/atf/common.conf
OLD_FILES+=usr/bin/atf-config
OLD_FILES+=usr/bin/atf-report
OLD_FILES+=usr/bin/atf-run
OLD_FILES+=usr/bin/atf-version
OLD_FILES+=usr/share/atf/atf-run.hooks
OLD_FILES+=usr/share/examples/atf/atf-run.hooks
OLD_FILES+=usr/share/examples/atf/tests-results.css
OLD_FILES+=usr/share/man/man1/atf-config.1.gz
OLD_FILES+=usr/share/man/man1/atf-report.1.gz
OLD_FILES+=usr/share/man/man1/atf-run.1.gz
OLD_FILES+=usr/share/man/man1/atf-version.1.gz
OLD_FILES+=usr/share/man/man5/atf-formats.5.gz
OLD_FILES+=usr/share/man/man7/atf.7.gz
OLD_FILES+=usr/share/xml/atf/tests-results.dtd
OLD_FILES+=usr/share/xsl/atf/tests-results.xsl
# 20131009: freebsd-version moved from /libexec to /bin
OLD_FILES+=/libexec/freebsd-version
OLD_FILES+=libexec/freebsd-version
# 20131001: ar and ranlib from binutils not used
OLD_FILES+=usr/bin/gnu-ar
OLD_FILES+=usr/bin/gnu-ranlib
@ -6093,6 +6112,13 @@ OLD_LIBS+=usr/lib/libkse.so.1
OLD_LIBS+=usr/lib/liblwres.so.3
OLD_LIBS+=usr/lib/pam_ftp.so.2
# 20131013: Removal of the ATF tools
OLD_DIRS+=etc/atf
OLD_DIRS+=usr/share/examples/atf
OLD_DIRS+=usr/share/xml/atf
OLD_DIRS+=usr/share/xml
OLD_DIRS+=usr/share/xsl/atf
OLD_DIRS+=usr/share/xsl
# 20040925: bind9 import
OLD_DIRS+=usr/share/doc/bind/html
OLD_DIRS+=usr/share/doc/bind/misc

View File

@ -16,8 +16,8 @@ from older versions of FreeBSD, try WITHOUT_CLANG to bootstrap to the tip of
head, and then rebuild without this option. The bootstrap process from
older version of current is a bit fragile.
NOTE TO PEOPLE WHO THINK THAT FreeBSD 10.x IS SLOW:
FreeBSD 10.x has many debugging features turned on, in both the kernel
NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
FreeBSD 11.x has many debugging features turned on, in both the kernel
and userland. These features attempt to detect incorrect use of
system primitives, and encourage loud failure through extra sanity
checking and fail stop semantics. They also substantially impact
@ -31,6 +31,25 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
20131010:
The rc.d/jail script has been updated to support jail(8)
configuration file. The "jail_<jname>_*" rc.conf(5) variables
for per-jail configuration are automatically converted to
/var/run/jail.<jname>.conf before the jail(8) utility is invoked.
This is transparently backward compatible. See below about some
incompatibilities and rc.conf(5) manual page for more details.
These variables are now deprecated in favor of jail(8) configuration
file. One can use "rc.d/jail config <jname>" command to generate
a jail(8) configuration file in /var/run/jail.<jname>.conf without
running the jail(8) utility. The default pathname of the
configuration file is /etc/jail.conf and can be specified by
using $jail_conf or $jail_<jname>_conf variables.
Please note that jail_devfs_ruleset accepts an integer at
this moment. Please consider to rewrite the ruleset name
with an integer.
20130930:
BIND has been removed from the base system. If all you need
is a local resolver, simply enable and start the local_unbound

View File

@ -81,7 +81,7 @@ userland_version() {
# Print a usage string and exit.
#
usage() {
echo "usage: $progname [-ku]\n" >&2
echo "usage: $progname [-ku]" >&2
exit 1
}

File diff suppressed because it is too large Load Diff

View File

@ -215,9 +215,6 @@ distribution:
echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
) | ${METALOG.add}
.endif
.if ${MK_ATF} != "no"
${_+_}cd ${.CURDIR}/atf; ${MAKE} install
.endif
.if ${MK_BLUETOOTH} != "no"
${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
.endif

View File

@ -1,12 +0,0 @@
Content-Type: application/X-atf-config; version="1"
# $FreeBSD$
#
# Configuration file for the FreeBSD test suite.
#
# See atf-formats(5) for details on the syntax of this file and tests(7) for
# details on the FreeBSD test suite.
#
#variable1 = value1
#variable2 = value2

View File

@ -1,39 +0,0 @@
#-
# Copyright (c) 2011 Google, Inc.
# 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.
#
# $FreeBSD$
ATF= ${.CURDIR}/../../contrib/atf
.PATH: ${ATF}/atf-run/sample
NO_OBJ=
FILESGROUPS= ETC
ETCDIR= /etc/atf
ETC= FreeBSD.conf atf-run.hooks common.conf
.include <bsd.prog.mk>

View File

@ -1,12 +0,0 @@
Content-Type: application/X-atf-config; version="1"
# $FreeBSD$
#
# Sample configuration file for properties affecting all test suites.
#
# When running the test suite as root, some tests require to switch to
# an unprivileged user to perform extra checks. Set this variable to
# the user you want to use in those cases. If not set, those tests will
# be skipped.
unprivileged-user = "_atf"

View File

@ -190,7 +190,7 @@ weekly_noid_dirs="/" # Look here
# 400.status-pkg
weekly_status_pkg_enable="NO" # Find out-of-date pkgs
pkg_version=pkg_version # Use this program
pkg_version_index=/usr/ports/INDEX-10 # Use this index file
pkg_version_index=/usr/ports/INDEX-11 # Use this index file
# 450.status-security
weekly_status_security_enable="YES" # Security check

View File

@ -675,44 +675,11 @@ mixer_enable="YES" # Run the sound mixer.
opensm_enable="NO" # Opensm(8) for infiniband devices defaults to off
##############################################################
### Jail Configuration #######################################
### Jail Configuration (see rc.conf(5) manual page) ##########
##############################################################
jail_enable="NO" # Set to NO to disable starting of any jails
jail_parallel_start="NO" # Start jails in the background
jail_list="" # Space separated list of names of jails
jail_set_hostname_allow="YES" # Allow root user in a jail to change its hostname
jail_socket_unixiproute_only="YES" # Route only TCP/IP within a jail
jail_sysvipc_allow="NO" # Allow SystemV IPC use from within a jail
#
# To use rc's built-in jail infrastructure create entries for
# each jail, specified in jail_list, with the following variables.
# NOTES:
# - replace 'example' with the jail's name.
# - except rootdir, hostname, ip and the _multi<n> addresses,
# all of the following variables may be made global jail variables
# if you don't specify a jail name (ie. jail_interface, jail_devfs_ruleset).
#
#jail_example_rootdir="/usr/jail/default" # Jail's root directory
#jail_example_hostname="default.domain.com" # Jail's hostname
#jail_example_interface="" # Jail's interface variable to create IP aliases on
#jail_example_fib="0" # Routing table for setfib(1)
#jail_example_ip="192.0.2.10,2001:db8::17" # Jail's primary IPv4 and IPv6 address
#jail_example_ip_multi0="2001:db8::10" # and another IPv6 address
#jail_example_exec_start="/bin/sh /etc/rc" # command to execute in jail for starting
#jail_example_exec_afterstart0="/bin/sh command" # command to execute after the one for
# starting the jail. More than one can be
# specified using a trailing number
#jail_example_exec_stop="/bin/sh /etc/rc.shutdown" # command to execute in jail for stopping
#jail_example_devfs_enable="NO" # mount devfs in the jail
#jail_example_devfs_ruleset="ruleset_name" # devfs ruleset to apply to jail -
# usually you want "devfsrules_jail".
#jail_example_fdescfs_enable="NO" # mount fdescfs in the jail
#jail_example_procfs_enable="NO" # mount procfs in jail
#jail_example_mount_enable="NO" # mount/umount jail's fs
#jail_example_fstab="" # fstab(5) for mount/umount
#jail_example_flags="-l -U root" # flags for jail(8)
#jail_example_parameters="allow.raw_sockets=1" # extra parameters for this jail
##############################################################
### Define source_rc_confs, the mechanism used by /etc/rc.* ##

View File

@ -15,7 +15,6 @@ man
sshd
smmsp
mailnull
_atf
bind
unbound
proxy

View File

@ -16,7 +16,6 @@ staff:*:20:
sshd:*:22:
smmsp:*:25:
mailnull:*:26:
_atf:*:27:
guest:*:31:
bind:*:53:
unbound:*:59:

View File

@ -13,7 +13,6 @@ man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin
sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin
smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin
mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin
_atf:*:27:27::0:0:& pseudo-user:/nonexistent:/usr/sbin/nologin
bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin
unbound:*:59:59::0:0:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin
proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin

View File

@ -24,8 +24,6 @@
etc
X11
..
atf
..
bluetooth
..
defaults

View File

@ -299,8 +299,6 @@
..
IPv6
..
atf
..
bhyve
..
bootforth
@ -1410,14 +1408,6 @@
catalog
..
..
xml
atf
..
..
xsl
atf
..
..
zoneinfo
Africa
..

View File

@ -82,6 +82,41 @@ ifn_stop()
return $cfg
}
# ifn_vnetup ifn
# Move ifn to the specified vnet jail.
#
ifn_vnetup()
{
ifn_vnet0 $1 vnet
}
# ifn_vnetdown ifn
# Reclaim ifn from the specified vnet jail.
#
ifn_vnetdown()
{
ifn_vnet0 $1 -vnet
}
# ifn_vnet0 ifn action
# Helper function for ifn_vnetup and ifn_vnetdown.
#
ifn_vnet0()
{
local _ifn _cfg _action _vnet
_ifn="$1"
_action="$2"
_cfg=1
if _vnet=$(vnetif $_ifn); then
${IFCONFIG_CMD} $_ifn $_action $_vnet && _cfg=0
fi
return $_cfg
}
# ifconfig_up if
# Evaluate ifconfig(8) arguments for interface $if and
# run ifconfig(8) with those arguments. It returns 0 if
@ -284,24 +319,27 @@ _ifconfig_getargs()
# args such as DHCP and WPA.
ifconfig_getargs()
{
local _tmpargs _arg _args
local _tmpargs _arg _args _vnet
_tmpargs=`_ifconfig_getargs $1 $2`
if [ $? -eq 1 ]; then
return 1
fi
_args=
_vnet=0
for _arg in $_tmpargs; do
case $_arg in
[Dd][Hh][Cc][Pp]) ;;
[Nn][Oo][Aa][Uu][Tt][Oo]) ;;
[Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;;
[Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;;
[Ww][Pp][Aa]) ;;
[Hh][Oo][Ss][Tt][Aa][Pp]) ;;
*)
case $_arg:$_vnet in
[Dd][Hh][Cc][Pp]:0) ;;
[Nn][Oo][Aa][Uu][Tt][Oo]:0) ;;
[Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]:0) ;;
[Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]:0) ;;
[Ww][Pp][Aa]:0) ;;
[Hh][Oo][Ss][Tt][Aa][Pp]:0) ;;
vnet:0) _vnet=1 ;;
*:1) _vnet=0 ;;
*:0)
_args="$_args $_arg"
;;
;;
esac
done
@ -426,6 +464,25 @@ hostapif()
return 1
}
# vnetif if
# Returns 0 and echo jail if "vnet" keyword is specified on the
# interface, and 1 otherwise.
vnetif()
{
local _tmpargs _arg _vnet
_tmpargs=`_ifconfig_getargs $1`
_vnet=0
for _arg in $_tmpargs; do
case $_arg:$_vnet in
vnet:0) _vnet=1 ;;
*:1) echo $_arg; return 0 ;;
esac
done
return 1
}
# afexists af
# Returns 0 if the address family is enabled in the kernel
# 1 otherwise.

View File

@ -8,81 +8,138 @@
# BEFORE: securelevel
# KEYWORD: nojail shutdown
# WARNING: This script deals with untrusted data (the data and
# processes inside the jails) and care must be taken when changing the
# code related to this! If you have any doubt whether a change is
# correct and have security impact, please get the patch reviewed by
# the FreeBSD Security Team prior to commit.
. /etc/rc.subr
name="jail"
rcvar="jail_enable"
start_precmd="jail_prestart"
start_cmd="jail_start"
start_postcmd="jail_warn"
stop_cmd="jail_stop"
config_cmd="jail_config"
console_cmd="jail_console"
status_cmd="jail_status"
extra_commands="config console status"
: ${jail_conf:=/etc/jail.conf}
: ${jail_program:=/usr/sbin/jail}
: ${jail_consolecmd:=/bin/sh}
: ${jail_jexec:=/usr/sbin/jexec}
: ${jail_jls:=/usr/sbin/jls}
# init_variables _j
# Initialize the various jail variables for jail _j.
#
init_variables()
need_dad_wait=
# extact_var jail name param num defval
# Extract value from ${jail_$jail_$name} or ${jail_$name} and
# set it to $param. If not defined, $defval is used.
# When $num is [0-9]*, ${jail_$jail_$name$num} are looked up and
# $param is set by using +=.
# When $num is YN or NY, the value is interpret as boolean.
extract_var()
{
_j="$1"
local i _j _name _param _num _def _name1 _name2
_j=$1
_name=$2
_param=$3
_num=$4
_def=$5
case $_num in
YN)
_name1=jail_${_j}_${_name}
_name2=jail_${_name}
eval $_name1=\"\${$_name1:-\${$_name2:-$_def}}\"
if checkyesno $_name1; then
echo " $_param = 1;"
else
echo " $_param = 0;"
fi
;;
NY)
_name1=jail_${_j}_${_name}
_name2=jail_${_name}
eval $_name1=\"\${$_name1:-\${$_name2:-$_def}}\"
if checkyesno $_name1; then
echo " $_param = 0;"
else
echo " $_param = 1;"
fi
;;
[0-9]*)
i=$_num
while : ; do
_name1=jail_${_j}_${_name}${i}
_name2=jail_${_name}${i}
eval _tmpargs=\"\${$_name1:-\${$_name2:-$_def}}\"
if [ -n "$_tmpargs" ]; then
echo " $_param += \"$_tmpargs\";"
else
break;
fi
i=$(($i + 1))
done
;;
*)
_name1=jail_${_j}_${_name}
_name2=jail_${_name}
eval _tmpargs=\"\${$_name1:-\${$_name2:-$_def}}\"
if [ -n "$_tmpargs" ]; then
echo " $_param = \"$_tmpargs\";"
fi
;;
esac
}
# parse_options _j
# Parse options and create a temporary configuration file if necessary.
#
parse_options()
{
local _j
_j=$1
_confwarn=0
if [ -z "$_j" ]; then
warn "init_variables: you must specify a jail"
warn "parse_options: you must specify a jail"
return
fi
eval _jconf=\"\${jail_${_j}_conf:-/etc/jail.${_j}.conf}\"
eval _rootdir=\"\$jail_${_j}_rootdir\"
_devdir="${_rootdir}/dev"
_fdescdir="${_devdir}/fd"
_procdir="${_rootdir}/proc"
eval _hostname=\"\$jail_${_j}_hostname\"
if [ -z "$_rootdir" -o \
-z "$_hostname" ]; then
if [ -r "$_jconf" ]; then
_conf="$_jconf"
return 0
elif [ -r "$jail_conf" ]; then
_conf="$jail_conf"
return 0
else
warn "Invalid configuration for $_j " \
"(no jail.conf, no hostname, or no path). " \
"Jail $_j was ignored."
fi
return 1
fi
eval _ip=\"\$jail_${_j}_ip\"
eval _interface=\"\${jail_${_j}_interface:-${jail_interface}}\"
if [ -z "$_ip" ] && ! check_kern_features vimage; then
warn "no ipaddress specified and no vimage support. " \
"Jail $_j was ignored."
return 1
fi
_conf=/var/run/jail.${_j}.conf
#
# To relieve confusion, show a warning message.
#
_confwarn=1
if [ -r "$jail_conf" -o -r "$_jconf" ]; then
warn "$_conf is created and used for jail $_j."
fi
/usr/bin/install -m 0644 -o root -g wheel /dev/null $_conf || return 1
eval : \${jail_${_j}_flags:=${jail_flags}}
eval _exec=\"\$jail_${_j}_exec\"
i=0
while : ; do
eval _exec_prestart${i}=\"\${jail_${_j}_exec_prestart${i}:-\${jail_exec_prestart${i}}}\"
[ -z "$(eval echo \"\$_exec_prestart${i}\")" ] && break
i=$((i + 1))
done
eval _exec_start=\"\${jail_${_j}_exec_start:-${jail_exec_start}}\"
i=1
while : ; do
eval _exec_afterstart${i}=\"\${jail_${_j}_exec_afterstart${i}:-\${jail_exec_afterstart${i}}}\"
[ -z "$(eval echo \"\$_exec_afterstart${i}\")" ] && break
i=$((i + 1))
done
i=0
while : ; do
eval _exec_poststart${i}=\"\${jail_${_j}_exec_poststart${i}:-\${jail_exec_poststart${i}}}\"
[ -z "$(eval echo \"\$_exec_poststart${i}\")" ] && break
i=$((i + 1))
done
i=0
while : ; do
eval _exec_prestop${i}=\"\${jail_${_j}_exec_prestop${i}:-\${jail_exec_prestop${i}}}\"
[ -z "$(eval echo \"\$_exec_prestop${i}\")" ] && break
i=$((i + 1))
done
eval _exec_stop=\"\${jail_${_j}_exec_stop:-${jail_exec_stop}}\"
i=0
while : ; do
eval _exec_poststop${i}=\"\${jail_${_j}_exec_poststop${i}:-\${jail_exec_poststop${i}}}\"
[ -z "$(eval echo \"\$_exec_poststop${i}\")" ] && break
i=$((i + 1))
done
eval _exec_start=\"\$jail_${_j}_exec_start\"
eval _exec_stop=\"\$jail_${_j}_exec_stop\"
if [ -n "${_exec}" ]; then
# simple/backward-compatible execution
_exec_start="${_exec}"
@ -96,285 +153,104 @@ init_variables()
fi
fi
fi
# The default jail ruleset will be used by rc.subr if none is specified.
eval _ruleset=\"\${jail_${_j}_devfs_ruleset:-${jail_devfs_ruleset}}\"
eval _devfs=\"\${jail_${_j}_devfs_enable:-${jail_devfs_enable}}\"
[ -z "${_devfs}" ] && _devfs="NO"
eval _fdescfs=\"\${jail_${_j}_fdescfs_enable:-${jail_fdescfs_enable}}\"
[ -z "${_fdescfs}" ] && _fdescfs="NO"
eval _procfs=\"\${jail_${_j}_procfs_enable:-${jail_procfs_enable}}\"
[ -z "${_procfs}" ] && _procfs="NO"
eval _mount=\"\${jail_${_j}_mount_enable:-${jail_mount_enable}}\"
[ -z "${_mount}" ] && _mount="NO"
# "/etc/fstab.${_j}" will be used for {,u}mount(8) if none is specified.
eval _fstab=\"\${jail_${_j}_fstab:-${jail_fstab}}\"
[ -z "${_fstab}" ] && _fstab="/etc/fstab.${_j}"
eval _flags=\"\${jail_${_j}_flags:-${jail_flags}}\"
[ -z "${_flags}" ] && _flags="-l -U root"
eval _consolelog=\"\${jail_${_j}_consolelog:-${jail_consolelog}}\"
[ -z "${_consolelog}" ] && _consolelog="/var/log/jail_${_j}_console.log"
eval _interface=\"\${jail_${_j}_interface:-${jail_interface}}\"
eval _parameters=\"\${jail_${_j}_parameters:-${jail_parameters}}\"
[ -z "${_parameters}" ] && _parameters=""
eval _fib=\"\${jail_${_j}_fib:-${jail_fib}}\"
eval _fstab=\"\${jail_${_j}_fstab:-${jail_fstab:-/etc/fstab.$_j}}\"
(
date +"# Generated by rc.d/jail at %Y-%m-%d %H:%M:%S"
echo "$_j {"
extract_var $_j hostname host.hostname - ""
extract_var $_j rootdir path - ""
if [ -n "$_ip" ]; then
extract_var $_j interface interface - ""
jail_handle_ips_option $_ip $_interface
alias=0
while : ; do
eval _x=\"\$jail_${_jail}_ip_multi${alias}\"
[ -z "$_x" ] && break
# Debugging aid
#
debug "$_j devfs enable: $_devfs"
debug "$_j fdescfs enable: $_fdescfs"
debug "$_j procfs enable: $_procfs"
debug "$_j mount enable: $_mount"
debug "$_j hostname: $_hostname"
debug "$_j ip: $_ip"
jail_show_addresses ${_j}
debug "$_j interface: $_interface"
debug "$_j fib: $_fib"
debug "$_j root: $_rootdir"
debug "$_j devdir: $_devdir"
debug "$_j fdescdir: $_fdescdir"
debug "$_j procdir: $_procdir"
debug "$_j ruleset: $_ruleset"
debug "$_j fstab: $_fstab"
i=0
while : ; do
eval out=\"\${_exec_prestart${i}:-''}\"
if [ -z "$out" ]; then
break
fi
debug "$_j exec pre-start #${i}: ${out}"
i=$((i + 1))
done
debug "$_j exec start: $_exec_start"
i=1
while : ; do
eval out=\"\${_exec_afterstart${i}:-''}\"
if [ -z "$out" ]; then
break;
fi
debug "$_j exec after start #${i}: ${out}"
i=$((i + 1))
done
i=0
while : ; do
eval out=\"\${_exec_poststart${i}:-''}\"
if [ -z "$out" ]; then
break
fi
debug "$_j exec post-start #${i}: ${out}"
i=$((i + 1))
done
i=0
while : ; do
eval out=\"\${_exec_prestop${i}:-''}\"
if [ -z "$out" ]; then
break
fi
debug "$_j exec pre-stop #${i}: ${out}"
i=$((i + 1))
done
debug "$_j exec stop: $_exec_stop"
i=0
while : ; do
eval out=\"\${_exec_poststop${i}:-''}\"
if [ -z "$out" ]; then
break
fi
debug "$_j exec post-stop #${i}: ${out}"
i=$((i + 1))
done
debug "$_j flags: $_flags"
debug "$_j consolelog: $_consolelog"
debug "$_j parameters: $_parameters"
if [ -z "${_hostname}" ]; then
err 3 "$name: No hostname has been defined for ${_j}"
fi
if [ -z "${_rootdir}" ]; then
err 3 "$name: No root directory has been defined for ${_j}"
fi
}
# set_sysctl rc_knob mib msg
# If the mib sysctl is set according to what rc_knob
# specifies, this function does nothing. However if
# rc_knob is set differently than mib, then the mib
# is set accordingly and msg is displayed followed by
# an '=" sign and the word 'YES' or 'NO'.
#
set_sysctl()
{
_knob="$1"
_mib="$2"
_msg="$3"
_current=`${SYSCTL} -n $_mib 2>/dev/null`
if checkyesno $_knob ; then
if [ "$_current" -ne 1 ]; then
echo -n " ${_msg}=YES"
${SYSCTL} 1>/dev/null ${_mib}=1
fi
else
if [ "$_current" -ne 0 ]; then
echo -n " ${_msg}=NO"
${SYSCTL} 1>/dev/null ${_mib}=0
fi
fi
}
# is_current_mountpoint()
# Is the directory mount point for a currently mounted file
# system?
#
is_current_mountpoint()
{
local _dir _dir2
_dir=$1
_dir=`echo $_dir | sed -Ee 's#//+#/#g' -e 's#/$##'`
[ ! -d "${_dir}" ] && return 1
_dir2=`df ${_dir} | tail +2 | awk '{ print $6 }'`
[ "${_dir}" = "${_dir2}" ]
return $?
}
# is_symlinked_mountpoint()
# Is a mount point, or any of its parent directories, a symlink?
#
is_symlinked_mountpoint()
{
local _dir
_dir=$1
[ -L "$_dir" ] && return 0
[ "$_dir" = "/" ] && return 1
is_symlinked_mountpoint `dirname $_dir`
return $?
}
# secure_umount
# Try to unmount a mount point without being vulnerable to
# symlink attacks.
#
secure_umount()
{
local _dir
_dir=$1
if is_current_mountpoint ${_dir}; then
umount -f ${_dir} >/dev/null 2>&1
else
debug "Nothing mounted on ${_dir} - not unmounting"
fi
}
# jail_umount_fs
# This function unmounts certain special filesystems in the
# currently selected jail. The caller must call the init_variables()
# routine before calling this one.
#
jail_umount_fs()
{
local _device _mountpt _rest
if checkyesno _fdescfs; then
if [ -d "${_fdescdir}" ] ; then
secure_umount ${_fdescdir}
fi
fi
if checkyesno _devfs; then
if [ -d "${_devdir}" ] ; then
secure_umount ${_devdir}
fi
fi
if checkyesno _procfs; then
if [ -d "${_procdir}" ] ; then
secure_umount ${_procdir}
fi
fi
if checkyesno _mount; then
[ -f "${_fstab}" ] || warn "${_fstab} does not exist"
tail -r ${_fstab} | while read _device _mountpt _rest; do
case ":${_device}" in
:#* | :)
continue
;;
esac
secure_umount ${_mountpt}
done
fi
}
# jail_mount_fstab()
# Mount file systems from a per jail fstab while trying to
# secure against symlink attacks at the mount points.
#
# If we are certain we cannot secure against symlink attacks we
# do not mount all of the file systems (since we cannot just not
# mount the file system with the problematic mount point).
#
# The caller must call the init_variables() routine before
# calling this one.
#
jail_mount_fstab()
{
local _device _mountpt _rest
while read _device _mountpt _rest; do
case ":${_device}" in
:#* | :)
continue
jail_handle_ips_option $_x $_interface
alias=$(($alias + 1))
done
case $need_dad_wait in
1)
# Sleep to let DAD complete before
# starting services.
echo " exec.start += \"sleep " \
$(($(${SYSCTL_N} net.inet6.ip6.dad_count) + 1)) \
"\";"
;;
esac
if is_symlinked_mountpoint ${_mountpt}; then
warn "${_mountpt} has symlink as parent - not mounting from ${_fstab}"
return
fi
done <${_fstab}
mount -a -F "${_fstab}"
}
# jail_show_addresses jail
# Debug print the input for the given _multi aliases
# for a jail for init_variables().
#
jail_show_addresses()
{
local _j _type alias
_j="$1"
alias=0
if [ -z "${_j}" ]; then
warn "jail_show_addresses: you must specify a jail"
return
fi
while : ; do
eval _addr=\"\$jail_${_j}_ip_multi${alias}\"
if [ -n "${_addr}" ]; then
debug "${_j} ip_multi${alias}: $_addr"
alias=$((${alias} + 1))
esac
# These are applicable only to non-vimage jails.
extract_var $_j fib exec.fib - ""
extract_var $_j socket_unixiproute_only \
allow.raw_sockets NY YES
else
break
echo " vnet;"
extract_var $_j vnet_interface vnet.interface - ""
fi
done
echo " exec.clean;"
echo " exec.system_user = \"root\";"
echo " exec.jail_user = \"root\";"
extract_var $_j exec_prestart exec.prestart 0 ""
extract_var $_j exec_poststart exec.poststart 0 ""
extract_var $_j exec_prestop exec.prestop 0 ""
extract_var $_j exec_poststop exec.poststop 0 ""
echo " exec.start += \"$_exec_start\";"
extract_var $_j exec_afterstart exec.start 1 ""
echo " exec.stop = \"$_exec_stop\";"
extract_var $_j consolelog exec.consolelog - \
/var/log/jail_${_j}_console.log
eval : \${jail_${_j}_devfs_enable:=${jail_devfs_enable:-NO}}
if checkyesno jail_${_j}_devfs_enable; then
echo " mount.devfs;"
case $_ruleset in
"") ;;
[0-9]*) echo " devfs_ruleset = \"$_ruleset\";" ;;
devfsrules_jail)
# XXX: This is the default value,
# Let jail(8) to use the default because
# mount(8) only accepts an integer.
# This should accept a ruleset name.
;;
*) warn "devfs_ruleset must be integer." ;;
esac
if [ -r $_fstab ]; then
echo " mount.fstab = \"$_fstab\";"
fi
fi
eval : \${jail_${_j}_fdescfs_enable:=${jail_fdescfs_enable:-NO}}
if checkyesno jail_${_j}_fdescfs_enable; then
echo " mount += " \
"\"fdescfs ${_rootdir%/}/dev/fd fdescfs rw 0 0\";"
fi
eval : \${jail_${_j}_procfs_enable:=${jail_procfs_enable:-NO}}
if checkyesno jail_${_j}_procfs_enable; then
echo " mount += " \
"\"procfs ${_rootdir%/}/proc procfs rw 0 0\";"
fi
echo " ${_parameters};"
eval : \${jail_${_j}_mount_enable:=${jail_mount_enable:-NO}}
if checkyesno jail_${_j}_mount_enable; then
echo " allow.mount;" >> $_conf
fi
extract_var $_j set_hostname_allow allow.set_hostname YN NO
extract_var $_j sysvipc_allow allow.sysvipc YN NO
echo "}"
) >> $_conf
return 0
}
# jail_extract_address argument
# jail_extract_address argument iface
# The second argument is the string from one of the _ip
# or the _multi variables. In case of a comma separated list
# only one argument must be passed in at a time.
@ -382,8 +258,9 @@ jail_show_addresses()
#
jail_extract_address()
{
local _i
local _i _interface
_i=$1
_interface=$2
if [ -z "${_i}" ]; then
warn "jail_extract_address: called without input"
@ -439,21 +316,21 @@ jail_extract_address()
_mask=${_mask:-/32}
elif [ "${_type}" = "inet6" ]; then
# In case _maske is not set for IPv6, use /128.
_mask=${_mask:-/128}
# In case _maske is not set for IPv6, use /64.
_mask=${_mask:-/64}
fi
}
# jail_handle_ips_option {add,del} input
# jail_handle_ips_option input iface
# Handle a single argument imput which can be a comma separated
# list of addresses (theoretically with an option interface and
# prefix/netmask/prefixlen).
#
jail_handle_ips_option()
{
local _x _action _type _i
_action=$1
_x=$2
local _x _type _i _iface
_x=$1
_iface=$2
if [ -z "${_x}" ]; then
# No IP given. This can happen for the primary address
@ -468,294 +345,146 @@ jail_handle_ips_option()
*,*) # Extract the first argument and strip it off the list.
_i=`expr "${_x}" : '^\([^,]*\)'`
_x=`expr "${_x}" : "^[^,]*,\(.*\)"`
;;
;;
*) _i=${_x}
_x=""
;;
;;
esac
_type=""
_iface=""
_addr=""
_mask=""
jail_extract_address "${_i}"
jail_extract_address $_i $_iface
# make sure we got an address.
case "${_addr}" in
case $_addr in
"") continue ;;
*) ;;
esac
# Append address to list of addresses for the jail command.
case "${_type}" in
case $_type in
inet)
case "${_addrl}" in
"") _addrl="${_addr}" ;;
*) _addrl="${_addrl},${_addr}" ;;
esac
;;
echo " ip4.addr += \"${_addr}${_mask}\";"
;;
inet6)
case "${_addr6l}" in
"") _addr6l="${_addr}" ;;
*) _addr6l="${_addr6l},${_addr}" ;;
esac
;;
esac
# Configure interface alias if requested by a given interface
# and if we could correctly parse everything.
case "${_iface}" in
"") continue ;;
esac
case "${_type}" in
inet) ;;
inet6) ipv6_address_count=$((ipv6_address_count + 1)) ;;
*) warn "Could not determine address family. Not going" \
"to ${_action} address '${_addr}' for ${_jail}."
continue
;;
esac
case "${_action}" in
add) ifconfig ${_iface} ${_type} ${_addr}${_mask} alias
;;
del) # When removing the IP, ignore the _mask.
ifconfig ${_iface} ${_type} ${_addr} -alias
;;
echo " ip6.addr += \"${_addr}${_mask}\";"
need_dad_wait=1
;;
esac
done
}
# jail_ips {add,del}
# Extract the comma separated list of addresses and return them
# for the jail command.
# Handle more than one address via the _multi option as well.
# If an interface is given also add/remove an alias for the
# address with an optional netmask.
#
jail_ips()
jail_config()
{
local _action
_action=$1
case "${_action}" in
add) ;;
del) ;;
*) warn "jail_ips: invalid action '${_action}'"
return
;;
case $1 in
_ALL) return ;;
esac
# Handle addresses.
ipv6_address_count=0
jail_handle_ips_option ${_action} "${_ip}"
# Handle jail_xxx_ip_multi<N>
alias=0
while : ; do
eval _x=\"\$jail_${_jail}_ip_multi${alias}\"
case "${_x}" in
"") break ;;
*) jail_handle_ips_option ${_action} "${_x}"
alias=$((${alias} + 1))
;;
esac
for _jail in $@; do
if parse_options $_jail; then
echo "$_jail: parameters are in $_conf."
fi
done
case ${ipv6_address_count} in
0) ;;
*) # Sleep 1 second to let DAD complete before starting services.
sleep 1
;;
esac
}
jail_prestart()
jail_console()
{
if checkyesno jail_parallel_start; then
command_args='&'
fi
# One argument that is not _ALL.
case $#:$1 in
1:_ALL) err 3 "Specify a jail name." ;;
1:*) ;;
*) err 3 "Specify a jail name." ;;
esac
eval _cmd=\${jail_$1_consolecmd:-$jail_consolecmd}
$jail_jexec $1 $_cmd
}
jail_status()
{
$jail_jls -N
}
jail_start()
{
echo -n 'Configuring jails:'
set_sysctl jail_set_hostname_allow security.jail.set_hostname_allowed \
set_hostname_allow
set_sysctl jail_socket_unixiproute_only \
security.jail.socket_unixiproute_only unixiproute_only
set_sysctl jail_sysvipc_allow security.jail.sysvipc_allowed \
sysvipc_allow
echo '.'
if [ $# = 0 ]; then
return
fi
echo -n 'Starting jails:'
_tmp_dir=`mktemp -d /tmp/jail.XXXXXXXX` || \
err 3 "$name: Can't create temp dir, exiting..."
for _jail in ${jail_list}
do
init_variables $_jail
if [ -f /var/run/jail_${_jail}.id ]; then
echo -n " [${_hostname} already running (/var/run/jail_${_jail}.id exists)]"
continue;
fi
_addrl=""
_addr6l=""
jail_ips "add"
if [ -n "${_fib}" ]; then
_setfib="setfib -F '${_fib}'"
case $1 in
_ALL)
echo -n ' '
command=$jail_program
rc_flags=$jail_flags
command_args="-f $jail_conf -c"
$command $rc_flags $command_args "*"
echo '.'
return
;;
esac
_tmp=`mktemp -t jail` || exit 3
for _jail in $@; do
parse_options $_jail || continue
eval rc_flags=\${jail_${_j}_flags:-$jail_flags}
eval command=\${jail_${_j}_program:-$jail_program}
if checkyesno jail_parallel_start; then
command_args="-i -f $_conf -c $_jail &"
else
_setfib=""
command_args="-i -f $_conf -c $_jail"
fi
if checkyesno _mount; then
info "Mounting fstab for jail ${_jail} (${_fstab})"
if [ ! -f "${_fstab}" ]; then
err 3 "$name: ${_fstab} does not exist"
fi
jail_mount_fstab
fi
if checkyesno _devfs; then
# If devfs is already mounted here, skip it.
df -t devfs "${_devdir}" >/dev/null
if [ $? -ne 0 ]; then
if is_symlinked_mountpoint ${_devdir}; then
warn "${_devdir} has symlink as parent - not starting jail ${_jail}"
continue
fi
info "Mounting devfs on ${_devdir}"
devfs_mount_jail "${_devdir}" ${_ruleset}
# Transitional symlink for old binaries
if [ ! -L "${_devdir}/log" ]; then
ln -sf ../var/run/log "${_devdir}/log"
fi
fi
# XXX - It seems symlinks don't work when there
# is a devfs(5) device of the same name.
# Jail console output
# __pwd="`pwd`"
# cd "${_devdir}"
# ln -sf ../var/log/console console
# cd "$__pwd"
fi
if checkyesno _fdescfs; then
if is_symlinked_mountpoint ${_fdescdir}; then
warn "${_fdescdir} has symlink as parent, not mounting"
else
info "Mounting fdescfs on ${_fdescdir}"
mount -t fdescfs fdesc "${_fdescdir}"
fi
fi
if checkyesno _procfs; then
if is_symlinked_mountpoint ${_procdir}; then
warn "${_procdir} has symlink as parent, not mounting"
else
info "Mounting procfs onto ${_procdir}"
if [ -d "${_procdir}" ] ; then
mount -t procfs proc "${_procdir}"
fi
fi
fi
_tmp_jail=${_tmp_dir}/jail.$$
i=0
while : ; do
eval out=\"\${_exec_prestart${i}:-''}\"
[ -z "$out" ] && break
${out}
i=$((i + 1))
done
eval ${_setfib} jail -n ${_jail} ${_flags} -i -c path=${_rootdir} host.hostname=${_hostname} \
${_addrl:+ip4.addr=\"${_addrl}\"} ${_addr6l:+ip6.addr=\"${_addr6l}\"} \
${_parameters} command=${_exec_start} > ${_tmp_jail} 2>&1 \
</dev/null
if [ "$?" -eq 0 ] ; then
_jail_id=$(head -1 ${_tmp_jail})
i=1
while : ; do
eval out=\"\${_exec_afterstart${i}:-''}\"
if [ -z "$out" ]; then
break;
fi
jexec "${_jail_id}" ${out}
i=$((i + 1))
done
echo -n " $_hostname"
tail +2 ${_tmp_jail} >${_consolelog}
echo ${_jail_id} > /var/run/jail_${_jail}.id
i=0
while : ; do
eval out=\"\${_exec_poststart${i}:-''}\"
[ -z "$out" ] && break
${out}
i=$((i + 1))
done
if $command $rc_flags $command_args \
>> $_tmp 2>&1 </dev/null; then
echo -n " ${_hostname:-${_jail}}"
else
jail_umount_fs
jail_ips "del"
echo " cannot start jail \"${_jail}\": "
tail +2 ${_tmp_jail}
echo " cannot start jail \"${_hostname:-${jail}}\": "
tail +2 $_tmp
fi
rm -f ${_tmp_jail}
rm -f $_tmp
done
rmdir ${_tmp_dir}
echo '.'
}
jail_stop()
{
if [ $# = 0 ]; then
return
fi
echo -n 'Stopping jails:'
for _jail in ${jail_list}
do
if [ -f "/var/run/jail_${_jail}.id" ]; then
_jail_id=$(cat /var/run/jail_${_jail}.id)
if [ ! -z "${_jail_id}" ]; then
init_variables $_jail
i=0
while : ; do
eval out=\"\${_exec_prestop${i}:-''}\"
[ -z "$out" ] && break
${out}
i=$((i + 1))
done
if [ -n "${_exec_stop}" ]; then
eval env -i /usr/sbin/jexec ${_jail_id} ${_exec_stop} \
>> ${_consolelog} 2>&1
fi
killall -j ${_jail_id} -TERM > /dev/null 2>&1
sleep 1
killall -j ${_jail_id} -KILL > /dev/null 2>&1
jail_umount_fs
echo -n " $_hostname"
i=0
while : ; do
eval out=\"\${_exec_poststop${i}:-''}\"
[ -z "$out" ] && break
${out}
i=$((i + 1))
done
fi
jail_ips "del"
rm /var/run/jail_${_jail}.id
else
echo " cannot stop jail ${_jail}. No jail id in /var/run"
case $1 in
_ALL)
echo -n ' '
command=$jail_program
rc_flags=$jail_flags
command_args="-f $jail_conf -r"
$command $rc_flags $command_args "*"
echo '.'
return
;;
esac
for _jail in $@; do
parse_options $_jail || continue
eval command=\${jail_${_j}_program:-$jail_program}
if $command -q -f $_conf -r $_jail; then
echo -n " ${_hostname:-${_jail}}"
fi
done
echo '.'
}
load_rc_config $name
cmd="$1"
if [ $# -gt 0 ]; then
shift
fi
if [ -n "$*" ]; then
jail_list="$*"
fi
jail_warn()
{
run_rc_command "${cmd}"
# To relieve confusion, show a warning message.
case $_confwarn in
1) warn "Per-jail configuration via jail_* variables " \
"is obsolete. Please consider to migrate to $jail_conf."
;;
esac
}
load_rc_config $name
case $# in
1) run_rc_command $@ ${jail_list:-_ALL} ;;
*) run_rc_command $@ ;;
esac

View File

@ -39,7 +39,9 @@ stop_cmd="network_stop"
cloneup_cmd="clone_up"
clonedown_cmd="clone_down"
clear_cmd="doclear"
extra_commands="cloneup clonedown clear"
vnetup_cmd="vnet_up"
vnetdown_cmd="vnet_down"
extra_commands="cloneup clonedown clear vnetup vnetdown"
cmdifn=
set_rcvar_obsolete ipv6_enable ipv6_activate_all_interfaces
@ -123,6 +125,20 @@ network_stop0()
fi
}
vnet_up()
{
cmdifn=$*
network_common ifn_vnetup $cmdifn
}
vnet_down()
{
cmdifn=$*
network_common ifn_vnetdown $cmdifn
}
# network_common routine
# Common configuration subroutine for network interfaces. This
# routine takes all the preparatory steps needed for configuriing
@ -198,7 +214,7 @@ network_common()
# inet6 address configuration needs sleep for DAD.
case ${_func}:${_dadwait} in
ifn_start:1)
ifn_start:1|ifn_vnetup:1|ifn_vnetdown:1)
sleep `${SYSCTL_N} net.inet6.ip6.dad_count`
sleep 1
;;
@ -209,12 +225,25 @@ network_common()
case ${_func} in
ifn_start)
_str='Starting'
;;
;;
ifn_stop)
_str='Stopping'
;;
;;
ifn_vnetup)
_str='Moving'
;;
ifn_vnetdown)
_str='Reclaiming'
;;
esac
echo "${_str} Network:${_ok}."
case ${_func} in
ifn_vnetup)
# Clear _ok not to do "ifconfig $ifn"
# because $ifn is no longer in the current vnet.
_ok=
;;
esac
if check_startmsgs; then
for ifn in ${_ok}; do
/sbin/ifconfig ${ifn}

View File

@ -1463,28 +1463,6 @@ devfs_domount()
return 0
}
# devfs_mount_jail dir [ruleset]
# Mounts a devfs file system appropriate for jails
# on the directory dir. If ruleset is specified, the ruleset
# it names will be used instead. If present, ruleset must
# be the name of a ruleset as defined in a devfs.rules(5) file.
# This function returns non-zero if an error occurs.
#
devfs_mount_jail()
{
local jdev rs _me
jdev="$1"
[ -n "$2" ] && rs=$2 || rs="devfsrules_jail"
_me="devfs_mount_jail"
devfs_init_rulesets
if ! devfs_domount "$jdev" $rs; then
warn "$_me: devfs was not mounted on $jdev"
return 1
fi
return 0
}
# Provide a function for normalizing the mounting of memory
# filesystems. This should allow the rest of the code here to remain
# as close as possible between 5-current and 4-stable.

View File

@ -7,8 +7,8 @@
#define FREEBSD_NATIVE 1
/* Fake out gcc/config/freebsd<version>.h. */
#define FBSD_MAJOR 10
#define FBSD_CC_VER 1000001 /* form like __FreeBSD_version */
#define FBSD_MAJOR 11
#define FBSD_CC_VER 1100001 /* form like __FreeBSD_version */
#undef SYSTEM_INCLUDE_DIR /* We don't need one for now. */
#undef TOOL_INCLUDE_DIR /* We don't need one for now. */

View File

@ -45,7 +45,7 @@
.ds doc-str-Lb-libstdthreads C11 Threads Library (libstdthreads, \-lstdthreads)
.
.\" Default .Os value
.ds doc-default-operating-system FreeBSD\~10.0
.ds doc-default-operating-system FreeBSD\~11.0
.
.\" FreeBSD releases not found in doc-common
.ds doc-operating-system-FreeBSD-7.4 7.4
@ -54,6 +54,7 @@
.ds doc-operating-system-FreeBSD-9.1 9.1
.ds doc-operating-system-FreeBSD-9.2 9.2
.ds doc-operating-system-FreeBSD-10.0 10.0
.ds doc-operating-system-FreeBSD-11.0 11.0
.
.\" Definitions not (yet) in doc-syms
.

View File

@ -27,8 +27,8 @@ TARGET_ABI= gnueabi
TARGET_ABI= unknown
.endif
TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd10.0
BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd10.0
TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0
BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd11.0
CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" \
-DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\" \
-DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\"

View File

@ -43,7 +43,7 @@ ATF_TC_BODY(invalid, tc)
/*
* This function must not do anything except enumerate
* the test cases, else atf-run is likely to be upset.
* the test cases, per atf-c-api(3).
*/
ATF_TP_ADD_TCS(tp)
{

View File

@ -400,10 +400,14 @@ tftp_open(const char *path, struct open_file *f)
struct iodesc *io;
int res;
#ifndef __i386__
if (strcmp(f->f_dev->dv_name, "net") != 0)
if (strcmp(f->f_dev->dv_name, "net") != 0) {
#ifdef __i386__
if (strcmp(f->f_dev->dv_name, "pxe") != 0)
return (EINVAL);
#else
return (EINVAL);
#endif
}
if (is_open)
return (EBUSY);

View File

@ -202,8 +202,3 @@ eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \
release RELSTRING=${RELSTRING}
eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \
install DESTDIR=/R RELSTRING=${RELSTRING}
cd ${CHROOTDIR}/R
sha256 FreeBSD-* > CHECKSUM.SHA256
md5 FreeBSD-* > CHECKSUM.MD5

View File

@ -886,12 +886,12 @@ mode_list(struct cam_device *device, int page_control, int dbd,
timeout, data, sizeof(data));
mh = (struct scsi_mode_header_6 *)data;
len = mh->blk_desc_len; /* Skip block descriptors. */
len = sizeof(*mh) + mh->blk_desc_len; /* Skip block descriptors. */
/* Iterate through the pages in the reply. */
while (len < mh->data_length) {
/* Locate the next mode page header. */
mph = (struct scsi_mode_page_header *)
((intptr_t)mh + sizeof(*mh) + len);
((intptr_t)mh + len);
mph->page_code &= SMS_PAGE_CODE;
nameentry = nameentry_lookup(mph->page_code);

View File

@ -24,18 +24,20 @@
.\"
.\" $FreeBSD$
.\"
.Dd June 5, 2007
.Dd October 10, 2013
.Dt ISCSI.CONF 5
.Os
.Sh NAME
.Nm iscsi.conf
.Nd key options to be negotiated in an iSCSI session
.Nd iSCSI initiator configuration file
.Sh DESCRIPTION
The file
.Nm ,
is read by the
is used by the
.Xr iscsictl 8
and
.Xr iscontrol 8
program.
utilities.
It contains declarations and parameter/key-options.
The syntax is very simple,
.D1 Li variable = value;
@ -69,9 +71,6 @@ Default is none.
.It Cm DataDigest
same as for HeaderDigest, but on the data part of the iSCSI PDU.
(not yet tested)
.It Cm MaxConnections
is the number of simultaneous connections per session,
currently only 1.
.It Cm TargetName
is the name by which the target is known, not to be confused with
target address, either obtained via the target administrator, or
@ -81,8 +80,6 @@ from a
if not specified, defaults to
.Sy iqn.2005-01.il.ac.huji.cs:
.Aq hostname .
.It Cm TargetAlias / InitiatorAlias
not implemented.
.It Cm TargetAddress
is of the form
.Sy domainname[:port][,portal-group-tag]
@ -93,35 +90,16 @@ dotted-decimal IPv4 address, or a bracketed IPv6 address as specified
in [RFC2732].
.Ed
Note: portal-group-tag is unused at the moment.
.It Cm TargetPortalGroupTag
.Em not implemented yet.
.It Cm InitialR2T
.Em not implemented yet.
.It Cm ImmediateData
.Em not implemented yet.
.It Cm MaxRecvDataSegmentLength
the maximum data segment length in
bytes it can receive in an iSCSI PDU, default is 8192.
.It Cm MaxBurstLength
.Em not implemented yet.
.It Cm FirstBurstLength
.Em not implemented yet.
.It Cm DefaultTime2Wait
.Em not implemented yet.
.It Cm DefaultTime2Retain
.Em not implemented yet.
.It Cm MaxOutstandingR2T
is used to calculate/negotiate the
.Em tag opening ,
can be overridden by the
.Sy tag
option.
.It Cm DataPDUInOrder
.Em not implemented yet.
.It Cm DataSequenceInOrder
.Em not implemented yet.
.It Cm ErrorRecoveryLevel
Only level 0 is supported.
.It Cm SessionType
either Discovery or Normal, default is Normal, see the
.Fl d
@ -196,9 +174,6 @@ chaptest {
tags = 256
}
.Ed
.Sh ERRORS
The parsing is very primitive, so do not expect - at the moment - any
error messages.
.Sh SEE ALSO
.Xr iscsi_initiator 4 ,
.Xr iscsictl 8 ,

View File

@ -5,8 +5,7 @@
# Do not include `info' in the SUBDIR list, it is handled separately.
SUBDIR= ${_atf} \
${_colldef} \
SUBDIR= ${_colldef} \
${_dict} \
${_doc} \
dtrace \
@ -27,16 +26,10 @@ SUBDIR= ${_atf} \
tabset \
termcap \
${_timedef} \
xml \
xsl \
${_zoneinfo}
# NB: keep these sorted by MK_* knobs
.if ${MK_ATF} != "no"
_atf= atf
.endif
.if ${MK_BSNMP} != "no"
_snmp= snmp
.endif

View File

@ -1,37 +0,0 @@
#-
# Copyright (c) 2012 EMC Corporation.
# 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.
#
# $FreeBSD$
ATF= ${.CURDIR}/../../contrib/atf
.PATH: ${ATF}/atf-run/sample
NO_OBJ=
FILESDIR= ${SHAREDIR}/atf
FILES= atf-run.hooks
.include <bsd.prog.mk>

View File

@ -241,9 +241,6 @@ etc-examples:
.if ${SHARED} != "symlinks"
SUBDIR= smbfs
.if ${MK_ATF} != "no"
SUBDIR+=atf
.endif
.if ${MK_IPFILTER} != "no"
SUBDIR+=ipfilter
.endif

View File

@ -1,39 +0,0 @@
#-
# Copyright (c) 2011 Google, Inc.
# 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.
#
# $FreeBSD$
ATF= ${.CURDIR}/../../../contrib/atf
.PATH: ${ATF}/atf-report
.PATH: ${ATF}/atf-run/sample
NO_OBJ=
FILESDIR= ${SHAREDIR}/examples/atf
FILES= atf-run.hooks \
tests-results.css
.include <bsd.prog.mk>

View File

@ -23,7 +23,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd August 7, 2013
.Dd October 12, 2013
.Dt RANDOM 4
.Os
.Sh NAME
@ -324,6 +324,7 @@ and is an implementation of the
.Em Yarrow
algorithm by Bruce Schneier,
.Em et al .
Significant infrastructure work was done by Arthur Mesh.
.Pp
The author gratefully acknowledges
significant assistance from VIA Technologies, Inc.

View File

@ -6,7 +6,6 @@
#MISSING: dump.5 plot.5
MAN= acct.5 \
ar.5 \
${_atf_formats.5} \
a.out.5 \
bluetooth.device.conf.5 \
bluetooth.hosts.5 \
@ -80,12 +79,6 @@ MLINKS+=quota.user.5 quota.group.5
MLINKS+=rc.conf.5 rc.conf.local.5
MLINKS+=resolver.5 resolv.conf.5
.if ${MK_ATF} != "no"
ATF= ${.CURDIR}/../../../contrib/atf
.PATH: ${ATF}/doc
_atf_formats.5= atf-formats.5
.endif
.if ${MK_FREEBSD_UPDATE} != "no"
MAN+= freebsd-update.conf.5
.endif

View File

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd September 23, 2013
.Dd October 10, 2013
.Dt RC.CONF 5
.Os
.Sh NAME
@ -3891,14 +3891,32 @@ indicates that the highest frequency (less power savings) should be used.
If set to
.Dq Li NO ,
any configured jails will not be started.
.It Va jail_conf
.Pq Vt str
The configuration filename used by
.Xr jail 8
utility.
The default value is
.Pa /etc/jail.conf .
.It Va jail_parallel_start
.Pq Vt bool
If set to
.Dq Li YES ,
all configured jails will be started in the background (in parallel).
.It Va jail_flags
.Pq Vt str
Unset by default.
When set, use as default value for
.Va jail_ Ns Ao Ar jname Ac Ns Va _flags
for every jail in
.Va jail_list .
.It Va jail_list
.Pq Vt str
A space separated list of names for jails.
If this variable is empty,
all of
.Xr jail 8
instances in the configuration file will be configured.
This is purely a configuration aid to help identify and
configure multiple jails.
The names specified in this list will be used to
@ -3908,171 +3926,41 @@ The literal jail name of
.Dq Li 0
.Pq zero
is not allowed.
.Pp
Assuming that the jail in question was named
.Li vjail ,
you would have the following dependent variables:
.Bd -literal
jail_vjail_hostname="jail.example.com"
jail_vjail_ip="192.0.2.100"
jail_vjail_rootdir="/var/jails/vjail/root"
.Ed
.Pp
.It Va jail_flags
.Pq Vt str
Unset by default.
When set, use as default value for
.Va jail_ Ns Ao Ar jname Ac Ns Va _flags
for every jail in
.Va jail_list .
.It Va jail_interface
.Pq Vt str
Unset by default.
When set, use as default value for
.Va jail_ Ns Ao Ar jname Ac Ns Va _interface
for every jail in
.Va jail_list .
.It Va jail_fstab
.Pq Vt str
Unset by default.
When set, use as default value for
.Va jail_ Ns Ao Ar jname Ac Ns Va _fstab
for every jail in
.Va jail_list .
.It Va jail_mount_enable
.Pq Vt bool
Set to
.Dq Li NO
by default.
When set to
.Dq Li YES ,
sets
.Va jail_ Ns Ao Ar jname Ac Ns Va _mount_enable
to
.Dq Li YES
by default for every jail in
.Va jail_list .
.It Va jail_devfs_ruleset
.Pq Vt str
Unset by default.
When set, sets
.Va jail_ Ns Ao Ar jname Ac Ns Va _devfs_ruleset
to given value for every jail in
.Va jail_list .
.It Va jail_devfs_enable
.Pq Vt bool
Set to
.Dq Li NO
by default.
When set to
.Dq Li YES ,
sets
.Va jail_ Ns Ao Ar jname Ac Ns Va _devfs_enable
to
.Dq Li YES
by default for every jail in
.Va jail_list .
.It Va jail_fdescfs_enable
.Pq Vt bool
Set to
.Dq Li NO
by default.
When set to
.Dq Li YES ,
sets
.Va jail_ Ns Ao Ar jname Ac Ns Va _fdescfs_enable
to
.Dq Li YES
by default for every jail in
.Va jail_list .
.It Va jail_procfs_enable
.Pq Vt bool
Set to
.Dq Li NO
by default.
When set to
.Dq Li YES ,
sets
.Va jail_ Ns Ao Ar jname Ac Ns Va _fdescfs_enable
to
.Dq Li YES
by default for every jail in
.Va jail_list .
.It Va jail_exec_prestart Ns Aq Ar N
.Pq Vt str
Unset by default.
When set, use as default value for
.Va jail_ Ns Ao Ar jname Ac Ns Va _exec_prestart Ns Aq Ar N
for every jail in
.Va jail_list .
.It Va jail_exec_start
.Pq Vt str
Unset by default.
When set, use as default value for
.Va jail_ Ns Ao Ar jname Ac Ns Va _exec_start
for every jail in
.Va jail_list .
.It Va jail_exec_afterstart Ns Aq Ar N
.Pq Vt str
Unset by default.
When set, use as default value for
.Va jail_ Ns Ao Ar jname Ac Ns Va _exec_afterstart Ns Aq Ar N
for every jail in
.Va jail_list .
.It Va jail_exec_poststart Ns Aq Ar N
.Pq Vt str
Unset by default.
When set, use as default value for
.Va jail_ Ns Ao Ar jname Ac Ns Va _exec_poststart Ns Aq Ar N
for every jail in
.Va jail_list .
.It Va jail_exec_prestop Ns Aq Ar N
.Pq Vt str
Unset by default.
When set, use as default value for
.Va jail_ Ns Ao Ar jname Ac Ns Va _exec_prestop Ns Aq Ar N
for every jail in
.Va jail_list .
.It Va jail_exec_stop
Unset by default.
When set, use as default value for
.Va jail_ Ns Ao Ar jname Ac Ns Va _exec_stop
for every jail in
.Va jail_list .
.It Va jail_exec_poststop Ns Aq Ar N
.Pq Vt str
Unset by default.
When set, use as default value for
.Va jail_ Ns Ao Ar jname Ac Ns Va _exec_poststop Ns Aq Ar N
for every jail in
.Va jail_list .
.It Va jail_ Ns Ao Ar jname Ac Ns Va _rootdir
.Pq Vt str
Unset by default.
Set to the root directory used by jail
.Va jname .
.It Va jail_ Ns Ao Ar jname Ac Ns Va _hostname
.Pq Vt str
Unset by default.
Set to the fully qualified domain name (FQDN) assigned to jail
.Va jname .
.It Va jail_ Ns Ao Ar jname Ac Ns Va _parameters
.Pq Vt str
Unset by default.
Set extra parameters for jail
.Va jname ,
such as
.Dq Li allow.chflags
or
.Dq Li children.max .
See
.It Va jail_* variables
Note that older releases supported per-jail configuration via
.Xr rc.conf 5
variables.
For example,
hostname of a jail named
.Li vjail
was able to be set by
.Li jail_vjail_hostname .
These per-jail configuration variables are now obsolete in favor of
.Xr jail 8
for a list of available parameters.
Note that the following parameters are already defined by
configuration file.
For backward compatibility,
when per-jail configuration variables are defined,
.Xr jail 8
configuration files are created as
.Pa /var/run/jail. Ns Ao Ar jname Ac Ns Pa .conf
and used.
.Pp
The following per-jail parameters are handled by
.Pa rc.d/jail
script out of their corresponding
.Nm
variables:
variables.
In addition to them, parameters in
.Va jail_ Ns Ao Ar jname Ac Ns Va _parameters
will be added to the configuration file.
They must be a semi-colon
.Pq Ql \&;
delimited list of
.Dq key=value .
For more details,
see
.Xr jail 8
manual page.
.Bl -tag -width "host.hostname" -offset indent
.It Li path
set from
@ -4080,202 +3968,90 @@ set from
.It Li host.hostname
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _hostname
.It Li command
.It Li exec.consolelog
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _exec_start
.Va jail_ Ns Ao Ar jname Ac Ns Va _consolelog .
The default value is
.Pa /var/log/jail_ Ao Ar jname Ac Pa _console.log .
.It Li interface
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _interface .
.It Li vnet.interface
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _vnet_interface .
This implies
.Li vnet
parameter will be enabled and cannot be specified with
.Va jail_ Ns Ao Ar jname Ac Ns Va _interface ,
.Va jail_ Ns Ao Ar jname Ac Ns Va _ip
and/or
.Va jail_ Ns Ao Ar jname Ac Ns Va _ip_multi Ns Aq Ar n
at the same time.
.It Li fstab
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _fstab
.It Li mount
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _fdescfs_enable
or
.Va jail_ Ns Ao Ar jname Ac Ns Va _procfs_enable.
.It Li exec.fib
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _fib
.It Li exec.start
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _exec_start .
The parameter name was
.Li command
in some older releases.
.It Li exec.prestart
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _exec_prestart
.It Li exec.poststart
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _exec_poststart
.It Li exec.stop
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _exec_stop
.It Li exec.prestop
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _exec_prestop
.It Li exec.poststop
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _exec_poststop
.It Li ip4.addr
set if
.Va jail_ Ns Ao Ar jname Ac Ns Va _ip
contains IPv4 addresses
or
.Va jail_ Ns Ao Ar jname Ac Ns Va _ip_multi Ns Aq Ar n
contain IPv4 addresses
.It Li ip6.addr
set if
.Va jail_ Ns Ao Ar jname Ac Ns Va _ip6
contains IPv6 addresses
.El
.It Va jail_ Ns Ao Ar jname Ac Ns Va _ip
.Pq Vt str
Unset by default.
Set to the (primary) IPv4 and/or IPv6 address(es) assigned to the jail.
The argument can be a sole address or a comma separated list of addresses.
Additionally each address can be prefixed by the name of an interface
followed by a pipe to overwrite
.Va jail_ Ns Ao Ar jname Ac Ns Va _interface
or
.Va jail_interface
and/or suffixed by a netmask, prefixlen or prefix.
In case no netmask, prefixlen or prefix is given,
.Sq /32
will be used for IPv4 and
.Sq /128
will be used for an IPv6 address.
If no address is given for the jail then the jail will be started with
no networking support.
.It Va jail_ Ns Ao Ar jname Ac Ns Va _ip_multi Ns Aq Ar n
.Pq Vt str
Unset by default.
Set additional IPv4 and/or IPv6 address(es) assigned to the jail.
The sequence starts with
.Dq Li _multi0
and the numbers have to be strictly ascending.
These entries follow the same syntax as their primary
.Va jail_ Ns Ao Ar jname Ac Ns Va _ip
entry.
The order of the entries can be important as the first address for
each address family found will be the primary address of the jail.
See
.Va ip-addresses
option in
.Xr jail 8
for more details.
.It Va jail_ Ns Ao Ar jname Ac Ns Va _flags
.Pq Vt str
Set to
.Dq Li -l -U root
by default.
These are flags to pass to
.Xr jail 8 .
.It Va jail_ Ns Ao Ar jname Ac Ns Va _interface
.Pq Vt str
Unset by default.
When set, sets the interface to use when setting IP address alias.
Note that the alias is created at jail startup and removed at jail shutdown.
.It Va jail_ Ns Ao Ar jname Ac Ns Va _fib
.Pq Vt str
Unset by default.
When set, the jail is started with the specified forwarding table (sometimes
referred to as a routing table) via
.Xr setfib 1 .
.It Va jail_ Ns Ao Ar jname Ac Ns Va _fstab
.Pq Vt str
Set to
.Pa /etc/fstab. Ns Aq Ar jname
by default.
This is the file system information file to use for jail
.Va jname .
.It Va jail_ Ns Ao Ar jname Ac Ns Va _mount_enable
.Pq Vt bool
Set to
.Dq Li NO
by default.
When set to
.Dq Li YES ,
mount all file systems from
.Va jail_ Ns Ao Ar jname Ac Ns Va _fstab
at jail startup.
.It Va jail_ Ns Ao Ar jname Ac Ns Va _devfs_ruleset
.Pq Vt str
Unset by default.
When set, defines the device file system ruleset file to use for jail
.Va jname .
.It Va jail_ Ns Ao Ar jname Ac Ns Va _devfs_enable
.Pq Vt bool
Set to
.Dq Li NO
by default.
When set to
.Dq Li YES ,
mount the device file system inside jail
.Ar jname
at jail startup.
.It Va jail_ Ns Ao Ar jname Ac Ns Va _fdescfs_enable
.Pq Vt bool
Set to
.Dq Li NO
by default.
When set to
.Dq Li YES ,
mount the file-descriptor file system inside jail
.Ar jname
at jail startup.
.It Va jail_ Ns Ao Ar jname Ac Ns Va _procfs_enable
.Pq Vt bool
Set to
.Dq Li NO
by default.
When set to
.Dq Li YES ,
mount the process file system inside jail
.Ar jname
at jail startup.
.It Va jail_ Ns Ao Ar jname Ac Ns Va _exec_prestart Ns Aq Ar N
.Pq Vt str
Unset by default.
This is the command run as
.Ar N Ns
th command
before jail startup, where
.Ar N
is 0, 1, and so on.
It is run outside the jail.
.It Va jail_ Ns Ao Ar jname Ac Ns Va _exec_start
.Pq Vt str
Set to
.Dq Li /bin/sh /etc/rc
by default.
This is the command executed in a jail at jail startup.
.It Va jail_ Ns Ao Ar jname Ac Ns Va _exec_afterstart Ns Aq Ar N
.Pq Vt str
Unset by default.
This is the command run as
.Ar N Ns
th command
in a jail
after jail startup, where
.Ar N
is 1, 2, and so on.
.It Va jail_ Ns Ao Ar jname Ac Ns Va _exec_poststart Ns Aq Ar N
.Pq Vt str
Unset by default.
This is the command run as
.Ar N Ns
th command
after jail startup, where
.Ar N
is 0, 1, and so on.
It is run outside the jail.
.It Va jail_ Ns Ao Ar jname Ac Ns Va _exec_prestop Ns Aq Ar N
.Pq Vt str
Unset by default.
This is the command run as
.Ar N Ns
th command
before jail shutdown, where
.Ar N
is 0, 1, and so on.
It is run outside the jail.
.It Va jail_ Ns Ao Ar jname Ac Ns Va _exec_stop
.Pq Vt str
Set to
.Dq Li /bin/sh /etc/rc.shutdown
by default.
This is the command executed in a jail at jail shutdown.
.It Va jail_ Ns Ao Ar jname Ac Ns Va _exec_poststop Ns Aq Ar N
.Pq Vt str
Unset by default.
This is the command run as
.Ar N Ns
th command
after jail shutdown, where
.Ar N
is 0, 1, and so on.
It is run outside the jail.
.It Va jail_set_hostname_allow
.Pq Vt bool
If set to
.Dq Li NO ,
do not allow the root user in a jail to set its hostname.
.It Va jail_socket_unixiproute_only
.Pq Vt bool
If set to
.Dq Li YES ,
do not allow any sockets,
besides UNIX/IP/route sockets,
to be used within a jail.
.It Va jail_sysvipc_allow
.Pq Vt bool
If set to
.Dq Li YES ,
allow applications within a jail to use System V IPC.
or
.Va jail_ Ns Ao Ar jname Ac Ns Va _ip_multi Ns Aq Ar n
contain IPv6 addresses
.It Li allow.mount
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _mount_enable
.It Li mount.devfs
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _devfs_enable
.It Li devfs_ruleset
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _devfs_ruleset .
This must be an integer,
not a string.
.It Li allow.set_hostname
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _set_hostname_allow
.It Li allow.rawsocket
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _socket_unixiproute_only
.It Li allow.sysvipc
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _sysvipc_allow
.El
.\" -----------------------------------------------------
.It Va harvest_interrupt
.Pq Vt bool

View File

@ -36,17 +36,4 @@ MLINKS+= c99.7 c78.7
MLINKS+= c99.7 c89.7
MLINKS+= c99.7 c90.7
.if ${MK_ATF} != "no"
ATF= ${.CURDIR}/../../../contrib/atf
.PATH: ${ATF}/doc
MAN+= atf.7
CLEANFILES+= atf.7 atf.7.tmp
atf.7: atf.7.in
sed -e 's,__DOCDIR__,${DOCDIR}/atf,g' \
-e 's,__TESTSDIR__,${TESTSBASE},g' \
< ${.ALLSRC} > ${.TARGET}.tmp
mv ${.TARGET}.tmp ${.TARGET}
.endif
.include <bsd.prog.mk>

View File

@ -275,7 +275,7 @@ FreeBSD 5.2 | | | |
| | | | | | 6.0.2 | |
| | | | | | | OpenBSD 5.3 DragonFly 3.4.1
| | | | | | NetBSD | |
| | | | | | 6.0.2 | |
| | | | | | 6.0.3 | |
| | | | | | | |
| | | | | |`-NetBSD 6.1 | |
| | FreeBSD | | | | |

View File

@ -145,6 +145,7 @@ dumbbell [label="Jean-Sebastien Pedron\ndumbbell@FreeBSD.org\n2004/11/29"]
dwmalone [label="David Malone\ndwmalone@FreeBSD.org\n2000/07/11"]
eadler [label="Eitan Adler\neadler@FreeBSD.org\n2012/01/18"]
ed [label="Ed Schouten\ned@FreeBSD.org\n2008/05/22"]
edavis [label="Eric Davis\nedavis@FreeBSD.org\n2013/10/09"]
edwin [label="Edwin Groothuis\nedwin@FreeBSD.org\n2007/06/25"]
eivind [label="Eivind Eklund\neivind@FreeBSD.org\n1997/02/02"]
emaste [label="Ed Maste\nemaste@FreeBSD.org\n2005/10/04"]

View File

@ -51,98 +51,4 @@ ${_T}: ${TESTS_SH_SRC_${_T}}
.endfor
.endif
ATFFILE?= auto
.if ${ATFFILE:tl} != "no"
FILES+= Atffile
FILESDIR_Atffile= ${TESTSDIR}
.if ${ATFFILE:tl} == "auto"
CLEANFILES+= Atffile Atffile.tmp
Atffile: Makefile
@{ echo 'Content-Type: application/X-atf-atffile; version="1"'; \
echo; \
echo '# Automatically generated by atf-test.mk.'; \
echo; \
echo 'prop: test-suite = "'`uname -o`'"'; \
echo; \
for tp in ${ATF_TESTS}; do \
echo "tp: $${tp}"; \
done; } >Atffile.tmp
@mv Atffile.tmp Atffile
.endif
.endif
# Generate support variables for atf-test.
#
# atf-test can only work for native builds, i.e. a build host of a particular
# OS building a release for the same OS version and architecture. The target
# runs ATF, which is on the build host, and the tests execute code built for
# the target host.
#
# Due to the dependencies of the binaries built by the source tree and how they
# are used by tests, it is highly possible for a execution of "make test" to
# report bogus results unless the new binaries are put in place.
# XXX (gcooper): Executing ATF from outside the source tree is improper; it
# should be built as part of the OS toolchain build for the host OS and
# executed from there.
ATF_PATH+= ${DESTDIR}/bin ${DESTDIR}/sbin ${DESTDIR}/usr/bin ${DESTDIR}/usr/sbin
TESTS_ENV+= PATH=${ATF_PATH:ts:}:${PATH}
ATF_BUILD_CC?= ${DESTDIR}/usr/bin/cc
ATF_BUILD_CPP?= ${DESTDIR}/usr/bin/cpp
ATF_BUILD_CXX?= ${DESTDIR}/usr/bin/c++
ATF_CONFDIR?= ${DESTDIR}/etc
ATF_INCLUDEDIR?= ${DESTDIR}/usr/include
ATF_LIBDIR?= ${DESTDIR}/usr/lib
ATF_LIBEXECDIR?= ${DESTDIR}/usr/libexec
ATF_PKGDATADIR?= ${DESTDIR}/usr/share/atf
ATF_SHELL?= ${DESTDIR}/bin/sh
LD_LIBRARY_PATH?= ${TESTS_LD_LIBRARY_PATH:tW:S/ /:/g}
ATF_ENV_VARS= \
ATF_BUILD_CC \
ATF_BUILD_CPP \
ATF_BUILD_CXX \
ATF_CONFDIR \
ATF_INCLUDEDIR \
ATF_LIBDIR \
ATF_LIBEXECDIR \
ATF_PKGDATADIR \
ATF_SHELL \
.for v in ${ATF_ENV_VARS}
.if !empty($v)
TESTS_ENV+= $v=${$v}
.endif
.endfor
_TESTS_FIFO= ${.OBJDIR}/atf-run.fifo
_TESTS_LOG= ${.OBJDIR}/atf-run.log
CLEANFILES+= ${_TESTS_FIFO} ${_TESTS_LOG}
ATF_BIN?= ${DESTDIR}/usr/bin
ATF_REPORT?= ${ATF_BIN}/atf-report
ATF_RUN?= ${ATF_BIN}/atf-run
.PHONY: realtest
realtest:
.if defined(TESTSDIR)
@set -e; \
cd ${DESTDIR}${TESTSDIR}; \
rm -f ${_TESTS_FIFO}; \
mkfifo ${_TESTS_FIFO}; \
tee ${_TESTS_LOG} < ${_TESTS_FIFO} | ${TESTS_ENV} ${ATF_REPORT} & \
set +e; \
${TESTS_ENV} ${ATF_RUN} >> ${_TESTS_FIFO}; \
result=$${?}; \
wait; \
rm -f ${_TESTS_FIFO}; \
echo; \
echo "*** The verbatim output of atf-run has been saved to ${_TESTS_LOG}"; \
exit $${result}
.endif
.include <bsd.test.mk>

View File

@ -117,7 +117,7 @@ danish.cp865.kbd:fr:Danois Code page 865
danish.cp865.kbd:pt:Dinamarquês Codepage 865
danish.cp865.kbd:es:Danés Codepage 865
danish.iso.macbook.kbd:Danish ISO-8859-1 (macbook)
danish.iso.macbook.kbd:da:Danish ISO-8859-1 (macbook)
dutch.iso.acc.kbd:en:Dutch ISO keymap (accent keys)

View File

@ -1,36 +0,0 @@
#-
# Copyright (c) 2012 EMC Corporation.
# 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.
#
# $FreeBSD$
.include <bsd.own.mk>
SUBDIR+= ${_atf}
.if ${MK_ATF} != "no"
_atf= atf
.endif
.include <bsd.subdir.mk>

View File

@ -1,39 +0,0 @@
#-
# Copyright (c) 2011 Google, Inc.
# 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.
#
# $FreeBSD$
ATF= ${.CURDIR}/../../../contrib/atf
.PATH: ${ATF}/atf-report
NO_OBJ=
FILESGROUPS= XML
XMLDIR= ${SHAREDIR}/xml/atf
XML= tests-results.dtd
.include <bsd.prog.mk>

View File

@ -1,36 +0,0 @@
#-
# Copyright (c) 2012 EMC Corporation.
# 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.
#
# $FreeBSD$
.include <bsd.own.mk>
SUBDIR+= ${_atf}
.if ${MK_ATF} != "no"
_atf= atf
.endif
.include <bsd.subdir.mk>

View File

@ -1,30 +0,0 @@
#-
# Copyright (c) 2012 EMC Corporation.
# 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.
#
# $FreeBSD$
BINDIR?= ${SHAREDIR}/xsl
# vim: syntax=make

View File

@ -1,39 +0,0 @@
#-
# Copyright (c) 2011 Google, Inc.
# 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.
#
# $FreeBSD$
ATF= ${.CURDIR}/../../../contrib/atf
.PATH: ${ATF}/atf-report
NO_OBJ=
FILESGROUPS= XSL
XSLDIR= ${SHAREDIR}/xsl/atf
XSL= tests-results.xsl
.include <bsd.prog.mk>

View File

@ -72,7 +72,6 @@ options KDTRACE_FRAME # Ensure frames are compiled in
options KDTRACE_HOOKS # Kernel DTrace hooks
options DDB_CTF # Kernel ELF linker loads CTF data
options INCLUDE_CONFIG_FILE # Include this file in kernel
options XENHVM # Include Xen support
# Debugging support. Always need this:
options KDB # Enable kernel debugger support.
@ -345,8 +344,10 @@ device virtio_balloon # VirtIO Memory Balloon device
# HyperV drivers
device hyperv # HyperV drivers
# Xen support
device xenpci # Generic Xen bus
# Xen HVM Guest Optimizations
# NOTE: XENHVM depends on xenpci. They must be added or removed together.
options XENHVM # Xen HVM kernel infrastructure
device xenpci # Xen HVM Hypervisor services driver
# VMware support
device vmx # VMware VMXNET3 Ethernet

View File

@ -360,6 +360,9 @@ versatile_pci_activate_resource(device_t bus, device_t child, int type, int rid,
res = (BUS_ACTIVATE_RESOURCE(device_get_parent(bus),
child, type, rid, r));
break;
default:
res = ENXIO;
break;
}
return (res);

View File

@ -41,6 +41,8 @@
.set PSL_RESERVED_DEFAULT,0x00000002
.set PSL_T,0x00000100 # Trap flag
.set PSL_I,0x00000200 # Interrupt enable flag
.set PSL_D,0x00000400 # String instruction direction
.set PSL_NT,0x00004000 # Nested task flag
.set PSL_VM,0x00020000 # Virtual 8086 mode flag
.set PSL_AC,0x00040000 # Alignment check flag
/*
@ -611,8 +613,8 @@ rret_tramp: movw $MEM_ESPR-0x08,%sp # Reset stack pointer
pushl %ds # regs
pushl %es
pushfl # Save %eflags
cli # Disable interrupts
std # String ops dec
pushl $PSL_RESERVED_DEFAULT|PSL_D # Use clean %eflags with
popfl # string ops dec
xorw %ax,%ax # Reset seg
movw %ax,%ds # regs
movw %ax,%es # (%ss is already 0)
@ -675,6 +677,7 @@ rret_tramp.1: xorl %ecx,%ecx # Zero
testl $V86F_FLAGS,%edx # User wants flags?
jz rret_tramp.3 # No
movl MEM_ESPR-0x3c,%eax # Read real mode flags
andl $~(PSL_T|PSL_NT),%eax # Clear unsafe flags
movw %ax,-0x08(%esi) # Update user flags (low 16)
/*
* Return to the user task

View File

@ -677,6 +677,16 @@ dmu_free_long_range(objset_t *os, uint64_t object,
if (err != 0)
return (err);
err = dmu_free_long_range_impl(os, dn, offset, length);
/*
* It is important to zero out the maxblkid when freeing the entire
* file, so that (a) subsequent calls to dmu_free_long_range_impl()
* will take the fast path, and (b) dnode_reallocate() can verify
* that the entire file has been freed.
*/
if (offset == 0 && length == DMU_OBJECT_END)
dn->dn_maxblkid = 0;
dnode_rele(dn, FTAG);
return (err);
}

View File

@ -616,7 +616,7 @@ dmu_tx_hold_free(dmu_tx_t *tx, uint64_t object, uint64_t off, uint64_t len)
*/
if (dn->dn_datablkshift == 0) {
if (off != 0 || len < dn->dn_datablksz)
dmu_tx_count_write(txh, off, len);
dmu_tx_count_write(txh, 0, dn->dn_datablksz);
} else {
/* first block will be modified if it is not aligned */
if (!IS_P2ALIGNED(off, 1 << dn->dn_datablkshift))

View File

@ -31,8 +31,8 @@
# $FreeBSD$
TYPE="FreeBSD"
REVISION="10.0"
BRANCH="ALPHA5"
REVISION="11.0"
BRANCH="CURRENT"
if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
fi

View File

@ -297,7 +297,7 @@ ipf_p_tftp_backchannel(fin, aps, nat)
tftpinfo_t *ti;
udphdr_t udp;
fr_info_t fi;
u_short slen;
u_short slen = 0; /* silence gcc */
nat_t *nat2;
int nflags;
ip_t *ip;

View File

@ -92,7 +92,7 @@ FEATURE(ata_cam, "ATA devices are accessed through the cam(4) driver");
int
ata_probe(device_t dev)
{
return 0;
return (BUS_PROBE_DEFAULT);
}
int

View File

@ -140,7 +140,7 @@ ata_pccard_attach(device_t dev)
ch-> flags |= ATA_NO_SLAVE;
ata_generic_hw(dev);
err = ata_probe(dev);
if (err)
if (err > 0)
return (err);
return (ata_attach(dev));
}

View File

@ -34,7 +34,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#define BXE_DRIVER_VERSION "1.78.17"
#define BXE_DRIVER_VERSION "1.78.18"
#include "bxe.h"
#include "ecore_sp.h"
@ -936,8 +936,8 @@ bxe_dma_alloc(struct bxe_softc *sc,
int rc;
if (dma->size > 0) {
BLOGE(sc, "dma block '%s' already has size %lu\n", msg,
(unsigned long) dma->size);
BLOGE(sc, "dma block '%s' already has size %lu\n", msg,
(unsigned long)dma->size);
return (1);
}
@ -2532,9 +2532,9 @@ bxe_sp_post(struct bxe_softc *sc,
atomic_subtract_acq_long(&sc->cq_spq_left, 1);
}
BLOGD(sc, DBG_SP, "SPQE -> %p\n", (void *)sc->spq_dma.paddr);
BLOGD(sc, DBG_SP, "FUNC_RDATA -> %p / %p\n",
BXE_SP(sc, func_rdata), (void *)BXE_SP_MAPPING(sc, func_rdata));
BLOGD(sc, DBG_SP, "SPQE -> %#jx\n", (uintmax_t)sc->spq_dma.paddr);
BLOGD(sc, DBG_SP, "FUNC_RDATA -> %p / %#jx\n",
BXE_SP(sc, func_rdata), (uintmax_t)BXE_SP_MAPPING(sc, func_rdata));
BLOGD(sc, DBG_SP,
"SPQE[%x] (%x:%x) (cmd, common?) (%d,%d) hw_cid %x data (%x:%x) type(0x%x) left (CQ, EQ) (%lx,%lx)\n",
sc->spq_prod_idx,
@ -6923,11 +6923,11 @@ bxe_alloc_fw_stats_mem(struct bxe_softc *sc)
sc->fw_stats_data_mapping = (sc->fw_stats_dma.paddr +
sc->fw_stats_req_size);
BLOGD(sc, DBG_LOAD, "statistics request base address set to %p\n",
(void *)sc->fw_stats_req_mapping);
BLOGD(sc, DBG_LOAD, "statistics request base address set to %#jx\n",
(uintmax_t)sc->fw_stats_req_mapping);
BLOGD(sc, DBG_LOAD, "statistics data base address set to %p\n",
(void *)sc->fw_stats_data_mapping);
BLOGD(sc, DBG_LOAD, "statistics data base address set to %#jx\n",
(uintmax_t)sc->fw_stats_data_mapping);
return (0);
}
@ -14201,8 +14201,14 @@ bxe_media_detect(struct bxe_softc *sc)
uint32_t phy_idx = bxe_get_cur_phy_idx(sc);
switch (sc->link_params.phy[phy_idx].media_type) {
case ELINK_ETH_PHY_SFPP_10G_FIBER:
case ELINK_ETH_PHY_SFP_1G_FIBER:
case ELINK_ETH_PHY_XFP_FIBER:
BLOGI(sc, "Found 10Gb Fiber media.\n");
sc->media = IFM_10G_SR;
break;
case ELINK_ETH_PHY_SFP_1G_FIBER:
BLOGI(sc, "Found 1Gb Fiber media.\n");
sc->media = IFM_1000_SX;
break;
case ELINK_ETH_PHY_KR:
case ELINK_ETH_PHY_CX4:
BLOGI(sc, "Found 10GBase-CX4 media.\n");
@ -14213,8 +14219,14 @@ bxe_media_detect(struct bxe_softc *sc)
sc->media = IFM_10G_TWINAX;
break;
case ELINK_ETH_PHY_BASE_T:
BLOGI(sc, "Found 10GBase-T media.\n");
sc->media = IFM_10G_T;
if (sc->link_params.speed_cap_mask[0] &
PORT_HW_CFG_SPEED_CAPABILITY_D0_10G) {
BLOGI(sc, "Found 10GBase-T media.\n");
sc->media = IFM_10G_T;
} else {
BLOGI(sc, "Found 1000Base-T media.\n");
sc->media = IFM_1000_T;
}
break;
case ELINK_ETH_PHY_NOT_PRESENT:
BLOGI(sc, "Media not present.\n");

View File

@ -263,6 +263,17 @@ bxe_stats_pmf_update(struct bxe_softc *sc)
int loader_idx = PMF_DMAE_C(sc);
uint32_t *stats_comp = BXE_SP(sc, stats_comp);
if (sc->devinfo.bc_ver <= 0x06001400) {
/*
* Bootcode v6.0.21 fixed a GRC timeout that occurs when accessing
* BRB registers while the BRB block is in reset. The DMA transfer
* below triggers this issue resulting in the DMAE to stop
* functioning. Skip this initial stats transfer for old bootcode
* versions <= 6.0.20.
*/
return;
}
/* sanity */
if (!sc->port.pmf || !sc->port.port_stx) {
BLOGE(sc, "BUG!\n");

View File

@ -77,9 +77,14 @@ struct bxe_softc;
typedef bus_addr_t ecore_dma_addr_t; /* expected to be 64 bit wide */
typedef volatile int ecore_atomic_t;
#if __FreeBSD_version < 1000002
typedef int bool;
#ifndef __bool_true_false_are_defined
#ifndef __cplusplus
#define bool _Bool
#if __STDC_VERSION__ < 199901L && __GNUC__ < 3 && !defined(__INTEL_COMPILER)
typedef _Bool bool;
#endif
#endif /* !__cplusplus */
#endif /* !__bool_true_false_are_defined$ */
#define ETH_ALEN ETHER_ADDR_LEN /* 6 */

View File

@ -298,3 +298,4 @@ DECLARE_MODULE(iw_cxgb, iwch_mod_data, SI_SUB_EXEC, SI_ORDER_ANY);
MODULE_DEPEND(t3_tom, cxgbc, 1, 1, 1);
MODULE_DEPEND(iw_cxgb, toecore, 1, 1, 1);
MODULE_DEPEND(iw_cxgb, t3_tom, 1, 1, 1);
MODULE_DEPEND(iw_cxgb, ibcore, 1, 1, 1);

View File

@ -24,6 +24,8 @@
* 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.
*
* $FreeBSD$
*/
/**
@ -669,6 +671,7 @@ typedef struct hv_vmbus_channel {
* Allocated memory for ring buffer
*/
void* ring_buffer_pages;
unsigned long ring_buffer_size;
uint32_t ring_buffer_page_count;
/*
* send to parent

View File

@ -24,6 +24,8 @@
* 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.
*
* $FreeBSD$
*/
/*
@ -970,6 +972,8 @@ typedef struct hn_softc {
int hn_if_flags;
struct mtx hn_lock;
int hn_initdone;
/* See hv_netvsc_drv_freebsd.c for rules on how to use */
int temp_unusable;
struct hv_device *hn_dev_obj;
netvsc_dev *net_dev;
} hn_softc_t;

View File

@ -52,6 +52,9 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@ -701,6 +704,17 @@ netvsc_recv(struct hv_device *device_ctx, netvsc_packet *packet)
return (0);
}
/*
* Rules for using sc->temp_unusable:
* 1. sc->temp_unusable can only be read or written while holding NV_LOCK()
* 2. code reading sc->temp_unusable under NV_LOCK(), and finding
* sc->temp_unusable set, must release NV_LOCK() and exit
* 3. to retain exclusive control of the interface,
* sc->temp_unusable must be set by code before releasing NV_LOCK()
* 4. only code setting sc->temp_unusable can clear sc->temp_unusable
* 5. code setting sc->temp_unusable must eventually clear sc->temp_unusable
*/
/*
* Standard ioctl entry point. Called when the user wants to configure
* the interface.
@ -713,7 +727,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
netvsc_device_info device_info;
struct hv_device *hn_dev;
int mask, error = 0;
int retry_cnt = 500;
switch(cmd) {
case SIOCSIFADDR:
@ -723,38 +738,80 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case SIOCSIFMTU:
hn_dev = vmbus_get_devctx(sc->hn_dev);
NV_LOCK(sc);
/* Check MTU value change */
if (ifp->if_mtu == ifr->ifr_mtu)
break;
if (ifr->ifr_mtu > NETVSC_MAX_CONFIGURABLE_MTU) {
error = EINVAL;
NV_UNLOCK(sc);
break;
}
/* Obtain and record requested MTU */
ifp->if_mtu = ifr->ifr_mtu;
do {
NV_LOCK(sc);
if (!sc->temp_unusable) {
sc->temp_unusable = TRUE;
retry_cnt = -1;
}
NV_UNLOCK(sc);
if (retry_cnt > 0) {
retry_cnt--;
DELAY(5 * 1000);
}
} while (retry_cnt > 0);
/*
* We must remove and add back the device to cause the new
if (retry_cnt == 0) {
error = EINVAL;
break;
}
/* We must remove and add back the device to cause the new
* MTU to take effect. This includes tearing down, but not
* deleting the channel, then bringing it back up.
*/
error = hv_rf_on_device_remove(hn_dev, HV_RF_NV_RETAIN_CHANNEL);
if (error) {
NV_LOCK(sc);
sc->temp_unusable = FALSE;
NV_UNLOCK(sc);
break;
}
error = hv_rf_on_device_add(hn_dev, &device_info);
if (error) {
NV_LOCK(sc);
sc->temp_unusable = FALSE;
NV_UNLOCK(sc);
break;
}
hn_ifinit_locked(sc);
NV_LOCK(sc);
sc->temp_unusable = FALSE;
NV_UNLOCK(sc);
break;
case SIOCSIFFLAGS:
NV_LOCK(sc);
do {
NV_LOCK(sc);
if (!sc->temp_unusable) {
sc->temp_unusable = TRUE;
retry_cnt = -1;
}
NV_UNLOCK(sc);
if (retry_cnt > 0) {
retry_cnt--;
DELAY(5 * 1000);
}
} while (retry_cnt > 0);
if (retry_cnt == 0) {
error = EINVAL;
break;
}
if (ifp->if_flags & IFF_UP) {
/*
* If only the state of the PROMISC flag changed,
@ -766,21 +823,14 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
*/
#ifdef notyet
/* Fixme: Promiscuous mode? */
/* No promiscuous mode with Xen */
if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
ifp->if_flags & IFF_PROMISC &&
!(sc->hn_if_flags & IFF_PROMISC)) {
/* do something here for Hyper-V */
;
/* XN_SETBIT(sc, XN_RX_MODE, */
/* XN_RXMODE_RX_PROMISC); */
} else if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
!(ifp->if_flags & IFF_PROMISC) &&
sc->hn_if_flags & IFF_PROMISC) {
!(ifp->if_flags & IFF_PROMISC) &&
sc->hn_if_flags & IFF_PROMISC) {
/* do something here for Hyper-V */
;
/* XN_CLRBIT(sc, XN_RX_MODE, */
/* XN_RXMODE_RX_PROMISC); */
} else
#endif
hn_ifinit_locked(sc);
@ -789,8 +839,10 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
hn_stop(sc);
}
}
sc->hn_if_flags = ifp->if_flags;
NV_LOCK(sc);
sc->temp_unusable = FALSE;
NV_UNLOCK(sc);
sc->hn_if_flags = ifp->if_flags;
error = 0;
break;
case SIOCSIFCAP:
@ -838,7 +890,6 @@ hn_stop(hn_softc_t *sc)
int ret;
struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev);
NV_LOCK_ASSERT(sc);
ifp = sc->hn_ifp;
printf(" Closing Device ...\n");
@ -859,6 +910,10 @@ hn_start(struct ifnet *ifp)
sc = ifp->if_softc;
NV_LOCK(sc);
if (sc->temp_unusable) {
NV_UNLOCK(sc);
return;
}
hn_start_locked(ifp);
NV_UNLOCK(sc);
}
@ -873,8 +928,6 @@ hn_ifinit_locked(hn_softc_t *sc)
struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev);
int ret;
NV_LOCK_ASSERT(sc);
ifp = sc->hn_ifp;
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
@ -902,7 +955,17 @@ hn_ifinit(void *xsc)
hn_softc_t *sc = xsc;
NV_LOCK(sc);
if (sc->temp_unusable) {
NV_UNLOCK(sc);
return;
}
sc->temp_unusable = TRUE;
NV_UNLOCK(sc);
hn_ifinit_locked(sc);
NV_LOCK(sc);
sc->temp_unusable = FALSE;
NV_UNLOCK(sc);
}

View File

@ -92,6 +92,7 @@ static int hv_check_for_hyper_v(void);
static int
hv_ata_pci_probe(device_t dev)
{
device_t parent = device_get_parent(dev);
int ata_disk_enable;
ata_disk_enable = 0;
@ -102,23 +103,9 @@ hv_ata_pci_probe(device_t dev)
if (!hv_check_for_hyper_v())
return (ENXIO);
if (bootverbose)
device_printf(dev,
"hv_ata_pci_probe dev_class/subslcass = %d, %d\n",
pci_get_class(dev), pci_get_subclass(dev));
/* is this a storage class device ? */
if (pci_get_class(dev) != PCIC_STORAGE)
if (device_get_unit(parent) != 0 || device_get_ivars(dev) != 0)
return (ENXIO);
/* is this an IDE/ATA type device ? */
if (pci_get_subclass(dev) != PCIS_STORAGE_IDE)
return (ENXIO);
if(bootverbose)
device_printf(dev,
"Hyper-V probe for disabling ATA-PCI, emulated driver\n");
/*
* On Hyper-V the default is to use the enlightened driver for
* IDE disks. However, if the user wishes to use the native
@ -126,15 +113,14 @@ hv_ata_pci_probe(device_t dev)
* hw_ata.disk_enable must be explicitly set to 1.
*/
if (getenv_int("hw.ata.disk_enable", &ata_disk_enable)) {
if(bootverbose)
if (bootverbose)
device_printf(dev,
"hw.ata.disk_enable flag is disabling Hyper-V"
" ATA driver support\n");
return (ENXIO);
}
if (bootverbose)
device_printf(dev, "Hyper-V ATA storage driver enabled.\n");
device_set_desc(dev, "Hyper-V ATA storage disengage driver");
return (BUS_PROBE_VENDOR);
}
@ -193,12 +179,12 @@ static device_method_t hv_ata_pci_methods[] = {
devclass_t hv_ata_pci_devclass;
static driver_t hv_ata_pci_disengage_driver = {
"pciata-disable",
"ata",
hv_ata_pci_methods,
sizeof(struct ata_pci_controller),
0,
};
DRIVER_MODULE(atapci_dis, pci, hv_ata_pci_disengage_driver,
hv_ata_pci_devclass, NULL, NULL);
DRIVER_MODULE(atapci_dis, atapci, hv_ata_pci_disengage_driver,
hv_ata_pci_devclass, NULL, NULL);
MODULE_VERSION(atapci_dis, 1);
MODULE_DEPEND(atapci_dis, ata, 1, 1, 1);

View File

@ -32,6 +32,8 @@
* converted into VSCSI protocol messages which are delivered to the parent
* partition StorVSP driver over the Hyper-V VMBUS.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/proc.h>
@ -322,10 +324,10 @@ hv_storvsc_channel_init(struct hv_device *dev)
vstor_packet->operation = VSTOR_OPERATION_QUERYPROTOCOLVERSION;
vstor_packet->flags = REQUEST_COMPLETION_FLAG;
vstor_packet->version.major_minor = VMSTOR_PROTOCOL_VERSION_CURRENT;
vstor_packet->u.version.major_minor = VMSTOR_PROTOCOL_VERSION_CURRENT;
/* revision is only significant for Windows guests */
vstor_packet->version.revision = 0;
vstor_packet->u.version.revision = 0;
ret = hv_vmbus_channel_send_packet(
dev->channel,
@ -532,11 +534,11 @@ hv_storvsc_io_request(struct hv_device *device,
vstor_packet->flags |= REQUEST_COMPLETION_FLAG;
vstor_packet->vm_srb.length = sizeof(struct vmscsi_req);
vstor_packet->u.vm_srb.length = sizeof(struct vmscsi_req);
vstor_packet->vm_srb.sense_info_len = SENSE_BUFFER_SIZE;
vstor_packet->u.vm_srb.sense_info_len = SENSE_BUFFER_SIZE;
vstor_packet->vm_srb.transfer_len = request->data_buf.length;
vstor_packet->u.vm_srb.transfer_len = request->data_buf.length;
vstor_packet->operation = VSTOR_OPERATION_EXECUTESRB;
@ -583,7 +585,7 @@ hv_storvsc_on_iocompletion(struct storvsc_softc *sc,
{
struct vmscsi_req *vm_srb;
vm_srb = &vstor_packet->vm_srb;
vm_srb = &vstor_packet->u.vm_srb;
request->sense_info_len = 0;
if (((vm_srb->scsi_status & 0xFF) == SCSI_STATUS_CHECK_COND) &&
@ -594,7 +596,7 @@ hv_storvsc_on_iocompletion(struct storvsc_softc *sc,
("vm_srb->sense_info_len <= "
"request->sense_info_len"));
memcpy(request->sense_data, vm_srb->sense_data,
memcpy(request->sense_data, vm_srb->u.sense_data,
vm_srb->sense_info_len);
request->sense_info_len = vm_srb->sense_info_len;
@ -1298,35 +1300,35 @@ create_storvsc_request(union ccb *ccb, struct hv_storvsc_request *reqp)
uint32_t pfn;
/* refer to struct vmscsi_req for meanings of these two fields */
reqp->vstor_packet.vm_srb.port =
reqp->vstor_packet.u.vm_srb.port =
cam_sim_unit(xpt_path_sim(ccb->ccb_h.path));
reqp->vstor_packet.vm_srb.path_id =
reqp->vstor_packet.u.vm_srb.path_id =
cam_sim_bus(xpt_path_sim(ccb->ccb_h.path));
reqp->vstor_packet.vm_srb.target_id = ccb->ccb_h.target_id;
reqp->vstor_packet.vm_srb.lun = ccb->ccb_h.target_lun;
reqp->vstor_packet.u.vm_srb.target_id = ccb->ccb_h.target_id;
reqp->vstor_packet.u.vm_srb.lun = ccb->ccb_h.target_lun;
reqp->vstor_packet.vm_srb.cdb_len = csio->cdb_len;
reqp->vstor_packet.u.vm_srb.cdb_len = csio->cdb_len;
if(ccb->ccb_h.flags & CAM_CDB_POINTER) {
memcpy(&reqp->vstor_packet.vm_srb.cdb, csio->cdb_io.cdb_ptr,
memcpy(&reqp->vstor_packet.u.vm_srb.u.cdb, csio->cdb_io.cdb_ptr,
csio->cdb_len);
} else {
memcpy(&reqp->vstor_packet.vm_srb.cdb, csio->cdb_io.cdb_bytes,
memcpy(&reqp->vstor_packet.u.vm_srb.u.cdb, csio->cdb_io.cdb_bytes,
csio->cdb_len);
}
switch (ccb->ccb_h.flags & CAM_DIR_MASK) {
case CAM_DIR_OUT:
reqp->vstor_packet.vm_srb.data_in = WRITE_TYPE;
reqp->vstor_packet.u.vm_srb.data_in = WRITE_TYPE;
break;
case CAM_DIR_IN:
reqp->vstor_packet.vm_srb.data_in = READ_TYPE;
reqp->vstor_packet.u.vm_srb.data_in = READ_TYPE;
break;
case CAM_DIR_NONE:
reqp->vstor_packet.vm_srb.data_in = UNKNOWN_TYPE;
reqp->vstor_packet.u.vm_srb.data_in = UNKNOWN_TYPE;
break;
default:
reqp->vstor_packet.vm_srb.data_in = UNKNOWN_TYPE;
reqp->vstor_packet.u.vm_srb.data_in = UNKNOWN_TYPE;
break;
}
@ -1375,7 +1377,7 @@ storvsc_io_done(struct hv_storvsc_request *reqp)
union ccb *ccb = reqp->ccb;
struct ccb_scsiio *csio = &ccb->csio;
struct storvsc_softc *sc = reqp->softc;
struct vmscsi_req *vm_srb = &reqp->vstor_packet.vm_srb;
struct vmscsi_req *vm_srb = &reqp->vstor_packet.u.vm_srb;
if (reqp->retries > 0) {
mtx_lock(&sc->hs_lock);

View File

@ -24,6 +24,8 @@
* 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.
*
* $FreeBSD$
*/
#ifndef __HV_VSTORAGE_H__
@ -107,7 +109,7 @@ struct vmscsi_req {
uint8_t sense_data[SENSE_BUFFER_SIZE];
uint8_t reserved_array[MAX_DATA_BUFFER_LENGTH_WITH_PADDING];
};
} u;
} __packed;
@ -191,7 +193,7 @@ struct vstor_packet {
* Used during version negotiations.
*/
struct vmstor_proto_ver version;
};
} u;
} __packed;

View File

@ -26,6 +26,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/malloc.h>
#include <sys/systm.h>
@ -70,7 +73,7 @@ vmbus_channel_set_event(hv_vmbus_channel *channel)
synch_set_bit(channel->monitor_bit,
(uint32_t *)&monitor_page->
trigger_group[channel->monitor_group].pending);
trigger_group[channel->monitor_group].u.pending);
} else {
hv_vmbus_set_event(channel->offer_msg.child_rel_id);
}
@ -101,17 +104,19 @@ hv_vmbus_channel_open(
/* Allocate the ring buffer */
out = contigmalloc((send_ring_buffer_size + recv_ring_buffer_size),
M_DEVBUF, M_ZERO, 0UL, BUS_SPACE_MAXADDR, PAGE_SIZE, 0);
M_DEVBUF, M_ZERO, 0UL, BUS_SPACE_MAXADDR, PAGE_SIZE, 0);
KASSERT(out != NULL,
("Error VMBUS: contigmalloc failed to allocate Ring Buffer!"));
if (out == NULL)
return (ENOMEM);
return (ENOMEM);
in = ((uint8_t *) out + send_ring_buffer_size);
new_channel->ring_buffer_pages = out;
new_channel->ring_buffer_page_count = (send_ring_buffer_size
+ recv_ring_buffer_size) >> PAGE_SHIFT;
new_channel->ring_buffer_page_count = (send_ring_buffer_size +
recv_ring_buffer_size) >> PAGE_SHIFT;
new_channel->ring_buffer_size = send_ring_buffer_size +
recv_ring_buffer_size;
hv_vmbus_ring_buffer_init(
&new_channel->outbound,
@ -536,10 +541,8 @@ hv_vmbus_channel_close(hv_vmbus_channel *channel)
hv_ring_buffer_cleanup(&channel->outbound);
hv_ring_buffer_cleanup(&channel->inbound);
contigfree(
channel->ring_buffer_pages,
channel->ring_buffer_page_count,
M_DEVBUF);
contigfree(channel->ring_buffer_pages, channel->ring_buffer_size,
M_DEVBUF);
free(info, M_DEVBUF);

View File

@ -240,8 +240,8 @@ hv_vmbus_init(void)
if (virt_addr == NULL)
goto cleanup;
hypercall_msr.enable = 1;
hypercall_msr.guest_physical_address =
hypercall_msr.u.enable = 1;
hypercall_msr.u.guest_physical_address =
(hv_get_phys_addr(virt_addr) >> PAGE_SHIFT);
wrmsr(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64_t);
@ -251,7 +251,7 @@ hv_vmbus_init(void)
hypercall_msr.as_uint64_t = 0;
hypercall_msr.as_uint64_t = rdmsr(HV_X64_MSR_HYPERCALL);
if (!hypercall_msr.enable)
if (!hypercall_msr.u.enable)
goto cleanup;
hv_vmbus_g_context.hypercall_page = virt_addr;
@ -284,7 +284,7 @@ hv_vmbus_init(void)
cleanup:
if (virt_addr != NULL) {
if (hypercall_msr.enable) {
if (hypercall_msr.u.enable) {
hypercall_msr.as_uint64_t = 0;
wrmsr(HV_X64_MSR_HYPERCALL,
hypercall_msr.as_uint64_t);
@ -426,8 +426,8 @@ hv_vmbus_synic_init(void *arg)
*/
simp.as_uint64_t = rdmsr(HV_X64_MSR_SIMP);
simp.simp_enabled = 1;
simp.base_simp_gpa = ((hv_get_phys_addr(
simp.u.simp_enabled = 1;
simp.u.base_simp_gpa = ((hv_get_phys_addr(
hv_vmbus_g_context.syn_ic_msg_page[cpu])) >> PAGE_SHIFT);
wrmsr(HV_X64_MSR_SIMP, simp.as_uint64_t);
@ -436,23 +436,23 @@ hv_vmbus_synic_init(void *arg)
* Setup the Synic's event page
*/
siefp.as_uint64_t = rdmsr(HV_X64_MSR_SIEFP);
siefp.siefp_enabled = 1;
siefp.base_siefp_gpa = ((hv_get_phys_addr(
siefp.u.siefp_enabled = 1;
siefp.u.base_siefp_gpa = ((hv_get_phys_addr(
hv_vmbus_g_context.syn_ic_event_page[cpu])) >> PAGE_SHIFT);
wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t);
/*HV_SHARED_SINT_IDT_VECTOR + 0x20; */
shared_sint.vector = setup_args->vector;
shared_sint.masked = FALSE;
shared_sint.auto_eoi = FALSE;
shared_sint.u.vector = setup_args->vector;
shared_sint.u.masked = FALSE;
shared_sint.u.auto_eoi = FALSE;
wrmsr(HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT,
shared_sint.as_uint64_t);
/* Enable the global synic bit */
sctrl.as_uint64_t = rdmsr(HV_X64_MSR_SCONTROL);
sctrl.enable = 1;
sctrl.u.enable = 1;
wrmsr(HV_X64_MSR_SCONTROL, sctrl.as_uint64_t);
@ -480,7 +480,7 @@ void hv_vmbus_synic_cleanup(void *arg)
shared_sint.as_uint64_t = rdmsr(
HV_X64_MSR_SINT0 + HV_VMBUS_MESSAGE_SINT);
shared_sint.masked = 1;
shared_sint.u.masked = 1;
/*
* Disable the interrupt
@ -490,14 +490,14 @@ void hv_vmbus_synic_cleanup(void *arg)
shared_sint.as_uint64_t);
simp.as_uint64_t = rdmsr(HV_X64_MSR_SIMP);
simp.simp_enabled = 0;
simp.base_simp_gpa = 0;
simp.u.simp_enabled = 0;
simp.u.base_simp_gpa = 0;
wrmsr(HV_X64_MSR_SIMP, simp.as_uint64_t);
siefp.as_uint64_t = rdmsr(HV_X64_MSR_SIEFP);
siefp.siefp_enabled = 0;
siefp.base_siefp_gpa = 0;
siefp.u.siefp_enabled = 0;
siefp.u.base_siefp_gpa = 0;
wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t);
}

View File

@ -29,6 +29,8 @@
/*
* VM Bus Driver Implementation
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/bus.h>
@ -113,7 +115,7 @@ vmbus_msg_swintr(void *dummy)
*/
wmb();
if (msg->header.message_flags.message_pending) {
if (msg->header.message_flags.u.message_pending) {
/*
* This will cause message queue rescan to possibly
* deliver another msg from the hypervisor

View File

@ -24,6 +24,8 @@
* 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.
*
* $FreeBSD$
*/
#ifndef __HYPERV_PRIV_H__
@ -285,7 +287,7 @@ typedef union {
struct {
uint8_t message_pending:1;
uint8_t reserved:7;
};
} u;
} hv_vmbus_msg_flags;
typedef uint64_t hv_vmbus_partition_id;
@ -393,7 +395,7 @@ typedef union {
*/
uint64_t os_id : 8;
uint64_t vendor_id : 16;
};
} u;
} hv_vmbus_x64_msr_guest_os_id_contents;
/*
@ -407,7 +409,7 @@ typedef union {
uint64_t enable :1;
uint64_t reserved :11;
uint64_t guest_physical_address :52;
};
} u;
} hv_vmbus_x64_msr_hypercall_contents;
typedef union {
@ -415,7 +417,7 @@ typedef union {
struct {
uint32_t group_enable :4;
uint32_t rsvd_z :28;
};
} u;
} hv_vmbus_monitor_trigger_state;
typedef union {
@ -423,7 +425,7 @@ typedef union {
struct {
uint32_t pending;
uint32_t armed;
};
} u;
} hv_vmbus_monitor_trigger_group;
typedef struct {
@ -499,7 +501,7 @@ typedef union {
uint64_t simp_enabled : 1;
uint64_t preserved : 11;
uint64_t base_simp_gpa : 52;
};
} u;
} hv_vmbus_synic_simp;
/*
@ -511,7 +513,7 @@ typedef union {
uint64_t siefp_enabled : 1;
uint64_t preserved : 11;
uint64_t base_siefp_gpa : 52;
};
} u;
} hv_vmbus_synic_siefp;
/*
@ -525,7 +527,7 @@ typedef union {
uint64_t masked : 1;
uint64_t auto_eoi : 1;
uint64_t reserved2 : 46;
};
} u;
} hv_vmbus_synic_sint;
/*
@ -536,7 +538,7 @@ typedef union _hv_vmbus_synic_scontrol {
struct {
uint64_t enable : 1;
uint64_t reserved : 63;
};
} u;
} hv_vmbus_synic_scontrol;
/*

View File

@ -1317,7 +1317,7 @@ vmxnet3_init_shared_data(struct vmxnet3_softc *sc)
/* DriverInfo */
ds->version = VMXNET3_DRIVER_VERSION;
ds->guest = VMXNET3_GOS_FREEBSD | VMXNET3_GUEST_OS_VERSION |
ds->guest = VMXNET3_GOS_FREEBSD |
#ifdef __LP64__
VMXNET3_GOS_64BIT;
#else

View File

@ -247,17 +247,6 @@ struct vmxnet3_softc {
*/
#define VMXNET3_DRIVER_VERSION 0x00010000
/*
* Convert the FreeBSD version in to something the hypervisor
* understands. This is apparently what VMware's driver reports
* so mimic it even though it probably is not required.
*/
#define VMXNET3_GUEST_OS_VERSION \
(((__FreeBSD_version / 100000) << 14) | \
(((__FreeBSD_version / 1000) % 100) << 6 ) | \
(((__FreeBSD_version / 100) % 10) << 30) | \
((__FreeBSD_version % 100) << 22))
/*
* Max descriptors per Tx packet. We must limit the size of the
* any TSO packets based on the number of segments.

View File

@ -72,7 +72,6 @@ options MAC # TrustedBSD MAC Framework
options KDTRACE_HOOKS # Kernel DTrace hooks
options DDB_CTF # Kernel ELF linker loads CTF data
options INCLUDE_CONFIG_FILE # Include this file in kernel
options XENHVM # Include Xen support
# Debugging support. Always need this:
options KDB # Enable kernel debugger support.
@ -356,8 +355,10 @@ device virtio_blk # VirtIO Block device
device virtio_scsi # VirtIO SCSI device
device virtio_balloon # VirtIO Memory Balloon device
# Xen support
device xenpci # Generic Xen bus
# Xen HVM Guest Optimizations
# NOTE: XENHVM depends on xenpci. They must be added or removed together.
options XENHVM # Xen HVM kernel infrastructure
device xenpci # Xen HVM Hypervisor services driver
# VMware support
device vmx # VMware VMXNET3 Ethernet

View File

@ -161,7 +161,7 @@ sysctl_nmbclusters(SYSCTL_HANDLER_ARGS)
newnmbclusters = nmbclusters;
error = sysctl_handle_int(oidp, &newnmbclusters, 0, req);
if (error == 0 && req->newptr) {
if (error == 0 && req->newptr && newnmbclusters != nmbclusters) {
if (newnmbclusters > nmbclusters &&
nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) {
nmbclusters = newnmbclusters;
@ -183,7 +183,7 @@ sysctl_nmbjumbop(SYSCTL_HANDLER_ARGS)
newnmbjumbop = nmbjumbop;
error = sysctl_handle_int(oidp, &newnmbjumbop, 0, req);
if (error == 0 && req->newptr) {
if (error == 0 && req->newptr && newnmbjumbop != nmbjumbop) {
if (newnmbjumbop > nmbjumbop &&
nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) {
nmbjumbop = newnmbjumbop;
@ -204,7 +204,7 @@ sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS)
newnmbjumbo9 = nmbjumbo9;
error = sysctl_handle_int(oidp, &newnmbjumbo9, 0, req);
if (error == 0 && req->newptr) {
if (error == 0 && req->newptr && newnmbjumbo9 != nmbjumbo9) {
if (newnmbjumbo9 > nmbjumbo9 &&
nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) {
nmbjumbo9 = newnmbjumbo9;
@ -225,7 +225,7 @@ sysctl_nmbjumbo16(SYSCTL_HANDLER_ARGS)
newnmbjumbo16 = nmbjumbo16;
error = sysctl_handle_int(oidp, &newnmbjumbo16, 0, req);
if (error == 0 && req->newptr) {
if (error == 0 && req->newptr && newnmbjumbo16 != nmbjumbo16) {
if (newnmbjumbo16 > nmbjumbo16 &&
nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) {
nmbjumbo16 = newnmbjumbo16;
@ -246,7 +246,7 @@ sysctl_nmbufs(SYSCTL_HANDLER_ARGS)
newnmbufs = nmbufs;
error = sysctl_handle_int(oidp, &newnmbufs, 0, req);
if (error == 0 && req->newptr) {
if (error == 0 && req->newptr && newnmbufs != nmbufs) {
if (newnmbufs > nmbufs) {
nmbufs = newnmbufs;
nmbufs = uma_zone_set_max(zone_mbuf, nmbufs);

View File

@ -749,4 +749,8 @@ generic_bs_barrier(void *t __unused,
if (flags & BUS_SPACE_BARRIER_WRITE)
mips_dcache_wbinv_all();
#endif
if (flags & BUS_SPACE_BARRIER_READ)
rmb();
if (flags & BUS_SPACE_BARRIER_WRITE)
wmb();
}

View File

@ -808,9 +808,9 @@ static eventhandler_tag wlan_ifllevent;
static void
bpf_track(void *arg, struct ifnet *ifp, int dlt, int attach)
{
/* NB: identify vap's by if_start */
/* NB: identify vap's by if_init */
if (dlt == DLT_IEEE802_11_RADIO &&
ifp->if_transmit == ieee80211_vap_transmit) {
ifp->if_init == ieee80211_init) {
struct ieee80211vap *vap = ifp->if_softc;
/*
* Track bpf radiotap listener state. We mark the vap

View File

@ -809,6 +809,9 @@ in6_ifdetach(struct ifnet *ifp)
struct sockaddr_in6 sin6;
struct in6_multi_mship *imm;
if (ifp->if_afdata[AF_INET6] == NULL)
return;
/* remove neighbor management table */
nd6_purge(ifp);

View File

@ -1859,33 +1859,6 @@ static void init_dev_assign(void)
"is incorrect. The parameter value is discarded!");
}
static int mlx4_ib_dev_idx(struct mlx4_dev *dev)
{
int /*bus,*/ slot, fn;
int i;
if (!dev)
return -1;
else if (!dev->pdev)
return -1;
//else if (!dev->pdev->bus)
// return -1;
//bus = dev->pdev->bus->conf.pc_sel.pc_bus;
slot = PCI_SLOT(dev->pdev->devfn);
fn = PCI_FUNC(dev->pdev->devfn);
for (i = 0; i < MAX_DR; ++i) {
if (/*dr[i].bus == bus &&*/
dr[i].dev == slot &&
dr[i].func == fn) {
return dr[i].nr;
}
}
return -1;
}
static void *mlx4_ib_add(struct mlx4_dev *dev)
{
struct mlx4_ib_dev *ibdev;
@ -1893,7 +1866,6 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
int i, j;
int err;
struct mlx4_ib_iboe *iboe;
int dev_idx;
printk(KERN_INFO "%s", mlx4_ib_version);
@ -1928,12 +1900,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
ibdev->dev = dev;
dev_idx = mlx4_ib_dev_idx(dev);
if (dev_idx >= 0)
sprintf(ibdev->ib_dev.name, "mlx4_%d", dev_idx);
else
strlcpy(ibdev->ib_dev.name, "mlx4_%d", IB_DEVICE_NAME_MAX);
strlcpy(ibdev->ib_dev.name, "mlx4_%d", IB_DEVICE_NAME_MAX);
ibdev->ib_dev.owner = THIS_MODULE;
ibdev->ib_dev.node_type = RDMA_NODE_IB_CA;
ibdev->ib_dev.local_dma_lkey = dev->caps.reserved_lkey;

View File

@ -58,7 +58,7 @@
* in the range 5 to 9.
*/
#undef __FreeBSD_version
#define __FreeBSD_version 1000055 /* Master, propagated to newvers */
#define __FreeBSD_version 1100000 /* Master, propagated to newvers */
/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

View File

@ -161,9 +161,9 @@ sysctl_vm_phys_free(SYSCTL_HANDLER_ARGS)
return (error);
sbuf_new_for_sysctl(&sbuf, NULL, 128 * vm_ndomains, req);
for (dom = 0; dom < vm_ndomains; dom++) {
sbuf_printf(&sbuf,"DOMAIN: %d\n", dom);
sbuf_printf(&sbuf,"\nDOMAIN %d:\n", dom);
for (flind = 0; flind < vm_nfreelists; flind++) {
sbuf_printf(&sbuf, "FREE LIST %d:\n"
sbuf_printf(&sbuf, "\nFREE LIST %d:\n"
"\n ORDER (SIZE) | NUMBER"
"\n ", flind);
for (pind = 0; pind < VM_NFREEPOOL; pind++)
@ -177,14 +177,12 @@ sysctl_vm_phys_free(SYSCTL_HANDLER_ARGS)
1 << (PAGE_SHIFT - 10 + oind));
for (pind = 0; pind < VM_NFREEPOOL; pind++) {
fl = vm_phys_free_queues[dom][flind][pind];
sbuf_printf(&sbuf, " | %6.6d",
sbuf_printf(&sbuf, " | %6d",
fl[oind].lcnt);
}
sbuf_printf(&sbuf, "\n");
}
sbuf_printf(&sbuf, "\n");
}
sbuf_printf(&sbuf, "\n");
}
error = sbuf_finish(&sbuf);
sbuf_delete(&sbuf);

View File

@ -69,15 +69,7 @@ OLD_FILES+=usr/share/man/man8/atrun.8.gz
.endif
.if ${MK_ATF} == no
OLD_DIRS+=etc/atf
OLD_FILES+=etc/atf/FreeBSD.conf
OLD_FILES+=etc/atf/atf-run.hooks
OLD_FILES+=etc/atf/common.conf
OLD_FILES+=usr/bin/atf-config
OLD_FILES+=usr/bin/atf-report
OLD_FILES+=usr/bin/atf-run
OLD_FILES+=usr/bin/atf-sh
OLD_FILES+=usr/bin/atf-version
OLD_DIRS+=usr/include/atf-c
OLD_FILES+=usr/include/atf-c/build.h
OLD_FILES+=usr/include/atf-c/check.h
@ -110,34 +102,20 @@ OLD_FILES+=usr/lib/libatf-c++.so
OLD_FILES+=usr/lib/libatf-c.a
OLD_FILES+=usr/libexec/atf-check
OLD_DIRS+=usr/share/atf
OLD_FILES+=usr/share/atf/atf-run.hooks
OLD_FILES+=usr/share/atf/libatf-sh.subr
OLD_DIRS+=usr/share/doc/atf
OLD_FILES+=usr/share/doc/atf/AUTHORS
OLD_FILES+=usr/share/doc/atf/COPYING
OLD_FILES+=usr/share/doc/atf/NEWS
OLD_FILES+=usr/share/doc/atf/README
OLD_DIRS+=usr/share/examples/atf
OLD_FILES+=usr/share/examples/atf/atf-run.hooks
OLD_FILES+=usr/share/examples/atf/tests-results.css
OLD_FILES+=usr/share/man/man1/atf-check.1.gz
OLD_FILES+=usr/share/man/man1/atf-config.1.gz
OLD_FILES+=usr/share/man/man1/atf-report.1.gz
OLD_FILES+=usr/share/man/man1/atf-run.1.gz
OLD_FILES+=usr/share/man/man1/atf-sh.1.gz
OLD_FILES+=usr/share/man/man1/atf-test-program.1.gz
OLD_FILES+=usr/share/man/man1/atf-version.1.gz
OLD_FILES+=usr/share/man/man3/atf-c-api.3.gz
OLD_FILES+=usr/share/man/man3/atf-c++-api.3.gz
OLD_FILES+=usr/share/man/man3/atf-sh-api.3.gz
OLD_FILES+=usr/share/man/man4/atf-test-case.4.gz
OLD_FILES+=usr/share/man/man5/atf-formats.5.gz
OLD_FILES+=usr/share/man/man7/atf.7.gz
OLD_FILES+=usr/share/mk/atf.test.mk
OLD_DIRS+=usr/share/xml/atf
OLD_FILES+=usr/share/xml/atf/tests-results.dtd
OLD_DIRS+=usr/share/xsl/atf
OLD_FILES+=usr/share/xsl/atf/tests-results.xsl
.endif
.if ${MK_ATM} == no

View File

@ -25,10 +25,6 @@
#
# $FreeBSD$
SUBDIR= atf-config \
atf-report \
atf-run \
atf-sh \
atf-version
SUBDIR= atf-sh
.include <bsd.subdir.mk>

View File

@ -2,7 +2,5 @@
ATF= ${.CURDIR}/../../../contrib/atf
CFLAGS+= -DGDB=\"gdb\"
BINDIR?= /usr/bin
WARNS?= 3

View File

@ -1,42 +0,0 @@
#-
# Copyright (c) 2011 Google, Inc.
# 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.
#
# $FreeBSD$
.include <bsd.init.mk>
.PATH: ${ATF}/atf-config
PROG_CXX= atf-config
SRCS= atf-config.cpp
MAN= atf-config.1
CFLAGS+= -DHAVE_CONFIG_H
CFLAGS+= -I${ATF}
DPADD+= ${LIBATF_C} ${LIBATF_CXX}
LDADD+= -latf-c++ -latf-c
.include <bsd.prog.mk>

View File

@ -1,42 +0,0 @@
#-
# Copyright (c) 2011 Google, Inc.
# 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.
#
# $FreeBSD$
.include <bsd.init.mk>
.PATH: ${ATF}/atf-report
PROG_CXX= atf-report
SRCS= atf-report.cpp reader.cpp
MAN= atf-report.1
CFLAGS+= -DHAVE_CONFIG_H
CFLAGS+= -I${ATF}
DPADD+= ${LIBATF_C} ${LIBATF_CXX}
LDADD+= -latf-c++ -latf-c
.include <bsd.prog.mk>

View File

@ -1,44 +0,0 @@
#-
# Copyright (c) 2011 Google, Inc.
# 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.
#
# $FreeBSD$
.include <bsd.init.mk>
.PATH: ${ATF}/atf-run
PROG_CXX= atf-run
SRCS= atf-run.cpp atffile.cpp config.cpp fs.cpp io.cpp requirements.cpp \
signals.cpp test-program.cpp timer.cpp user.cpp
MAN= atf-run.1
CFLAGS+= -DHAVE_CONFIG_H
CFLAGS+= -I${ATF}
CFLAGS+= -I${.CURDIR}/../../lib/libatf-c
DPADD+= ${LIBATF_C} ${LIBATF_CXX}
LDADD+= -latf-c++ -latf-c
.include <bsd.prog.mk>

View File

@ -1,52 +0,0 @@
#-
# Copyright (c) 2011 Google, Inc.
# 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.
#
# $FreeBSD$
.include <bsd.init.mk>
.PATH: ${ATF}/atf-version
PROG_CXX= atf-version
SRCS= atf-version.cpp revision.h
MAN= atf-version.1
CFLAGS+= -DHAVE_CONFIG_H
CFLAGS+= -I${ATF}
CFLAGS+= -I${.CURDIR}/../../lib/libatf-c
CFLAGS+= -I${.CURDIR}
CFLAGS+= -I.
CLEANFILES+= revision.h
revision.h:
@sh ${ATF}/atf-version/generate-revision.sh \
-o ${.TARGET} \
-r ${ATF} \
-v `awk '$$2 == "VERSION" { print $$3 }' ${ATF}/bconfig.h`
DPADD+= ${LIBATF_C} ${LIBATF_CXX}
LDADD+= -latf-c++ -latf-c
.include <bsd.prog.mk>

View File

@ -941,10 +941,19 @@ pci_emul_capwrite(struct pci_devinst *pi, int offset, int bytes, uint32_t val)
assert(offset >= capoff);
/*
* Capability ID and Next Capability Pointer are readonly
* Capability ID and Next Capability Pointer are readonly.
* However, some o/s's do 4-byte writes that include these.
* For this case, trim the write back to 2 bytes and adjust
* the data.
*/
if (offset == capoff || offset == capoff + 1)
return;
if (offset == capoff || offset == capoff + 1) {
if (offset == capoff && bytes == 4) {
bytes = 2;
offset += 2;
val >>= 16;
} else
return;
}
switch (capid) {
case PCIY_MSI:

View File

@ -201,6 +201,7 @@ msg_lithuania="Lithuania"
msg_loading_of_dependent_package_failed="Loading of dependent package %s failed"
msg_located_index_now_reading_package_data_from_it="Located INDEX, now reading package data from it..."
msg_logging_in_to_user_at_host="Logging in to %s@%s.."
msg_looking_for_keymap_files="Looking for keymap files..."
msg_looking_up_host="Looking up host %s"
msg_mail_desc="Electronic mail packages and utilities."
msg_main_menu="Main Menu"

View File

@ -5,8 +5,9 @@ NO_OBJ=
SUBDIR= media packages
FILESDIR= ${SHAREDIR}/bsdconfig
FILES= common.subr device.subr dialog.subr mustberoot.subr \
script.subr strings.subr struct.subr sysrc.subr variable.subr
FILES= common.subr device.subr dialog.subr keymap.subr \
mustberoot.subr script.subr strings.subr struct.subr \
sysrc.subr variable.subr
beforeinstall:
mkdir -p ${DESTDIR}${FILESDIR}

View File

@ -49,6 +49,7 @@ f_struct_define DEVICE \
desc \
devname \
type \
capacity \
enabled \
init \
get \
@ -114,7 +115,7 @@ f_device_try()
}
# f_device_register $name $desc $devname $type $enabled $init_function \
# $get_function $shutdown_function $private
# $get_function $shutdown_function $private $capacity
#
# Register a device. A `structure' (see struct.subr) is created with the name
# device_$name (so make sure $name contains only alpha-numeric characters or
@ -128,6 +129,7 @@ f_device_register()
{
local name="$1" desc="$2" devname="$3" type="$4" enabled="$5"
local init_func="$6" get_func="$7" shutdown_func="$8" private="$9"
local capacity="${10}"
f_struct_new DEVICE "device_$name" || return $FAILURE
device_$name set name "$name"
@ -139,6 +141,7 @@ f_device_register()
device_$name set get "$get_func"
device_$name set shutdown "$shutdown_func"
device_$name set private "$private"
device_$name set capacity "$capacity"
# Scan our global register to see if it needs ammending
local dev found=
@ -196,7 +199,7 @@ f_device_get_all()
f_dprintf "Found a network device named %s" "$devname"
f_device_register $devname \
"$desc" "$devname" $DEVICE_TYPE_NETWORK 1 \
f_media_init_network "" f_media_shutdown_network ""
f_media_init_network "" f_media_shutdown_network "" -1
done
# Next, try to find all the types of devices one might use
@ -208,6 +211,10 @@ f_device_get_all()
n=$(( $n + 1 ))
# Get the desc, type, and max (with debugging disabled)
# NOTE: Bypassing f_device_name_get() for efficiency
# ASIDE: This would be equivalent to the following:
# debug= f_device_name_get $dev desc
# debug= f_device_name_get $dev type
# debug= f_device_name_get $dev max
debug= f_getvar _device_desc$n desc
debug= f_getvar _device_type$n type
debug= f_getvar _device_max$n max
@ -222,7 +229,8 @@ f_device_get_all()
f_device_register "${devname##*/}" "$desc" \
"$devname" $DEVICE_TYPE_CDROM 1 \
f_media_init_cdrom f_media_get_cdrom \
f_media_shutdown_cdrom ""
f_media_shutdown_cdrom "" \
"$( f_device_capacity "$devname" )"
f_dprintf "Found a CDROM device for %s" \
"$devname"
;;
@ -232,7 +240,8 @@ f_device_get_all()
"$devname" $DEVICE_TYPE_FLOPPY 1 \
f_media_init_floppy \
f_media_get_floppy \
f_media_shutdown_floppy ""
f_media_shutdown_floppy "" \
"$( f_device_capacity "$devname" )"
f_dprintf "Found a floppy device for %s" \
"$devname"
;;
@ -241,7 +250,8 @@ f_device_get_all()
f_device_register "${devname##*/}" "$desc" \
"$devname" $DEVICE_TYPE_USB 1 \
f_media_init_usb f_media_get_usb \
f_media_shutdown_usb ""
f_media_shutdown_usb "" \
"$( f_device_capacity "$devname" )"
f_dprintf "Found a USB disk for %s" "$devname"
;;
esac
@ -254,7 +264,8 @@ f_device_get_all()
f_device_register "${devname##*/}" "ISO9660 file system" \
"$devname" $DEVICE_TYPE_CDROM 1 \
f_media_init_cdrom f_media_get_cdrom \
f_media_shutdown_cdrom ""
f_media_shutdown_cdrom "" \
"$( f_device_capacity "$devname" )"
f_dprintf "Found a CDROM device for %s" "$devname"
done
@ -281,7 +292,8 @@ f_device_get_all()
"md(4) vnode file system" \
"$devname" $DEVICE_TYPE_CDROM 1 \
f_media_init_cdrom f_media_get_cdrom \
f_media_shutdown_cdrom ""
f_media_shutdown_cdrom "" \
"$( f_device_capacity "$devname" )"
f_dprintf "Found a CDROM device for %s" "$devname"
;;
esac
@ -313,8 +325,13 @@ f_device_get_all()
continue
fi
f_device_register "$diskname" "" \
"/dev/$diskname" $DEVICE_TYPE_DISK 0
# Try and find its description
f_device_desc "$diskname" $DEVICE_TYPE_DISK desc
f_device_register "$diskname" "$desc" \
"/dev/$diskname" $DEVICE_TYPE_DISK 0 \
"" "" "" "" \
"$( f_device_capacity "$diskname" )"
f_dprintf "Found a disk device named %s" "$diskname"
# Look for existing partitions to register
@ -327,7 +344,8 @@ f_device_get_all()
f_device_register "$slice" "" \
"/dev/$slice" $DEVICE_TYPE_DOS 1 \
f_media_init_dos f_media_get_dos \
f_media_shutdown_dos ""
f_media_shutdown_dos "" \
"$( f_device_capacity "/dev/$slice" )"
f_dprintf "Found a DOS partition %s" "$slice"
;;
0xa5) # FreeBSD partition
@ -347,7 +365,9 @@ f_device_get_all()
$DEVICE_TYPE_UFS 1 \
f_media_init_ufs \
f_media_get_ufs \
f_media_shutdown_ufs ""
f_media_shutdown_ufs "" \
"$( f_device_capacity \
"$/dev/$part" )"
f_dprintf "Found a UFS partition %s" \
"$part"
done # parts
@ -379,10 +399,27 @@ f_device_name_get()
case "$__prop" in type|desc|max) : good ;;
*) return $FAILURE; esac
#
# Attempt to create an alternate-form of $__name that contains the
# first contiguous string of numbers replaced with `%d' for comparison
# against stored pattern names (see MAIN).
#
local __left="${__name%%[0-9]*}" __right="${__name#*[0-9]}" __dname=
if [ "$__left" != "$__name" ]; then
# Chop leading digits from right 'til we hit first non-digit
while :; do
case "$__right" in
[0-9]*) __right="${__right#[0-9]}" ;;
*) break
esac
done
__dname="${__left}%d$__right"
fi
[ "$__type" = "$DEVICE_TYPE_ANY" ] && __type=
for __dev in $DEVICE_NAMES; do
__n=$(( $__n + 1 ))
[ "$__dev" = "$__name" ] || continue
[ "$__dev" = "$__name" -o "$__dev" = "$__dname" ] || continue
f_getvar _device_type$__n __devtype
[ "${__type:-$__devtype}" = "$__devtype" ] || continue
f_getvar _device_$__prop$__n $__var_to_set
@ -463,6 +500,39 @@ f_device_desc()
fi
fi
#
# For disks, attempt to return camcontrol(8) descriptions.
# Otherwise fall through to below static list.
#
f_have camcontrol &&
[ "${__type:-$DEVICE_TYPE_DISK}" = "$DEVICE_TYPE_DISK" ] &&
__cp=$( camcontrol devlist 2> /dev/null | awk -v disk="$__name" '
$0~"(\\(|,)"disk"(,|\\))" {
if (!match($0, "<[^>]+>")) next
print substr($0, RSTART+1, RLENGTH-2)
found = 1
exit
}
END { exit ! found }
' ) && setvar "$__var_to_set" "$__cp" && return $SUCCESS
#
# Attempt to create an alternate-form of $__name that contains the
# first contiguous string of numbers replaced with `%d' for comparison
# against stored pattern names (see MAIN).
#
local __left="${__name%%[0-9]*}" __right="${__name#*[0-9]}" __dname=
if [ "$__left" != "$__name" ]; then
# Chop leading digits from right 'til we hit first non-digit
while :; do
case "$__right" in
[0-9]*) __right="${__right#[0-9]}" ;;
*) break
esac
done
__dname="${__left}%d$__right"
fi
local __dev __devtype __n=0
for __dev in $DEVICE_NAMES; do
__n=$(( $__n + 1 ))
@ -472,11 +542,8 @@ f_device_desc()
__devname=$( f_substr "$__name" 0 ${#__dev} )
[ "$__devname" = "$__dev" ] || continue
else
__devname="${__name%%[0-9]*}"
__devunit="${__name#$__devname}"
__devunit="${__devunit%%[!0-9]*}"
__devname=$( printf "$__dev" $__devunit )
[ "$__devname" = "$__name" ] || continue
[ "$__dev" = "$__name" -o "$__dev" = "$__dname" ] ||
continue
fi
debug= f_getvar _device_desc$__n $__var_to_set
return $?
@ -655,6 +722,25 @@ f_device_menu()
return $retval
}
# f_device_capacity $device [$var_to_set]
#
# Return the capacity of $device in bytes.
#
f_device_capacity()
{
local __dev="$1" __var_to_set="$2"
local __bytes
__bytes=$( diskinfo -v "$__dev" 2> /dev/null |
awk '/# mediasize in bytes/{print $1}' ) || __bytes=-1
if [ "$__var_to_set" ]; then
setvar "$__var_to_set" "$__bytes"
else
echo "$__bytes"
fi
}
#
# Short-hand
#
@ -680,6 +766,7 @@ f_disk "ipsd%d" "IBM ServeRAID RAID array" 4
f_disk "mfid%d" "LSI MegaRAID SAS array" 4
f_disk "mlxd%d" "Mylex RAID disk" 4
f_disk "twed%d" "3ware ATA RAID array" 4
f_disk "vtbd%d" "VirtIO Block Device" 16
f_floppy "fd%d" "Floppy Drive unit A" 4
f_serial "cuau%d" "%s on device %s (COM%d)" 16
f_usb "da%da" "USB Mass Storage Device" 16

View File

@ -415,8 +415,8 @@ f_dialog_size_constrain()
if [ "$debug" ]; then
# Print final constrained values to debugging
f_quietly f_getvar "$__var_height"
f_quietly f_getvar "$__var_width"
[ "$__var_height" ] && f_quietly f_getvar "$__var_height"
[ "$__var_width" ] && f_quietly f_getvar "$__var_width"
fi
return $__retval # success if no debug warnings were printed
@ -532,10 +532,10 @@ f_dialog_menu_constrain()
fi
if [ "$debug" ]; then
# Print final constrained values to debuggin
f_quietly f_getvar "$__var_height"
f_quietly f_getvar "$__var_width"
f_quietly f_getvar "$__var_rows"
# Print final constrained values to debugging
[ "$__var_height" ] && f_quietly f_getvar "$__var_height"
[ "$__var_width" ] && f_quietly f_getvar "$__var_width"
[ "$__var_rows" ] && f_quietly f_getvar "$__var_rows"
fi
return $__retval # success if no debug warnings were printed
@ -2044,6 +2044,7 @@ f_dialog_menutag2index_with_help()
f_dialog_init()
{
DIALOG_SELF_INITIALIZE=
USE_DIALOG=1
#
# Clone terminal stdout so we can redirect to it from within sub-shells
@ -2087,7 +2088,7 @@ f_dialog_init()
#
# Process `-X' command-line option
#
[ "$USE_XDIALOG" ] && DIALOG=Xdialog
[ "$USE_XDIALOG" ] && DIALOG=Xdialog USE_DIALOG=
#
# Sanity check, or die gracefully

View File

@ -0,0 +1,262 @@
if [ ! "$_KEYMAP_SUBR" ]; then _KEYMAP_SUBR=1
#
# Copyright (c) 2013 Devin Teske
# 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.
#
# $FreeBSD$
#
############################################################ INCLUDES
BSDCFG_SHARE="/usr/share/bsdconfig"
. $BSDCFG_SHARE/common.subr || exit 1
f_dprintf "%s: loading includes..." keymap.subr
f_include $BSDCFG_SHARE/struct.subr
############################################################ CONFIGURATION
#
# Defaults taken from usr.sbin/kbdmap/kbdmap.h
#
: ${DEFAULT_LANG:=en}
: ${DEFAULT_KEYMAP_DIR:=/usr/share/syscons/keymaps}
############################################################ GLOBALS
KEYMAPS=
# A "keymap" from kbdmap's point of view
f_struct_define KEYMAP \
desc \
keym \
mark
#
# Default behavior is to call f_keymap_get_all() automatically when loaded.
#
: ${KEYMAP_SELF_SCAN_ALL=1}
############################################################ FUNCTIONS
# f_keymap_register $name $desc $keym $mark
#
# Register a keymap. A `structure' (see struct.subr) is created with the name
# keymap_$name (so make sure $name contains only alpha-numeric characters or
# the underscore, `_'). The remaining arguments after $name correspond to the
# propertise of the `KEYMAP' structure-type (defined above).
#
# If not already registered, the keymap is then appended to the KEYMAPS
# environment variable, a space-separated list of all registered keymaps.
#
f_keymap_register()
{
local name="$1" desc="$2" keym="$3" mark="$4"
f_struct_new KEYMAP "keymap_$name" || return $FAILURE
keymap_$name set desc "$desc"
keymap_$name set keym "$keym"
keymap_$name set mark "$mark"
# Scan our global register to see if needs ammending
local k found=
for k in $KEYMAPS; do
[ "$k" = "$name" ] || continue
found=1 && break
done
[ "$found" ] || KEYMAPS="$KEYMAPS $name"
return $SUCCESS
}
# f_keymap_checkfile $keymap
#
# Check that $keymap is a readable kbdmap(5) file. Returns success if $keymap
# is a file, is readable, and exists in $DEFAULT_KEYMAP_DIR; otherwise failure.
# If debugging is enabled, an appropriate debug error message is printed if
# $keymap is not available.
#
f_keymap_checkfile()
{
local keym="$1"
# Fixup keymap if it doesn't already contain at least one `/'
[ "${keym#*/}" = "$keym" ] && keym="$DEFAULT_KEYMAP_DIR/$keym"
# Short-cuts
[ -f "$keym" -a -r "$keym" ] && return $SUCCESS
f_debugging || return $FAILURE
# Print an appropriate debug error message
if [ ! -e "$keym" ]; then
f_dprintf "%s: No such file or directory" "$keym"
elif [ ! -f "$keym" ]; then
f_dprintf "%s: Not a file!" "$keym"
elif [ ! -r "$keym" ]; then
f_dprintf "%s: Permission denied" "$keym"
fi
return $FAILURE
}
# f_keymap_get_all
#
# Get all keymap information for kbdmap(5) entries both in the database and
# loosely existing in $DEFAULT_KEYMAP_DIR.
#
f_keymap_get_all()
{
local fname=f_keymap_get_all
local lang="${LC_ALL:-${LC_CTYPE:-${LANG:-$DEFAULT_LANG}}}"
[ "$lang" = "C" ] && lang="$DEFAULT_LANG"
f_dprintf "%s: Looking for keymap files..." $fname
f_dialog_info "$msg_looking_for_keymap_files"
f_dprintf "DEFAULT_LANG=[%s]" "$DEFAULT_LANG"
eval "$( awk -F: -v lang="$lang" -v lang_default="$DEFAULT_LANG" '
BEGIN {
# en_US.ISO8859-1 -> en_..\.ISO8859-1
dialect = lang
if (length(dialect) >= 6 &&
substr(dialect, 3, 1) == "_")
dialect = substr(dialect, 1, 3) ".." \
substr(dialect, 6)
printf "f_dprintf \"dialect=[%%s]\" \"%s\";\n", dialect
# en_US.ISO8859-1 -> en
lang_abk = lang
if (length(lang_abk) >= 3 &&
substr(lang_abk, 3, 1) == "_")
lang_abk = substr(lang_abk, 1, 2)
printf "f_dprintf \"lang_abk=[%%s]\" \"%s\";\n",
lang_abk
}
function find_token(buffer, token)
{
if (split(buffer, tokens, /,/) == 0) return 0
found = 0
for (t in tokens)
if (token == tokens[t]) { found = 1; break }
return found
}
function add_keymap(desc,mark,keym)
{
marks[keym] = mark
name = keym
gsub(/[^[:alnum:]_]/, "_", name)
gsub(/'\''/, "'\''\\'\'''\''", desc);
printf "f_keymap_checkfile %s && " \
"f_keymap_register %s '\'%s\'' %s %u\n",
keym, name, desc, keym, mark
}
!/^[[:space:]]*(#|$)/ {
sub(/^[[:space:]]*/, "", $0)
keym = $1
if (keym ~ /^(MENU|FONT)$/) next
lg = ($2 == "" ? lang_default : $2)
# Match the entry and store the type of match we made
# as the mark value (so that if we make a better match
# later on with a higher mark, it overwrites previous)
mark = marks[keym];
if (find_token(lg, lang))
add_keymap($3, 4, keym) # Best match
else if (mark <= 3 && find_token(lg, dialect))
add_keymap($3, 3, keym)
else if (mark <= 2 && find_token(lg, lang_abk))
add_keymap($3, 2, keym)
else if (mark <= 1 && find_token(lg, lang_default))
add_keymap($3, 1, keym)
else if (mark <= 0)
add_keymap($3, 0, keym)
}
' "$DEFAULT_KEYMAP_DIR/INDEX.${DEFAULT_KEYMAP_DIR##*/}" )"
#
# Look for keymaps not in database
#
local direntry keym name
set +f # glob
for direntry in "$DEFAULT_KEYMAP_DIR"/*; do
[ "${direntry##*.}" = ".kbd" ] || continue
keym="${direntry##*/}"
f_str2varname "$keym" name
f_struct keymap_$name && continue
f_keymap_checkfile "$keym" &&
f_keymap_register $name "${keym%.*}" "$keym" 0
f_dprintf "%s: not in kbdmap(5) database" "$keym"
done
#
# Sort the items by their descriptions
#
f_dprintf "%s: Sorting keymap entries by description..." $fname
KEYMAPS=$(
for k in $KEYMAPS; do
echo -n "$k "
# NOTE: Translate '8x8' to '8x08' before sending to
# sort(1) so that things work out as we might expect.
debug= keymap_$k get desc | sed -e 's/8x8/8x08/g'
done | sort -k2 | awk '{
printf "%s%s", (started ? " " : ""), $1; started = 1
}'
)
return $SUCCESS
}
# f_keymap_kbdcontrol $keymap
#
# Install keyboard map file from $keymap.
#
f_keymap_kbdcontrol()
{
local keymap="$1"
[ "$keymap" ] || return $SUCCESS
# Fixup keymap if it doesn't already contain at least one `/'
[ "${keymap#*/}" = "$keymap" ] && keymap="$DEFAULT_KEYMAP_DIR/$keymap"
[ "$USE_XDIALOG" ] || kbdcontrol -l "$keymap"
}
############################################################ MAIN
#
# Scan for keymaps unless requeted otherwise
#
f_dprintf "%s: KEYMAP_SELF_SCAN_ALL=[%s]" keymap.subr "$KEYMAP_SELF_SCAN_ALL"
case "$KEYMAP_SELF_SCAN_ALL" in
""|0|[Nn][Oo]|[Oo][Ff][Ff]|[Ff][Aa][Ll][Ss][Ee]) : do nothing ;;
*) f_keymap_get_all
esac
f_dprintf "%s: Found %u keymap file(s)." keymap.subr \
"$( set -- $KEYMAPS; echo $# )"
f_dprintf "%s: Successfully loaded." keymap.subr
fi # ! $_KEYMAP_SUBR

View File

@ -26,6 +26,11 @@ if [ ! "$_STRINGS_SUBR" ]; then _STRINGS_SUBR=1
#
# $FreeBSD$
#
############################################################ INCLUDES
BSDCFG_SHARE="/usr/share/bsdconfig"
. $BSDCFG_SHARE/common.subr || exit 1
############################################################ GLOBALS
#
@ -319,6 +324,112 @@ f_shell_unescape()
f_replaceall "$__string" "'\\''" "'" "$__var_to_set"
}
# f_expand_number $string [$var_to_set]
#
# Unformat $string into a number, optionally to be stored in $var_to_set. This
# function follows the SI power of two convention.
#
# The prefixes are:
#
# Prefix Description Multiplier
# k kilo 1024
# M mega 1048576
# G giga 1073741824
# T tera 1099511627776
# P peta 1125899906842624
# E exa 1152921504606846976
#
# NOTE: Prefixes are case-insensitive.
#
# Upon successful completion, the value 0 is returned (or stored to
# $var_to_set); otherwise -1. Reasons for a -1 return include:
#
# Given $string contains no digits.
# An unrecognized prefix was given.
# Result too large to calculate.
#
f_expand_number()
{
local __string="$1" __var_to_set="$2"
local __cp __num
# Remove any leading non-digits
while :; do
__cp="$__string"
__string="${__cp#[!0-9]}"
[ "$__string" = "$__cp" ] && break
done
# Return `-1' if string didn't contain any digits
if [ ! "$__string" ]; then
if [ "$__var_to_set" ]; then
setvar "$__var_to_set" -1
else
echo -1
fi
return $FAILURE
fi
# Store the numbers
__num="${__string%%[!0-9]*}"
# Shortcut
if [ $__num -eq 0 ]; then
if [ "$__var_to_set" ]; then
setvar "$__var_to_set" 0
else
echo 0
fi
return $SUCCESS
fi
# Remove all the leading numbers from the string to get at the prefix
while :; do
__cp="$__string"
__string="${__cp#[0-9]}"
[ "$__string" = "$__cp" ] && break
done
# Test for invalid prefix
case "$__string" in
""|[KkMmGgTtPpEe]*) : known prefix ;;
*)
# Unknown prefix
if [ "$__var_to_set" ]; then
setvar "$__var_to_set" -1
else
echo -1
fi
return $FAILURE
esac
# Multiply the number out
case "$__string" in
[Kk]) __num=$(( $__num * 1024 )) ;;
[Mm]) __num=$(( $__num * 1048576 )) ;;
[Gg]) __num=$(( $__num * 1073741824 )) ;;
[Tt]) __num=$(( $__num * 1099511627776 )) ;;
[Pp]) __num=$(( $__num * 1125899906842624 )) ;;
[Ee]) __num=$(( $__num * 1152921504606846976 )) ;;
esac
if [ $__num -le 0 ]; then
# Arithmetic overflow
if [ "$__var_to_set" ]; then
setvar "$__var_to_set" -1
else
echo -1
fi
return $FAILURE
fi
# Return the number
if [ "$__var_to_set" ]; then
setvar "$__var_to_set" $__num
else
echo $__num
fi
}
############################################################ MAIN
f_dprintf "%s: Successfully loaded." strings.subr

View File

@ -205,6 +205,21 @@ f_netinteractive()
f_getvar $VAR_NETINTERACTIVE value && [ "$value" ]
}
# f_zfsinteractive()
#
# Has the user specifically requested the ZFS-portion of configuration and
# setup to be performed interactively? Returns success if the user has asked
# for the ZFS configuration to be done interactively even if perhaps overall
# non-interactive mode has been requested (by setting nonInteractive).
#
# Returns success if $zfsInteractive is set and non-NULL.
#
f_zfsinteractive()
{
local value
f_getvar $VAR_ZFSINTERACTIVE value && [ "$value" ]
}
############################################################ MAIN
#
@ -240,6 +255,7 @@ f_variable_new VAR_IFCONFIG ifconfig_
f_variable_new VAR_IPADDR ipaddr
f_variable_new VAR_IPV6ADDR ipv6addr
f_variable_new VAR_IPV6_ENABLE ipv6_activate_all_interfaces
f_variable_new VAR_KEYMAP keymap
f_variable_new VAR_MEDIA_TIMEOUT MEDIA_TIMEOUT
f_variable_new VAR_MEDIA_TYPE mediaType
f_variable_new VAR_NAMESERVER nameserver
@ -263,6 +279,7 @@ f_variable_new VAR_SLOW_ETHER slowEthernetCard
f_variable_new VAR_TRY_DHCP tryDHCP
f_variable_new VAR_TRY_RTSOL tryRTSOL
f_variable_new VAR_UFS_PATH ufs
f_variable_new VAR_ZFSINTERACTIVE zfsInteractive
#
# Self-initialize unless requested otherwise

View File

@ -28,6 +28,7 @@
: ${BSDINSTALL_LOG="/tmp/bsdinstall_log"}; export BSDINSTALL_LOG
: ${BSDINSTALL_TMPETC="/tmp/bsdinstall_etc"}; export BSDINSTALL_TMPETC
: ${BSDINSTALL_TMPBOOT="/tmp/bsdinstall_boot"}; export BSDINSTALL_TMPBOOT
: ${PATH_FSTAB="$BSDINSTALL_TMPETC/fstab"}; export PATH_FSTAB
: ${BSDINSTALL_DISTDIR="/usr/freebsd-dist"}; export BSDINSTALL_DISTDIR
: ${BSDINSTALL_CHROOT="/mnt"}; export BSDINSTALL_CHROOT
@ -35,5 +36,6 @@
VERB=${1:-auto}; shift
[ -d "$BSDINSTALL_TMPETC" ] || mkdir -p "$BSDINSTALL_TMPETC"
[ -d "$BSDINSTALL_TMPBOOT" ] || mkdir -p "$BSDINSTALL_TMPBOOT"
echo "Running installation step: $VERB $@" >> "$BSDINSTALL_LOG"
exec "/usr/libexec/bsdinstall/$VERB" "$@" 2>> "$BSDINSTALL_LOG"

View File

@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd January 21, 2013
.Dd October 6, 2013
.Dt BSDINSTALL 8
.Os
.Sh NAME
@ -60,6 +60,10 @@ targets.
.Bl -tag -width ".Cm jail Ar destination"
.It Cm auto
Run the standard interactive installation, including disk partitioning.
.It Cm entropy
Reads a small amount of data from
.Pa /dev/random
and stores it in a file in the new system's root directory.
.It Cm jail Ar destination
Sets up a new chroot system at
.Pa destination ,

View File

@ -1,8 +1,8 @@
# $FreeBSD$
SCRIPTS= auto adduser checksum config docsinstall hostname jail keymap \
mirrorselect mount netconfig netconfig_ipv4 netconfig_ipv6 rootpass \
script services time umount wlanconfig
SCRIPTS= auto adduser checksum config docsinstall entropy hostname jail \
keymap mirrorselect mount netconfig netconfig_ipv4 netconfig_ipv6 \
rootpass script services time umount wlanconfig zfsboot
BINDIR= /usr/libexec/bsdinstall
NO_MAN= true

View File

@ -93,24 +93,46 @@ fi
rm $PATH_FSTAB
touch $PATH_FSTAB
dialog --backtitle "FreeBSD Installer" --title "Partitioning" --extra-button \
--extra-label "Manual" --ok-label "Guided" --cancel-label "Shell" \
--yesno "Would you like to use the guided partitioning tool (recommended for beginners) or to set up partitions manually (experts)? You can also open a shell and set up partitions entirely by hand." 0 0
PMODES="\
Guided \"Partitioning Tool (Recommended for Beginners)\" \
Manual \"Manually Configure Partitions (Expert)\" \
Shell \"Open a shell and partition by hand\""
case $? in
0) # Guided
CURARCH=$( uname -m )
case $CURARCH in
amd64|i386) # Booting ZFS Supported
PMODES="$PMODES ZFS \"Automatic Root-on-ZFS (Experimental)\""
;;
*) # Booting ZFS Unspported
;;
esac
exec 3>&1
PARTMODE=`echo $PMODES | xargs dialog --backtitle "FreeBSD Installer" \
--title "Partitioning" \
--menu "How would you like to partition your disk?" \
0 0 0 2>&1 1>&3`
if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi
exec 3>&-
case "$PARTMODE" in
"Guided") # Guided
bsdinstall autopart || error
bsdinstall mount || error
;;
1) # Shell
"Shell") # Shell
clear
echo "Use this shell to set up partitions for the new system. When finished, mount the system at $BSDINSTALL_CHROOT and place an fstab file for the new system at $PATH_FSTAB. Then type 'exit'. You can also enter the partition editor at any time by entering 'bsdinstall partedit'."
sh 2>&1
;;
3) # Manual
"Manual") # Manual
bsdinstall partedit || error
bsdinstall mount || error
;;
"ZFS") # ZFS
bsdinstall zfsboot || error
bsdinstall mount || error
;;
*)
error
;;
@ -222,5 +244,8 @@ if [ $? -eq 0 ]; then
chroot "$BSDINSTALL_CHROOT" /bin/sh 2>&1
fi
bsdinstall entropy
bsdinstall umount
echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG

View File

@ -31,6 +31,11 @@ rm $BSDINSTALL_TMPETC/rc.conf.*
cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc
cat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.conf
rm $BSDINSTALL_TMPBOOT/loader.conf.*
cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot
# Set up other things from installed config
chroot $BSDINSTALL_CHROOT /usr/bin/newaliases

View File

@ -1,5 +1,6 @@
#!/bin/sh
#-
# Copyright (c) 2012 EMC Corporation.
# Copyright (c) 2013 Dag-Erling Smørgrav
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -25,6 +26,4 @@
#
# $FreeBSD$
BINDIR?= ${SHAREDIR}/xml
# vim: syntax=make
dd if=/dev/random of=$BSDINSTALL_CHROOT/entropy bs=4096 count=1

View File

@ -110,5 +110,7 @@ bsdinstall config || error
cp /etc/resolv.conf $1/etc
cp /etc/localtime $1/etc
bsdinstall entropy
echo "Installation Completed at $(date)" >> $BSDINSTALL_LOG

Some files were not shown because too many files have changed in this diff Show More