diff options
author | ngie <ngie@FreeBSD.org> | 2015-05-24 07:11:03 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2015-05-24 07:11:03 +0000 |
commit | 1a0cbcd01aba9ae90897d49b5987c635a695c974 (patch) | |
tree | 007bbfb4eef88985f91be20dbbd9080c695a4fdb /etc | |
parent | b0e50d6cad74822a727e0d04d3c960115275e21e (diff) | |
parent | e6b664c390af88d4a87208bc042ce503da664c3b (diff) | |
download | FreeBSD-src-1a0cbcd01aba9ae90897d49b5987c635a695c974.zip FreeBSD-src-1a0cbcd01aba9ae90897d49b5987c635a695c974.tar.gz |
MFhead @ r283351
Diffstat (limited to 'etc')
-rw-r--r-- | etc/Makefile | 8 | ||||
-rw-r--r-- | etc/defaults/rc.conf | 2 | ||||
-rw-r--r-- | etc/etc.arm/ttys | 4 | ||||
-rw-r--r-- | etc/libmap32.conf | 2 | ||||
-rw-r--r-- | etc/mtree/BSD.tests.dist | 6 | ||||
-rw-r--r-- | etc/mtree/BSD.usr.dist | 10 | ||||
-rw-r--r-- | etc/rc.d/Makefile | 4 | ||||
-rwxr-xr-x | etc/rc.d/devd | 2 | ||||
-rwxr-xr-x | etc/rc.d/hostid | 64 | ||||
-rwxr-xr-x | etc/rc.d/local_unbound | 2 | ||||
-rw-r--r-- | etc/rc.d/tests/Makefile | 7 | ||||
-rwxr-xr-x | etc/rc.d/tests/routing_test.sh | 138 | ||||
-rw-r--r-- | etc/tests/Makefile | 10 |
13 files changed, 73 insertions, 186 deletions
diff --git a/etc/Makefile b/etc/Makefile index e5ade7f..e5195f6 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -10,10 +10,6 @@ SUBDIR= \ SUBDIR+=sendmail .endif -.if ${MK_TESTS} != "no" -SUBDIR+=tests -.endif - BIN1= crontab \ devd.conf \ devfs.conf \ @@ -54,10 +50,6 @@ BIN1= crontab \ syslog.conf \ termcap.small -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" -BIN1+= libmap32.conf -.endif - .if exists(${.CURDIR}/etc.${MACHINE}/ttys) BIN1+= etc.${MACHINE}/ttys .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys) diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index 2f5cbca..ef3b861 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -648,7 +648,7 @@ devfs_system_ruleset="" # The name (NOT number) of a ruleset to apply to /dev devfs_set_rulesets="" # A list of /mount/dev=ruleset_name settings to # apply (must be mounted already, i.e. fstab(5)) devfs_load_rulesets="YES" # Enable to always load the default rulesets -performance_cx_lowest="Cmax" # Online CPU idle state +performance_cx_lowest="C2" # Online CPU idle state performance_cpu_freq="NONE" # Online CPU frequency economy_cx_lowest="Cmax" # Offline CPU idle state economy_cpu_freq="NONE" # Offline CPU frequency diff --git a/etc/etc.arm/ttys b/etc/etc.arm/ttys index ba410b7..501bae6 100644 --- a/etc/etc.arm/ttys +++ b/etc/etc.arm/ttys @@ -29,7 +29,7 @@ # when going to single-user mode. console none unknown off secure # -ttyv0 "/usr/libexec/getty Pc" xterm off secure +ttyv0 "/usr/libexec/getty Pc" xterm onifconsole secure # Virtual terminals ttyv1 "/usr/libexec/getty Pc" xterm off secure ttyv2 "/usr/libexec/getty Pc" xterm off secure @@ -41,7 +41,7 @@ ttyv7 "/usr/libexec/getty Pc" xterm off secure #ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty 3wire" vt100 on secure +ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure ttyu1 "/usr/libexec/getty std.9600" dialup off secure ttyu2 "/usr/libexec/getty std.9600" dialup off secure ttyu3 "/usr/libexec/getty std.9600" dialup off secure diff --git a/etc/libmap32.conf b/etc/libmap32.conf deleted file mode 100644 index 07fb138..0000000 --- a/etc/libmap32.conf +++ /dev/null @@ -1,2 +0,0 @@ -# $FreeBSD$ -/usr/lib/private /usr/lib32/private diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 755b504..efa3837 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -410,6 +410,8 @@ .. vfs .. + vm + .. .. usr.bin apply @@ -518,6 +520,8 @@ .. cmp .. + col + .. comm .. cut @@ -550,6 +554,8 @@ regress.multitest.out .. .. + soelim + .. timeout .. tr diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index b182894..f0d42a2 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -8,6 +8,12 @@ bin .. include + private + bsdstat + .. + ucl + .. + .. .. lib aout @@ -32,16 +38,12 @@ .. i18n .. - private - .. .. lib32 dtrace .. i18n .. - private - .. .. libdata gcc diff --git a/etc/rc.d/Makefile b/etc/rc.d/Makefile index f1f6afe..1e6e28f 100644 --- a/etc/rc.d/Makefile +++ b/etc/rc.d/Makefile @@ -263,10 +263,6 @@ FILES+= routed FILES+= sendmail .endif -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif - .if ${MK_TIMED} != "no" FILES+= timed .endif diff --git a/etc/rc.d/devd b/etc/rc.d/devd index c7288e4..53532cc 100755 --- a/etc/rc.d/devd +++ b/etc/rc.d/devd @@ -4,7 +4,7 @@ # # PROVIDE: devd -# REQUIRE: netif +# REQUIRE: netif ldconfig # BEFORE: NETWORKING mountcritremote # KEYWORD: nojail shutdown diff --git a/etc/rc.d/hostid b/etc/rc.d/hostid index c4545bd..281b241 100755 --- a/etc/rc.d/hostid +++ b/etc/rc.d/hostid @@ -1,6 +1,7 @@ #!/bin/sh # # Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org> +# Copyright (c) 2015 Xin LI <delphij@FreeBSD.org> # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -55,23 +56,66 @@ hostid_set() ${SYSCTL} kern.hostid=${id} >/dev/null } -hostid_hardware() +valid_hostid() { - uuid=`kenv -q smbios.system.uuid` + uuid=$1 + x="[0-9a-f]" y=$x$x$x$x + + # Check against a blacklist before + # accepting the UUID. case "${uuid}" in + 00000000-0000-0000-0000-000000000000) + ;; + 00020003-0004-0005-0006-000700080009) + ;; + 03000200-0400-0500-0006-000700080009) + ;; + 07090201-0103-0301-0807-060504030201) + ;; + 11111111-1111-1111-1111-111111111111) + ;; + 11111111-2222-3333-4444-555555555555) + ;; + 4c4c4544-0000-2010-8020-80c04f202020) + ;; + 58585858-5858-5858-5858-585858585858) + ;; + 890e2d14-cacd-45d1-ae66-bc80e8bfeb0f) + ;; + 8e275844-178f-44a8-aceb-a7d7e5178c63) + ;; + dc698397-fa54-4cf2-82c8-b1b5307a6a7f) + ;; + fefefefe-fefe-fefe-fefe-fefefefefefe) + ;; + *-ffff-ffff-ffff-ffffffffffff) + ;; $y$y-$y-$y-$y-$y$y$y) - echo "${uuid}" + return 0 ;; esac + + return 1 +} + +hostid_hardware() +{ + uuid=`kenv -q smbios.system.uuid` + + if valid_hostid $uuid; then + echo "${uuid}" + fi } hostid_generate() { # First look for UUID in hardware. uuid=`hostid_hardware` - if [ -z ${uuid} ]; then + if [ -z "${uuid}" ]; then + warn "hostid: unable to figure out a UUID from DMI data, generating a new one" + sleep 2 # If not found, fall back to software-generated UUID. uuid=`uuidgen` fi @@ -92,11 +136,15 @@ hostid_start() { # If ${hostid_file} already exists, we take UUID from there. if [ -r ${hostid_file} ]; then - hostid_set `cat ${hostid_file}` - else - # No hostid file, generate UUID. - hostid_generate + read saved_hostid < ${hostid_file} + if valid_hostid ${saved_hostid}; then + hostid_set `cat ${hostid_file}` + exit 0 + fi fi + + # No hostid file, generate UUID. + hostid_generate } load_rc_config $name diff --git a/etc/rc.d/local_unbound b/etc/rc.d/local_unbound index 5f3d0cf..ce3256d 100755 --- a/etc/rc.d/local_unbound +++ b/etc/rc.d/local_unbound @@ -25,7 +25,7 @@ pidfile="/var/run/${name}.pid" : ${local_unbound_workdir:=/var/unbound} : ${local_unbound_config:=${local_unbound_workdir}/unbound.conf} -: ${local_unbound_flags:=-c${local_unbound_config}} +: ${local_unbound_flags:="-c ${local_unbound_config}"} : ${local_unbound_forwardconf:=${local_unbound_workdir}/forward.conf} : ${local_unbound_controlconf:=${local_unbound_workdir}/control.conf} : ${local_unbound_anchor:=${local_unbound_workdir}/root.key} diff --git a/etc/rc.d/tests/Makefile b/etc/rc.d/tests/Makefile deleted file mode 100644 index 368e8f4..0000000 --- a/etc/rc.d/tests/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# $FreeBSD$ - -TESTSDIR= ${TESTSBASE}/etc/rc.d - -ATF_TESTS_SH+= routing_test - -.include <bsd.test.mk> diff --git a/etc/rc.d/tests/routing_test.sh b/etc/rc.d/tests/routing_test.sh deleted file mode 100755 index 693af23..0000000 --- a/etc/rc.d/tests/routing_test.sh +++ /dev/null @@ -1,138 +0,0 @@ -# -# Copyright (c) 2014 Spectra Logic 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, -# without modification. -# 2. Redistributions in binary form must reproduce at minimum a disclaimer -# substantially similar to the "NO WARRANTY" disclaimer below -# ("Disclaimer") and any redistribution must be conditioned upon -# including a substantially similar Disclaimer requirement for further -# binary redistribution. -# -# NO WARRANTY -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. -# -# Authors: Alan Somers (Spectra Logic Corporation) -# -# $FreeBSD$ - -atf_test_case static_ipv6_loopback_route_for_each_fib cleanup -static_ipv6_loopback_route_for_each_fib_head() -{ - atf_set "descr" "Every FIB should have a static IPv6 loopback route" - atf_set "require.user" "root" - atf_set "require.config" "fibs" - atf_set "require.progs" "sysrc" -} -static_ipv6_loopback_route_for_each_fib_body() -{ - # Configure the TAP interface to use an RFC5737 nonrouteable address - # and a non-default fib - ADDR="192.0.2.2" - SUBNET="192.0.2.0" - MASK="24" - - # Check system configuration - if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then - atf_skip "This test requires net.add_addr_allfibs=0" - fi - - get_fibs 1 - get_tap - - # Configure a TAP interface in /etc/rc.conf. Register the sysrc - # variable for cleanup. - echo "ifconfig_${TAP}" >> "sysrc_vars_to_cleanup" - sysrc ifconfig_${TAP}="${ADDR}/${MASK} fib ${FIB0}" - - # Start the interface - service netif start ${TAP} - # Check for an IPv6 loopback route - setfib ${FIB0} netstat -rn -f inet6 | grep -q "^::1.*lo0$" - if [ 0 -eq $? ]; then - atf_pass - else - setfib ${FIB0} netstat -rn -f inet6 - atf_fail "Did not find an IPv6 loopback route" - fi -} -static_ipv6_loopback_route_for_each_fib_cleanup() -{ - cleanup_sysrc - cleanup_tap -} - -atf_init_test_cases() -{ - atf_add_test_case static_ipv6_loopback_route_for_each_fib -} - -# Looks up one or more fibs from the configuration data and validates them. -# Returns the results in the env varilables FIB0, FIB1, etc. -# parameter numfibs The number of fibs to lookup -get_fibs() -{ - NUMFIBS=$1 - net_fibs=`sysctl -n net.fibs` - i=0 - while [ $i -lt "$NUMFIBS" ]; do - fib=`atf_config_get "fibs" | \ - awk -v i=$(( i + 1 )) '{print $i}'` - echo "fib is ${fib}" - eval FIB${i}=${fib} - if [ "$fib" -ge "$net_fibs" ]; then - msg="The ${i}th configured fib is ${fub}, which is " - msg="$msg not less than net.fibs (${net_fibs})" - atf_skip "$msg" - fi - i=$(( $i + 1 )) - done -} - - -# Creates a new tap(4) interface, registers it for cleanup, and returns the -# name via the environment variable TAP -get_tap() -{ - local TAPN=0 - while ! ifconfig tap${TAPN} create > /dev/null 2>&1; do - if [ "$TAPN" -ge 8 ]; then - atf_skip "Could not create a tap(4) interface" - else - TAPN=$(($TAPN + 1)) - fi - done - local TAPD=tap${TAPN} - # Record the TAP device so we can clean it up later - echo ${TAPD} >> "tap_devices_to_cleanup" - TAP=${TAPD} -} - -cleanup_sysrc() -{ - for var in `cat "sysrc_vars_to_cleanup"`; do - sysrc -x $var - done -} - -cleanup_tap() -{ - for TAPD in `cat "tap_devices_to_cleanup"`; do - ifconfig ${TAPD} destroy - done -} diff --git a/etc/tests/Makefile b/etc/tests/Makefile deleted file mode 100644 index 5aacd5b..0000000 --- a/etc/tests/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# $FreeBSD$ - -.include <bsd.own.mk> - -TESTSDIR= ${TESTSBASE}/etc - -.PATH: ${.CURDIR:H:H}/tests -KYUAFILE= yes - -.include <bsd.test.mk> |