From ad33b776110e2ed58f9847471d200e0e7302281a Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Thu, 9 Mar 2017 01:26:10 +0000 Subject: [PATCH] ec2.conf and vmimage.subr can be used from the installation livecd after install to prepare an AMI image. This can be used to create a ZFS AMI disk image using a virtual machine. Change ec2.conf to use the pkg tool from a chroot rather than trying to bootstrap it and fail from the livecd readonly filesystem. Reviewed by: gjb --- release/tools/ec2.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf index 85714c3253cb..4581788c7531 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -32,7 +32,8 @@ vm_extra_pre_umount() { # catalogue and install or update pkg when the instance first # launches, so these files would just be replaced anyway; removing # them from the image allows it to boot faster. - env ASSUME_ALWAYS_YES=yes pkg -c ${DESTDIR} delete -f -y pkg + chroot ${DESTDIR} env ASSUME_ALWAYS_YES=yes \ + /usr/sbin/pkg delete -f -y pkg rm ${DESTDIR}/var/db/pkg/repo-*.sqlite # The size of the EC2 root disk can be configured at instance launch