2014-11-09 10:57:12 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-01-20 10:43:35 +01:00
|
|
|
# Copyright (c) 2014-2016 Franco Fichtner <franco@opnsense.org>
|
2014-11-09 10:57:12 +01:00
|
|
|
#
|
|
|
|
# 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.
|
2014-11-09 11:06:26 +01:00
|
|
|
#
|
2014-11-09 10:57:12 +01:00
|
|
|
# 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
|
|
|
|
|
2015-05-16 12:48:14 +02:00
|
|
|
. ./common.sh && $(${SCRUB_ARGS})
|
2014-11-09 10:57:12 +01:00
|
|
|
|
2016-01-31 12:12:55 +01:00
|
|
|
KERNEL_SET=$(find ${SETSDIR} -name "kernel-*-${ARCH}.txz")
|
2016-01-20 10:43:35 +01:00
|
|
|
|
2016-01-31 17:27:44 +01:00
|
|
|
if [ -f "${KERNEL_SET}" -a -z "${1}" ]; then
|
2016-01-31 12:12:55 +01:00
|
|
|
echo ">>> Reusing kernel set: ${KERNEL_SET}"
|
2016-01-20 10:43:35 +01:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2016-01-31 12:12:55 +01:00
|
|
|
git_describe ${SRCDIR}
|
|
|
|
|
|
|
|
KERNEL_SET=${SETSDIR}/kernel-${REPO_VERSION}-${ARCH}
|
|
|
|
|
2016-01-20 10:43:35 +01:00
|
|
|
sh ./clean.sh kernel
|
|
|
|
|
2014-11-15 15:54:43 +01:00
|
|
|
BUILD_KERNEL="SMP"
|
|
|
|
|
2015-06-12 08:01:54 +02:00
|
|
|
cp ${CONFIGDIR}/${BUILD_KERNEL} ${SRCDIR}/sys/${ARCH}/conf/${BUILD_KERNEL}
|
2014-11-15 15:54:43 +01:00
|
|
|
|
2016-01-31 12:12:55 +01:00
|
|
|
MAKE_ARGS="TARGET_ARCH=${ARCH} KERNCONF=${BUILD_KERNEL}"
|
2014-11-09 10:57:12 +01:00
|
|
|
|
2016-02-01 18:34:13 +01:00
|
|
|
make -s -C${SRCDIR} -j${CPUS} buildkernel ${MAKE_ARGS} NO_KERNELCLEAN=yes
|
|
|
|
make -s -C${SRCDIR}/release obj ${MAKE_ARGS}
|
|
|
|
make -s -C${SRCDIR}/release kernel.txz ${MAKE_ARGS}
|
2014-11-09 10:57:12 +01:00
|
|
|
|
2016-01-31 12:12:55 +01:00
|
|
|
mv $(make -C${SRCDIR}/release -V .OBJDIR)/kernel.txz ${KERNEL_SET}.txz
|
2015-12-25 23:47:57 +01:00
|
|
|
|
2016-01-31 12:12:55 +01:00
|
|
|
generate_signature ${KERNEL_SET}.txz
|