opnsense-src/release
Colin Percival 0db0821fb8 release: Rework vm_extra_pre_umount
The vm_extra_pre_umount function in vmimage.subr served two purposes:
It removed /etc/resolv.conf and /qemu (if cross-building), and it
provided a function for cloudware to override in order to make cloud
specific changes to the filesystem before constructing a disk image.

This resulted in a number of bugs:
1. When cross-building, the emulator binary was left as /qemu in the
Azure, GCE, Openstack and Vagrant images.
2. The build host's resolv.conf was left as /etc/resolv.conf in the
basic-ci and basic-cloudinit images.
3. When building GCE images, a Google-specific resolv.conf file was
constructed, and then deleted before the disk image was created.

Move the bits needed for running code inside a VM staging directory
from vm_install_base into a new vm_emulation_setup routine, and move
the corresponding cleanup bits from vm_extra_pre_umount to a new
vm_emulation_cleanup routine.

Remove the /qemu and /etc/resolv.conf cleanups from the cloudware
configuration files (where they exist) since we will now be running
vm_emulation_cleanup to remove those even when vm_extra_pre_umount
has been overridden.

Override vm_emulation_cleanup in gce.conf since in that one case (and
*only* that one case) we don't want to clean up resolv.conf (since it
was constructed for the VM image rather than copied from the host).

releng/14.1 candidate.

MFC after:	1 week
Approved by:	re (delphij)
Sponsored by:	https://www.patreon.com/cperciva

(cherry picked from commit 0b1c5628c74a37e2aa2aa3769c606d3e826302f8)
(cherry picked from commit c5342be39c)
2024-05-14 14:38:09 -07:00
..
amd64 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
arm release: remove arm/armv6 RPI-B configuration file 2023-09-03 16:59:00 -04:00
arm64 arm64/RPI: enable powerd by default on arm64-aarch64-RPI images 2024-01-30 14:10:00 -06:00
i386 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
packages nuageinit: add basic support for cloudinit. 2024-04-11 13:52:52 +02:00
pkg_repos 14.1: create releng/14.1 branch 2024-05-02 23:13:50 -07:00
powerpc release: Fix powerpc boot block uudecoding 2024-04-16 22:43:27 -07:00
riscv Increase the size of riscv GENERICSD images to 6 GB 2024-01-15 07:29:35 -06:00
scripts release: Rework vm_extra_pre_umount 2024-05-14 14:38:09 -07:00
tools release: Rework vm_extra_pre_umount 2024-05-14 14:38:09 -07:00
Makefile release: Build dvd image before staging pkgs 2024-04-16 22:43:27 -07:00
Makefile.azure release: Support r/o /usr/ports for cloudware 2024-04-16 22:43:27 -07:00
Makefile.ec2 release: Support r/o /usr/ports for cloudware 2024-04-16 22:43:27 -07:00
Makefile.firecracker Firecracker: Make root disk configurable 2023-08-07 09:21:08 -07:00
Makefile.gce release: Support r/o /usr/ports for cloudware 2024-04-16 22:43:27 -07:00
Makefile.inc1 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.mirrors Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.vagrant release: Support r/o /usr/ports for cloudware 2024-04-16 22:43:27 -07:00
Makefile.vm release: Use qemu when cross-building vm images 2024-05-14 14:37:47 -07:00
rc.local bsdinstall release: Start installer on multiple consoles 2022-10-03 17:09:17 +01:00
release.conf.sample release: update stable/14 following branching from main 2023-08-24 19:07:33 -04:00
release.sh Reapply "release.sh: Add -jN to make release" 2024-04-16 22:43:26 -07:00