diff -ruN usr.sbin/bsdinstall/scripts/Makefile usr.sbin/bsdinstall.new/scripts/Makefile --- usr.sbin/bsdinstall/scripts/Makefile 2015-03-22 11:15:52.983247000 -0700 +++ usr.sbin/bsdinstall.new/scripts/Makefile 2015-03-22 11:15:28.606862000 -0700 @@ -2,7 +2,7 @@ SCRIPTS= auto adduser checksum config docsinstall entropy hostname jail \ keymap mirrorselect mount netconfig netconfig_ipv4 netconfig_ipv6 \ - rootpass script services time umount wlanconfig zfsboot + rootpass script services time umount wlanconfig zfsboot bsdstats BINDIR= /usr/libexec/bsdinstall MAN= diff -ruN usr.sbin/bsdinstall/scripts/auto usr.sbin/bsdinstall.new/scripts/auto --- usr.sbin/bsdinstall/scripts/auto 2015-03-22 11:15:53.002317000 -0700 +++ usr.sbin/bsdinstall.new/scripts/auto 2015-03-22 11:15:28.565459000 -0700 @@ -204,7 +204,8 @@ "Network" "Networking configuration" \ "Services" "Set daemons to run on startup" \ "Time Zone" "Set system timezone" \ - "Handbook" "Install FreeBSD Handbook (requires network)" 2>&1 1>&3) + "Handbook" "Install FreeBSD Handbook (requires network)" \ + "BSDstats" "Install BSDstats to report system statistics" 2>&1 1>&3) exec 3>&- case "$REVISIT" in @@ -236,6 +237,10 @@ bsdinstall docsinstall finalconfig ;; + "BSDstats") + bsdinstall bsdstats + finalconfig + ;; esac } diff -ruN usr.sbin/bsdinstall/scripts/bsdstats usr.sbin/bsdinstall.new/scripts/bsdstats --- usr.sbin/bsdinstall/scripts/bsdstats 1969-12-31 16:00:00.000000000 -0800 +++ usr.sbin/bsdinstall.new/scripts/bsdstats 2015-03-22 11:26:02.734925000 -0700 @@ -0,0 +1,52 @@ +#!/bin/sh +#- +# Copyright (c) 2014 Yuri Victorovich +# 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$ + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 + +# Let pkg or port build process be able to use name servers +f_quietly cp -f $BSDINSTALL_TMPETC/resolv.conf $BSDINSTALL_CHROOT/etc/ + +echo "" +if [ -f $BSDINSTALL_CHROOT/usr/local/etc/periodic/monthly/300.statistics ]; then + echo "BSDstats already installed" +elif [ -f $BSDINSTALL_CHROOT/usr/ports/sysutils/bsdstats/Makefile ]; then + echo "Installing BSDstats from the port, this will take a while" + # initialize the ldconfig hints, pkg build will need it + [ -f $BSDINSTALL_CHROOT/var/run/ld-elf.so.hints ] || + f_quietly chroot $BSDINSTALL_CHROOT ldconfig /usr/lib /usr/lib/compat /usr/local/lib + # build and install + chroot $BSDINSTALL_CHROOT sh -c "(cd /usr/ports/sysutils/bsdstats && make install clean)" 2>&1 +else + echo "Installing BSDstats using the package" + chroot $BSDINSTALL_CHROOT pkg install bsdstats 2>&1 +fi +echo "" + +# wait for user acknowledgement +read -p "Press any key..." key 2>&1