diff options
author | gjb <gjb@FreeBSD.org> | 2014-11-24 02:34:01 +0000 |
---|---|---|
committer | gjb <gjb@FreeBSD.org> | 2014-11-24 02:34:01 +0000 |
commit | 14b8fb23980471b417fd74d0aabf4df363e9da54 (patch) | |
tree | 45542016665b8d24c07f8a709b2c6fde6792cd7a /release/tools | |
parent | 5074f8a73ef15d33d0e142de9376bc34ec07dbdf (diff) | |
download | FreeBSD-src-14b8fb23980471b417fd74d0aabf4df363e9da54.zip FreeBSD-src-14b8fb23980471b417fd74d0aabf4df363e9da54.tar.gz |
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
Diffstat (limited to 'release/tools')
-rw-r--r-- | release/tools/vmimage.subr | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index c780572..3ea5056 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 |