build: allow type to be overridden; fixes #19

Building has gotten pretty complicated with the introduction
of opnsense-devel pacakges, which will be further complicated
by doing opnsense-stable soon enough...

This needs more smarts, but for now the README works again.
This only affects image builds.
This commit is contained in:
Franco Fichtner 2015-09-09 15:54:26 +02:00
parent 40b122e808
commit e093cc884c
8 changed files with 18 additions and 10 deletions

View File

@ -16,6 +16,7 @@ all:
# Bootstrap the build options if not set:
NAME?= OPNsense
TYPE?= opnsense-devel
FLAVOUR?= OpenSSL
SETTINGS?= 15.7
_VERSION!= date '+%Y%m%d%H%M'
@ -57,5 +58,5 @@ ${STEP}:
@cd build && sh ${DEBUG_FLAGS} ./${.TARGET}.sh \
-f ${FLAVOUR} -n ${NAME} -v ${VERSION} -s ${SETTINGS} \
-S ${SRCDIR} -P ${PORTSDIR} -p ${PLUGINSDIR} -T ${TOOLSDIR} \
-C ${COREDIR} -R ${PORTSREFDIR} ${${STEP}_ARGS}
-C ${COREDIR} -R ${PORTSREFDIR} -t ${TYPE} ${${STEP}_ARGS}
.endfor

View File

@ -75,6 +75,7 @@ All build steps are invoked via make(1):
Available build options are:
* NAME: "OPNsense" (default)
* TYPE: the name of the meta package to be installed
* FLAVOUR: "OpenSSL" (default), "LibreSSL"
* VERSION: a version tag (if applicable)
* SETTINGS: the name of the selected settings in config/

View File

@ -32,11 +32,11 @@ SCRUB_ARGS=:
usage()
{
echo "Usage: ${0} -f flavour -n name -v version -R freebsd-ports.git" >&2
echo " -C core.git -P ports.git -S src.git -T tools.git" >&2
echo " -C core.git -P ports.git -S src.git -T tools.git -t type" >&2
exit 1
}
while getopts C:f:n:P:p:R:S:s:T:v: OPT; do
while getopts C:f:n:P:p:R:S:s:T:t:v: OPT; do
case ${OPT} in
C)
export COREDIR=${OPTARG}
@ -74,6 +74,10 @@ while getopts C:f:n:P:p:R:S:s:T:v: OPT; do
export TOOLSDIR=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
t)
export PRODUCT_TYPE=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
;;
v)
export PRODUCT_VERSION=${OPTARG}
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
@ -85,6 +89,7 @@ while getopts C:f:n:P:p:R:S:s:T:v: OPT; do
done
if [ -z "${PRODUCT_NAME}" -o \
-z "${PRODUCT_TYPE}" -o \
-z "${PRODUCT_FLAVOUR}" -o \
-z "${PRODUCT_VERSION}" -o \
-z "${PRODUCT_SETTINGS}" -o \
@ -415,7 +420,7 @@ setup_packages()
{
# legacy package extract
extract_packages ${1}
install_packages ${@}
install_packages ${@} ${PRODUCT_TYPE}
clean_packages ${1}
}

View File

@ -35,7 +35,7 @@ LABEL="${LABEL}_Install"
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}
setup_kernel ${STAGEDIR}
setup_packages ${STAGEDIR} opnsense
setup_packages ${STAGEDIR}
setup_mtree ${STAGEDIR}
echo -n ">>> Building ISO image... "

View File

@ -36,7 +36,7 @@ LABEL="${LABEL}_Install"
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}
setup_kernel ${STAGEDIR}
setup_packages ${STAGEDIR} opnsense
setup_packages ${STAGEDIR}
setup_mtree ${STAGEDIR}
echo ">>> Building memstick image(s)..."

View File

@ -40,7 +40,7 @@ NANO_MEDIASIZE=$(expr ${NANO_MEDIASIZE} - \( ${NANO_MEDIASIZE} % 8 \))
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}
setup_kernel ${STAGEDIR}
setup_packages ${STAGEDIR} opnsense
setup_packages ${STAGEDIR}
echo "-S115200 -D" > ${STAGEDIR}/boot.config

View File

@ -35,7 +35,8 @@ setup_clone ${STAGEDIR} ${COREDIR}
setup_chroot ${STAGEDIR}
extract_packages ${STAGEDIR}
install_packages ${STAGEDIR} opnsense pear-PHP_CodeSniffer
install_packages ${STAGEDIR} ${PRODUCT_TYPE} pear-PHP_CodeSniffer
# don't want to deinstall in case of testing...
echo ">>> Running ${COREDIR} test suite..."

View File

@ -32,9 +32,9 @@ set -e
# make sure the all-encompassing package is a release, too
setup_stage ${STAGEDIR}
extract_packages ${STAGEDIR}
if [ ! -f ${STAGEDIR}${PACKAGESDIR}/All/opnsense-${PRODUCT_VERSION}.txz ]; then
if [ ! -f ${STAGEDIR}${PACKAGESDIR}/All/${PRODUCT_TYPE}-${PRODUCT_VERSION}.txz ]; then
echo "Release version mismatch:"
(cd ${STAGEDIR}${PACKAGESDIR}/All; ls opnsense-*.txz)
(cd ${STAGEDIR}${PACKAGESDIR}/All; ls ${PRODUCT_TYPE}-*.txz)
exit 1
fi