Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    How to Build pfSense 2.3?

    Scheduled Pinned Locked Moved Development
    21 Posts 12 Posters 13.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      Iggy Houdini
      last edited by

      I am also new here and would appreciate if someone could provide an updated guide to building pfsense.

      1 Reply Last reply Reply Quote 0
      • S
        simontkk
        last edited by

        Its very easy to build.

        1. Setup FreeBsd-10.3
        2. git build tools from https://github.com/pfsense
        3. under build folder execute this command " ./build.sh iso "

        Regards,
        SIMON T.

        1 Reply Last reply Reply Quote 0
        • I
          Iggy Houdini
          last edited by

          Thanks for the help Simon, but it doesn't work for me. I'll list down what I try to do and someone can tell me where I go wrong.

          When I run build.sh iso I recieve the message "It was not possible to find pkg conf template [my pfsense repo]/tmp/FreeBSD-src/release/pkg_repos/nonSense-repo.conf".

          It seems like this is because the freeBSD-src repo has "pfSense-repo.conf" in that location instead, so I can either set the build configuration to look for the file that exists, or create the file it is looking for.

          So, I create a "build.conf" from "build.conf.sample" and change the "PRODUCT_NAME" to "pfSense" and the build fails because of copyright.

          So instead, I try to add the file it is looking for, but the build system reverts to an earlier commit every time I do this, so I need to make the changes, commit them and then set pfsense to use that commit instead. This would require me to fork the pfsense/FreeBSD-src repo, and now I feel like I have made a mistake somewhere along the way.

          I cloned the repo and added a nonSense.conf to have the same contents as my installed pfsense (having the same contents as the pfsense repo didn't work) and i managed to get to buildworld and installworld stages before it started looking for "[my pfsense repo]/tmp/FreeBSD-src/sys/amd64/conf/nonSense" which wasnt there. I think I'm going to add that as well.

          1 Reply Last reply Reply Quote 0
          • S
            simontkk
            last edited by

            Hi Iggy,

            You may need look into builder_default.sh.
            Try to look for "nonSense", change "nonSense" into "pfSense".

            If it`s still not working, you may email me via simontkk2005@gmail.com

            Thank you.

            1 Reply Last reply Reply Quote 0
            • S
              susaa
              last edited by

              Hi,

              RELENG_2_4 is still there?

              While executing "./build.sh iso" i am getting this "Remote branch RELENG_2_4 not found in upstream origin" error.

              Is there any workaround for this?

              Thanks in advance.

              1 Reply Last reply Reply Quote 0
              • S
                susaa
                last edited by

                Hi Iggy,

                I am facing the same issue. Did find a workaround for the problem yet?!

                Thanks

                1 Reply Last reply Reply Quote 0
                • J
                  jwt Netgate
                  last edited by

                  @simontkk:

                  Hi Iggy,

                  You may need look into builder_default.sh.
                  Try to look for "nonSense", change "nonSense" into "pfSense".

                  If it`s still not working, you may email me via simontkk2005@gmail.com

                  Thank you.

                  Trademark violation right there.  Don't do it, or gonzo will have your ass. :-)

                  1 Reply Last reply Reply Quote 0
                  • K
                    kpa
                    last edited by

                    @jwt:

                    @simontkk:

                    Hi Iggy,

                    You may need look into builder_default.sh.
                    Try to look for "nonSense", change "nonSense" into "pfSense".

                    If it`s still not working, you may email me via simontkk2005@gmail.com

                    Thank you.

                    Trademark violation right there.  Don't do it, or gonzo will have your ass. :-)

                    You can build pfSense yourself for testing/development purposes but don't try to publish any of your own modifications/fork under the name "pfSense", that will get you in trouble.

                    1 Reply Last reply Reply Quote 0
                    • P
                      phil.davis
                      last edited by

                      Don't publish even an "exact" build of just the existing code. Both for legal reasons, and security, people should be getting the official tested pfSense builds with checksums/signatures from the official download site.
                      If you publish anything, then you have to do proper rebadging to ensure you do not claim, or appear to claim, it is "pfSense".

                      As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                      If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

                      1 Reply Last reply Reply Quote 0
                      • S
                        susaa
                        last edited by

                        @kpa:

                        @jwt:

                        @simontkk:

                        Hi Iggy,

                        You may need look into builder_default.sh.
                        Try to look for "nonSense", change "nonSense" into "pfSense".

                        If it`s still not working, you may email me via simontkk2005@gmail.com

                        Thank you.

                        Trademark violation right there.  Don't do it, or gonzo will have your ass. :-)

                        You can build pfSense yourself for testing/development purposes but don't try to publish any of your own modifications/fork under the name "pfSense", that will get you in trouble.

                        I am trying to build pfSense for development purposes.

                        For the trademark violation reasons, I am rebranding it with say "MypfSense". I am doing it like, export PRODUCT_NAME=MypfSense in build.conf, which is the right way.

                        But the problem here is, I find ${PRODUCT_NAME} being used hundreds of times inside the code, for updating repositories and stuff. Is it okay to replace them with pfSense?! Is that the proper way of rebranding it?

                        1 Reply Last reply Reply Quote 0
                        • S
                          susaa
                          last edited by

                          Is there any kind of documentation or standard steps to be followed for building a clean pfSense .iso from the available pfSense sources?!

                          There are clear replies for "What and what not violates the copyright". But if there are proper steps defined to build it, it would be much easier.

                          I have spent like 4 weeks on this and it's doesn't get any better.

                          Thanks.

                          1 Reply Last reply Reply Quote 0
                          • ?
                            Guest
                            last edited by

                            This is what I've done so far … but I still can't build from source yet ...

                            1. Forked GitHub repos, pfsense, FreeBSD-src and FreeBSD-ports

                            2. Setup Vagrant to spin up a VirtualBox VM based on config.vm.box = "freebsd/FreeBSD-10.3-RELEASE" (see below)

                            3. The VirtualBox VM is configured to share the GitHub pfsense repo folder (see below)

                            4. Running (cd /var/pfsense) ./build.sh iso without modification results in the first issue,
                            “It was not possible to find pkg conf template /var/jssapplianceos/tmp/FreeBSD-src/release/pkg_repos/nonSense-repo.conf”

                            5. Just to see if the build process with work (for testing) using Product Name = pfSense… results in “>>>ERROR: According the following license, only Electric Sheep Fencing can build genuine pfSense® software...”

                            6. Back to Product Name = nonSense; copied
                            pfSense-repo.conf to nonSense-repo.conf ;
                            pfSense-repo.descr to nonSense-repo.descr;
                            pfSense-repo-devel.conf to nonSense-repo-devel.conf;
                            pfSense-repo-devel.descr to nonSense-repo-devel.descr
                            and commit new files to Git FreeBSD-src repo

                            7. ./build.sh iso results in
                            “Updating nonSense-core repository catalogue...
                            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: http://release-staging.netgate.com/ce/packages/nonSense_master_amd64-nonSense_master/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_master/packagesite.txz: No route to host
                            Unable to update repository nonSense
                            All repositories are up-to-date.
                            pkg: Repository nonSense-core cannot be opened. 'pkg update' required
                            pkg: Repository nonSense cannot be opened. 'pkg update' required
                            pkg: No packages available to install matching 'nonSense-builder' have been found in the repositories

                            ====>> ERROR: __MAKE_CONF is pointing to a nonexistent file /var/jssapplianceos/tmp/FreeBSD-src/release/conf/nonSense_make.conf”

                            8.  http://release-staging.netgate.com/ce/packages/nonSense_master_amd64-core/meta.txz  etc. I’m assuming do not exists, since nonSense is not a “valid” product name.  I could change the build.conf value “export PKG_REPO_SERVER_STAGING” to a valid URL (something I have access to), but I’m not sure how to get the proper content, ie packages.

                            9. Copied:
                            pfSense_src.conf to nonSense_src.conf
                            pfSense_make.conf to nonSense_make.conf
                            and commit new files to Git FreeBSD-src repo

                            10. ./build.iso results on
                            The same Package errors as above, plus:

                            “====>> ERROR: SRC_ENV_CONF is pointing to a nonexistent file /var/jssapplianceos/tmp/FreeBSD-src/release/conf/nonSense_src-env.conf”

                            11. I can’t find a  pfSense_src-env.conf to copy …

                            Any help or suggestion would be appreciated… Thanks

                            ** Running pfSense build via a VirtualBox VM using Vagrant I use “sudo -E -s” so the ssh agent forwarding would work, to allow access to GitHub via my SSH Key.

                            sudo -E -s

                            cd /var/pfsense

                            ./build.sh iso

                            ** Vagrant File
                            Vagrant.configure(2) do |config|
                              config.vm.guest = :freebsd
                              config.vm.box = "freebsd/FreeBSD-10.3-RELEASE"
                              config.ssh.shell = "sh"
                              config.ssh.forward_agent = true
                              config.vm.base_mac = "080027D14C66"
                              config.vm.network "private_network", ip: "192.168.33.10"

                            config.vm.synced_folder ".", "/vagrant", :nfs => true, id: "vagrant-root", disabled: false

                            config.vm.synced_folder "./github/pfsense", "/var/pfsense", :nfs => true, id: "pfsense-root", disabled: false

                            config.vm.provider "virtualbox" do |vb|
                                vb.name = "pfSense FreeBSD-10.3"
                                vb.customize ["modifyvm", :id, "–memory", "2048"]
                                vb.customize ["modifyvm", :id, "–cpus", "2"]
                                vb.customize ["modifyvm", :id, "–hwvirtex", "on"]
                                vb.customize ["modifyvm", :id, "–audio", "none"]
                                vb.customize ["modifyvm", :id, "–nictype1", "virtio"]
                                vb.customize ["modifyvm", :id, "–nictype2", "virtio"]
                              end

                            config.vm.provision "shell" do |s|
                                s.inline = <<-SHELL
                                  pkg install –yes git
                                SHELL
                              end
                            end

                            1 Reply Last reply Reply Quote 0
                            • S
                              susaa
                              last edited by

                              Hi malber-jss,

                              The netgate URL's don't exist. Instead, you can refer https://forum.pfsense.org/index.php?topic=109690.0 for proceeding further.

                              1 Reply Last reply Reply Quote 0
                              • M
                                mitra7
                                last edited by

                                Any updates about this subject?
                                I would like to build a custom PFSense for personal use but it seems that there's no documentation about how to do it.
                                I've tried a lot of things, different branches and so on, I always get a lot of issues in the process.

                                1 Reply Last reply Reply Quote 0
                                • R
                                  revengineer
                                  last edited by

                                  The only way I found to compile pfSense is to comment out the name check in tools/builder_defaults.sh. This is not ideal but I assume since the compiled version is solely for myself that I am ok here.

                                  UPDATE: After 40 minutes of compiling, the build routine stopped with error "Installing built ports (packages) in chroot (/root/pfsense/tmp/stage-dir)… Failed!". :(

                                  I suggest a book section for developers and/or a hangout on the subject.

                                  1 Reply Last reply Reply Quote 0
                                  • luckman212L
                                    luckman212 LAYER 8
                                    last edited by

                                    Has anyone had further success building from source? Add me to the list of people who would like to be able to do this.

                                    1 Reply Last reply Reply Quote 0
                                    • C
                                      chrcoluk
                                      last edited by

                                      I followed the detailed post above, its on the right path but the build script is clearly designed with obstacles.

                                      So if rename to pfSense it blocks the build.

                                      So then try to rename appropriate files from pfSense to nonSense since they dont distribute with that name

                                      in addition it tries to fetch packages from dead netgate url's.

                                      The showstopper is when renaming the 3 files in here to nonSense

                                      pfsense # ls /root/work/pfsense/pfsense/tmp/FreeBSD-src/release/conf/
                                      pfSense_make.conf          ufw_installer_make.conf    ufw_recover_make.conf
                                      pfSense_src-env.conf      ufw_installer_src-env.conf ufw_recover_src-env.conf
                                      pfSense_src.conf          ufw_installer_src.conf    ufw_recover_src.conf

                                      Then running build.sh again, the build script itself renames them back to pfSense and then complains it cannot find the nonSense files, so its sabotaging itself.

                                      I blocked the script doing the sabotage by making the filles immune (root cannot even write/delete)

                                      chflags schg nonSense_*

                                      But now hitting repo clone errors.

                                      Since I only need to compile a custom kernel I might just try to compile the kernel in the traditional FreeBSD way, as I am only oing this to get a patched kernel to fix a nasty panic bug.

                                      pfSense CE 2.8.0

                                      1 Reply Last reply Reply Quote 0
                                      • First post
                                        Last post
                                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.