Augustin-FL / building-pfsense-iso-from-source

How to: Building a pfSense .iso from sources

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building iso file from pfsense source code

Getachew0557 opened this issue · comments

Hello Everyone, First I Have installed FreeBSD 13.2 on my desktop via VMware.
Step1:
I have cloned the three files;
- FreeBSD kerner source,
- FreeBSD ports
- pfSense GUI

Step2:

Then some configuration files were renamed

  1. FreeBSD source code

In the folder /release/conf/, rename pfSense_src-env.conf, pfSense_src.conf and pfSense_make.conf to libreSense_src-env.conf, libreSense_src.conf and libreSense_make.conf
Rename the file /sys/amd64/conf/pfSense to /sys/amd64/conf/libreSense

  1. FreeBSD ports

in the file /security/pfSense/Makefile : there is no wireguard-tools>=0:security/wireguard-tools on the RUN_DEPENDS variable

  1. pfsense source code

Go to the folder /tools/templates/pkg_repos/ in the branch you would like to build (masterfor dev version, RELENG_2_5_0 for stable version) and change pfSense to libreSense in the file names (e.g., pfSense-repo.abi => libreSense-repo.abi)
Edit the file /src/etc/inc/globals.inc : replace the content of product_name by libreSense, and the content of pkg_prefix by libreSense-pkg-.
In the folder /src/usr/local/share/, rename the folder pfSense to libreSense.
In the folder /src/etc/, rename the files pfSense-ddb.conf and pfSense-devd.conf to libreSense-ddb.conf and libreSense-devd.conf.
Edit the file /tools/builder_defaults.sh : remove if_wg from the MODULES_OVERRIDE variable.

Step3: Build the pfsense source code

Unix@Unix:~/Downloads/pfsense_source/pfsense $ sudo ./build.sh iso

Operation ./build.sh has started at Thu Aug 10 14:24:02 EAT 2023
Building image type(s): iso
Cleaning up previous build environment...Please wait!
Cleaning build directories: Done!
Cleaning previously built kernel stage area...Done!
Cleaning previously built images...Done!
Cleaning previous builder logs...Done!
Cleaning of builder environment has finished.
Obtaining FreeBSD sources (devel-12)...
====>> Removing local changes from git repo https://github.com/pfsense/freebsd-src.git (devel-12)
====>> Removing leftovers from git repo https://github.com/pfsense/freebsd-src.git (devel-12)
====>> Retrieving updates from git repo https://github.com/pfsense/freebsd-src.git (devel-12)
====>> Updating git repo https://github.com/pfsense/freebsd-src.git (devel-12)
====>> Rebasing git repo https://github.com/pfsense/freebsd-src.git (devel-12)
Last known to commit Kristof Provost - d9601d99bbeb1d941484d777d8d3fbe1839a2faa
Missing dependency (sys-utils/screen).

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

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

Terminated

As the name suggests, devel-12 contains the source code of freebsd 12. (pfsense 5.x was using freebsd 12)

Please retry using devel-main instead

Also, it is normal if wireguard-tools/if_wg are missing/already removed. wireguard-tools has been removed after pfsense 5.x

Can I close this issue?

I have used another version of source code for FreeBSD-kernel, pfsense, and FreeBSD-ports with the version of RELENG_2_5_0 (The version of each source code was 2.5.0). FreeBSD 12.4 operating system has been used for the building process, but still, we get the following bugs."

Unix@Unix :/pfsense/pfsense $ sudo build. sh iso
Password:
sudo: build. sh: command not found
Unix@Unix :
/pfsense/pfsense $ sudo bash build. sh iso

Operation build.sh has started at Thu Sep 7 15:55:14 EAT 2023
Building image type (s) : iso
Cleaning up previous build environment. . .Please wait!
Cleaning build directories: Done!
Cleaning previously built images. . .Done!
Cleaning previous builder logs...Done!
Cleaning of builder environment has finished.
Obtaining FreeBSD sources (RELENG _2_5_0)...
====)> Cloning git repository https://github. com/pfsense/freebsd-src . git (RELENG_2_5_0)
Last known commit Renato Botelho do Couto- 23f7faObd454b6ad7ca5c 5640cebbf2523353 513
Missing dependency (net/rsync).
Something went wrong, check errors!
NOTE: a lot of times you can run './build . sh --clean-builder' to resolve.
Terminated
Unix@Unix;~/pfsense/pfsense $

but still I have installed the dependency "rsync, but It does not solved.

Anyone can help me with the building process by fixing the bug.