summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bsdinstall/distextract/distextract.c2
-rw-r--r--usr.sbin/bsdinstall/distfetch/distfetch.c2
-rw-r--r--usr.sbin/bsdinstall/partedit/part_wizard.c8
-rw-r--r--usr.sbin/bsdinstall/partedit/partedit.c8
-rw-r--r--usr.sbin/bsdinstall/partedit/partedit_x86.c5
-rw-r--r--usr.sbin/bsdinstall/scripts/Makefile2
-rwxr-xr-xusr.sbin/bsdinstall/scripts/auto71
-rwxr-xr-xusr.sbin/bsdinstall/scripts/checksum4
-rwxr-xr-xusr.sbin/bsdinstall/scripts/config24
-rwxr-xr-xusr.sbin/bsdinstall/scripts/fix_fstab118
-rwxr-xr-xusr.sbin/bsdinstall/scripts/keymap4
-rwxr-xr-xusr.sbin/bsdinstall/scripts/mount2
-rwxr-xr-xusr.sbin/bsdinstall/scripts/zfsboot21
-rw-r--r--usr.sbin/rtsold/rtsol.c4
-rw-r--r--usr.sbin/syslogd/clog.h52
-rw-r--r--usr.sbin/syslogd/syslogd.c125
-rw-r--r--usr.sbin/traceroute6/traceroute6.c4
17 files changed, 378 insertions, 78 deletions
diff --git a/usr.sbin/bsdinstall/distextract/distextract.c b/usr.sbin/bsdinstall/distextract/distextract.c
index 94536bc..4acafbb 100644
--- a/usr.sbin/bsdinstall/distextract/distextract.c
+++ b/usr.sbin/bsdinstall/distextract/distextract.c
@@ -69,7 +69,7 @@ main(void)
size_t span;
struct dpv_config *config;
struct dpv_file_node *dist = dists;
- static char backtitle[] = "FreeBSD Installer";
+ static char backtitle[] = "pfSense Installer";
static char title[] = "Archive Extraction";
static char aprompt[] = "\n Overall Progress:";
static char pprompt[] = "Extracting distribution files...\n";
diff --git a/usr.sbin/bsdinstall/distfetch/distfetch.c b/usr.sbin/bsdinstall/distfetch/distfetch.c
index 219847d..e5af4ad 100644
--- a/usr.sbin/bsdinstall/distfetch/distfetch.c
+++ b/usr.sbin/bsdinstall/distfetch/distfetch.c
@@ -67,7 +67,7 @@ main(void)
}
init_dialog(stdin, stdout);
- dialog_vars.backtitle = __DECONST(char *, "FreeBSD Installer");
+ dialog_vars.backtitle = __DECONST(char *, "pfSense Installer");
dlg_put_backtitle();
for (i = 0; i < ndists; i++) {
diff --git a/usr.sbin/bsdinstall/partedit/part_wizard.c b/usr.sbin/bsdinstall/partedit/part_wizard.c
index 1e9c899..e0eec9f 100644
--- a/usr.sbin/bsdinstall/partedit/part_wizard.c
+++ b/usr.sbin/bsdinstall/partedit/part_wizard.c
@@ -152,7 +152,7 @@ boot_disk(struct gmesh *mesh)
if (n > 1) {
err = dlg_menu("Partitioning",
- "Select the disk on which to install FreeBSD.", 0, 0, 0,
+ "Select the disk on which to install pfSense.", 0, 0, 0,
n, disks, &selected, NULL);
chosen = (err == 0) ? strdup(disks[selected].name) : NULL;
@@ -234,7 +234,7 @@ query:
dialog_vars.defaultno = TRUE;
snprintf(message, sizeof(message), "Would you like to use this entire "
- "disk (%s) for FreeBSD or partition it to share it with other "
+ "disk (%s) for pfSense or partition it to share it with other "
"operating systems? Using the entire disk will erase any data "
"currently stored there.", disk);
choice = dialog_yesno("Partition", message, 0, 0);
@@ -249,7 +249,7 @@ query:
sprintf(warning, "The existing partition scheme on this "
"disk (%s) is not bootable on this platform. To install "
- "FreeBSD, it must be repartitioned. This will destroy all "
+ "pfSense, it must be repartitioned. This will destroy all "
"data on the disk. Are you sure you want to proceed?",
scheme);
subchoice = dialog_yesno("Non-bootable Disk", warning, 0, 0);
@@ -331,7 +331,7 @@ wizard_makeparts(struct gmesh *mesh, const char *disk, const char *fstype, int i
humanize_number(neededstr, 7, MIN_FREE_SPACE, "B", HN_AUTOSCALE,
HN_DECIMAL);
sprintf(message, "There is not enough free space on %s to "
- "install FreeBSD (%s free, %s required). Would you like "
+ "install pfSense (%s free, %s required). Would you like "
"to choose another disk or to open the partition editor?",
disk, availablestr, neededstr);
diff --git a/usr.sbin/bsdinstall/partedit/partedit.c b/usr.sbin/bsdinstall/partedit/partedit.c
index 6723af5..fd7817a 100644
--- a/usr.sbin/bsdinstall/partedit/partedit.c
+++ b/usr.sbin/bsdinstall/partedit/partedit.c
@@ -87,7 +87,7 @@ main(int argc, const char **argv)
init_dialog(stdin, stdout);
if (!sade_mode)
- dialog_vars.backtitle = __DECONST(char *, "FreeBSD Installer");
+ dialog_vars.backtitle = __DECONST(char *, "pfSense Installer");
dialog_vars.item_help = TRUE;
nscroll = i = 0;
@@ -111,7 +111,7 @@ main(int argc, const char **argv)
return (error);
}
} else {
- prompt = "Create partitions for FreeBSD. No changes will be "
+ prompt = "Create partitions for pfSense. No changes will be "
"made until you select Finish.";
}
@@ -281,7 +281,7 @@ validate_setup(void)
if (root == NULL) {
dialog_msgbox("Error", "No root partition was found. "
- "The root FreeBSD partition must have a mountpoint of '/'.",
+ "The root pfSense partition must have a mountpoint of '/'.",
0, 0, TRUE);
return (FALSE);
}
@@ -294,7 +294,7 @@ validate_setup(void)
dialog_vars.defaultno = TRUE;
cancel = dialog_yesno("Warning", "The chosen root partition "
"has a preexisting filesystem. If it contains an existing "
- "FreeBSD system, please update it with freebsd-update "
+ "pfSense system, please update it "
"instead of installing a new system on it. The partition "
"can also be erased by pressing \"No\" and then deleting "
"and recreating it. Are you sure you want to proceed?",
diff --git a/usr.sbin/bsdinstall/partedit/partedit_x86.c b/usr.sbin/bsdinstall/partedit/partedit_x86.c
index 5616e58..a600bec 100644
--- a/usr.sbin/bsdinstall/partedit/partedit_x86.c
+++ b/usr.sbin/bsdinstall/partedit/partedit_x86.c
@@ -51,10 +51,7 @@ x86_bootmethod(void)
const char *
default_scheme(void)
{
- if (strcmp(x86_bootmethod(), "UEFI") == 0)
- return ("GPT");
- else
- return ("MBR");
+ return ("GPT");
}
int
diff --git a/usr.sbin/bsdinstall/scripts/Makefile b/usr.sbin/bsdinstall/scripts/Makefile
index 163929a..419c8bc 100644
--- a/usr.sbin/bsdinstall/scripts/Makefile
+++ b/usr.sbin/bsdinstall/scripts/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-SCRIPTS= auto adduser checksum config docsinstall entropy hardening hostname jail \
+SCRIPTS= auto adduser checksum config docsinstall entropy fix_fstab hardening hostname jail \
keymap mirrorselect mount netconfig netconfig_ipv4 netconfig_ipv6 \
rootpass script services time umount wlanconfig zfsboot
BINDIR= ${LIBEXECDIR}/bsdinstall
diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto
index 254daa2..e826f36 100755
--- a/usr.sbin/bsdinstall/scripts/auto
+++ b/usr.sbin/bsdinstall/scripts/auto
@@ -42,7 +42,7 @@ error() {
fi
test -n "$DISTDIR_IS_UNIONFS" && umount -f $BSDINSTALL_DISTDIR
test -f $PATH_FSTAB && bsdinstall umount
- dialog --backtitle "FreeBSD Installer" --title "Abort" \
+ dialog --backtitle "pfSense Installer" --title "Abort" \
--no-label "Exit" --yes-label "Restart" --yesno \
"${msg}An installation step has been aborted. Would you like to restart the installation or exit the installer?" 0 0
if [ $? -ne 0 ]; then
@@ -111,23 +111,25 @@ trap true SIGINT # This section is optional
bsdinstall keymap
trap error SIGINT # Catch cntrl-C here
-bsdinstall hostname || error "Set hostname failed"
+#bsdinstall hostname || error "Set hostname failed"
-export DISTRIBUTIONS="base.txz kernel.txz"
+export DISTRIBUTIONS="base.txz"
if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then
DISTMENU=`awk -F'\t' '!/^(kernel\.txz|base\.txz)/{print $1,$5,$6}' $BSDINSTALL_DISTDIR/MANIFEST`
DISTMENU="$(echo ${DISTMENU} | sed -E 's/\.txz//g')"
- exec 3>&1
- EXTRA_DISTS=$( eval dialog \
- --backtitle \"FreeBSD Installer\" \
- --title \"Distribution Select\" --nocancel --separate-output \
- --checklist \"Choose optional system components to install:\" \
- 0 0 0 $DISTMENU \
- 2>&1 1>&3 )
- for dist in $EXTRA_DISTS; do
- export DISTRIBUTIONS="$DISTRIBUTIONS $dist.txz"
- done
+ if [ -n "$DISTMENU" ]; then
+ exec 3>&1
+ EXTRA_DISTS=$( eval dialog \
+ --backtitle \"pfSense Installer\" \
+ --title \"Distribution Select\" --nocancel --separate-output \
+ --checklist \"Choose optional system components to install:\" \
+ 0 0 0 $DISTMENU \
+ 2>&1 1>&3 )
+ for dist in $EXTRA_DISTS; do
+ export DISTRIBUTIONS="$DISTRIBUTIONS $dist.txz"
+ done
+ fi
fi
LOCAL_DISTRIBUTIONS="MANIFEST"
@@ -143,7 +145,7 @@ LOCAL_DISTRIBUTIONS=`echo $LOCAL_DISTRIBUTIONS` # Trim white space
FETCH_DISTRIBUTIONS=`echo $FETCH_DISTRIBUTIONS` # Trim white space
if [ -n "$FETCH_DISTRIBUTIONS" -a -n "$BSDINSTALL_CONFIGCURRENT" ]; then
- dialog --backtitle "FreeBSD Installer" --title "Network Installation" --msgbox "Some installation files were not found on the boot volume. The next few screens will allow you to configure networking so that they can be downloaded from the Internet." 0 0
+ dialog --backtitle "pfSense Installer" --title "Network Installation" --msgbox "Some installation files were not found on the boot volume. The next few screens will allow you to configure networking so that they can be downloaded from the Internet." 0 0
bsdinstall netconfig || error
NETCONFIG_DONE=yes
fi
@@ -268,7 +270,7 @@ case $CURARCH in
esac
exec 3>&1
-PARTMODE=`echo $PMODES | xargs dialog --backtitle "FreeBSD Installer" \
+PARTMODE=`echo $PMODES | xargs dialog --backtitle "pfSense Installer" \
--title "Partitioning" \
--menu "How would you like to partition your disk?" \
0 0 0 2>&1 1>&3` || exit 1
@@ -277,6 +279,7 @@ exec 3>&-
case "$PARTMODE" in
"Auto (UFS)") # Guided
bsdinstall autopart || error "Partitioning error"
+ bsdinstall fix_fstab || error "Failed to set partition labels"
bsdinstall mount || error "Failed to mount filesystem"
;;
"Shell") # Shell
@@ -291,6 +294,7 @@ case "$PARTMODE" in
else
bsdinstall partedit || error "Partitioning error"
fi
+ bsdinstall fix_fstab || error "Failed to set partition labels"
bsdinstall mount || error "Failed to mount filesystem"
;;
"Auto (ZFS)") # ZFS
@@ -302,6 +306,7 @@ case "$PARTMODE" in
;;
esac
+unset mounted_nullfs
if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then
ALL_DISTRIBUTIONS="$DISTRIBUTIONS"
WANT_DEBUG=
@@ -315,6 +320,7 @@ if [ ! -z "$FETCH_DISTRIBUTIONS" ]; then
if [ -d $BSDINSTALL_DISTDIR ]; then
DISTDIR_IS_UNIONFS=1
mount_nullfs -o union "$BSDINSTALL_FETCHDEST" "$BSDINSTALL_DISTDIR"
+ mounted_nullfs=1
else
export DISTRIBUTIONS="$FETCH_DISTRIBUTIONS"
export BSDINSTALL_DISTDIR="$BSDINSTALL_FETCHDEST"
@@ -367,6 +373,7 @@ if [ ! -z "$LOCAL_DISTRIBUTIONS" ]; then
if [ -d $BSDINSTALL_DISTDIR ]; then
DISTDIR_IS_UNIONFS=1
mount_nullfs -o union "$BSDINSTALL_FETCHDEST" "$BSDINSTALL_DISTDIR"
+ mounted_nullfs=1
export BSDINSTALL_DISTDIR="$BSDINSTALL_FETCHDEST"
fi
env DISTRIBUTIONS="$LOCAL_DISTRIBUTIONS" \
@@ -377,25 +384,33 @@ fi
bsdinstall checksum || error "Distribution checksum failed"
bsdinstall distextract || error "Distribution extract failed"
-bsdinstall rootpass || error "Could not set root password"
+
+if [ -n "${mounted_nullfs}" ]; then
+ umount $BSDINSTALL_DISTDIR
+fi
+
+if [ -f /root/factory.sh ]; then
+ sh /root/factory.sh || error "System configuration failed"
+fi
+#bsdinstall rootpass || error "Could not set root password"
trap true SIGINT # This section is optional
if [ "$NETCONFIG_DONE" != yes ]; then
- bsdinstall netconfig # Don't check for errors -- the user may cancel
+# bsdinstall netconfig # Don't check for errors -- the user may cancel
fi
-bsdinstall time
-bsdinstall services
-bsdinstall hardening
+#bsdinstall time
+#bsdinstall services
+#bsdinstall hardening
-dialog --backtitle "FreeBSD Installer" --title "Add User Accounts" --yesno \
- "Would you like to add users to the installed system now?" 0 0 && \
- bsdinstall adduser
+#dialog --backtitle "pfSense Installer" --title "Add User Accounts" --yesno \
+# "Would you like to add users to the installed system now?" 0 0 && \
+# bsdinstall adduser
finalconfig() {
exec 3>&1
- REVISIT=$(dialog --backtitle "FreeBSD Installer" \
+ REVISIT=$(dialog --backtitle "pfSense Installer" \
--title "Final Configuration" --no-cancel --menu \
- "Setup of your FreeBSD system is nearly complete. You can now modify your configuration choices. After this screen, you will have an opportunity to make more complex changes using a shell." 0 0 0 \
+ "Setup of your pfSense system is nearly complete. You can now modify your configuration choices. After this screen, you will have an opportunity to make more complex changes using a shell." 0 0 0 \
"Exit" "Apply configuration and exit installer" \
"Add User" "Add a user to the system" \
"Root Password" "Change root password" \
@@ -404,7 +419,7 @@ finalconfig() {
"Services" "Set daemons to run on startup" \
"System Hardening" "Set security options" \
"Time Zone" "Set system timezone" \
- "Handbook" "Install FreeBSD Handbook (requires network)" 2>&1 1>&3)
+ "Handbook" "Install pfSense Handbook (requires network)" 2>&1 1>&3)
exec 3>&-
case "$REVISIT" in
@@ -444,7 +459,7 @@ finalconfig() {
}
# Allow user to change his mind
-finalconfig
+#finalconfig
trap error SIGINT # SIGINT is bad again
bsdinstall config || error "Failed to save config"
@@ -457,7 +472,7 @@ if [ ! -z "$BSDINSTALL_FETCHDEST" ]; then
rm -rf "$BSDINSTALL_FETCHDEST"
fi
-dialog --backtitle "FreeBSD Installer" --title "Manual Configuration" \
+dialog --backtitle "pfSense Installer" --title "Manual Configuration" \
--default-button no --yesno \
"The installation is now finished. Before exiting the installer, would you like to open a shell in the new system to make any final manual modifications?" 0 0
if [ $? -eq 0 ]; then
diff --git a/usr.sbin/bsdinstall/scripts/checksum b/usr.sbin/bsdinstall/scripts/checksum
index 1c537f3..ddf7f8e6 100755
--- a/usr.sbin/bsdinstall/scripts/checksum
+++ b/usr.sbin/bsdinstall/scripts/checksum
@@ -37,7 +37,7 @@ for dist in $DISTRIBUTIONS; do
for i in $DISTRIBUTIONS; do
items="$items $i `eval echo \\\${status_$(basename $i .txz):-Pending}`"
done
- dialog --backtitle "FreeBSD Installer" --title "Checksum Verification" \
+ dialog --backtitle "pfSense Installer" --title "Checksum Verification" \
--mixedgauge "Verifying checksums of selected distributions." \
0 0 $percentage $items
@@ -62,7 +62,7 @@ for dist in $DISTRIBUTIONS; do
percentage=$(echo $percentage + 100/`echo $DISTRIBUTIONS | wc -w` | bc)
else
eval "status_$distname=1"
- dialog --backtitle "FreeBSD Installer" --title "Error" \
+ dialog --backtitle "pfSense Installer" --title "Error" \
--msgbox "The checksum for $dist does not match. It may have become corrupted, and should be redownloaded." 0 0
exit 1
fi
diff --git a/usr.sbin/bsdinstall/scripts/config b/usr.sbin/bsdinstall/scripts/config
index 90ee257..6c0a2ce 100755
--- a/usr.sbin/bsdinstall/scripts/config
+++ b/usr.sbin/bsdinstall/scripts/config
@@ -29,24 +29,38 @@
#
############################################################ MAIN
-cat $BSDINSTALL_TMPETC/rc.conf.* >> $BSDINSTALL_TMPETC/rc.conf
-rm $BSDINSTALL_TMPETC/rc.conf.*
+#cat $BSDINSTALL_TMPETC/rc.conf.* >> $BSDINSTALL_TMPETC/rc.conf
+#rm $BSDINSTALL_TMPETC/rc.conf.*
cat $BSDINSTALL_CHROOT/etc/sysctl.conf $BSDINSTALL_TMPETC/sysctl.conf.hardening >> $BSDINSTALL_TMPETC/sysctl.conf
-rm $BSDINSTALL_TMPETC/sysctl.conf.*
+rm $BSDINSTALL_TMPETC/sysctl.conf*
cp $BSDINSTALL_TMPETC/* $BSDINSTALL_CHROOT/etc
+# Copy pfSense loader.conf
+if [ -f $BSDINSTALL_CHROOT/boot/loader.conf ]; then
+ cp $BSDINSTALL_CHROOT/boot/loader.conf \
+ $BSDINSTALL_TMPBOOT/loader.conf.pfSense
+fi
cat $BSDINSTALL_TMPBOOT/loader.conf.* >> $BSDINSTALL_TMPBOOT/loader.conf
rm $BSDINSTALL_TMPBOOT/loader.conf.*
-df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "zfs_load=\"YES\"" >> $BSDINSTALL_TMPBOOT/loader.conf
cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot
+if [ -f /tmp/loader.conf.pfSense ]; then
+ cp /tmp/loader.conf.pfSense $BSDINSTALL_CHROOT/boot/loader.conf
+fi
+
+df -t zfs $BSDINSTALL_CHROOT > /dev/null && echo "zfs_load=\"YES\"" >> $BSDINSTALL_CHROOT/boot/loader.conf
+
+if [ -f /tmp/boot.config ]; then
+ cp /tmp/boot.conf $BSDINSTALL_CHROOT
+fi
+
[ "${debugFile#+}" ] && cp "${debugFile#+}" $BSDINSTALL_CHROOT/var/log/
# Set up other things from installed config
-chroot $BSDINSTALL_CHROOT /usr/bin/newaliases > /dev/null 2>&1
+#chroot $BSDINSTALL_CHROOT /usr/bin/newaliases > /dev/null 2>&1
exit $SUCCESS
diff --git a/usr.sbin/bsdinstall/scripts/fix_fstab b/usr.sbin/bsdinstall/scripts/fix_fstab
new file mode 100755
index 0000000..7c84847
--- /dev/null
+++ b/usr.sbin/bsdinstall/scripts/fix_fstab
@@ -0,0 +1,118 @@
+#!/bin/sh
+#-
+# Copyright (c) 2016 Rubicon Communications, LLC
+# 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$
+
+dev_label() {
+ if [ -z "${1}" -o -z "${2}" ]; then
+ return
+ fi
+
+ local _fstype="${1}"
+ local _device="${2}"
+
+ case "${_fstype}" in
+ ufs|swap)
+ ;;
+ *)
+ echo ${_device}
+ return
+ esac
+
+ # Detect if device is already a label and return
+ local _prefix=${_device%/*}
+ case "${_prefix#/dev/}" in
+ mirror|ufsid|label|geom|gpt|gptid)
+ echo ${_device}
+ return
+ ;;
+ esac
+
+ local _devname=${_device#/dev/}
+ if [ -z "${_devname}" ]; then
+ echo ${_device}
+ return
+ fi
+
+ # Get already defined labels if exist
+ local _label=""
+ for lt in mirror label gpt ufsid gptid; do
+ _label=$(glabel list ${_devname} 2>/dev/null \
+ | grep "Name: *${lt}/" \
+ | sed 's,^.*Name: *,,')
+
+ if [ -n "${_label}" -a -e "/dev/${_label}" ]; then
+ echo "/dev/${_label}"
+ return
+ fi
+ done
+
+ # No label found, lets create one. It should be swap
+ if [ "${_fstype}" != "swap" ]; then
+ echo ${_device}
+ return
+ fi
+
+ glabel label swap${SWAPNUM} ${_device}
+ # Error, don't use label
+ if [ $? -ne 0 ]; then
+ echo ${_device}
+ return
+ fi
+
+ SWAPNUM=$((SWAPNUM+1))
+ echo "/dev/label/swap${SWAPNUM}"
+}
+
+FSTAB=${BSDINSTALL_TMPETC}/fstab
+
+if [ -z "${FSTAB}" -o ! -f "${FSTAB}" ]; then
+ dialog --backtitle "pfSense Installer" --title "Error" \
+ --msgbox "Error creating device labels" 0 0
+ exit 1
+fi
+
+TMP="${FSTAB}.tmp"
+
+[ -f "${TMP}" ] \
+ && rm -f ${TMP}
+
+SWAPNUM=0
+while read device mountpoint fstype options dump pass; do
+ if ! echo "${device}" | egrep -q '^/dev/'; then
+ continue
+ fi
+
+ label=$(dev_label ${fstype} ${device})
+
+ # If label is blank, use device name
+ label=${label:-${device}}
+
+ printf "%s\t%s\t%s\t%s\t%s\t%s\n" ${label} ${mountpoint} ${fstype} \
+ ${options} ${dump} ${pass} >> ${TMP}
+done < ${FSTAB}
+
+mv ${TMP} ${FSTAB}
diff --git a/usr.sbin/bsdinstall/scripts/keymap b/usr.sbin/bsdinstall/scripts/keymap
index 7b42571..cb20b78 100755
--- a/usr.sbin/bsdinstall/scripts/keymap
+++ b/usr.sbin/bsdinstall/scripts/keymap
@@ -57,8 +57,8 @@ hline_arrows_tab_enter="Press arrows, TAB or ENTER"
msg_continue_with_keymap="Continue with %s keymap"
msg_default="default"
msg_error="Error"
-msg_freebsd_installer="FreeBSD Installer"
-msg_keymap_menu_text="The system console driver for FreeBSD defaults to standard \"US\"\nkeyboard map. Other keymaps can be chosen below."
+msg_freebsd_installer="pfSense Installer"
+msg_keymap_menu_text="The system console driver for pfSense defaults to standard \"US\"\nkeyboard map. Other keymaps can be chosen below."
msg_keymap_selection="Keymap Selection"
msg_ok="OK"
msg_select="Select"
diff --git a/usr.sbin/bsdinstall/scripts/mount b/usr.sbin/bsdinstall/scripts/mount
index fca8000..157997f 100755
--- a/usr.sbin/bsdinstall/scripts/mount
+++ b/usr.sbin/bsdinstall/scripts/mount
@@ -44,7 +44,7 @@ for i in $FILESYSTEMS; do
mkdir -p $i 2>/dev/null
MNTERROR=`mount -F $TMP_FSTAB $i 2>&1`
if [ $? -ne 0 ]; then
- dialog --backtitle "FreeBSD Installer" --title "Error" \
+ dialog --backtitle "pfSense Installer" --title "Error" \
--msgbox "Error mounting partition $i:\n$MNTERROR" 0 0
exit 1
fi
diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot
index 9fbf5c9..13df482 100755
--- a/usr.sbin/bsdinstall/scripts/zfsboot
+++ b/usr.sbin/bsdinstall/scripts/zfsboot
@@ -148,25 +148,8 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATASETS="
# Compress /tmp, allow exec but not setuid
/tmp mountpoint=/tmp,exec=on,setuid=off
- # Don't mount /usr so that 'base' files go to the BEROOT
- /usr mountpoint=/usr,canmount=off
-
- # Home directories separated so they are common to all BEs
- /usr/home # NB: /home is a symlink to /usr/home
-
- # Ports tree
- /usr/ports setuid=off
-
- # Source tree (compressed)
- /usr/src
-
# Create /var and friends
- /var mountpoint=/var,canmount=off
- /var/audit exec=off,setuid=off
- /var/crash exec=off,setuid=off
- /var/log exec=off,setuid=off
- /var/mail atime=on
- /var/tmp setuid=off
+ /var mountpoint=/var
" # END-QUOTE
#
@@ -250,7 +233,7 @@ msg_encrypt_disks_help="Use geli(8) to encrypt all data partitions"
msg_error="Error"
msg_force_4k_sectors="Force 4K Sectors?"
msg_force_4k_sectors_help="Align partitions to 4K sector boundries and set vfs.zfs.min_auto_ashift=12"
-msg_freebsd_installer="FreeBSD Installer"
+msg_freebsd_installer="pfSense Installer"
msg_geli_password="Enter a strong passphrase, used to protect your encryption keys. You will be required to enter this passphrase each time the system is booted"
msg_geli_setup="Initializing encryption on selected disks,\n this will take several seconds per disk"
msg_install="Install"
diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c
index cff2831..d40f243 100644
--- a/usr.sbin/rtsold/rtsol.c
+++ b/usr.sbin/rtsold/rtsol.c
@@ -92,7 +92,7 @@ static int ra_opt_rdnss_dispatch(struct ifinfo *, struct rainfo *,
struct script_msg_head_t *, struct script_msg_head_t *);
static char *make_rsid(const char *, const char *, struct rainfo *);
-#define _ARGS_OTHER otherconf_script, ifi->ifname
+#define _ARGS_OTHER otherconf_script, ifi->ifname, ntopbuf
#define _ARGS_RESADD resolvconf_script, "-a", rsid
#define _ARGS_RESDEL resolvconf_script, "-d", rsid
@@ -374,8 +374,8 @@ rtsol_input(int s)
warnmsg(LOG_DEBUG, __func__,
"OtherConfigFlag on %s is turned on", ifi->ifname);
ifi->otherconfig = 1;
- CALL_SCRIPT(OTHER, NULL);
}
+ CALL_SCRIPT(OTHER, NULL);
clock_gettime(CLOCK_MONOTONIC_FAST, &now);
newent_rai = 0;
rai = find_rainfo(ifi, &from);
diff --git a/usr.sbin/syslogd/clog.h b/usr.sbin/syslogd/clog.h
new file mode 100644
index 0000000..ed9e7a2
--- /dev/null
+++ b/usr.sbin/syslogd/clog.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 2001
+ * Jeff Wheelhouse (jdw@wwwi.com)
+ *
+ * This code was originally developed by Jeff Wheelhouse (jdw@wwwi.com).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistribution of source code must retail 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 JEFF WHEELHOUSE ``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 JEFF WHEELHOUSE 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.
+ *
+ * $Id: clog.h,v 1.2 2001/10/02 04:43:52 jdw Exp $
+ * $DragonFly: src/usr.sbin/clog/clog.h,v 1.1 2004/10/30 20:26:46 dillon Exp $
+ */
+
+
+#ifndef _CLOG_H_
+#define _CLOG_H_
+
+/*
+ * This magic constant is used to identify a valid circular log file.
+ * syslogd will ignore any circular log file that doesn't have this constant.
+ */
+
+const char MAGIC_CONST[4] = "CLOG";
+
+
+struct clog_footer {
+ uint32_t cf_magic;
+ uint32_t cf_wrap;
+ uint32_t cf_next;
+ uint32_t cf_max;
+ uint32_t cf_lock;
+};
+
+
+#endif /* _CLOG_H_ */
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index fa51669..7603be8 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -89,6 +89,7 @@ __FBSDID("$FreeBSD$");
#include <sys/un.h>
#include <sys/wait.h>
#include <sys/types.h>
+#include <sys/mman.h>
#include <netinet/in.h>
#include <netdb.h>
@@ -111,6 +112,8 @@ __FBSDID("$FreeBSD$");
#include <utmpx.h>
#include "pathnames.h"
+#include "clog.h"
+
#include "ttymsg.h"
#define SYSLOG_NAMES
@@ -195,6 +198,11 @@ struct filed {
char f_pname[MAXPATHLEN];
pid_t f_pid;
} f_pipe;
+ struct {
+ char f_rname[MAXPATHLEN];
+ struct clog_footer *f_footer;
+ size_t f_size;
+ } f_ring;
} f_un;
char f_prevline[MAXSVLINE]; /* last message logged */
char f_lasttime[16]; /* time of last occurrence */
@@ -273,10 +281,12 @@ int repeatinterval[] = { 30, 120, 600 }; /* # of secs before flush */
#define F_USERS 5 /* list of users */
#define F_WALL 6 /* everyone logged on */
#define F_PIPE 7 /* pipe to program */
+#define F_RING 8 /* ring buffer (circular log) */
-const char *TypeNames[8] = {
+const char *TypeNames[9] = {
"UNUSED", "FILE", "TTY", "CONSOLE",
- "FORW", "USERS", "WALL", "PIPE"
+ "FORW", "USERS", "WALL", "PIPE",
+ "RING"
};
static struct filed *Files; /* Log files that we write to */
@@ -342,6 +352,8 @@ static int skip_message(const char *, const char *, int);
static void printline(const char *, char *, int);
static void printsys(char *);
static int p_open(const char *, pid_t *);
+ssize_t rbwrite __P((struct filed *, char *, size_t));
+ssize_t rbwritev __P((struct filed *, struct iovec *, int));
static void readklog(void);
static void reapchild(int);
static const char *ttymsg_check(struct iovec *, int, char *, int);
@@ -962,7 +974,7 @@ logmsg(int pri, const char *msg, const char *from, int flags)
struct filed *f;
int i, fac, msglen, omask, prilev;
const char *timestamp;
- char prog[NAME_MAX+1];
+ char prog[NAME_MAX+1];
char buf[MAXLINE+1];
dprintf("logmsg: pri %o, flags %x, from %s, msg %s\n",
@@ -1336,6 +1348,20 @@ fprintlog(struct filed *f, int flags, const char *msg)
needdofsync = 1;
}
break;
+ case F_RING:
+ dprintf(" %s\n", f->f_un.f_ring.f_rname);
+ v->iov_base = "\n";
+ v->iov_len = 1;
+ if (rbwritev(f, iov, 7)==-1) {
+ int e = errno;
+ (void)munmap(f->f_un.f_ring.f_footer,sizeof(struct clog_footer));
+ (void)close(f->f_file);
+ f->f_type = F_UNUSED;
+ errno = e;
+ logerror(f->f_un.f_fname);
+ }
+
+ break;
case F_PIPE:
dprintf(" %s\n", f->f_un.f_pipe.f_pname);
@@ -1828,6 +1854,10 @@ init(int signo)
}
f->f_un.f_pipe.f_pid = 0;
break;
+ case F_RING:
+ (void)munmap(f->f_un.f_ring.f_footer,sizeof(struct clog_footer));
+ (void)close(f->f_file);
+ break;
}
next = f->f_next;
if (f->f_program) free(f->f_program);
@@ -1893,6 +1923,10 @@ init(int signo)
}
break;
+ case F_RING:
+ printf("%s", f->f_un.f_ring.f_rname);
+ break;
+
case F_PIPE:
printf("%s", f->f_un.f_pipe.f_pname);
break;
@@ -1943,6 +1977,7 @@ cfline(const char *line, struct filed *f, const char *prog, const char *host)
const char *p, *q;
char *bp;
char buf[MAXLINE], ebuf[100];
+ struct stat sb;
dprintf("cfline(\"%s\", f, \"%s\", \"%s\")\n", line, prog, host);
@@ -2116,9 +2151,16 @@ cfline(const char *line, struct filed *f, const char *prog, const char *host)
p++;
endkey = ']';
}
- while (*p && (*p != endkey) && (i-- > 0)) {
+ while (*p && (*p != endkey) && (*p != '[') && (i-- > 0)) {
*tp++ = *p++;
}
+ if (*p == '[') {
+ p++;
+ while (*p && (*p != ']') && (i-- > 0)) {
+ *tp++ = *p++;
+ }
+ p++;
+ }
if (endkey == ']' && *p == endkey)
p++;
*tp = '\0';
@@ -2163,6 +2205,38 @@ cfline(const char *line, struct filed *f, const char *prog, const char *host)
}
break;
+ case '%':
+ if ((f->f_file = open(p+1, O_RDWR, 0 )) < 0) {
+ f->f_type = F_UNUSED;
+ logerror(p+1);
+ break;
+ }
+ if (fstat(f->f_file,&sb)<0) {
+ (void)close(f->f_file);
+ f->f_type = F_UNUSED;
+ logerror(p+1);
+ break;
+ }
+ f->f_un.f_ring.f_footer = mmap(NULL,sizeof(struct clog_footer),PROT_READ|PROT_WRITE,MAP_SHARED,f->f_file,sb.st_size-sizeof(struct clog_footer));
+ if (f->f_un.f_ring.f_footer==NULL) {
+ (void)close(f->f_file);
+ f->f_type = F_UNUSED;
+ logerror(p+1);
+ break;
+ }
+ if (memcmp(&(f->f_un.f_ring.f_footer->cf_magic),MAGIC_CONST,4)!=0) {
+ (void)munmap(f->f_un.f_ring.f_footer,sizeof(struct clog_footer));
+ (void)close(f->f_file);
+ f->f_type = F_UNUSED;
+ errno = ENODEV;
+ logerror(p+1);
+ break;
+ }
+ f->f_un.f_ring.f_size = sb.st_size;
+ (void)strcpy(f->f_un.f_ring.f_rname, p + 1);
+ f->f_type = F_RING;
+ break;
+
case '|':
f->f_un.f_pipe.f_pid = 0;
(void)strlcpy(f->f_un.f_pipe.f_pname, p + 1,
@@ -2907,6 +2981,49 @@ socksetup(int af, char *bindhostname)
return (socks);
}
+ssize_t rbwritev(struct filed *f, struct iovec *iov, int iovcnt) {
+ int i;
+ ssize_t out = 0;
+ ssize_t err;
+
+ for(i=0;i<iovcnt;i++) {
+ err = rbwrite(f,iov[i].iov_base,iov[i].iov_len);
+ if (err==-1) return -1;
+ out += err;
+ }
+ return out;
+}
+
+
+ssize_t rbwrite(struct filed *f, char *buf, size_t nbytes) {
+ size_t maxwrite = f->f_un.f_ring.f_footer->cf_max - f->f_un.f_ring.f_footer->cf_next;
+ ssize_t err;
+ ssize_t out = 0;
+
+ f->f_un.f_ring.f_footer->cf_lock = 1;
+ while (nbytes>0) {
+ maxwrite = f->f_un.f_ring.f_footer->cf_max - f->f_un.f_ring.f_footer->cf_next;
+ if (maxwrite>nbytes) maxwrite = nbytes;
+ err = pwrite(f->f_file,buf,maxwrite,f->f_un.f_ring.f_footer->cf_next);
+ if (err==-1) {
+ f->f_un.f_ring.f_footer->cf_lock = 0;
+ return -1;
+ }
+ nbytes -= err;
+ out += err;
+ buf += err;
+ f->f_un.f_ring.f_footer->cf_next += err;
+ if (f->f_un.f_ring.f_footer->cf_next==f->f_un.f_ring.f_footer->cf_max) {
+ f->f_un.f_ring.f_footer->cf_next = 0;
+ f->f_un.f_ring.f_footer->cf_wrap = 1;
+ }
+
+ }
+
+ f->f_un.f_ring.f_footer->cf_lock = 0;
+ return out;
+}
+
static void
increase_rcvbuf(int fd)
{
diff --git a/usr.sbin/traceroute6/traceroute6.c b/usr.sbin/traceroute6/traceroute6.c
index 62dfc6a..8924433 100644
--- a/usr.sbin/traceroute6/traceroute6.c
+++ b/usr.sbin/traceroute6/traceroute6.c
@@ -959,6 +959,10 @@ main(argc, argv)
cc = 0;
break;
}
+ else if (deltaT(&t1, &t2) > waittime * 1000) {
+ cc = 0;
+ break;
+ }
}
if (cc == 0)
printf(" *");
OpenPOWER on IntegriCloud