summaryrefslogtreecommitdiffstats
path: root/release/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts')
-rwxr-xr-xrelease/scripts/mk-vmimage.sh111
-rwxr-xr-xrelease/scripts/pkg-stage.sh34
-rwxr-xr-xrelease/scripts/relnotes-search.sh2
3 files changed, 143 insertions, 4 deletions
diff --git a/release/scripts/mk-vmimage.sh b/release/scripts/mk-vmimage.sh
new file mode 100755
index 0000000..b6122a5
--- /dev/null
+++ b/release/scripts/mk-vmimage.sh
@@ -0,0 +1,111 @@
+#!/bin/sh
+#-
+# Copyright (c) 2014 The FreeBSD Foundation
+# All rights reserved.
+#
+# This software was developed by Glen Barber under sponsorship
+# from the FreeBSD Foundation.
+#
+# 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.
+#
+# mk-vmimage.sh: Create virtual machine disk images in various formats.
+#
+# $FreeBSD$
+#
+
+usage() {
+ echo "${0} usage:"
+ echo "${@}"
+ return 1
+}
+
+main() {
+ local arg
+ while getopts "C:c:d:f:i:o:s:S:" arg; do
+ case "${arg}" in
+ C)
+ VMBUILDCONF="${OPTARG}"
+ ;;
+ c)
+ VMCONFIG="${OPTARG}"
+ ;;
+ d)
+ DESTDIR="${OPTARG}"
+ ;;
+ f)
+ VMFORMAT="${OPTARG}"
+ ;;
+ i)
+ VMBASE="${OPTARG}"
+ ;;
+ o)
+ VMIMAGE="${OPTARG}"
+ ;;
+ s)
+ VMSIZE="${OPTARG}"
+ ;;
+ S)
+ WORLDDIR="${OPTARG}"
+ ;;
+ *)
+ ;;
+ esac
+ done
+ shift $(( ${OPTIND} - 1))
+
+ if [ -z "${VMBASE}" -o \
+ -z "${WORLDDIR}" -o \
+ -z "${DESTDIR}" -o \
+ -z "${VMSIZE}" -o \
+ -z "${VMIMAGE}" -o \
+ -z "${VMCONFIG}" ];
+ then
+ usage
+ fi
+
+ if [ -z "${VMBUILDCONF}" ] || [ ! -e "${VMBUILDCONF}" ]; then
+ echo "Must provide the path to vmimage.subr."
+ return 1
+ fi
+
+ . "${VMBUILDCONF}"
+
+ if [ ! -z "${VMCONFIG}" ] && [ -e "${VMCONFIG}" ]; then
+ . "${VMCONFIG}"
+ fi
+
+ vm_create_base
+ vm_install_base
+ vm_extra_install_base
+ vm_extra_install_packages
+ vm_extra_install_ports
+ vm_extra_enable_services
+ vm_extra_pre_umount
+ vm_extra_pkg_rmcache
+ cleanup
+ vm_create_disk || return 0
+ vm_extra_create_disk
+
+ return 0
+}
+
+main "$@"
diff --git a/release/scripts/pkg-stage.sh b/release/scripts/pkg-stage.sh
index 0b99632..095f996 100755
--- a/release/scripts/pkg-stage.sh
+++ b/release/scripts/pkg-stage.sh
@@ -11,7 +11,7 @@ export PERMISSIVE="YES"
export REPO_AUTOUPDATE="NO"
export PKGCMD="/usr/sbin/pkg -d"
-DVD_PACKAGES="archivers/unzip
+_DVD_PACKAGES="archivers/unzip
devel/subversion
devel/subversion-static
emulators/linux_base-f10
@@ -27,23 +27,51 @@ sysutils/screen
www/firefox
www/links
x11-drivers/xf86-video-vmware
-x11/gnome2
+x11/gnome3
x11/kde4
x11/xorg"
# If NOPORTS is set for the release, do not attempt to build pkg(8).
if [ ! -f /usr/ports/Makefile ]; then
+ echo "*** /usr/ports is missing! ***"
+ echo "*** Skipping pkg-stage.sh ***"
+ echo "*** Unset NOPORTS to fix this ***"
exit 0
fi
if [ ! -x /usr/local/sbin/pkg ]; then
+ /etc/rc.d/ldconfig restart
/usr/bin/make -C /usr/ports/ports-mgmt/pkg install clean
fi
+export DVD_DIR="dvd/packages"
export PKG_ABI=$(pkg config ABI)
-export PKG_REPODIR="dvd/packages/${PKG_ABI}"
+export PKG_ALTABI=$(pkg config ALTABI 2>/dev/null)
+export PKG_REPODIR="${DVD_DIR}/${PKG_ABI}"
/bin/mkdir -p ${PKG_REPODIR}
+if [ ! -z "${PKG_ALTABI}" ]; then
+ (cd ${DVD_DIR} && ln -s ${PKG_ABI} ${PKG_ALTABI})
+fi
+
+# Ensure the ports listed in _DVD_PACKAGES exist to sanitize the
+# final list.
+for _P in ${_DVD_PACKAGES}; do
+ if [ -d "/usr/ports/${_P}" ]; then
+ DVD_PACKAGES="${DVD_PACKAGES} ${_P}"
+ else
+ echo "*** Skipping nonexistent port: ${_P}"
+ fi
+done
+
+# Make sure the package list is not empty.
+if [ -z "${DVD_PACKAGES}" ]; then
+ echo "*** The package list is empty."
+ echo "*** Something is very wrong."
+ # Exit '0' so the rest of the build process continues
+ # so other issues (if any) can be addressed as well.
+ exit 0
+fi
# Print pkg(8) information to make debugging easier.
${PKGCMD} -vv
diff --git a/release/scripts/relnotes-search.sh b/release/scripts/relnotes-search.sh
index a9a931a..895f399 100755
--- a/release/scripts/relnotes-search.sh
+++ b/release/scripts/relnotes-search.sh
@@ -125,7 +125,7 @@ main() {
# All tests passed. Let's see what can possibly go wrong
# from here. The search string specified should match this
# in PCRE speak: ':[\t ]*'
- ${svn} log ${rev} --search 'Relnotes:?[^ ]*' ${1} > ${where}
+ ${svn} log ${rev} --search 'Relnotes:*[A-Za-z0-9]*' ${1} > ${where}
return $?
}
OpenPOWER on IntegriCloud