How to build pbi packages for pfSense?



  • Hi,

    I want to build and maintain public packages for pfSense and submit them to the pfsense-packages repository on github [1], but I seem to be unable to find the required documentation. Besides an outdated article on the wiki [2] and some examples from pull requests [3] I couldn't find anything useful.

    I don't want to submit untested stuff, so how do I test building the PBI packages myself?

    [1] https://github.com/pfsense/pfsense-packages
    [2] https://doc.pfsense.org/index.php/Developing_Packages
    [3] https://github.com/pfsense/pfsense-packages/pull/314/files

    Thanks

    • Frank

  • Rebel Alliance Developer Netgate

    That will require getting access to the tools repository, check the mailing list archives for info on how to request access.



  • @jimp:

    That will require getting access to the tools repository, check the mailing list archives for info on how to request access.

    In a conversation off the forum, ganzopancho has told me that access to -tools is not required to build packages.

    I've struggled with building packages without it, with limited success. Are there tools in the pfsense-tools repo that help here?


  • Rebel Alliance Developer Netgate

    It would be possible to build packages into PBIs without the tools repository, but we do have a script that makes it much easier that is in the tools repository.

    You could look at the PC BSD documentation on how to build PBIs and such and end up with a PBI, but it would be much simpler to use our build script from -tools.

    The -tools repository would be required if you needed patches for a specific pfPort that we have customizations for, but many of the packages are simply PBIs built from the FreeBSD ports tree, maybe with some custom build options.

    Our build script looks at the package xml, uses data from that to build the pbi.conf for the port, and then builds the PBI using those settings.



  • That's what I ended up doing, because -tools was unavailable when I needed to do it. Easier said than done, mostly because 8.3 is old enough that docs are hard to find.

    Given that, I think I'm OK for now. I'll give the -tools script a try if I can resolve my concerns with the TLA.

    Thanks!


  • Rebel Alliance Developer Netgate

    The tools script makes the whole process smoother, but it also depends on other things in the tools repository. My initial response above, now that I think about it, was probably because we had recently tried to take the PBI build script out of -tools and put it into -packages but it had other dependencies that prevented that from being viable.

    Good that you managed to find your own way to build PBIs, though.



  • I have a feeling there might be some mismatched libs in my build environment, though. Something's not right… something as simple as rinetd shouldn't segfault as much as it does.


  • Rebel Alliance Developer Netgate

    The best solution is to target 2.3 where you can use standard FreeBSD-style pkgng files and then you don't have to worry about PBI headaches anymore. 2.3 isn't that far off, and you'll be ahead of the curve instead of behind it. Extra bonus, you don't go insane trying to deal with PBIs :-)



  • @jimp:

    The best solution is to target 2.3 where you can use standard FreeBSD-style pkgng files and then you don't have to worry about PBI headaches anymore. 2.3 isn't that far off, and you'll be ahead of the curve instead of behind it. Extra bonus, you don't go insane trying to deal with PBIs :-)

    I don't know if this was targeted to my post - that I trashed a second after posting it when I saw the sticky thread about the tools repo (which actually is non-existant now as it has been moved to the normal pfsense source?)

    I'm trying to get varnish4 up and running bit still fail using the current package from http://pkg.freebsd.org/freebsd:10:x86:64/latest/All/varnish4-4.0.3_7.txz. You're saying the pfSense package installer should handle these just fine in general?



  • @taenzerme:

    @jimp:

    The best solution is to target 2.3 where you can use standard FreeBSD-style pkgng files and then you don't have to worry about PBI headaches anymore. 2.3 isn't that far off, and you'll be ahead of the curve instead of behind it. Extra bonus, you don't go insane trying to deal with PBIs :-)

    I don't know if this was targeted to my post - that I trashed a second after posting it when I saw the sticky thread about the tools repo (which actually is non-existant now as it has been moved to the normal pfsense source?)

    Jim's argument is that, with pfSense 2.3 getting closer, there is now little point developing and testing new packages on pfSense 2.2. The combination of the new bootstrap user interface and the switch from PBI to pkgng (the FreeBSD native package manager) means that much of the work would have to be done again for pfSense 2.3 and onwards.

    pfSense 2.3 uses a different build system to 2.2 and earlier. The pfsense-tools repository still exists and you can still get access to it by executing the agreements and providing your GitHub user name. The master branch of pfsense-tools consists of a readme file saying that the build tools are in the (public) pfsense repository. As pfsense-tools has no relevance to pfSense 2.3 and beyond, the pfsense-tools repository is now obsolescent.

    You still need access to pfsense-tools to build pfSense 2.2 - I needed it recently to build and test the RFC 4638 client support patch. Access to pfsense-tools is helpful if you want to build PBIs for pfSense 2.2 packages, as noted earlier in the thread.

    @taenzerme:

    I'm trying to get varnish4 up and running bit still fail using the current package from http://pkg.freebsd.org/freebsd:10:x86:64/latest/All/varnish4-4.0.3_7.txz. You're saying the pfSense package installer should handle these just fine in general?

    It is unlikely that you will succeed in installing a package from the FreeBSD 10.x latest packages repository on a pfSense 2.2 box, if that is what you were attempting to do. pkg will bootstrap if you attempt to use it at a pfSense 2.2 command prompt and you might succeed in installing the package, but pkgng packages are not supported on pfSense 2.2 and you might get library version mismatches or worse.

    It is possible that, with pfSense 2.2 regarded as feature frozen, the pfSense team might decline to review a new package for pfSense 2.2 even if you developed and tested the package before submitting a pull request. Whether new pfSense 2.2 packages are being accepted is a policy question only the pfSense team can answer. Pull requests adding new features to the pfSense 2.2 base system are being politely rejected.

    If you want to develop a pkgng based package, you should be developing and testing on a recent pfSense 2.3 snapshot in a development only environment. A virtual machine is convenient for this, though you could use a bare metal install in a non-production environment.



  • David, thanks for the insight. I already have my 2.3 VM up and running and will try to patch things for varnish4 in there.


Log in to reply