summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbuild.sh31
-rwxr-xr-xtools/build_snapshots.sh11
-rw-r--r--tools/builder_defaults.sh3
3 files changed, 31 insertions, 14 deletions
diff --git a/build.sh b/build.sh
index 79d1ce0..989bc6c 100755
--- a/build.sh
+++ b/build.sh
@@ -51,8 +51,9 @@
set +e
usage() {
- echo "Usage $0 [options] [ iso | nanobsd | ova | nanobsd-vga | memstick | memstickserial | memstickadi | fullupdate | all ]"
+ echo "Usage $0 [options] [ iso | nanobsd | ova | nanobsd-vga | memstick | memstickserial | memstickadi | fullupdate | all | none ]"
echo " all = iso nanobsd nanobsd-vga memstick memstickserial memstickadi fullupdate"
+ echo " none = upgrade only pkg repo"
echo " [ options ]: "
echo " --flash-size|-f size(s) - a list of flash sizes to build with nanobsd i.e. '2g 4g'. Default: 2g"
echo " --no-buildworld|-c - Will set NO_BUILDWORLD NO_BUILDKERNEL to not build kernel and world"
@@ -137,7 +138,6 @@ while test "$1" != ""; do
;;
--snapshots)
export SNAPSHOTS=1
- IMAGETYPE="all"
;;
--poudriere-snapshots)
export POUDRIERE_SNAPSHOTS=1
@@ -195,7 +195,7 @@ while test "$1" != ""; do
--do-not-upload|-u)
export DO_NOT_UPLOAD=1
;;
- all|*iso*|*ova*|*memstick*|*memstickserial*|*memstickadi*|*nanobsd*|*nanobsd-vga*|*fullupdate*)
+ all|none|*iso*|*ova*|*memstick*|*memstickserial*|*memstickadi*|*nanobsd*|*nanobsd-vga*|*fullupdate*)
BUILDACTION="images"
IMAGETYPE="${1}"
;;
@@ -260,7 +260,7 @@ case $BUILDACTION in
printflags)
print_flags
;;
- images|snapshots)
+ images)
# It will be handled below
;;
updatesources)
@@ -336,13 +336,20 @@ if [ $# -gt 1 ]; then
echo
usage
fi
+
+if [ -n "${SNAPSHOTS}" -a -z "${IMAGETYPE}" ]; then
+ IMAGETYPE="all"
+fi
+
if [ -z "${IMAGETYPE}" ]; then
echo "ERROR: Need to specify image type to build."
echo
usage
fi
-if [ "$IMAGETYPE" = "all" ]; then
+if [ "$IMAGETYPE" = "none" ]; then
+ _IMAGESTOBUILD=""
+elif [ "$IMAGETYPE" = "all" ]; then
_IMAGESTOBUILD="iso fullupdate nanobsd nanobsd-vga memstick memstickserial"
if [ "${TARGET}" = "amd64" ]; then
_IMAGESTOBUILD="${_IMAGESTOBUILD} memstickadi"
@@ -476,11 +483,15 @@ if [ -n "${_bg_pids}" ]; then
fi
if [ -n "${SNAPSHOTS}" ]; then
- snapshots_copy_to_staging_iso_updates
- snapshots_copy_to_staging_nanobsd "${FLASH_SIZE}"
- # SCP files to snapshot web hosting area
- if [ -z "${DO_NOT_UPLOAD}" ]; then
- snapshots_scp_files
+ if [ "${IMAGETYPE}" = "none" -a -z "${DO_NOT_UPLOAD}" ]; then
+ pkg_repo_rsync "${CORE_PKG_PATH}"
+ elif [ "${IMAGETYPE}" != "none" ]; then
+ snapshots_copy_to_staging_iso_updates
+ snapshots_copy_to_staging_nanobsd "${FLASH_SIZE}"
+ # SCP files to snapshot web hosting area
+ if [ -z "${DO_NOT_UPLOAD}" ]; then
+ snapshots_scp_files
+ fi
fi
# Alert the world that we have some snapshots ready.
snapshots_update_status ">>> Builder run is complete."
diff --git a/tools/build_snapshots.sh b/tools/build_snapshots.sh
index 5297d17..cd42514 100755
--- a/tools/build_snapshots.sh
+++ b/tools/build_snapshots.sh
@@ -31,8 +31,9 @@
#
usage() {
- echo "Usage: $(basename $0) [-l] [-r] [-u] [-p]"
+ echo "Usage: $(basename $0) [-l] [-n] [-r] [-u] [-p]"
echo " -l: Build looped operations"
+ echo " -n: Do not build images, only core pkg repo"
echo " -p: Update poudriere repo"
echo " -r: Do not reset local changes"
echo " -u: Do not upload snapshots"
@@ -41,14 +42,18 @@ usage() {
export BUILDER_TOOLS=$(realpath $(dirname ${0}))
export BUILDER_ROOT=$(realpath "${BUILDER_TOOLS}/..")
+NO_IMAGES=""
NO_RESET=""
NO_UPLOAD=""
LOOPED_SNAPSHOTS=""
POUDRIERE_SNAPSHOTS=""
# Handle command line arguments
-while getopts lpru opt; do
+while getopts lnpru opt; do
case ${opt} in
+ n)
+ NO_IMAGES="none"
+ ;;
l)
LOOPED_SNAPSHOTS=1
;;
@@ -186,7 +191,7 @@ while [ /bin/true ]; do
done
(${BUILDER_ROOT}/build.sh ${NO_UPLOAD} --flash-size '2g 4g' \
- --snapshots 2>&1) | while read -r LINE; do
+ --snapshots ${NO_IMAGES} 2>&1) | while read -r LINE; do
snapshot_update_status "${LINE}"
done
fi
diff --git a/tools/builder_defaults.sh b/tools/builder_defaults.sh
index 8deb017..f812702 100644
--- a/tools/builder_defaults.sh
+++ b/tools/builder_defaults.sh
@@ -126,6 +126,7 @@ if [ -z "${PRODUCT_VERSION}" ]; then
export PRODUCT_VERSION=$(head -n 1 ${PRODUCT_SRC}/etc/version)
fi
+export PRODUCT_REVISION=${PRODUCT_REVISION:-""}
# Product repository tag to build
_cur_git_repo_branch_or_tag=$(git -C ${BUILDER_ROOT} rev-parse --abbrev-ref HEAD)
@@ -335,7 +336,7 @@ fi
export PKG_REPO_SIGNING_COMMAND=${PKG_REPO_SIGNING_COMMAND:-"ssh sign@codesigner.netgate.com sudo ./sign.sh ${PKG_REPO_SIGN_KEY}"}
# Define base package version, based on date for snaps
-export CORE_PKG_VERSION="${PRODUCT_VERSION%%-*}${CORE_PKG_DATESTRING}"
+export CORE_PKG_VERSION="${PRODUCT_VERSION%%-*}${CORE_PKG_DATESTRING}${PRODUCT_REVISION:+_}${PRODUCT_REVISION}"
export CORE_PKG_PATH=${CORE_PKG_PATH:-"${SCRATCHDIR}/${PRODUCT_NAME}_${POUDRIERE_BRANCH}_${TARGET_ARCH}-core"}
export CORE_PKG_REAL_PATH="${CORE_PKG_PATH}/.real_${DATESTRING}"
export CORE_PKG_TMP=${CORE_PKG_TMP:-"${SCRATCHDIR}/core_pkg_tmp"}
OpenPOWER on IntegriCloud