Install

/bin/sh
alias finch-bootstrap="SSL_NO_VERIFY_PEER=YES fetch -q -o - http://git.io/HxXrsw | sh -s --"
finch-bootstrap --help

To install Finch,

finch-bootstrap install --dir "/path/to/finch"

Replacing /path/to/finch with the full path where Finch is to be installed.

Then follow the platform-specific post install steps, which you must do after running the installer.

Installer options

$ finch-bootstrap --help

Usage:
    $ finch-bootstrap "command" [--options]

Example:
    $ finch-bootstrap install --dir "/mnt/disk0/finch"

Commands:

    install   - Install a new copy of Finch FreeBSD.
    uninstall - Uninstall a copy of Finch FreeBSD.
    update    - Update the finch command and finch scripts to the latest version.
    move      - Move/rename the paths/locations to this copy of finch.

Options:

    -d, --dir "{realpath}"
         The full installation "/path/to/finch". Defaults to "\$PWD/finch".
         ~ if not set a new subdirectory will be created here named "finch".
         Internally referred to as "$finch_realpath" - the chroot directory.

    -y, --yes
         Do not prompt for user confirmation before continuing. Useful
         for unattended operations or launching from other scripts.

    -f, --force
         Do not exit when a potential problem is encountered. Continue
         regardless of all warnings and errors.

    -e, --dest-dir "{dest_dir}"
         (move) A destination path where to move this installation.
         Where the current location is specified by "--dir {realpath}".

    -t, --txz-distfiles-dir "{txz_distfiles_dir}"
         (install) A local folder from which to obtain the FreeBSD ".txz"
         distribution files from ("distfiles"), "base.txz"... etc. With this
         option *nothing* will be downloaded from ftp://ftp.freebsd.org.
         You will be locally responsible for ensuring a correct set of
         distribution files is present. All "*.txz" files found in the folder
         will be unpacked / installed to the target directory ("--dir {dir}").

    -x, --debug
         Debugging output. Switches on "set -x" to echo all commands.

    -h, --help
         Display this message and exit.

Bugs:
    Can be reported at http://dreamcat4.github.io/finch/support

Created by:
    Dreamcat4, dreamcat4@gmail.com (C 2014). FreeBSD License.

Pre-Install steps

pfSense

Finch requires at least 5GB of hard disk space on a UFS partition. Finch should only be installed on a regular hard disk and not on a USB Flash drive.

If you have already installed pfSense onto hard disk, then the drive where you have installed pfSense may already be suitable and meet those requirements.

Prepping a new hard disk

If you are running pfSense from an embedded image (which is the best way and recommended), then you will have to manually format, mount and prep the hard disk. These steps assume a blank or unformatted hard disk is already installed into the target machine

# Ensure you are in a POSIX.2 (ISO-compliant) shell. To avoid any confusion.
/bin/sh

# 1.a. Locate and identify which device name your hard disk is represented by
dmesg | grep -E 'ad[0-9]|da[0-9]'

# 1.b. Don't get this wrong. Double-check.
camcontrol devlist

# 1.c. Check for any existing partitions on attached disks
ls -l /dev/

# Put here the device name of your hard drive. Ours was "/dev/adz1"
disk="adz1"

# Destroy previous partition table. This will ruin any data on the disk
dd if="/dev/zero" of="/dev/$disk" bs="64k" count="100"

# Format the disk as UFS. Creates one big partition
newfs "/dev/$disk"

# Remount the root "/" filesystem as read-write
[ "$(mount | grep -e "on / " | grep read-only)" ] && mount -o noatime -u -w "/"

# Put here the mountpoint for your new drive
mountpoint="/mnt/disk0"

# Create the folder for our mountpoint
mkdir -p "$mountpoint"

# Add new fstab entry
echo "/dev/$disk $mountpoint ufs rw 1 1" >> "/etc/fstab"

# Check that it worked
mount -a && df -h

Getting pfSense to mount your hard disk(s) at boot time

We have done everything correctly, but pfSense still needs some slight modification to respectfully mount your fstab file, as it should. Yet pfSense / nanoBSD will not automatically do a mount -a during boot time like regular FreeBSD-GENERIC. Sensible? No. Easily fixed? Yes.

Run this script to correct the issue. It will instll a small boot script to mount -a and perform fsck check if necessary1. Just copy-paste these lines into your terminal (as root):

