config: change config handling again; decouples NAME and SETTINGS
This commit is contained in:
parent
a6dc804c86
commit
634a50fb7c
3
Makefile
3
Makefile
|
@ -17,6 +17,7 @@ all:
|
|||
|
||||
NAME?= OPNsense
|
||||
FLAVOUR?= OpenSSL
|
||||
SETTINGS?= latest
|
||||
_VERSION!= date '+%Y%m%d%H%M'
|
||||
VERSION?= ${_VERSION}
|
||||
PORTSREFDIR?= /usr/freebsd-ports
|
||||
|
@ -49,7 +50,7 @@ ${TARGET}: ${_TARGET}
|
|||
.for STEP in ${STEPS}
|
||||
${STEP}:
|
||||
@cd build && sh ./${.TARGET}.sh \
|
||||
-f ${FLAVOUR} -n ${NAME} -v ${VERSION} \
|
||||
-f ${FLAVOUR} -n ${NAME} -v ${VERSION} -s ${SETTINGS} \
|
||||
-S ${SRCDIR} -P ${PORTSDIR} -T ${TOOLSDIR} \
|
||||
-C ${COREDIR} -R ${PORTSREFDIR} ${${STEP}_ARGS}
|
||||
.endfor
|
||||
|
|
|
@ -76,6 +76,7 @@ Available build options are:
|
|||
* NAME: "OPNsense" (default)
|
||||
* FLAVOUR: "OpenSSL" (default), "LibreSSL"
|
||||
* VERSION: a version tag (if applicable)
|
||||
* SETTINGS: the name of the selected settings in config/
|
||||
* CONFIG: reads the above from the specified file
|
||||
|
||||
Build the userland binaries, bootloader and administrative
|
||||
|
|
|
@ -33,7 +33,7 @@ sh ./clean.sh base
|
|||
|
||||
git_describe ${SRCDIR}
|
||||
|
||||
MAKEARGS="SRCCONF=${PRODUCT_CONFIG}/src.conf COMPILER_TYPE=clang __MAKE_CONF="
|
||||
MAKEARGS="SRCCONF=${CONFIGDIR}/src.conf COMPILER_TYPE=clang __MAKE_CONF="
|
||||
|
||||
make -C${SRCDIR} -j${CPUS} buildworld ${MAKEARGS} NO_CLEAN=yes
|
||||
make -C${SRCDIR}/release obj ${MAKEARGS}
|
||||
|
|
|
@ -62,6 +62,10 @@ while getopts C:f:n:P:R:S:T:v: OPT; do
|
|||
export SRCDIR=${OPTARG}
|
||||
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
|
||||
;;
|
||||
s)
|
||||
export PRODUCT_SETTINGS=${OPTARG}
|
||||
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
|
||||
;;
|
||||
T)
|
||||
export TOOLSDIR=${OPTARG}
|
||||
SCRUB_ARGS=${SCRUB_ARGS};shift;shift
|
||||
|
@ -79,6 +83,7 @@ done
|
|||
if [ -z "${PRODUCT_NAME}" -o \
|
||||
-z "${PRODUCT_FLAVOUR}" -o \
|
||||
-z "${PRODUCT_VERSION}" -o \
|
||||
-z "${PRODUCT_SETTINGS}" -o \
|
||||
-z "${TOOLSDIR}" -o \
|
||||
-z "${PORTSDIR}" -o \
|
||||
-z "${PORTSREFDIR}" -o \
|
||||
|
@ -89,7 +94,6 @@ fi
|
|||
|
||||
# full name for easy use and actual config directory
|
||||
export PRODUCT_RELEASE="${PRODUCT_NAME}-${PRODUCT_VERSION}_${PRODUCT_FLAVOUR}"
|
||||
export PRODUCT_CONFIG="${TOOLSDIR}/config/${PRODUCT_NAME}"
|
||||
|
||||
# misc. foo
|
||||
export CONFIG_PKG="/usr/local/etc/pkg/repos/origin.conf"
|
||||
|
@ -101,10 +105,11 @@ export TARGET_ARCH=${ARCH}
|
|||
export TARGETARCH=${ARCH}
|
||||
|
||||
# define target directories
|
||||
export PACKAGESDIR="/.pkg"
|
||||
export CONFIGDIR="${TOOLSDIR}/config/${PRODUCT_SETTINGS}"
|
||||
export STAGEDIR="/usr/local/stage"
|
||||
export IMAGESDIR="/tmp/images"
|
||||
export SETSDIR="/tmp/sets"
|
||||
export PACKAGESDIR="/.pkg"
|
||||
|
||||
# bootstrap target directories
|
||||
mkdir -p ${STAGEDIR} ${IMAGESDIR} ${SETSDIR}
|
||||
|
|
|
@ -42,7 +42,7 @@ while read PORT_NAME PORT_CAT PORT_OPT; do
|
|||
fi
|
||||
|
||||
PORT_LIST="${PORT_LIST} ${PORT_NAME}"
|
||||
done < ${PRODUCT_CONFIG}/ports.conf
|
||||
done < ${CONFIGDIR}/ports.conf
|
||||
|
||||
extract_packages ${STAGEDIR} opnsense
|
||||
install_packages ${STAGEDIR} gettext-tools ${PORT_LIST}
|
||||
|
|
|
@ -36,7 +36,7 @@ git_describe ${SRCDIR}
|
|||
BUILD_KERNEL="SMP"
|
||||
|
||||
# XXX move config to src.git
|
||||
cp ${PRODUCT_CONFIG}/${BUILD_KERNEL} ${SRCDIR}/sys/${ARCH}/conf/${BUILD_KERNEL}
|
||||
cp ${CONFIGDIR}/${BUILD_KERNEL} ${SRCDIR}/sys/${ARCH}/conf/${BUILD_KERNEL}
|
||||
|
||||
MAKEARGS="TARGET_ARCH=${ARCH} KERNCONF=${BUILD_KERNEL}"
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ set -e
|
|||
|
||||
. ./common.sh && $(${SCRUB_ARGS})
|
||||
|
||||
PORT_LIST=$(cat ${PRODUCT_CONFIG}/ports.conf)
|
||||
PORT_LIST=$(cat ${CONFIGDIR}/ports.conf)
|
||||
|
||||
setup_stage ${STAGEDIR}
|
||||
setup_base ${STAGEDIR}
|
||||
|
@ -44,7 +44,7 @@ clean_packages ${STAGEDIR}
|
|||
|
||||
echo ">>> Building packages..."
|
||||
|
||||
MAKE_CONF="${PRODUCT_CONFIG}/make.conf"
|
||||
MAKE_CONF="${CONFIGDIR}/make.conf"
|
||||
if [ -f ${MAKE_CONF} ]; then
|
||||
cp ${MAKE_CONF} ${STAGEDIR}/etc/make.conf
|
||||
fi
|
||||
|
|
|
@ -29,7 +29,7 @@ set -e
|
|||
|
||||
. ./common.sh && $(${SCRUB_ARGS})
|
||||
|
||||
export __MAKE_CONF=${PRODUCT_CONFIG}/make.conf
|
||||
export __MAKE_CONF=${CONFIGDIR}/make.conf
|
||||
|
||||
git_update ${PORTSREFDIR} origin/master
|
||||
|
||||
|
@ -102,7 +102,7 @@ while read PORT_NAME PORT_CAT PORT_OPT; do
|
|||
PORTS_CHANGED="${PORTS_CHANGED} ${PORT}"
|
||||
fi
|
||||
done
|
||||
done < ${PRODUCT_CONFIG}/ports.conf
|
||||
done < ${CONFIGDIR}/ports.conf
|
||||
|
||||
echo "done"
|
||||
|
||||
|
|
Loading…
Reference in New Issue