Skip to content

Commit

Permalink
Merge branch 'opnsense:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
maurice-w authored Dec 3, 2024
2 parents 4bb9adc + 2ad6f99 commit 7dd1703
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 13 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ STEPS= audit arm base boot chroot clean clone compress confirm \
connect core distfiles download dvd fingerprint info \
kernel list make.conf nano options packages plugins ports \
prefetch print rebase release rename serial sign skim \
sync test update upload verify vga vm xtools
sync test tests update upload verify vga vm xtools
SCRIPTS= custom distribution factory hotfix nightly watch

.PHONY: ${STEPS} ${SCRIPTS}
Expand Down Expand Up @@ -136,7 +136,8 @@ SRCDIR?= ${ROOTDIR}/src

# A couple of meta-targets for easy use and ordering:

kernel ports distfiles: base
kernel tests ports distfiles: base
kernel: tests
audit plugins: ports
core: plugins
packages test: core
Expand Down
13 changes: 5 additions & 8 deletions build/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ for ARG in ${@}; do
echo ">>> Removing arm image"
rm -f ${IMAGESDIR}/*-arm-${PRODUCT_ARCH}-${PRODUCT_DEVICE}.img*
;;
aux)
echo ">>> Removing aux set"
rm -f ${SETSDIR}/aux-*-${PRODUCT_ARCH}.*
aux|tests|xtools)
echo ">>> Removing ${ARG} set"
rm -f ${SETSDIR}/${ARG}-*-${PRODUCT_ARCH}.*
;;
base)
echo ">>> Removing base set"
echo ">>> Removing base including tests set"
rm -f ${SETSDIR}/base-*-${PRODUCT_ARCH}${PRODUCT_DEVICE+"-${PRODUCT_DEVICE}"}.*
rm -f ${SETSDIR}/tests-*-${PRODUCT_ARCH}.*
;;
core)
echo ">>> Removing core from packages set"
Expand Down Expand Up @@ -141,9 +142,5 @@ for ARG in ${@}; do
echo ">>> Removing vm image"
rm -f ${IMAGESDIR}/*-vm-${PRODUCT_ARCH}.*
;;
xtools)
echo ">>> Removing xtools set"
rm -f ${SETSDIR}/xtools-*-${PRODUCT_ARCH}.*
;;
esac
done
3 changes: 2 additions & 1 deletion build/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,7 @@ check_packages()
PKG_HAVE=$(pkg -v | cut -d. -f 1-2)
if [ "${PKG_WANT}" != "${PKG_HAVE}" ]; then
echo "Installed pkg version '${PKG_HAVE}' does not match required version '${PKG_WANT}'" >&2
echo "To fix this please run 'make -C ${PORTSDIR}/ports-mgmt/pkg clean all reinstall'" >&2
exit 1
fi

Expand Down Expand Up @@ -771,7 +772,7 @@ find_set()
aux|packages|release)
echo $(find ${SETSDIR} -name "${1}-*-${PRODUCT_ARCH}.tar")
;;
xtools)
tests|xtools)
echo $(find ${SETSDIR} -name "${1}-*-${PRODUCT_ARCH}.txz")
;;
*)
Expand Down
2 changes: 1 addition & 1 deletion build/rename.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ for ARG in ${@}; do
mv ${FILE} ${IMAGESDIR}/${PRODUCT_NAME}${PRODUCT_SUFFIX}-${PRODUCT_VERSION}-arm-${FILE##*-arm-}
done
;;
aux|distfiles|packages)
aux|distfiles|packages|tests)
echo ">>> Renaming ${ARG} set: ${PRODUCT_VERSION}"
for FILE in $(find ${SETSDIR} -name \
"${ARG}-*-${PRODUCT_ARCH}.*"); do
Expand Down
64 changes: 64 additions & 0 deletions build/tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/sh

# Copyright (c) 2024 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.

set -e

SELF=tests

. ./common.sh

TESTSSET=$(find_set tests)

if [ -f "${TESTSSET}" -a -z "${1}" ]; then
echo ">>> Reusing tests set: ${TESTSSET}"
exit 0
fi

git_branch ${SRCDIR} ${SRCBRANCH} SRCBRANCH
git_version ${SRCDIR}

TESTSSET=${SETSDIR}/tests-${PRODUCT_VERSION}-${PRODUCT_ARCH}.txz

MAKE_ARGS="
TARGET_ARCH=${PRODUCT_ARCH}
TARGET=${PRODUCT_TARGET}
SRCCONF=${CONFIGDIR}/src.conf
WITHOUT_DEBUG_FILES=yes
__MAKE_CONF=
${MAKE_ARGS_DEV}
"

${ENV_FILTER} make -C${SRCDIR}/lib/libnetbsd -j${CPUS} all ${MAKE_ARGS}
${ENV_FILTER} make -C${SRCDIR}/tests -j${CPUS} all ${MAKE_ARGS}

setup_stage ${STAGEDIR} work/usr/tests
mtree -deiU -f ${SRCDIR}/etc/mtree/BSD.tests.dist -p ${STAGEDIR}/work/usr/tests

${ENV_FILTER} make -C${SRCDIR}/tests install ${MAKE_ARGS} DESTDIR=${STAGEDIR}/work

generate_set ${STAGEDIR}/work ${TESTSSET}
generate_signature ${TESTSSET}
2 changes: 1 addition & 1 deletion build/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ for ARG in ${@}; do
arm|dvd|nano|serial|vga|vm)
upload ${ARG} ${IMAGESDIR} "*-${ARG}-*${PRODUCT_DEVICE+"-${PRODUCT_DEVICE}"}*"
;;
aux|distfiles|packages|release)
aux|distfiles|packages|release|tests)
upload ${ARG} ${SETSDIR} "${ARG}-*"
;;
base|kernel)
Expand Down

0 comments on commit 7dd1703

Please sign in to comment.