Netgate SG-1000 microFirewall

Author Topic: How to Build pfSense 2.3?  (Read 8648 times)

0 Members and 1 Guest are viewing this topic.

malber-jss

  • Guest
Re: How to Build pfSense 2.3?
« Reply #15 on: September 04, 2016, 04:43:23 pm »
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

Offline susaa

  • Newbie
  • *
  • Posts: 5
  • Karma: +1/-0
    • View Profile
Re: How to Build pfSense 2.3?
« Reply #16 on: September 07, 2016, 01:39:14 am »
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.

Offline mitra7

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: How to Build pfSense 2.3?
« Reply #17 on: December 10, 2016, 04:30:15 pm »
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.

Offline revengineer

  • Jr. Member
  • **
  • Posts: 64
  • Karma: +4/-0
    • View Profile
Re: How to Build pfSense 2.3?
« Reply #18 on: January 28, 2017, 07:15:24 am »
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.
« Last Edit: January 28, 2017, 08:10:15 am by revengineer »

Offline luckman212

  • Hero Member
  • *****
  • Posts: 726
  • Karma: +59/-0
    • View Profile
    • @luckman212 - github
Re: How to Build pfSense 2.3?
« Reply #19 on: March 05, 2017, 04:02:44 pm »
Has anyone had further success building from source? Add me to the list of people who would like to be able to do this.

Offline chrcoluk

  • Sr. Member
  • ****
  • Posts: 387
  • Karma: +20/-50
    • View Profile
Re: How to Build pfSense 2.3?
« Reply #20 on: June 08, 2017, 11:36:25 am »
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.
« Last Edit: June 08, 2017, 11:39:35 am by chrcoluk »
pfSense 2.4
Qotom Q355G4 or Braswell N3150 with Jetway mini pcie 2x intel i350 lan - 4 gig Kingston 1333 C11 DDR3L
 - 60 gig kingston ssdnow ssd - ISP Sky UK