Update guidelines for v2.7.2

This commit is contained in:
Augustin-FL 2024-05-28 00:55:19 +02:00
parent 1345e2098a
commit 50f606bb78
No known key found for this signature in database
GPG Key ID: 07C2BC8C948B0D9A
4 changed files with 206 additions and 42 deletions

108
README.md
View File

@ -1,6 +1,6 @@
# How to: building a pfSense .iso from sources
Here are the steps for building a pfSense ISO file. I tried to follow [the guide of PiBa-NL](https://github.com/PiBa-NL/PiBa-NL-WIKI/wiki/How-to-building-a-pfSense-.iso-from-sources) firstly, but there was missing things so I made my own guide. This guide has been written for 2.5.0, but may works for other versions
Here are the steps for building a pfSense-CE ISO file. I tried to follow [the guide of PiBa-NL](https://github.com/PiBa-NL/PiBa-NL-WIKI/wiki/How-to-building-a-pfSense-.iso-from-sources) firstly, but there was missing things so I made my own guide. This guide has been written for 2.7.2, but may works for other versions
*Like for PiBa-NL guide, small disclaimer: Stuff might be missing, and stuff will change over time, and might not be updated.*
@ -16,24 +16,40 @@ You will then have to fork 3 repositories:
- [FreeBSD Ports](https://github.com/pfsense/freebsd-ports) (Ports collection is the FreeBSD package management system, it works like `apt` or `rpm` on Linux)
- [FreeBSD Kernel Source](https://github.com/pfsense/freebsd-src)
You will also need to apply the follwing changes :
You will also need to apply the following changes:
### FreeBSD Source
- Checkout to the the branch you would like to build (`devel-12` for dev version, `RELENG_2_5_0` for stable version).
- 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`
- Checkout to the branch you would like to build (`devel-main` for dev version, `RELENG_2_7_2` for stable version).
- In the folder `/release/conf/`, rename files starting with `pfSense` to `libreSense` (eg, `pfSense_install_src.conf` => `libreSense_install_src.conf`)
- Rename the file `/sys/amd64/conf/pfSense` to `/sys/amd64/conf/libreSense`
- Edit the file `/tools/tools/crypto/Makefile`: remove `cryptotest cryptostats` from the `PROGS` command
### FreeBSD Ports
- Checkout to the the branch you would like to build (`devel` for dev version, `RELENG_2_5_0` for stable version).
- Edit the file `/security/pfSense/Makefile` : remove `wireguard-tools>=0:security/wireguard-tools` from the `RUN_DEPENDS` variable. (While [open source](https://github.com/pfsense/wireguard-tools), the wireguard-tools port for pfSense is currently not integrated into FreeBSD)
- Checkout to the the branch you would like to build (`devel` for dev version, `RELENG_2_7_2` for stable version).
- Edit the file `/sysutils/pfSense-upgrade/Makefile`: remove the line `RUN_DEPENDS+= pfSense-repoc>=0:sysutils/pfSense-repoc`.
- Edit the file `/sysutils/pfSense-repo/Makefile` : change the line `MIRROR_TYPE?= srv` by `MIRROR_TYPE?= none`.
- Edit the file `/security/pfSense/pkg-plist`: Remove all lines starting with `%%DATADIR%%/keys`.
- Edit the file `/security/pfSense/Makefile`:
- Rename the variable `USE_GITLAB` to `USE_GITHUB`.
- Rename the variable `GL_ACCOUNT` to `GH_ACCOUNT`. Also, change the variable content to your actual GitHub username.
- Rename the variable `GL_COMMIT` to `GH_TAGNAME`.
- Change the line `GL_PROJECT= ${PFSENSE_SRC_REPO}` to `GH_PROJECT= pfsense`.
- Remove the line `GL_SITE= https://gitlab.netgate.com`.
- Remove the line `pfSense-gnid>=0:security/pfSense-gnid \` from the `RUN_DEPENDS` variable, if it exists.
### pfSense GUI
- Go to the folder `/tools/templates/pkg_repos/` in the branch you would like to build (`master`for 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`)
- Checkout to the branch you would like to build (`master` for dev version, `RELENG_2_7_2` for stable version).
- Go to the folder `/tools/templates/pkg_repos/` and rename the file `pfSense-repo.conf` to `libreSense-repo.conf` (if you are building a stable ISO) or `libreSense-repo-devel.conf` (if you are building a dev version).
- 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.
- Edit the file `/tools/templates/core_pkg/base/pkg-plist`: Remove the line `share/%%PRODUCT_NAME%%/initial.txz` from the file.
- Edit the file `/tools/builder_common.sh`: apply the [following patches](https://github.com/Augustin-FL/building-pfsense-iso-from-source/blob/master/patches/builder-common.sh.diff) to the file.
- Edit the file `/tools/builder_defaults.sh`:
- Remove`drm2` and `ndis` from the variable `MODULES_OVERRIDE_amd64`.
- Change variable `PKG_REPO_BRANCH_RELEASE` to `v2_7_2`.
- If you are building a stable version, change variable `PFSENSE_DEFAULT_REPO` to `"${PRODUCT_NAME}-repo"`.
## A deeper look into Netgate build environment
Finally, it is important to understand how we are going to build our ISO and what will be the build environment of this tutorial.
@ -53,9 +69,9 @@ With that said, let's setup our build server.
# Setup a proper build environment
- You will need to download and install a FreeBSD server that matches the version you want to build. pfSense 2.5.0 [require FreeBSD 12.2](https://docs.netgate.com/pfsense/en/latest/releases/versions-of-pfsense-and-freebsd.html), in AMD64.
- You will need to download and install a FreeBSD server that matches the version you want to build. pfSense CE 2.7.2 [require FreeBSD 14.0](https://docs.netgate.com/pfsense/en/latest/releases/versions-of-pfsense-and-freebsd.html) and the `devel` version [currently require FreeBSD 15.0](https://github.com/pfsense/FreeBSD-src/blob/devel-main/sys/conf/newvers.sh#L53), both in AMD64.
This server can be either a VM or a physical machine. High amount of HDD isn't needed (at least 30 Gb is recommended) but high number of CPU core is advised (otherwise build time may be very long) and high memory amount is required (>10Gb recommended. 10 Gb should be fine....8 Gb is not enough and may cause your build to crash). [You can download a FreeBSD ISO here](https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/).
This server can be either a VM or a physical machine. High amount of HDD isn't needed (at least 50 Gb is recommended) but high number of CPU core is advised (otherwise build time may be very long) and high memory amount is required (>20Gb recommended. 20 Gb should be fine....16 Gb is not enough and may cause your build to crash). [You can download a FreeBSD ISO here](https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/).
This FreeBSD machine will also have to be connected to the internet and will have to be reachable by your workstations in SSH and HTTP.
@ -80,7 +96,7 @@ pkg install -y pkg vim nano emacs
pkg install -y git nginx poudriere-devel rsync sudo
# Required for building kernel and iso
pkg install -y vmdktool curl qemu-user-static gtar xmlstarlet pkgconf openssl
pkg install -y vmdktool curl qemu-user-static gtar xmlstarlet pkgconf openssl portsnap
# Required for building iso
portsnap fetch extract
@ -91,8 +107,8 @@ pkg install -y htop screen wget mmv
# Only install this if your FreeBSD is a virtual machine
pkg install -y open-vm-tools
# Create an 8G swap device (Not required but advised : will be useful if you don't have enough memory)
dd if=/dev/zero of=/root/swap.bin bs=1M count=8192
# Create an 16G swap device (Not required but advised : will be useful if you don't have enough memory)
dd if=/dev/zero of=/root/swap.bin bs=1M count=16384
chmod 0600 /root/swap.bin
mdconfig -a -t vnode -f /root/swap.bin -u 0
echo 'swapfile="/root/swap.bin"' >> /etc/rc.conf
@ -103,13 +119,13 @@ swapon /dev/md0
Then you need to configure nginx for PKG hosting and poudriere monitoring:
```
# pfSense_gui_branch represents the branch of pfSense GUI that will be compiled, with "RELENG" replaced by "v" : master for a development ISO, v2_5_0 for a stable ISO
# pfSense_port_branch represents the branch of FreeBSD ports that will be compiled, using the same replacement ("RELENG"=>"v") : devel for a development ISO, v2_5_0 for a stable ISO
# pfSense_gui_branch represents the branch of pfSense GUI that will be compiled, with "RELENG" replaced by "v" : master for a development ISO, v2_7_2 for a stable ISO
# pfSense_port_branch represents the branch of FreeBSD ports that will be compiled, using the same replacement ("RELENG"=>"v") : devel for a development ISO, v2_7_2 for a stable ISO
# product_name represents the name of your product.
set pfSense_gui_branch=v2_5_0 # Replace with the version you want to build
set pfSense_port_branch=v2_5_0 # Replace with the version you want to build
set product_name=libreSense # Replace with your product name
pfSense_gui_branch=v2_7_2 # Replace with the version you want to build
pfSense_port_branch=v2_7_2 # Replace with the version you want to build
product_name=libreSense # Replace with your product name
cd /usr/local/www/nginx/
@ -124,6 +140,7 @@ ln -s /usr/local/poudriere/data/logs/bulk/${product_name}_${pfSense_gui_branch}_
# Allow directory indexing, and configure nginx to start automatically on boot
sed -i '' 's+/usr/local/www/nginx;+/usr/local/www/nginx; autoindex on;+g' /usr/local/etc/nginx/nginx.conf
pw group mod wheel -m www
echo nginx_enable=\"YES\" >> /etc/rc.conf
service nginx restart
```
@ -139,6 +156,7 @@ chmod 0400 repo.key
openssl rsa -in repo.key -out repo.pub -pubout
printf "function: sha256\nfingerprint: `sha256 -q repo.pub`\n" > fingerprint
curl -o /root/sign/sign.sh https://raw.githubusercontent.com/freebsd/pkg/master/scripts/sign.sh
sed -i "" 's+ repo\.+ /root/sign/repo\.+g' /root/sign/sign.sh
chmod +x /root/sign/sign.sh
```
@ -150,7 +168,7 @@ Now that your server is configured, we will configure how pfSense will be compil
cd /root
git clone https://github.com/{your username}/pfsense.git
cd pfsense
git checkout RELENG_2_5_0 # Replace by the branch of pfSense GUI to build.
git checkout RELENG_2_7_2 # Replace by the branch of pfSense GUI to build.
# Ports repositories signing key
rm src/usr/local/share/${product_name}/keys/pkg/trusted/*
@ -164,14 +182,8 @@ export PRODUCT_NAME="libreSense" # Replace with your product name
export FREEBSD_REPO_BASE=https://github.com/{your username}/FreeBSD-src.git # Location of your FreeBSD sources repository
export POUDRIERE_PORTS_GIT_URL=https://github.com/{your username}/FreeBSD-ports.git # Location your FreeBSD ports repository
export FREEBSD_BRANCH=RELENG_2_5_0 # Branch of FreeBSD sources to build
# The branch of FreeBSD ports to build is set automatically based on pfSense GUI branch.
# If you would like to build a specific branch of FreeBSD ports, the variable to set is POUDRIERE_PORTS_GIT_BRANCH
# Also, if you are building a FreeBSD port branch that does not respect Netgate conventions (devel or RELENG_*),
# You will also have to update .conf files in "tools/templates/pkg_repos/" because repositories names are partially
# hardcoded there.
export FREEBSD_BRANCH=RELENG_2_7_2 # Branch of FreeBSD sources to build
export POUDRIERE_PORTS_GIT_BRANCH=RELENG_2_7_2 # Branch of FreeBSD ports to build
# Netgate support creation of staging builds (pre-dev, nonpublic version)
@ -184,13 +196,15 @@ export DEFAULT_ARCH_LIST="amd64.amd64" # We only want to build an x64 ISO, we d
export PKG_REPO_SIGNING_COMMAND="/root/sign/sign.sh ${PKG_REPO_SIGN_KEY}"
# This command retrieves the IP address of the first network interface
export myIPAddress=$(ifconfig -a | grep inet | head -1 | cut -d ' ' -f 2)
export myIPAddress=$(ifconfig -a | grep inet | grep '.'| head -1 | cut -d ' ' -f 2)
export PKG_REPO_SERVER_DEVEL="pkg+http://${myIPAddress}/packages"
export PKG_REPO_SERVER_RELEASE="pkg+http://${myIPAddress}/packages"
export PKG_REPO_SERVER_DEVEL="http://${myIPAddress}/packages"
export PKG_REPO_SERVER_RELEASE="http://${myIPAddress}/packages"
export PKG_REPO_SERVER_STAGING="pkg+http://${myIPAddress}/packages" # We need to also specify this variable, because even
# if we don't build staging release some ports configuration is made for staging.
export PKG_REPO_SERVER_STAGING="http://${myIPAddress}/packages" # We need to also specify this variable, because even
# if we don't build staging release some ports configuration is made for staging
export SRCCONF="/root/pfsense/tmp/FreeBSD-src/release/conf/${PRODUCT_NAME}_build_src.conf"
```
# Building the ISO
@ -200,7 +214,7 @@ Now that we have a working environment, let's start the heavy work.
First, start a screen on your build server, using command ```screen -S build```. You may leave this screen using ctrl+A then D, and you may enter this screen again using command ```screen -r build```. The purpose of the screen is to keep your work running if you disconnect from the build server.
### Setup Jails
Execute the command ```./build.sh --setup-poudriere```. This will setup the environment and create the FreeBSD jail necessary for your build. You can then leave the screen and `tail -f logs/poudriere.log` to check what's going on. Expect the command to run for ~1 hour.
Execute the command ```./build.sh --setup-poudriere```. This will setup the environment and create the FreeBSD jail necessary for your build. You can then leave the screen and `tail -f logs/poudriere.log` to check what's going on. Expect the command to run for ~3 hours on a 16 core CPU.
If something goes wrong:
- You may add `set -x` at the beginning of `build.sh` to debug what's happening in there.
@ -209,8 +223,8 @@ If something goes wrong:
### Build ports
Then execute ```./build.sh --update-pkg-repo``` to compile the ~500 FreeBSD ports of pfSense.
You may want to monitor the build environment on your server using HTTP ( http://ipOfYourServer/poudriere ). Expect between 4 to 6 hours to run.
Then execute ```./build.sh --update-pkg-repo``` to compile the ~550 FreeBSD ports of pfSense.
You may want to monitor the build environment on your server using HTTP ( http://ipOfYourServer/poudriere ). Expect the build to take around 6 hours.
![Disk partition](
https://github.com/Augustin-FL/building-pfsense-iso-from-source/blob/master/images/poudriere_build.png?raw=true)
@ -235,26 +249,28 @@ The build can the monitored from the two files in the `logs/` directory of pfSen
- `install_pkg_install_ports.txt` contain logs relative to the installation of the ports. They are retrieved from the URL specified in the `build.conf` file.
- `isoimage.amd64` and `cloning.amd64.log` contain logs relative to the build of the ISO itself
At the end of the build, a compressed iso file (`.iso.gz`) will be present in `~pfsense/tmp/${product_name}/installer/`. You can extract it using `gzip -kd *.gz` if you need the plain `.iso`.
At the end of the build, a compressed iso file (`.iso.gz`) will be present in `~pfsense/tmp/${product_name}/installer/`. You can extract it using `gunzip *.gz` if you need the plain `.iso`.
### If your encounter errors during ports or kernel build: possible root causes, and how to fix them:
One very possible root cause to why your build is failing, is related to how `Makefile` system works correlated with an unlucky timing. What happens is usually close to the following:
1. Netgate build port XXX from `FreeBSD-ports`. On internal Netgate servers, poudriere marks the port as built and won't attempt to re-build it unless an update is made on the code ("config bump")
3. Few month later, ports owners update their build requirement (`distfile` update) / Netgate update its build environment (e.g., `openssl => opensll111` )
3. Few months later, ports owners update their build requirement (`distfile` update) / Netgate update its build environment (e.g., `openssl => opensll111` )
2. Netgate does NOT keep `FreeBSD-ports` in sync with the official FreeBSD ports repository. At this point, any attempt of rebuilding ports will fail...But it is fine for Netgate : the built packages are already there, and no rebuild will be made as long as no config bump is done on the ports.
4. When you try to build ports yourself, some ports fail during build and you don't understand why.
The same applies for the content of `FreeBSD-src`. The recommended way to fix this issue is to simply re-synchronize modules that are failing with upstream, so that you will have an up-to-date ISO.
Also, Netgate has been accused of [performing *delayed open-sourcing*](https://github.com/doktornotor/pfsense-still-closedsource/blob/master/img/screenshot_bug8155_rebuilding_pfsense_kernel.png) in the past on `Freebsd-src`. It is unclear if it was due to users misunderstanding on how the build system works, due to Netgate shady practices, or due to a temporary maintenance.
I haven't noticed any *delayed open sourcing* myself, but If that ever happens, you can merge FreeBSD sources with your branch directly.
I haven't noticed any *delayed open sourcing* myself, but if that ever happens, you can merge FreeBSD sources with your branch directly.
# Differences between a genuine pfSense and your ISO
Your ISO is built the same way as pfSense ISO distributed by Netgate, and does contain the same code, with one major difference: your ISO does not include GNID.
Your ISO is built the same way as pfSense ISO distributed by Netgate, and does contain the same code, with two major differences: your ISO does not include GNID nor pfSense-repoc.
## GNID
GNID is a binary (located at `/usr/sbin/gnid`) which is managing Netgate license for pfSense. This binary basically generates a unique Netgate ID for each genuine pfSense.
@ -264,5 +280,13 @@ It is also required for accessing Netgate services on pfSense (such as ACB, or p
How does this binary works is known *(a quick look to this binary with `radare2` show that it basically tries to fetch the platform it is running on, and if the platform is not Netgate hardware then it computes an ID using sha256 and MAC addresses of the device)*, but this program is property of Netgate and is closed-source (it is stored in the internal GitLab of Netgate).
Because your ISO does not contain GNID, you may not be able to retrieve bogons feed from Netgate, to use ACB, to install packages from official repositories or to ask for professional support to Netgate.
You also won't recieve latest pfSense updates (which makes sense, since your ISO can't be called *pfSense software*..)
## pfSense-repoc
pfSense-repoc is a package containing multiple binaries. These binaries are in charge of configuring the right PKG repositories, depending on your licence and product (pfSense-CE, plus, etc..).
Like GNID, this package is property of Netgate and is closed-source.
Because your ISO does not contain pfSense-repoc nor GNID, you may not be able to retrieve bogons feed from Netgate, to use ACB, to install packages from official repositories or to ask for professional support to Netgate.
You also won't receive latest pfSense updates (which makes sense, since your ISO can't be called *pfSense software*..).

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 144 KiB

View File

@ -0,0 +1,140 @@
diff --git a/tools/builder_common.sh b/tools/builder_common.sh
index 6280c31460..343daf49ad 100644
--- a/tools/builder_common.sh
+++ b/tools/builder_common.sh
@@ -622,9 +622,8 @@ clone_to_staging_area() {
-X ${_exclude_files} \
.
- core_pkg_create rc "" ${CORE_PKG_VERSION} ${STAGE_CHROOT_DIR}
+ core_pkg_create boot "" ${CORE_PKG_VERSION} ${STAGE_CHROOT_DIR} "./boot"
core_pkg_create base "" ${CORE_PKG_VERSION} ${STAGE_CHROOT_DIR}
- core_pkg_create default-config "" ${CORE_PKG_VERSION} ${STAGE_CHROOT_DIR}
local DEFAULTCONF=${STAGE_CHROOT_DIR}/conf.default/config.xml
@@ -635,7 +634,6 @@ clone_to_staging_area() {
# Change default interface names to match vmware driver
xml ed -P -L -u "${XML_ROOTOBJ}/interfaces/wan/if" -v "vmx0" ${DEFAULTCONF}
xml ed -P -L -u "${XML_ROOTOBJ}/interfaces/lan/if" -v "vmx1" ${DEFAULTCONF}
- core_pkg_create default-config "vmware" ${CORE_PKG_VERSION} ${STAGE_CHROOT_DIR}
# Restore default values to be used by serial package
xml ed -P -L -u "${XML_ROOTOBJ}/interfaces/wan/if" -v "${_old_wan_if}" ${DEFAULTCONF}
@@ -650,8 +648,6 @@ clone_to_staging_area() {
echo force > ${STAGE_CHROOT_DIR}/cf/conf/enableserial_force
- core_pkg_create default-config-serial "" ${CORE_PKG_VERSION} ${STAGE_CHROOT_DIR}
- core_pkg_create default-config "bhyve" ${CORE_PKG_VERSION} ${STAGE_CHROOT_DIR}
rm -f ${STAGE_CHROOT_DIR}/cf/conf/enableserial_force
rm -f ${STAGE_CHROOT_DIR}/cf/conf/config.xml
@@ -714,11 +710,11 @@ customize_stagearea_for_image() {
# Prepare final stage area
create_final_staging_area
- pkg_chroot_add ${FINAL_CHROOT_DIR} rc
+ pkg_chroot_add ${FINAL_CHROOT_DIR} boot
pkg_chroot_add ${FINAL_CHROOT_DIR} base
# Set base/rc pkgs as vital to avoid user end up removing it for any reason
- pkg_chroot ${FINAL_CHROOT_DIR} set -v 1 -y $(get_pkg_name rc)
+ pkg_chroot ${FINAL_CHROOT_DIR} set -v 1 -y $(get_pkg_name boot)
pkg_chroot ${FINAL_CHROOT_DIR} set -v 1 -y $(get_pkg_name base)
if [ "${_image_type}" = "iso" -o \
@@ -729,7 +725,6 @@ customize_stagearea_for_image() {
cp ${CORE_PKG_ALL_PATH}/*default-config*.txz ${FINAL_CHROOT_DIR}/pkgs
fi
- pkg_chroot_add ${FINAL_CHROOT_DIR} ${_default_config}
# XXX: Workaround to avoid pkg to complain regarding release
# repo on first boot since packages are installed from
@@ -1008,7 +1003,7 @@ setup_pkg_repo() {
local _target_arch="${4}"
local _staging="${5}"
local _pkg_conf="${6}"
- local _mirror_type="srv"
+ local _mirror_type="none"
local _signature_type="fingerprints"
if [ -z "${_template}" -o ! -f "${_template}" ]; then
@@ -1032,6 +1027,8 @@ setup_pkg_repo() {
sed \
-e "s/%%ARCH%%/${_target_arch}/" \
+ -e "s/%%OSVERSION%%/${GIT_REPO_BRANCH_OR_TAG}/" \
+ -e "s/%%VERSION%%/${POUDRIERE_PORTS_BRANCH}/" \
-e "s/%%MIRROR_TYPE%%/${_mirror_type}/" \
-e "s/%%PKG_REPO_BRANCH_DEVEL%%/${_pkg_repo_branch_devel}/g" \
-e "s/%%PKG_REPO_BRANCH_RELEASE%%/${_pkg_repo_branch_release}/g" \
@@ -1184,7 +1181,7 @@ pkg_chroot_add() {
fi
local _target="${1}"
- local _pkg="$(get_pkg_name ${2}).txz"
+ local _pkg="$(get_pkg_name ${2}).pkg"
if [ ! -d "${_target}" ]; then
echo ">>> ERROR: Target dir ${_target} not found"
@@ -1240,6 +1237,7 @@ install_pkg_install_ports() {
echo "Failed!"
print_error_pfS
fi
+ pkg_chroot ${STAGE_CHROOT_DIR} install "${PRODUCT_NAME}-default-config"
# Make sure required packages are set as non-automatic
pkg_chroot ${STAGE_CHROOT_DIR} set -A 0 pkg ${MAIN_PKG} ${custom_package_list}
# pkg and MAIN_PKG are vital
@@ -1568,7 +1566,13 @@ poudriere_rename_ports() {
cp -r ${d} ${_pdir}/${_pname}
- if [ -f ${_pdir}/${_pname}/pkg-plist ]; then
+ # Composer module is special
+ if echo "${_pname}" | grep -q "composer"; then
+ sed -i '' -e "s,pfSense-composer-deps,${PRODUCT_NAME}-composer-deps,g" \
+ ${_pdir}/${_pname}/Makefile ${_pdescr} ${_plist}
+ continue
+ fi
+ if [ -f ${_pdir}/${_pname}/pkg-plist ] && [ "${_pname}" != "${PRODUCT_NAME}" ]; then
_plist=${_pdir}/${_pname}/pkg-plist
fi
@@ -1576,6 +1580,12 @@ poudriere_rename_ports() {
_pdescr=${_pdir}/${_pname}/pkg-descr
fi
+ # main package is special
+ if [ "${_pname}" == "${PRODUCT_NAME}" ]; then
+ sed -i '' -e "s,pfSense-devd,${PRODUCT_NAME}-devd,g" \
+ -e "s,pfSense-ddb,${PRODUCT_NAME}-ddb,g" \
+ ${_pdir}/${_pname}/pkg-plist
+ fi
sed -i '' -e "s,pfSense,${PRODUCT_NAME},g" \
-e "s,https://www.pfsense.org,${PRODUCT_URL},g" \
-e "/^MAINTAINER=/ s,^.*$,MAINTAINER= ${PRODUCT_EMAIL}," \
@@ -1593,10 +1603,12 @@ poudriere_rename_ports() {
sed -i '' -e "s,COMPILE_DL_PFSENSE,COMPILE_DL_${_product_capital}," \
-e "s,pfSense_module_entry,${PRODUCT_NAME}_module_entry,g" \
-e "s,php_pfSense.h,php_${PRODUCT_NAME}\.h,g" \
+ -e "s,pfSense_arginfo.h,${PRODUCT_NAME}_arginfo\.h,g" \
+ -e "s,pfSense_private.h,${PRODUCT_NAME}_private\.h,g" \
-e "/ZEND_GET_MODULE/ s,pfSense,${PRODUCT_NAME}," \
-e "/PHP_PFSENSE_WORLD_EXTNAME/ s,pfSense,${PRODUCT_NAME}," \
${_pdir}/${_pname}/files/pfSense.c \
- ${_pdir}/${_pname}/files/dummynet.c \
+ ${_pdir}/${_pname}/files/pfSense_private.h \
${_pdir}/${_pname}/files/php_pfSense.h
fi
@@ -2038,6 +2050,8 @@ POUDRIERE_PORTS_NAME=${POUDRIERE_PORTS_NAME}
PFSENSE_DEFAULT_REPO=${PFSENSE_DEFAULT_REPO}
PRODUCT_NAME=${PRODUCT_NAME}
REPO_BRANCH_PREFIX=${REPO_PATH_PREFIX}
+PFSENSE_COMMITHASH=$(git -C ${BUILDER_ROOT} log -1 --format='%H')
+PFSENSE_DATESTRING=${DATESTRING}
EOF
local _value=""