Assertion failed

Oct 15, 2014

Running poudriere in a jail

Poudriere is a great tool when you need to build packages for freebsd, but sometimes one would prefer to run it in a jail. Even though this is not recomended there is a basic guide for how to do this on the poudriere wiki. But this does not work if your poudriere jail is configured with an ip-address instead of inheriting ip-addresses.

In addition to the settings shown in the guide one would have to add the following to poudriere.conf:

LOIP4="192.168.1.10/24" # IPv4 of jail
LOIP6="fec0::10/64"     # IPv6 of jail

But there is still one caveat left to discover. If your kernel supports IPv4/6 and the jail does not have an IPv4/6-address it will fail. This problem can be solved with the following patch assuming you use poudriere 3.1-pre (your miles may wary with other versions).

diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh
index 6a78e37..ef91e4b 100755
--- a/src/share/poudriere/common.sh
+++ b/src/share/poudriere/common.sh
@@ -4341,6 +4341,13 @@ fi

 : ${LOIP6:=::1}
 : ${LOIP4:=127.0.0.1}
+
+[ "${LOIP4}" = "no" ] && \
+       IPS="0$(echo $IPS | tail -c 1)"
+
+[ "${LOIP6}" = "no" ] && \
+       IPS="$(echo $IPS | head -c 1)0"
+
 case $IPS in
 01)
        localipargs="ip6.addr=${LOIP6}"

After applying this patch you can use the following in poudriere.conf to disable IPv4 and/or IPv6:

LOIP4="no" # Disable IPv4
LOIP6="no" # Disable IPv6

What you will probably want is something similar to the following:

LOIP4="192.168.1.10/24" # IPv4 of jail
LOIP6="no"              # Disable IPv6

or:

LOIP4="no"          # Disable IPv4
LOIP6="fec0::10/64" # IPv6 of jail

Note: When disabling either IPv4 or IPv6 ‘no’ is case sensitive when using this pathch.

Mastodon