2.2 build help



  • hello, I tried to build the pfSense v2.2.3 on FreeBSD FBSD101 10.1-RELEASE FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 21:02:49 UTC 2014 but after execute ./set_version.sh RELENG_2_2 https://github.com/freebsd/freebsd.git I got error:

    Finding fastest CVSUp host… Please wait...
    -=(oooooooooooooooooo)=(cvsup18.freebsd.org)=-
    **  No servers were found :(

    Removing needed files listed in patches.RELENG_2_0 RELENG_2_0
    Obtaining FreeBSD sources RELENG_8_1-supfile…Done!
    Removing old patch rejects...
    Applying patches from /home/pfsense/tools/builder_scripts/../builder_scripts/patches.RELENG_2_0 please wait...Done!
    Finding patch rejects…

    WARNING!  Rejected patches found!  Please fix before building!

    /usr/pfSensesrc/src/sys/ip_carp.c.rej
    /usr/pfSensesrc/src/sys/sys/modules/Makefile.rej
    /usr/pfSensesrc/src/sys/sys/proc.h.rej
    /usr/pfSensesrc/src/files.rej
    /usr/pfSensesrc/src/pf.c.rej
    /usr/pfSensesrc/src/pfvar.h.rej
    /usr/pfSensesrc/src/Makefile.rej
    /usr/pfSensesrc/src/if.c.rej

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



  • Why not try to build 2.3 or better yet 2.4 ? If your going to develop/customize something probably best to do so against latest versions.?

    p.s. I have not tried to build either one..



  • Thank you so much for your reply…

    I registered to ICLA & submit my SSH-2 RSA public key and now I have full access to github repo but I can't clone :(

    git clone git@git.pfsense.org:pfsense-tools tools
    Cloning into 'tools'...
    ssh: Could not resolve hostname git.pfsense.org: hostname nor servname provided, or not known
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights and the repository exists.



  • The pfsense-tools are on github: git@github.com:pfsense/pfsense-tools.git There is no need to clone from git.pfsense.org. You do need to be made a member of the github 'pfsense organization' group that has access to that repository. But that used to be automated after signing the CLA & ICLA agreements. Should get a email about that from github i think. Not sure anymore, its been 2 years since i went through that process..



  • So I fixed some issues but can't build :(

    Because I want to build version 2.2.3:

    –>Clone pfsense repo
    git clone -b RELENG_2_2_3 git@github.com:pfsense/pfsense.git /home/pfsense

    –>Clone pfsense-tools repo
    git clone -b RELENG_2_2_3 git@github.com:pfsense/pfsense-tools.git /home/pfsense/tools

    and replace all git.pfmechanics.com with described addresses.

    Checkout Freesbie2
    git clone git://github.com/pfsense/freesbie2.git freesbie2

    cd /home/pfsense/tools/builder_scripts
    ./set_version.sh RELENG_2_2_3 https://github.com/freebsd/freebsd.git
    scripts/get_bsdinstaller.sh
    scripts/rebuild_bsdinstaller.sh

    ./build.sh –build-pfPorts --no-cleanrepos

    root@FBSD101PR:/home/pfsense/tools/builder_scripts # ./build.sh --build-pfPorts --no-cleanrepos

    Operation ./build.sh has started at Wed Sep 21 08:06:28 UTC 2016
    --> Preparing for pfPorts build buildports.RELENG_2_2

    Obtaining FreeBSD sources releng/10.1... Done!
    Removing files listed for FreeBSD version: 10 file-name: /home/pfsense/tools/builder_scripts/conf/patchlist/releng/10.1/patches
    Applying patches from /home/pfsense/tools/builder_scripts/conf/patchlist/releng/10.1/patches please wait…
    1 out of 1 hunks failed--saving rejects to sys/netinet6/ip6_output.c.rej
    1 out of 2 hunks failed--saving rejects to sys/netpfil/pf/pf_ioctl.c.rej failed to apply pf_reply-to.enahnce.diff
    1 out of 1 hunks failed--saving rejects to sys/modules/ixgbe/Makefile.rej
    1 out of 1 hunks failed--saving rejects to sys/conf/files.rej failed to apply ixgbe-x552.diff
    Done!

    Finding patch rejects...

    WARNING!  Rejected patches found!  Please fix before building!

    /usr/pfSensesrc/src/sys/conf/files.rej
    /usr/pfSensesrc/src/sys/modules/ixgbe/Makefile.rej
    /usr/pfSensesrc/src/sys/netinet6/ip6_output.c.rej
    /usr/pfSensesrc/src/sys/netpfil/pf/pf_ioctl.c.rej

    What is wrong???

    Please help me, it seem I'm last stage to build success. thank you!



  • There are a few things to try..

    -try and run without preventing the cleaning repositories? (remove the  –no-cleanrepos parameter )

    -start over from a new fresh FreeBSD install.. (yes takes a lot of time, but helped me back in the day resolve various issues..)

    -Check why the patches fail to apply..
    There might be a mismatch between the code those patches want to change and what got checked out in the sources folders.
    So open te patch look what it tries to change and what the original line should look like, then find the corresponding source file and see if that is perhaps 'to new', due to changes taking place in freebsd after the patches were written..
    Then if you find the freebsd sources are different than expected by the patch check why that might be, perhaps a specific tag should be checked oht instead of only the branche.. Then change buildscripts to include those..

    Thats about all i can tell without going to try and build it myself.. Hope it helps.



  • I managed many issues  :D but I get error on building stage 4.4: building everthing :-\

    –- pf.o ---
    /usr/pfSensesrc/src.RELENG_2_2/sys/netpfil/pf/pf.c:417:34: error: too few arguments to function call, expected 9, have 8
                                    nk->port[pd->sidx], 0, pd->af);
                                                                ^
    /usr/pfSensesrc/src.RELENG_2_2/sys/netpfil/pf/pf.c:211:1: note: 'pf_change_ap' declared here
    static void              pf_change_ap(struct mbuf *, struct pf_addr *, u_int16_t *,
    ^
    /usr/pfSensesrc/src.RELENG_2_2/sys/netpfil/pf/pf.c:421:34: error: too few arguments to function call, expected 9, have 8
                                    nk->port[pd->didx], 0, pd->af);
                                                                ^
    /usr/pfSensesrc/src.RELENG_2_2/sys/netpfil/pf/pf.c:211:1: note: 'pf_change_ap' declared here
    static void              pf_change_ap(struct mbuf *, struct pf_addr *, u_int16_t *,
    ^
    /usr/pfSensesrc/src.RELENG_2_2/sys/netpfil/pf/pf.c:432:34: error: too few arguments to function call, expected 9, have 8
                                    nk->port[pd->sidx], 1, pd->af);
                                                                ^
    /usr/pfSensesrc/src.RELENG_2_2/sys/netpfil/pf/pf.c:211:1: note: 'pf_change_ap' declared here
    static void              pf_change_ap(struct mbuf *, struct pf_addr *, u_int16_t *,
    ^
    /usr/pfSensesrc/src.RELENG_2_2/sys/netpfil/pf/pf.c:436:34: error: too few arguments to function call, expected 9, have 8
                                    nk->port[pd->didx], 1, pd->af);
                                                                ^
    /usr/pfSensesrc/src.RELENG_2_2/sys/netpfil/pf/pf.c:211:1: note: 'pf_change_ap' declared here
    static void              pf_change_ap(struct mbuf *, struct pf_addr *, u_int16_t *,
    ^
    /usr/pfSensesrc/src.RELENG_2_2/sys/netpfil/pf/pf.c:494:34: error: too few arguments to function call, expected 9, have 8
                                    nk->port[pd->sidx], 0, pd->af);
                                                                ^
    /usr/pfSensesrc/src.RELENG_2_2/sys/netpfil/pf/pf.c:211:1: note: 'pf_change_ap' declared here
    –- mp_machdep.o ---
    --- pf.o ---
    static void              pf_change_ap(struct mbuf *, struct pf_addr *, u_int16_t *,
    ^
    /usr/pfSensesrc/src.RELENG_2_2/sys/netpfil/pf/pf.c:498:34: error: too few arguments to function call, expected 9, have 8
                                    nk->port[pd->didx], 0, pd->af);
                                                                ^
    /usr/pfSensesrc/src.RELENG_2_2/sys/netpfil/pf/pf.c:211:1: note: 'pf_change_ap' declared here
    static void              pf_change_ap(struct mbuf *, struct pf_addr *, u_int16_t *,
    ^
    /usr/pfSensesrc/src.RELENG_2_2/sys/netpfil/pf/pf.c:509:34: error: too few arguments to function call, expected 9, have 8
                                    nk->port[pd->sidx], 1, pd->af);
                                                                ^
    /usr/pfSensesrc/src.RELENG_2_2/sys/netpfil/pf/pf.c:211:1: note: 'pf_change_ap' declared here
    static void              pf_change_ap(struct mbuf *, struct pf_addr *, u_int16_t *,
    ^
    /usr/pfSensesrc/src.RELENG_2_2/sys/netpfil/pf/pf.c:513:34: error: too few arguments to function call, expected 9, have 8
                                    nk->port[pd->didx], 1, pd->af);
                                                                ^
    /usr/pfSensesrc/src.RELENG_2_2/sys/netpfil/pf/pf.c:211:1: note: 'pf_change_ap' declared here
    static void              pf_change_ap(struct mbuf *, struct pf_addr *, u_int16_t *,
    ^
    –- mp_machdep.o ---
    cc  -c -O2 -pipe -fno-strict-aliasing  -std=c99  -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs -fdiagnostics-show-option  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality -Wno-error-unused-function  -nostdinc  -I. -I/usr/pfSensesrc/src.RELENG_2_2/sys -I/usr/pfSensesrc/src.RELENG_2_2/sys/contrib/altq -I/usr/pfSensesrc/src.RELENG_2_2/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror  /usr/pfSensesrc/src.RELENG_2_2/sys/amd64/amd64/mp_machdep.c
    --- pmap.o ---
    cc  -c -O2 -pipe -fno-strict-aliasing  -std=c99  -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs -fdiagnostics-show-option  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality -Wno-error-unused-function  -nostdinc  -I. -I/usr/pfSensesrc/src.RELENG_2_2/sys -I/usr/pfSensesrc/src.RELENG_2_2/sys/contrib/altq -I/usr/pfSensesrc/src.RELENG_2_2/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror  /usr/pfSensesrc/src.RELENG_2_2/sys/amd64/amd64/pmap.c
    --- trap.o ---
    cc  -c -O2 -pipe -fno-strict-aliasing  -std=c99  -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs -fdiagnostics-show-option  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality -Wno-error-unused-function  -nostdinc  -I. -I/usr/pfSensesrc/src.RELENG_2_2/sys -I/usr/pfSensesrc/src.RELENG_2_2/sys/contrib/altq -I/usr/pfSensesrc/src.RELENG_2_2/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror  /usr/pfSensesrc/src.RELENG_2_2/sys/amd64/amd64/trap.c
    --- pf.o ---
    8 errors generated.
    *** [pf.o] Error code 1

    make[2]: stopped in /usr/obj.RELENG_2_2.amd64/usr/pfSensesrc/src.RELENG_2_2/sys/pfSense_SMP.10
    1 error

    make[2]: stopped in /usr/obj.RELENG_2_2.amd64/usr/pfSensesrc/src.RELENG_2_2/sys/pfSense_SMP.10
    *** [buildkernel] Error code 2

    make[1]: stopped in /usr/pfSensesrc/src.RELENG_2_2
    1 error

    make[1]: stopped in /usr/pfSensesrc/src.RELENG_2_2
    *** [buildkernel] Error code 2

    make: stopped in /usr/pfSensesrc/src.RELENG_2_2
    1 error

    make: stopped in /usr/pfSensesrc/src.RELENG_2_2

    Help me please!



  • As you can find the FreeBSD source changed on 14 January 2016 and the pf_change_ap got a new extra mbuf parameter:

     -static void		 pf_change_ap(struct pf_addr *, u_int16_t *,
     +static void		 pf_change_ap(struct mbuf *, struct pf_addr *, u_int16_t *,
    

    Source: https://github.com/freebsd/freebsd/commit/5af8834e70ae2dde58ee682e1a3e9c6998d9a683#diff-4f594011be0477d0b5f594cd00a64245

    Likely one of the patches / sources that build pfSense 2.2 did not take that into account.
    So either make sure to checkout the freebsd sources from before that time, or change the patches / code written for pfSense to adapt to these changes and pass the mbuf parameter where needed.

    Find it interesting though, why spend so all this time on a nolonger maintained version.?



  • Thanks a lot…

    But I have new issue for build "pfSense.so" php extension!

    After build iso (2.2.3-RELEASE), the php -v is same as official .iso release BUT php -m does not contain "pfSense.so" php extension also find entire system (find / -name "pfSense.so") does not found it! :(

    also inside official .iso file apc php extension version is: APC-3.1.15-dev but it does not exist in my build and by this note: https://www.freshports.org/www/pecl-APC/**  No longer maintained upstream, and not working with PHP > 5.4**

    How can I build "pfSense.so" & "apc.so" php extensions?! :-*



  • Your building 2.2.3 right?, i guess you might still be using the wrong sources in some places..

    Not the 2_2 branche but the 2_2_3 'tag' seems to have the pecl-APC your looking for which is patched for php 5.5 :
      https://github.com/pfsense/pfsense-tools/tree/RELENG_2_2_3/pfPorts/www/pecl-APC

    As for pfSense.so i think it should come from here:
      https://github.com/pfsense/pfsense-tools/tree/RELENG_2_2_3/pfPorts/devel/php55-pfSense-module

    Now how to get it all to build properly.. I think that should happen 'automatically' when calling the build script. Though i'm not sure i checked for versions and presence of particular modules in 2014. All i probably cared about was why my ipsec connection didnt work.. And digging through code got me the answer.. Upstream improvement introduced a incompatibility with some other ipsec platform implementations, which they later fixed..



  • Thank you for reply…

    I use 2.2.3 repo and the path /home/pfsense/tools/pfPorts/www/pecl-APC is exist, my make try result:

    root@FBSD101X64:/home/pfsense/tools/pfPorts/www/pecl-APC # make
    ===>  License PHP301 accepted by the user
    ===>  Found saved configuration for pecl-APC-3.1.14_1
    ===>  pecl-APC-3.1.14_1 depends on file: /usr/local/sbin/pkg - found
    ===>  Fetching all distfiles required by pecl-APC-3.1.14_1 for building
    ===>  Extracting for pecl-APC-3.1.14_1
    ===>  SHA256 Checksum OK for PECL/APC-3.1.13.tgz.
    ===>  Patching for pecl-APC-3.1.14_1
    ===>  Applying extra patch /home/pfsense/tools/pfPorts/www/pecl-APC/files/extra-patch-fix-build-55
    ===>  Configuring for pecl-APC-3.1.14_1
    ===>  Building for pecl-APC-3.1.14_1
    make[2]: cannot open Makefile.

    make[2]: stopped in /home/pfsense/tools/pfPorts/www/pecl-APC/work/APC-3.1.13
    ===> Compilation failed unexpectedly.
    Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
    the maintainer.
    *** Error code 1
    Stop.
    make[1]: stopped in /home/pfsense/tools/pfPorts/www/pecl-APC
    *** Error code 1
    Stop.
    make: stopped in /home/pfsense/tools/pfPorts/www/pecl-APC

    Next try with option MAKE_JOBS_UNSAFE=yes
    root@FBSD101X64:/home/pfsense/tools/pfPorts/www/pecl-APC # make MAKE_JOBS_UNSAFE=yes install
    ===>  Building for pecl-APC-3.1.14_1
    make[2]: cannot open Makefile.

    make[2]: stopped in /home/pfsense/tools/pfPorts/www/pecl-APC/work/APC-3.1.13
    *** Error code 1
    Stop.
    make[1]: stopped in /home/pfsense/tools/pfPorts/www/pecl-APC
    *** Error code 1
    Stop.
    make: stopped in /home/pfsense/tools/pfPorts/www/pecl-APC

    root@FBSD101X64:/home/pfsense/tools/pfPorts/devel/php55-pfSense-module # make

    mkdir -p /home/pfsense/tools/pfPorts/devel/php55-pfSense-module/work/pfSense-0.1
    cp -r files/* /home/pfsense/tools/pfPorts/devel/php55-pfSense-module/work/pfSense-0.1
    ===>  Patching for php55-pfSense-module-0.1_2
    ===>  Configuring for php55-pfSense-module-0.1_2
    ===>  Building for php55-pfSense-module-0.1_2
    make[1]: cannot open Makefile.

    make[1]: stopped in /home/pfsense/tools/pfPorts/devel/php55-pfSense-module/work/pfSense-0.1
    ===> Compilation failed unexpectedly.
    Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
    the maintainer.
    *** Error code 1
    Stop.
    make: stopped in /home/pfsense/tools/pfPorts/devel/php55-pfSense-module
    Next try with option MAKE_JOBS_UNSAFE=yes

    root@FBSD101X64:/home/pfsense/tools/pfPorts/devel/php55-pfSense-module # make MAKE_JOBS_UNSAFE=yes
    ===>  Building for php55-pfSense-module-0.1_2
    make[1]: cannot open Makefile.

    make[1]: stopped in /home/pfsense/tools/pfPorts/devel/php55-pfSense-module/work/pfSense-0.1
    *** Error code 1
    Stop.
    make: stopped in /home/pfsense/tools/pfPorts/devel/php55-pfSense-module
    root@FBSD101X64:/home/pfsense/tools/pfPorts/devel/php55-pfSense-module #

    Can you help me please?!


Log in to reply