Skip to content

Commit

Permalink
Support src-env.conf
Browse files Browse the repository at this point in the history
Fixes #457
  • Loading branch information
bdrewery committed Jun 3, 2017
1 parent 4399c34 commit 1191f9f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
12 changes: 11 additions & 1 deletion src/bin/poudriere.8
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
.\"
.\" Note: The date here should be updated whenever a non-trivial
.\" change is made to the manual page.
.Dd June 1, 2017
.Dd June 3, 2017
.Dt POUDRIERE 8
.Os
.Sh NAME
Expand Down Expand Up @@ -1032,6 +1032,16 @@ Any of the following are allowed and will all be used in the order shown:
.Dl /usr/local/etc/poudriere.d/src.conf
.Dl /usr/local/etc/poudriere.d/<setname>-src.conf
.Dl /usr/local/etc/poudriere.d/<jailname>-src.conf
.Ss Create optional src-env.conf
You can also specify a global src-env.conf which will be used for building
jails with the
.Cm jail -c
subcommand.
Any of the following are allowed and will all be used in the order shown:
.Pp
.Dl /usr/local/etc/poudriere.d/src-env.conf
.Dl /usr/local/etc/poudriere.d/<setname>-src-env.conf
.Dl /usr/local/etc/poudriere.d/<jailname>-src-env.conf
.Sh CAVEATS
.Ss Jailname
.Fl j ,
Expand Down
26 changes: 19 additions & 7 deletions src/share/poudriere/jail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -334,23 +334,35 @@ setup_build_env() {
MAKE_JOBS="-j${PARALLEL_JOBS}"
}

setup_src_conf() {
local src="$1"

[ -f ${JAILMNT}/etc/${src}.conf ] && rm -f ${JAILMNT}/etc/${src}.conf
touch ${JAILMNT}/etc/${src}.conf
[ -f ${POUDRIERED}/${src}.conf ] && \
cat ${POUDRIERED}/${src}.conf > ${JAILMNT}/etc/${src}.conf
[ -n "${SETNAME}" ] && \
[ -f ${POUDRIERED}/${SETNAME}-${src}.conf ] && \
cat ${POUDRIERED}/${SETNAME}-${src}.conf >> \
${JAILMNT}/etc/${src}.conf
[ -f ${POUDRIERED}/${JAILNAME}-${src}.conf ] && \
cat ${POUDRIERED}/${JAILNAME}-${src}.conf >> \
${JAILMNT}/etc/${src}.conf
fi

build_and_install_world() {
export SRC_BASE=${JAILMNT}/usr/src
mkdir -p ${JAILMNT}/etc
[ -f ${JAILMNT}/etc/src.conf ] && rm -f ${JAILMNT}/etc/src.conf
touch ${JAILMNT}/etc/src.conf
[ -f ${POUDRIERED}/src.conf ] && cat ${POUDRIERED}/src.conf > ${JAILMNT}/etc/src.conf
[ -n "${SETNAME}" ] && [ -f ${POUDRIERED}/${SETNAME}-src.conf ] && \
cat ${POUDRIERED}/${SETNAME}-src.conf >> ${JAILMNT}/etc/src.conf
[ -f ${POUDRIERED}/${JAILNAME}-src.conf ] && cat ${POUDRIERED}/${JAILNAME}-src.conf >> ${JAILMNT}/etc/src.conf
setup_src_conf "src"
setup_src_conf "src-env"

if [ "${TARGET}" = "mips" ]; then
echo "WITH_ELFTOOLCHAIN_TOOLS=y" >> ${JAILMNT}/etc/src.conf
fi

export __MAKE_CONF=/dev/null
export SRCCONF=${JAILMNT}/etc/src.conf
export SRC_ENV_CONF=/dev/null
export SRC_ENV_CONF=${JAILMNT}/etc/src-env.conf

setup_build_env

Expand Down

0 comments on commit 1191f9f

Please sign in to comment.