aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlen Barber <gjb@FreeBSD.org>2014-11-24 02:34:01 +0000
committerGlen Barber <gjb@FreeBSD.org>2014-11-24 02:34:01 +0000
commita4900ff5a54937813a00feb0f3f157a0c432dc3d (patch)
tree45542016665b8d24c07f8a709b2c6fde6792cd7a
parent30a20c89bf905f464bf62a3904e74802fb86b80d (diff)
downloadsrc-a4900ff5a54937813a00feb0f3f157a0c432dc3d.tar.gz
src-a4900ff5a54937813a00feb0f3f157a0c432dc3d.zip
In vm_extra_install_packages(), only bootstrap pkg(8)
if VM_EXTRA_PACKAGES is empty. In vm_extra_pre_umount(), cleanup downloaded packages if pkg(8) was bootstrapped earlier. Inspired by: cperciva Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/projects/release-vmimage/; revision=274945
-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