Source Code



  • Hello,

    How can I run pfsense from source code?

    Thanks,


  • Developer Netgate

    You can't.

    An insrtallable image must be built from the source code using the tools provided in the source code repository. Search the web for "Build pfSense from source" for details.

    Doing so requires a high level of technical expertise, and while not trying to be condescending, the fact that you asked the question probably indicates the task is beyond your experience :)



  • Don't bother, the sources are incomplete and you will not be able to build an image. It has nothing to do with expertise, I have built other open-source firewalls from sources but this one is just impossible.


  • Developer Netgate

    I beg to differ.



  • Thank you so much. It helps me to understand.



  • It's possible to build the whole thing from the sources (which are complete contrary to the claim) but you have to do some configuration and know what changes what because the defaults are deliberately set so that you're not building "pfSense" but your own version that is named differently (can't remember what name was used last time I built pfSense on my own).  This is to force the issue that you're not allowed to build "pfSense" and distribute it as such because of trademarks.



  • @kpa:

    It's possible to build the whole thing from the sources (which are complete contrary to the claim) but you have to do some configuration and know what changes what because the defaults are deliberately set so that you're not building "pfSense" but your own version that is named differently (can't remember what name was used last time I built pfSense on my own).  This is to force the issue that you're not allowed to build "pfSense" and distribute it as such because of trademarks.

    Did you make changes from this source code: https://github.com/pfsense ?



  • @iska:

    @kpa:

    It's possible to build the whole thing from the sources (which are complete contrary to the claim) but you have to do some configuration and know what changes what because the defaults are deliberately set so that you're not building "pfSense" but your own version that is named differently (can't remember what name was used last time I built pfSense on my own).  This is to force the issue that you're not allowed to build "pfSense" and distribute it as such because of trademarks.

    Did you make changes from this source code: https://github.com/pfsense ?

    I changed nothing in the source code. You'll need to sign an agreement at https://portal.pfsense.org/members/signup/ICLA to obtain access to the tools repository that is a required part to build pfSense from sources. The customizations you do are supposed to go to a configuration file (I forget the name, builder.conf ?) that the build tools use.



  • @kpa:

    @iska:

    @kpa:

    It's possible to build the whole thing from the sources (which are complete contrary to the claim) but you have to do some configuration and know what changes what because the defaults are deliberately set so that you're not building "pfSense" but your own version that is named differently (can't remember what name was used last time I built pfSense on my own).  This is to force the issue that you're not allowed to build "pfSense" and distribute it as such because of trademarks.

    Did you make changes from this source code: https://github.com/pfsense ?

    I changed nothing in the source code. You'll need to sign an agreement at https://portal.pfsense.org/members/signup/ICLA to obtain access to the tools repository that is a required part to build pfSense from sources. The customizations you do are supposed to go to a configuration file (I forget the name, builder.conf ?) that the build tools use.

    Thank you so much



  • @iska:

    @kpa:

    @iska:

    @kpa:

    It's possible to build the whole thing from the sources (which are complete contrary to the claim) but you have to do some configuration and know what changes what because the defaults are deliberately set so that you're not building "pfSense" but your own version that is named differently (can't remember what name was used last time I built pfSense on my own).  This is to force the issue that you're not allowed to build "pfSense" and distribute it as such because of trademarks.

    Did you make changes from this source code: https://github.com/pfsense ?

    I changed nothing in the source code. You'll need to sign an agreement at https://portal.pfsense.org/members/signup/ICLA to obtain access to the tools repository that is a required part to build pfSense from sources. The customizations you do are supposed to go to a configuration file (I forget the name, builder.conf ?) that the build tools use.

    Thank you so much

    ….and working????



  • @Steve_B:

    I beg to differ.

    Would you care to enlighten me? Tried again. Have the license, cloned the github repo, changed name from "nonSense" to "pfSense", disabled the name check in builder_defaults.sh, started build with "./build.sh iso". The result is that the scripts compile for ~30 minutes, then I get

    Building gnid…
    cd: /root/pfsense/tmp/gnid: No such file or directory

    ####################################
    Something went wrong, check errors!
    ####################################

    NOTE: a lot of times you can run './build.sh --clean-builder' to resolve.

    Log saved on /root/pfsense/logs/installworld.amd64

    Terminated


  • Developer Netgate

    Please use a name other than pfSense. That will cause some of the dependencies to change and that error should go away.

    That's why you got the warning message about the use of pfSense being unsupported.



  • @Steve_B:

    Please use a name other than pfSense. That will cause some of the dependencies to change and that error should go away.

    That's why you got the warning message about the use of pfSense being unsupported.

    Tried that first, but then the scripts cannot even grab the sources. See errors below. I noticed that I cannot event ping release-staging.netgate.com. It seems that there is no IP v4 address. I tried adding ipv6_enable="YES" to my rc.conf, but that does not help. Feedback appreciated.

    Updating nonSense-core repository catalogue…
    pkg: Repository nonSense-core load error: access repo file(/var/db/pkg/repo-nonSense-core.sqlite) failed: No such file or directory
    pkg: http://release-staging.netgate.com/ce/packages/nonSense_master_amd64-core/meta.txz: No route to host
    repository nonSense-core has no meta file, using default settings
    pkg: http://release-staging.netgate.com/ce/packages/nonSense_master_amd64-core/packagesite.txz: No route to host
    Unable to update repository nonSense-core
    Updating nonSense repository catalogue...
    pkg: Repository nonSense load error: access repo file(/var/db/pkg/repo-nonSense.sqlite) failed: No such file or directory
    pkg: http://release-staging.netgate.com/ce/packages/nonSense_master_amd64-nonSense_devel/meta.txz: No route to host
    repository nonSense has no meta file, using default settings
    pkg: http://release-staging.netgate.com/ce/packages/nonSense_master_amd64-nonSense_devel/packagesite.txz: No route to host
    Unable to update repository nonSense
    Updating pfSense-core repository catalogue...
    pkg: Repository pfSense-core load error: access repo file(/var/db/pkg/repo-pfSense-core.sqlite) failed: No such file or directory
    pkg: http://release-staging.netgate.com/ce/packages/pfSense_master_amd64-core/meta.txz: No route to host
    repository pfSense-core has no meta file, using default settings
    pkg: http://release-staging.netgate.com/ce/packages/pfSense_master_amd64-core/packagesite.txz: No route to host
    Unable to update repository pfSense-core
    Updating pfSense repository catalogue...
    pkg: Repository pfSense load error: access repo file(/var/db/pkg/repo-pfSense.sqlite) failed: No such file or directory
    pkg: http://release-staging.netgate.com/ce/packages/pfSense_master_amd64-pfSense_devel/meta.txz: No route to host
    repository pfSense has no meta file, using default settings
    pkg: http://release-staging.netgate.com/ce/packages/pfSense_master_amd64-pfSense_devel/packagesite.txz: No route to host
    Unable to update repository pfSense
    Error updating repositories!

    LOGFILE set to /root/pfsense/logs/buildworld.amd64.
    Thu Jun  8 20:39:36 EDT 2017 - Starting build world for amd64 architecture...
    ====>> ERROR: __MAKE_CONF is pointing to a nonexistent file /root/pfsense/tmp/FreeBSD-src/release/conf/nonSense_make.conf

    ####################################
    Something went wrong, check errors!
    ####################################


  • Developer Netgate Administrator

    You will not be able to reach our internal staging servers, you would need to have your own. The build process is not trivial and we do not offer support for it, but the code is not incomplete, it's all there and it's all we use to build our images. You just need to read the code and figure out what needs to be done.



  • Example :
    @revengineer:

    ====>> ERROR: __MAKE_CONF is pointing to a nonexistent file /root/pfsense/tmp/FreeBSD-src/release/conf/nonSense_make.conf
    ####################################
    Something went wrong, check errors!
    ####################################

    What about : https://github.com/pfsense/FreeBSD-src/tree/devel/release/conf
    Make sure a "yourproductname_make.conf" exists ;)

    PS : I never even tried to rebuild pfSense because its already close to perfect by default.



  • Its certainly possible to build from sources, and you wont need the 'tools repository' for the recent 2.3 / 2.4beta versions.

    I've written a forum post about building 2.2.0 a few years back, and a little wiki page for 2.4 a few months back.. Both used to result in a 'working' pfSense .iso file at the time i wrote them.. (working in regard that it can be installed and webgui comes up.. not much else tested..)
    2.2: https://forum.pfsense.org/index.php?topic=83785.msg470881#msg470881
    2.4: https://github.com/PiBa-NL/PiBa-NL-WIKI/wiki/How-to-building-a-pfSense-.iso-from-sources

    Steps will probably be incomplete at some point especially the 2.4 one, as it was taken from a crappy pile of notes.. But with some imagination / trial&error it should get a developer far enough to make it work without to much time spend.



  • Thank you, I appreciate the responses. I am presently on travel but will give the provided instructions a shot at earliest possibility.


Log in to reply