Skip to content

Commit

Permalink
build: allow type to be overridden; fixes #19
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fichtner committed Sep 9, 2015
1 parent 40b122e commit e093cc8
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
11 changes: 8 additions & 3 deletions build/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand All @@ -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 \
Expand Down Expand Up @@ -415,7 +420,7 @@ setup_packages()
{
# legacy package extract
extract_packages ${1}
install_packages ${@}
install_packages ${@} ${PRODUCT_TYPE}
clean_packages ${1}
}

Expand Down
2 changes: 1 addition & 1 deletion build/iso.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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... "
Expand Down
2 changes: 1 addition & 1 deletion build/memstick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)..."
Expand Down
2 changes: 1 addition & 1 deletion build/nano.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion build/regress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."

Expand Down
4 changes: 2 additions & 2 deletions build/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e093cc8

Please sign in to comment.