Steps to recompile kernel for pfsense 2.2.5
-
Hi all. I have see some guides to how to compile pfsense's kernel, but today some things are changes:
1. freebsd from 8.3 to 10.1
2. pfsense toolsI need to recompile the kernel for add support to my Huawei MU609 pci-e 3G modem.
[idVendor=12d1, idProduct=1573]I have got the access to the pfsense-tool repos, but this is now deprecated and the tools are in the public repo; sadly some script are changed and I cant build the kernel.
What i've done:1. Installed FreeBSD 10.1 amd64
2. Downloaded FreeBSD src in /usr/src [ svn checkout http://svn.FreeBSD.org/base/releng/10.1/ /usr/src ]
3. Sigled ICA+LA (useless now, I think)
4. Downloaded pfSense repo [git clone git@github.com:pfsense/pfsense.git]
5. looked for set_version.sh script, but it doesnt exists
6. tried to build kernel with ./build.sh –apply-patches --build-kernels, but this prompt me the correct usage of this commandI was looking this old guide https://forum.pfsense.org/index.php?topic=83062.0
Could someone point me in the right way? I can do a beginners guide next ;) -
Hi I'm still here, trying to build pfsense kernel, here my new tries:
root@freebsd-test:~/pfsense # ./build.sh --build-kernels >>> Operation ./build.sh has started at Wed Dec 9 11:17:55 CET 2015 >>> Obtaining FreeBSD sources devel...Done! >>> Building nonSense kernel. >>> ERROR: Could not find /root/pfsense/tmp/FreeBSD-src/sys/amd64/conf/nonSense #################################### 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/kernel.nonSense.amd64.log >>> Building nonSense kernel. Terminated root@freebsd-test:~/pfsense # cat /root/pfsense/logs/kernel.nonSense.amd64.log >>> Building nonSense kernel.
I see some users that have correctly build pfsense kernel.. could anyone help me? :)
-
Still nothing…
root@freebsd-test:~/pfsense # ./build.sh --build-kernel GENERIC >>> Operation ./build.sh has started at Fri Dec 11 10:34:02 CET 2015 >>> Obtaining FreeBSD sources devel...Done! >>> Building GENERIC kernel. >>> KERNCONFDIR: /root/pfsense/tmp/FreeBSD-src/sys/amd64/conf >>> ARCH: amd64 >>> SRC_CONF: piSense_src.conf >>> Builder is running the command: script -aq /root/pfsense/logs/kernel.GENERIC.amd64.log make -DNO_KERNELCLEAN -j4 SRCCONF=/root/pfsense/tmp/FreeBSD-src/release/conf/piSense_src.conf __MAKE_CONF=/root/pfsense/tmp/FreeBSD-src/release/conf/piSense_make.conf TARGET_ARCH=amd64 TARGET=amd64 buildkernel KERNCONF=GENERIC Something went wrong, check errors! --- buildkernel --- make[1]: "/root/pfsense/tmp/FreeBSD-src/share/mk/bsd.own.mk" line 128: Cannot open /root/pfsense/tmp/FreeBSD-src/release/conf/piSense_src.conf make[2]: "/usr/share/mk/bsd.own.mk" line 128: Cannot open /root/pfsense/tmp/FreeBSD-src/release/conf/piSense_src.conf make[2]: Fatal errors encountered -- cannot continuemake[1]: "/root/pfsense/tmp/FreeBSD-src/Makefile.inc1" line 136: warning: "make -C /root/pfsense/tmp/FreeBSD-src/release -V REVISION" returned non-zero status make[2]: "/usr/share/mk/bsd.own.mk" line 128: Cannot open /root/pfsense/tmp/FreeBSD-src/release/conf/piSense_src.conf make[2]: Fatal errors encountered -- cannot continuemake[1]: "/root/pfsense/tmp/FreeBSD-src/Makefile.inc1" line 137: warning: "make -C /root/pfsense/tmp/FreeBSD-src/release -V BRANCH" returned non-zero status make[1]: Fatal errors encountered -- cannot continue make[1]: stopped in /root/pfsense/tmp/FreeBSD-src *** [buildkernel] Error code 1 make: stopped in /root/pfsense/tmp/FreeBSD-src 1 error make: stopped in /root/pfsense/tmp/FreeBSD-src Terminated
i've edited product in piSense, when i try to put files in
/root/pfsense/tmp/FreeBSD-src/release/conf/ /root/pfsense/tmp/FreeBSD-src/release/pkg_repos/
They are deleted from the next step:
Obtaining FreeBSD sources devel
-
With the pfsense tool I can't build anything… So I've downloaded the freebsd source modified for pfsense and compiled it:
cd /usr git clone git@github.com:pfsense/FreeBSD-src.git cd FreeBSD-src #Switch branch from master to RELENG_2_2 git checkout RELENG_2_2 make buildkernel #it will be used the default GENERIC config that i suppose* is already optimized for pfsense
Trying this kernel, pfsense start and my device is fully recognised.
But.. Is this the common step for build pfSense kernel? If yes, why I have a lot of .ko modules in /boot/kernel? And why at start-up I have no sound from buzzer? Is this a symptom of wrong configured kernel?
Waiting for a reply, regards
*Is this true?EDIT:yes, pfsense start, but the kernel isn't the correct one.. i have the following error:
[ There were error(s) loading the rules: pfctl: /dev/pf: No such file or directory - The line in question reads [0]: ]
States are empty and i have no connectivity.. so the core of pfSense it wasn't build and so this is not how I should compile the kernel…
-
The correct way is to use the build scripts in the RELENG_2_2 branch of the pfsense-tools repository. The instructions thread will likely help, though note that access to the pfsense-tools repository is now granted on github using the github user name you provided on the portal.
There is no way to build a working pfSense 2.2 kernel without pfsense-tools, as the kernel patches are contained in this repository. I know this repository is deprecated, but this deprecation only applies from pfSense 2.3 (still not yet beta) onwards.
Your build environment needs to be FreeBSD 10.1 of the appropriate architecture (amd64 or i386).