/bin/sh
alias pfmount_install="SSL_NO_VERIFY_PEER=YES fetch -q -o - http://git.io/NBLjxw | sh -s --"
pfmount_install

# Check that your fstab disk mounts are persistent across reboots
reboot
df -h
cat /etc/fstab

Getting pfSense to remember your hard disk(s) after upgrades

Whenever you upgrade or re-install pfSense, your fstab file and also the fstab boot script will disappear. To get around this issue requires the help of two Packages: Backup and ShellCmd. We will use Backup to save / restore our fstab file. And ShellCmd will ensure that the fstab boot script is reinstalled after upgrades.

Install the 'Backup' Package

Go to System|Packages

Go to Available Packages|System

Install the 'ShellCmd' Package

Go to System|Packages

Go to Available Packages|Services

Add bootup script

This script ensures that the fstab boot script is present. If absent the necessary boot scripts will be downloaded again from Github, and re-installed. This may happen for example after upgrading pfSense. (You will still need to restore your fstab file manually however).

Go to Services|ShellCmd

[ -x "/etc/rc.mount_-a" ] || SSL_NO_VERIFY_PEER=YES fetch -q -o - http://git.io/NBLjxw | sh -s --

Backup '/etc/fstab'

Go to Diagnostics|Backup Files/Dir

Input the following text fields

Take note! If you remove, swap, or attach new disks, then you may need to change the contents of your fstab file. Remember to backup your new fstab file if you ever have to change it.

Restore '/etc/fstab'

After upgrading pfSense, it is necessary to restore this file from your downloaded pfsense.bak.tgz archive.

Go to Diagnostics|Backup Files/Dir

Post-Install Steps

Choose your platform from the list below.

NAS4Free

These steps should be followed after installation.

Configure administrator accounts

Finch will automatically configure the root account for you. These steps should be followed for any other normal users who you want to be administrators, and use Finch too.

Add bootup / shutdown scripts

Go to System|Advanced|Command Scripts

/path/to/finch/etc/finch/postinit
/path/to/finch/etc/finch/shutdown

Take note! The above text /path/to/finch is not a real path. Instead you must put the real directory where Finch is located on the filesystem. For example, if you are installing Finch into /mnt/disk0/finch, then the correct startup and shutdown commands would be:

/mnt/disk0/finch/etc/finch/postinit
/mnt/disk0/finch/etc/finch/shutdown

Start the Finch FreeBSD installation process

tail -99999 -f /path/to/finch/var/log/finch/install.log

FreeNAS

These steps should be followed after installation.

FreeNAS services not working after reboot ?

FreeNAS services are not started until after all POSTINIT scripts have finished execution. So after the first reboot (during Finch installation) the etc/finch/postinit will take much longer to complete. Anywhere from 20 minutes up to 1 hour.

Symptom:

Solution #1:

Solution #2:

Configure root & administrator accounts

Add bootup / shutdown scripts

Expand + System --> + Init/Shutdown Scripts --> Add Init/Shutdown Script

/path/to/finch/etc/finch/postinit
/path/to/finch/etc/finch/shutdown

Take note! The above text /path/to/finch is not a real path. Instead you must put the real directory where Finch is located on the filesystem. For example, if you are installing Finch into /mnt/disk0/finch, then the correct startup and shutdown commands would be:

/mnt/disk0/finch/etc/finch/postinit
/mnt/disk0/finch/etc/finch/shutdown

Start the Finch FreeBSD installation process

tail -99999 -f /path/to/finch/var/log/finch/install.log

pfSense

Configure admin accounts

Create user account(s) which are a member of the admins group.

Go to System|User Manager

Create or edit a user by clicking + or e.

In the Group Memberships section:

Install the 'ShellCmd' Package

Go to System|Packages

Go to Available Packages|Services

Add bootup script

Go to Services|ShellCmd

/path/to/finch/etc/finch/postinit

Take note! The above text /path/to/finch is not a real path. Instead you must put the real directory where Finch is located on the filesystem. For example, if you are installing Finch into /mnt/disk0/finch, then the correct startup command would be:

/mnt/disk0/finch/etc/finch/postinit

Start the Finch FreeBSD installation process

tail -99999 -f /path/to/finch/var/log/finch/install.log

FreeBSD-GENERIC

These steps should be followed after installation.

Configure root & administrator accounts

$ "pw user mod $USER -G wheel"
$ "pw user mod $USER -s /usr/local/bin/bash"
$ ". /etc/profile" will re-source profile for this shell