Wiki source for BuildingpFSense


Show raw source

===== This is outdated, retained for historical purposes only - DO NOT USE =====

====The current page is: ==== DevelopersBootStrapAndDevIso

How to build pfSense from scratch

__//**NOTE: This is featured for your luxury only. No support is available on this process officially.**//__

**These instructions have recently changed (11/15)! Please redo your environment.**

Install FreeBSD 6
%%We'll let you handle this one.
Ensure that you have internet access and that you can ping out.%%
Prepare the FreeBSD chroot build environment:
%%export PFSENSEROOT=/usr/jails/pfsense
mkdir -p $PFSENSEROOT
# NOTE - make buildworld takes a _LONG_ time ;-)
# Do this overnight and/or get a FAST machine with very fast disks
# Make sure you have cvsupped the src files for RELENG_6
cd /usr/src/ && make DESTDIR=$PFSENSEROOT buildworld
cd /usr/src/ && make DESTDIR=$PFSENSEROOT installworld distribution
cp /etc/resolv.conf ${PFSENSEROOT}/etc/resolv.conf
mount -t devfs none ${PFSENSEROOT}/dev
# Copy ports tree to chroot dir
cp -R /usr/ports ${PFSENSEROOT}/usr%%

Enter the chroot build environment and install bash (optional):
%%echo PS1=\'pfSense jail - $PS1\'>> ${PFSENSEROOT}/root/.bashrc
SHELL=/bin/sh chroot $PFSENSEROOT
pkg_add -r bash
exit%%

Enter the FreeBSD chroot build environment and setup a .cvsrc in the ~ (root home dir) and make.conf:
%%chroot $PFSENSEROOT
pkg_add -r cvsup-without-gui
pkg_add -r rsync
pkg_add -r cpdup
pkg_add -r cdrtools
pkg_add -r pcre
pkg_add -r libevent
echo SKIP_RSYNC=yes >> /etc/make.conf
echo SKIP_CHECKOUT=yes >> /etc/make.conf
echo "cvs -q" >~/.cvsrc
echo "diff -u" >>~/.cvsrc
echo "update -d" >>~/.cvsrc%%

Prepare and fetch the pfsense builder directory items:
%%mkdir -p /home/pfsense
cd /home/pfsense
touch ~/.cvspass
cvs -z3 -d :pserver:anonymous@cvs.freesbie.org:/cvs co -P freesbie2
fetch http://www.pfsense.com/cvs.tgz
tar xzvpf cvs.tgz%%

Checkout pfsense and tools to /home/pfsense by issuing (note the captial S in pfSense):
%%cd /home/pfsense
cvs -d /home/pfsense/cvsroot co tools pfSense
pkg_add -r curl
cd /home/pfsense/tools/pfPorts/php4-pfsense && make && make install && make clean%%
N.B.: if you build your packages in another box, instead of downloading them with 'pkg_add -r', please verify that libcurl is built without libidn support! This happens if you build curl on a box where libidn is already installed, it's one of those 'smart' (???) ports which changes its dependencies based on what is already installed on the box it's built. You can verify by issuing the following command: "ldd /usr/local/lib/libcurl.so.3", libidn must not be present. In any case, you can rebuild libcurl with -DWITHOUT_LIBIDN.

Setup skip RSYNC:
%%echo export SKIP_RSYNC=yes >> /home/pfsense/tools/builder_scripts/pfsense_local.sh
echo export SKIP_CHECKOUT=yes >> /home/pfsense/tools/builder_scripts/pfsense_local.sh
%%

Install needed packages for BSD Installer and webConfigurator:
%%pkg_add -r http://pfsense.iserv.nl/packages/All/bsdinstaller-2.0.2007.0827.tbz
pkg_add -r http://pfsense.iserv.nl/packages/All/cpdup-1.05.tbz
pkg_add -r http://pfsense.iserv.nl/packages/All/lua-5.0.2_1.tbz
pkg_add -r http://pfsense.iserv.nl/packages/All/lighttpd-1.4.9_1.tbz
%%

Exit the build-ready chroot environment, save a copy and re-enter (optional):
%%exit
tar zcf /bigdisk/pfSense-jail.tar.gz $PFSENSEROOT
chroot $PFSENSEROOT%%
Now cd to the builder scripts directory:
%%cd /home/pfsense/tools/builder_scripts/%%

To sync with FreeBSD and patch up:
(assumes that /etc/current-supfile exists)
%%./cvsup_current%%

Then run (to build a livecd iso):
%%./build_iso.sh%%
or (to build a full update version)
%%./build_updates.sh%%
or (to build a embedded image)
%%./build_embedded.sh%%

Environment variables that can be overridden:
General:
%%env NO_COMPRESSEDFS=yes%%
Emebedded:
%%env MSDOS_CONF=yes%%
%%env SECTT=220000%%

Cutting down more stuff from the freesbie2 build:
%%cd /usr/local/pfsense-fs && find . -print -depth > /some/file/in/your/home%%

==Categories==
CategoryHowTo
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki