aboutsummaryrefslogtreecommitdiff
path: root/release
diff options
context:
space:
mode:
Diffstat (limited to 'release')
-rw-r--r--release/tools/vmimage.subr9
1 files changed, 7 insertions, 2 deletions
diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr
index c7805721d2a5..3ea505619bef 100644
--- a/release/tools/vmimage.subr
+++ b/release/tools/vmimage.subr
@@ -114,14 +114,15 @@ vm_extra_enable_services() {
}
vm_extra_install_packages() {
+ if [ -z "${VM_EXTRA_PACKAGES}" ]; then
+ return 0
+ fi
mkdir -p ${DESTDIR}/dev
mount -t devfs devfs ${DESTDIR}/dev
chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes \
/usr/sbin/pkg bootstrap -y
- if [ ! -z "${VM_EXTRA_PACKAGES}" ]; then
chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes \
/usr/sbin/pkg install -y ${VM_EXTRA_PACKAGES}
- fi
umount ${DESTDIR}/dev
return 0
@@ -138,6 +139,10 @@ vm_extra_pre_umount() {
# Prototype. When overridden, installs additional ports within the
# virtual machine environment.
+ if [ -e ${DESTDIR}/usr/local/sbin/pkg ]; then
+ chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes \
+ /usr/local/sbin/pkg clean -y -a
+ fi
rm -f ${DESTDIR}/etc/resolv.conf
return 0