Unverified Commit 9747d40c authored by Shawn Webb's avatar Shawn Webb
Browse files

Build finished successfully



We now have the basics for building HardenedBSD and publishing built
artifacts. Note that this is just a functionality check-in before more
extensive work. The build is currently performed with hard-coded
variables. Obviously, that will need to change to a dynamic config file.
Signed-off-by: Shawn Webb's avatarShawn Webb <shawn.webb@hardenedbsd.org>
parent e583ffbe
...@@ -24,7 +24,27 @@ ...@@ -24,7 +24,27 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE. # SUCH DAMAGE.
. ./lib/build.sh
. ./lib/publish.sh
main() { main() {
HBSD_BUILDNUMBER=1
HBSD_KERNEL=HARDENEDBSD
HBSD_NJOBS=4
HBSD_OBJRELDIR=/usr/obj/usr/src/amd64.amd64/release
HBSD_PUBDIR=/build/pub
HBSD_SRC=/usr/src
HBSD_STAGEDIR=/build/stage
HBSD_TARGET=amd64
HBSD_TARGET_ARCH=amd64
build_hardenedbsd && \
build_release && \
stage_release && \
sign_release && \
publish_release && \
kick_publisher_tires
return ${?}
} }
main ${0} $* main ${0} $*
......
...@@ -30,15 +30,17 @@ build_hardenedbsd() { ...@@ -30,15 +30,17 @@ build_hardenedbsd() {
cd ${HBSD_SRC} cd ${HBSD_SRC}
make \ make \
-n ${NJOBS} \ -j ${HBSD_NJOBS} \
TARGET=${HBSD_TARGET} \ TARGET=${HBSD_TARGET} \
TARGET_ARCH=${HBSD_TARGET_ARCH} \ TARGET_ARCH=${HBSD_TARGET_ARCH} \
-DNO_CLEAN \
buildworld buildworld
make \ make \
-n ${NJOBS} \ -j ${HBSD_NJOBS} \
TARGET=${HBSD_TARGET} \ TARGET=${HBSD_TARGET} \
TARGET_ARCH=${HBSD_TARGET_ARCH} \ TARGET_ARCH=${HBSD_TARGET_ARCH} \
KERNCONF=${HBSD_KERNEL} \ KERNCONF=${HBSD_KERNEL} \
-DNO_KERNELCLEAN \
buildkernel buildkernel
) )
return ${?} return ${?}
...@@ -71,9 +73,40 @@ stage_release() { ...@@ -71,9 +73,40 @@ stage_release() {
local f local f
local file local file
for file in $(find ${HBSD_OBJRELDIR} -maxdepth 1 -name '*.iso' - -name '*.img'); do mkdir -p \
${HBSD_STAGEDIR} \
${HBSD_PUBDIR}
for file in $(find ${HBSD_OBJRELDIR} -maxdepth 1 \
-name '*.iso' \
-o -name '*.img' \
-o -name '*.txz' \
-o -name 'MANIFEST'); do
f=${file##*/} f=${file##*/}
mv ${file} ${HBSD_STAGEDIR}/${f} mv ${file} ${HBSD_STAGEDIR}/${f}
xz -c9 ${HBSD_STAGEDIR}/${f} > ${HBSD_STAGEDIR}/${f}.xz xz -kc9 ${HBSD_STAGEDIR}/${f} > ${HBSD_STAGEDIR}/${f}.xz
done done
return 0
}
sign_release() {
(
cd ${HBSD_STAGEDIR}
for file in $(find . \
-name '*.txz' \
-o -name '*.img' \
-o -name '*.iso' \
-o -name 'MANIFEST'); do
f=${file##*/}
sha256 ${f} >> CHECKSUMS.SHA256
sha512 ${f} >> CHECKSUMS.SHA512
if [ ! -z "${HBSD_GPG_KEY}" ]; then
gpg --sign -a --detach \
-u ${HBSD_GPG_KEY} \
-o ${f}.asc \
${f}
fi
done
)
return 0
} }
#!/bin/sh
#-
# Copyright (c) 2019 HardenedBSD
# Author: Shawn Webb <shawn.webb@hardenedbsd.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.
publish_release() {
mv ${HBSD_STAGEDIR} ${HBSD_PUBDIR}/${HBSD_BUILDNUMBER}
return ${?}
}
kick_publisher_tires() {
# This function is for those mirrors that require push rather
# than pull. For now: nothing to see here; move along.
return 0
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment