Php52-pfSense-module build error

  • Hi everyone,

    I'm hoping someone can give me some pointers on how to fix this.

    I've just installed a new FreeBSD 8.1 build system for building 2.0, and I'm running into one issue/error with the build that I can't seem to fix or find anything else about.  The pfPorts php52-pfSense-module will not build.  It encounters an error about NGM_ETHER_ATTACH being undefined.  When I search the netgraph information, I can find the associated NGM_ETHER_DETACH, but it appears there is no NGM_ETHER_ATTACH message truly defined for the NgSendMsg call.

    The error is happening on line 739 of pfSense.c in this module.

    Am I missing something in my build environment, or is there a recent change that has broken this module?

    I was going to try to fix it myself and submit a patch, but I'm not exactly sure what to change since I'm unfamiliar with netgraph.  Any pointers would be helpful, or if someone else knows exactly what to do to fix it that would be great too.


  • Rebel Alliance Developer Netgate

    There are some netgraph patches that need to be on the base system, iirc, before it will work right.

  • Hi all,

    I encountered the same error.

    I cut&paste the patch files i have added to tools/pfPorts/php52-pfSense-module/files/patch-config.m4 to get it compile on FreeBSD-8.1 on vmware ;-)

    --- ./config.m4.orig    2010-09-09 15:29:01.000000000 +0200
    +++ ./config.m4 2010-09-09 15:29:20.000000000 +0200
    @@ -1,9 +1,21 @@
     PHP_ARG_ENABLE(pfSense, whether to enable pfSense support,
    -[ --enable-pfSense   Enable pfSense support])
    +[  --enable-pfSense   Enable pfSense support])
    +PHP_ARG_WITH(pfsense-kernel, where pfSense kernel sources are located,
    +[  --with-pfsense-kernel=DIR    Location of git kernel sources])
     if test "$PHP_PFSENSE" = "yes"; then
       AC_DEFINE(HAVE_PFSENSE, 1, [Whether you have pfSense])
       PHP_NEW_EXTENSION(pfSense, pfSense.c, $ext_shared)
    +  dnl Check for the custom kernel dir
    +  if test "$PHP_PFSENSE_KERNEL" != "no"; then
    +    if test "$PHP_PFSENSE_KERNEL" == "yes"; then
    +      AC_MSG_ERROR([You must specify a path when using --with-pfsense-kernel])
    +    fi
    +  fi

    Then, I added into Makefile:
    CONFIGURE_ARGS= –enable-pfSense --with-pfsense-kernel=/usr/pfsense-src/src

    Because "system" /usr/src/sys does not have the right patch level to get module compiled.

    Do not forget to change the /usr/pfsense-src/src dir if you have not checkout kernel sources here.

    The module compile now cleanly, but php failed to launch because it needs a ng_socket.ko module at runtime (not loaded in my released kernel ).
    I am looking for fixing that dependency too..

    If any has another solution, he is welcome :-)


  • You can do this from the port itself no need to do that in the C sources.
    Just hack up the Makefile of the port.

Log in to reply