aboutsummaryrefslogtreecommitdiff
path: root/release/tools/vmimage.subr
Commit message (Collapse)AuthorAgeFilesLines
* Use makefs(8) in release VM-image generation instead of md(4) and newfs.Nathan Whitehorn2021-02-251-100/+77
| | | | | | | | | | | | | | Using makefs instead reduces the privileges needed to build VM images, simplifies the script (no need to copy files to a fresh image at the end), and improves portability by allowing generation of cross-endian images. As a result of the last, this patch also adds support for generation of powerpc64 and powerpc64le VM images. No other changes to the output. Tested and working for both amd64 and powerpc64 targets. Reviewed by: gjb Differential Revision: https://reviews.freebsd.org/D28912
* Mount the ESP on /boot/efi in VM images.Nathan Whitehorn2021-02-241-1/+10
| | | | | This follows an earlier change (0b7472b3d8d2) for mounting the ESP from systems set up through the installer and should be MFC'ed with it.
* riscv: allow building virtual machine imagesMitchell Horne2020-12-081-1/+1
| | | | | | | | | | | | RISC-V has the same booting requirements as arm64 (loader.efi, no legacy boot options), so generated images for both architectures have the same partition layout. Reviewed by: gjb Differential Revision: https://reviews.freebsd.org/D27044 Notes: svn path=/head/; revision=368422
* arm64: convert virtual machine images to GPTMitchell Horne2020-10-301-2/+2
| | | | | | | | | | | | | | | | | | | These images were switched to MBR in r281876 as a way to cope with a hard-coded partition GUID in QEMU's default EFI firmware. Enough time has passed that this is no longer a problem; QEMU versions >= 4.0 include a copy of edk2 EFI firmware that can detect the root filesystem properly. Alternatively, sysutils/u-boot-qemu-arm64 can be used. Switch back to building these images with a GPT partition table, and re-enable the swap partition. Reviewed by: gjb, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26986 Notes: svn path=/head/; revision=367177
* vmimage.subr: noisier failure for unsupported targetsMitchell Horne2020-10-301-2/+2
| | | | | | | | | | | | | | | | | | | The return code of write_partition_layout() doesn't bubble up, so an invocation of make vm-release for an incorrect/unsupported target will appear to succeed while make vm-install will fail due to missing files. This isn't a common point of failure, but is worth handling properly. Upgrade this case to print a message to stderr, and exit in place. This is okay to do since at this point in the execution of mk-vmimage.sh, cleanup() has already been run. Reviewed by: gjb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26985 Notes: svn path=/head/; revision=367176
* Slight refactor in vmimage.subrMitchell Horne2020-10-301-24/+30
| | | | | | | | | | | | De-duplicate the invocation of mkimg(1). No functional change. Reviewed by: gjb MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26984 Notes: svn path=/head/; revision=367175
* Enable EFI system partition on amd64 and i386 VM imagesOleksandr Tymoshenko2020-07-141-0/+5
| | | | | | | | | | | EFI support is a hard requirement for generating Hyper-V Gen2 VM images. Reviewed by: gjb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25655 Notes: svn path=/head/; revision=363187
* Revert r348438.Glen Barber2019-05-311-4/+0
| | | | | | | | | | | | | | | | The fix to override the default python version when building the sysutils/py-google-compute-engine did not work, and there are still issues that need to be addressed in the port itself. See bugzilla 238267 for additional details. MFC after: 6 days MFC with: r348438 MFC note: no-op to appease the merge tracker Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=348474
* Fix GCE virtual machine startup.Glen Barber2019-05-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | The ports/head branch recently switched to python3 as the default, which breaks the sysutils/py-google-compute-engine startup scripts, as lang/python installs lang/python3{,.x} where lang/python2{,.x} are needed. Set DEFAULT_VERSIONS in release/tools/gce.conf to python=2.7, and remove the lang/python3 inclusion in VM_EXTRA_PACKAGES. Additionally, unset DEFAULT_VERSIONS in release/tools/vmimage.subr to prevent persistence of DEFAULT_VERSIONS=python=2.7 in subsequent VM/cloud image builds. Note: at present, this affects only 13-CURRENT and 12-STABLE, as the stable/11 branch had already switched to using the 2019Q2 branch at the start of the 11.3-RELEASE cycle, so this does not immediately affect 11.3-BETA, hence the 1-week merge timeout. This had been manually tested on 13-CURRENT. Reported by: ler (privately) MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=348438
* Reduce the default image size for virtual machine disk images fromGlen Barber2019-04-301-0/+3
| | | | | | | | | | | | | | | | | 30GB to 3GB. The raw images can be resized using truncate(1), and other formats can be resized with tools included with other tools included with other hypervisors. Enable the growfs(8) rc(8) at firstboot if the disk was resized prior to booting the virtual machine for the first time. Discussed with: several PR: 232313 (requested in other context) MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=346959
* Add support for cross-building cloudware images.Colin Percival2019-04-031-5/+13
| | | | | | | | | | | | | | If MACHINE_ARCH doesn't match TARGET_ARCH, and we're not in the special case of building i386 images on an amd64 host, we need to pull in the qemu-user-static package; this allows us to run some commands inside the VM disk image chroot, most notably to install packages. Reviewed by: gjb MFC after: 2 weeks Sponsored by: FreeBSD/EC2 patreon (https://www.patreon.com/cperciva) Notes: svn path=/head/; revision=345858
* Rework UEFI ESP generationRebecca Cran2018-12-201-1/+8
| | | | | | | | | | | | | | | | Currently, the installer uses pre-created 800KB FAT12 filesystems that it dd's onto the ESP partition. This changeset improves that by having the installer generate a FAT32 filesystem directly onto the ESP using newfs_msdos and then copying loader.efi into /EFI/freebsd. For live installs it then runs efibootmgr to add a FreeBSD boot entry in the BIOS. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D17947 Notes: svn path=/head/; revision=342283
* Fix an indentation nit.Glen Barber2017-11-301-2/+2
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=326411
* Move sys/boot to stand. Fix all references to new locationWarner Losh2017-11-141-1/+1
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=325834
* Add option UNIFIED_OBJDIR, on by default, which moves the default build OBJDIR.Bryan Drewery2017-11-011-7/+4
| | | | | | | | | | | | | | | | | | | | | | This changes the build OBJDIR from the older style of /usr/obj/<srcdir> for native builds, and /usr/obj/<target>.<target_arch>/<srcdir> for cross builds to a new simpler format of /usr/obj/<srcdir>/<target>.<target_arch>. This new format is used regardless of cross or native build. It allows easier management of multiple source tree object directories. The UNIFIED_OBJDIR option will be removed and its feature made permanent for the 12.0 release. Relnotes: yes (don't note UNIFIED_OBJDIR option since it will be removed) Prior work: D3711 D874 Reviewed by: gjb, sjg Discussed at: https://lists.freebsd.org/pipermail/freebsd-arch/2016-May/017805.html Discussed with: emaste Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12840 Notes: svn path=/head/; revision=325288
* Set a default hostname for virtual machine images.Glen Barber2017-10-301-0/+4
| | | | | | | | | | | | | A recent bug in security/sudo causes segmentation faults when the system is not configured with a hostname, which causes issues with some virtual machine setups, notably Vagrant. Set the default hostname to the output of 'uname -o'. Submitted by: Nicholas Fiorentini Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=325156
* Bootstrap etcupdate(8) and mergemaster(8) databases when creatingGlen Barber2017-09-201-0/+9
| | | | | | | | | | | | | | virtual machine images and embedded images, similar to what is done when extracting base.txz to the target root filesystem in an new installation. Noticed by: marius Tested with: head@r323729 MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=323812
* Enable DHCP and IPv6 autoconfig on non-cloud VM images.Glen Barber2017-05-251-0/+5
| | | | | | | | | PR: 203653 MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=318872
* Trim trailing '/release/..' when setting _OBJDIR so arm64/aarch64Glen Barber2017-04-191-0/+1
| | | | | | | | | boot1.efifat is properly located when creating virtual machine images. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=317169
* Add the ability to override the size of the swap partition when buildingNavdeep Parhar2016-10-101-1/+1
| | | | | | | | | | VM images. The default continues to be 1G. Reviewed by: gjb@ Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=307008
* In vm_copy_base(), turn off SU+J on the resultant filesystem,Glen Barber2015-09-291-1/+1
| | | | | | | | | | | leaving only SU enabled. Discussed with: kib (a few weeks ago) MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=288370
* Fix virtual machine disk format creating by passing VMFORMATGlen Barber2015-05-111-3/+4
| | | | | | | | | | | | to mkimg(1) PR: 200068 Submitted by: Jeremy Norris MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=282772
* Fix a comment.Glen Barber2015-04-271-2/+4
| | | | | | | | MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=282112
* Create the arm64/aarch64 VM disk image as MBR instead ofGlen Barber2015-04-231-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | GPT scheme. UEFI needs to know the unique partition GUID with GPT, which changes each time. Specifically, the QEMU EFI BIOS file has this hard-coded.[1] Since the GPT labels are now unavailable, unconditionally label the root filesystem as 'rootfs' with newfs(8), since it does not hurt anything anywhere else. For the arm64 case, '/' is mounted from /dev/ufs/rootfs; for all other VM images, '/' is mounted from /dev/gpt/rootfs. Unfortunately, since the /dev/gpt/swapfs label is also lost, set NOSWAP=1 for the arm64/aarch64 images. This is temporary, until I figure out a scalable solution to this. But, a certain piece of softare was written "very fast", and ended up living for 15 years. We can deal with this for a week or so. Information from: andrew, emaste [1] Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=281876
* Revert r281809, which did more harm than good, and applyGlen Barber2015-04-211-4/+4
| | | | | | | | | | a more proper fix when attempting to locate the /boot files. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=281832
* Simplify variable expansion in attempt to fix the vm-image build.Glen Barber2015-04-211-3/+3
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=281809
* Add support for building arm64/aarch64 virtual machine images.Glen Barber2015-04-201-0/+7
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-arm64/; revision=281786
* When building VM disk images, vm_copy_base() uses tar(1) toGlen Barber2015-04-201-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | copy the userland from one md(4)-mounted filesystem to a clean filesystem to prevent remnants of files that were added and removed from resulting in an unclean filesystem. When newfs(8) creates the first filesystem with journaled soft-updates enabled, the /.sujournal file in the new filesystem cannot be overwritten by the /.sujournal in the original filesystem. To avoid this particular error case, do not enable journaled soft-updates when creating the md(4)-backed filesystems, and instead use tunefs(8) to enable journaled soft-updates after the new filesystem is populated in vm_copy_base(). While here, fix a long standing bug where the build environment /boot files were used by mkimg(1) when creating the VM disk images by using the files in .OBJDIR. MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=281783
* Improve check for whether ${DESTDIR}/dev is mounted.Colin Percival2015-03-301-1/+1
| | | | | | | Submitted by: gcooper Notes: svn path=/head/; revision=280846
* Clean up filesystem unmounting in vmimage builds:Colin Percival2015-03-301-11/+14
| | | | | | | | | | | | | | | | * Remove vm_umount_base function which is currently unused. * Add umount_loop function which loops attempting to unmount one filesystem. * Replace calls to umount with calls to umount_loop. * Don't attempt to unmount ${DESTDIR}/dev if it isn't mounted. The looping is necessary because sometimes umount fails due to filesystems being busy. The most common cause of such busyness is periodic(8) jobs running `find / ...`. Reviewed by: gjb Notes: svn path=/head/; revision=280840
* When creating VM images, copy the contents of the created filesystem intoColin Percival2015-03-201-0/+29
| | | | | | | | | | | a new filesystem before packaging it into a disk image. This prevents "remnants" of deleted files from showing up in the VM images, and reduces their compressed size (by about 10% for the cloudware images) as a result. Looks good to: gjb Notes: svn path=/head/; revision=280299
* Merge the following revisions from ^/projects/release-vmimage:Glen Barber2015-01-201-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r273823-r273826, r273833, r273836, r273944, r274069-r274071, r274134, r274211, r274280-r274285, r274287-r274288, r274292, r274296-r274297, r274356, r274533, r274725, r274726, r274729, r274734, r274771, r274945-r274946, r277180, r277183-r277184, r277186-r277187, r277250-r277253, r277263-r277264, r277383-r277384, r277393-r277395, r277438-r277439, r277447, r277455: r273823: Move virtual machine / cloud provider targets and options from release/Makefile to their own Makefile. r273824: Add glue to allow enabling building cloud provider VM images by default. When WITH_CLOUDWARE is not empty, add CLOUDTARGETS to the release/Makefile 'release' target. r273825: Avoid hard-coding the Azure image file format. While here, avoid using OSRELEASE for the output file name. r273826: Remove a few vestiges of passing an exit code to panic(). r273833: Initial commit providing a mechanism to create openstack images as part of the release build. r273836: Fix output file name for openstack images. No further conversion is necessary for this VM file target, so there is no need to append the '.raw' suffix here. r273944: Uncomment the cloudinit rc.conf(5) line. r274069: Add line continuation so OPENSTACKCONF is actually included in the env(1). r274070: Add a 'vm-cloudware' target, used to drive all targets in CLOUDTARGETS. r274071: Add examples for WITH_CLOUDWARE to release.conf.sample. Add WITH_CLOUDWARE evaluation to RELEASE_RMAKEFLAGS. r274134: Initial rewrite to consolidate VM image build scripts into one. r274211: Add write_partition_layout() used to populate the final image. Fix duplicated mkimg(1) call in vm_create_disk(). Add primitive (untested) PowerPC/PowerPC64 VM image support. Note: As it is currently written, the /boot/pmbr and /boot/{gptboot,boot1.hfs} use the build host and not the target build. Fixing this is likely going to be a hack in itself. r274280: Return if vm_create_disk() is unsuccessful. r274281: Add CLEANFILES entry for VM targets r274282: Add vm_extra_pre_umount() prototype to vmimage.subr. r274283: Fix DESTDIR for installworld, and make sure it is created before use. r274284: Move usage() from vmimage.subr to mk-vmimage.sh, in case vmimage.subr has not been sourced. r274285: Spell 'OPTARG' correctly. Actually call vm_create_base(). r274287: Fix line continuation in write_partition_layout(). Remove variable test that is no longer needed. r274288: Fix scheme flag to mkimg(1). r274292: mount(8) and umount(8) devfs(5) as needed. r274296: Change path for mk-vmimage.sh from ${TARGET}/ to scripts/ now that it is consolidated into one file. Fix paths for the base image and output disk image files. r274297: Call cleanup() after everything is done. r274356: Remove a stray directory from CLEANFILES. r274533: Set the boot partition type to 'apple-boot' for powerpc. r274725: In vm_install_base(), copy the host resolv.conf into the build chroot before attempting to do anything that requires working DNS (i.e., pkg bootstrap). In vm_extra_pre_umount(), remove the resolv.conf before the disk image is unmounted from the backing md(4). r274726 (cperciva): Silence errors when umounting the chroot's /dev, since it probably doesn't exist when we're running this. Unmount filesystems before attempting to destroy the md which holds them. r274729 (cperciva): Unmount filesystem and destroy md before we read the vnode from disk and package it into a disk image. Otherwise we end up packaging an unclean filesystem. r274734 (cperciva): Merge duplicative vm-CLOUDTYPE targets before additional duplication gets added by the impending arrival of ec2 and gcloud. r274771 (cperciva): Add NOSWAP option which can be set by a vmimage.conf file to specify that no swap space should be created in the image. This will be used by EC2 builds, since FreeBSD/EC2 allocates swap space on "ephemeral" disks which are physically attached to the Xen host node. r274945: 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. r274946: Fix indentation nit. r277180: In vm_extra_install_base(), do not install waagent in the openstack image, because it is not used. This appears to be a copy mistake. Remove vm_extra_install_base() from the openstack.conf entirely, since it does not need to be overridden. r277183: Enable the textmode console by default for VM images, since there is no way to tell if the environment will be able to use the graphics-mode console. r277184: Enable password-less sudo for openstack images. r277186: Update the VM_EXTRA_PACKAGES list for the openstack images. The documentation suggests doing a "just fetch this and run it"-style bootstrap, from which the list of dependencies was obtained (in github, at: pellaeon/bsd-cloudinit-installer) There is one Python dependency unmet, oslo.config, which is not in the Ports Collection. r277187: Add a comment to note that setting hw.vga.textmode=1 is temporary. r277250: Remove vm_extra_install_base() for the Azure image, now that the waagent exists in the ports tree. Add sysutils/azure-agent to the VM_EXTRA_PACKAGES list. In vm_extra_pre_umount(), remove the explicit pkg(8) install list, as dependencies are resolved by sysutils/azure-agent. r277251: Add a 'list-cloudware' target to print the list of supported CLOUDWARE values and a description. Add the AZURE_DESC and OPENSTACK_DESC descriptions. r277252: Update release(7) r277253: Add 'list-vmtargets' target, which produces a list of all supported VM and cloud provider images. Add VHD_DESC, VMDK_DESC, QCOW2_DESC, RAW_DESC image descriptions. Format the output to make a bit more readable. Update release(7) to document the list-vmtargets target. r277263: Add initial support for the GCE (Google Compute Engine) cloud hosting provider image. r277264: Style and line length cleanup. r277383: Remove the console setting from rc.conf(5), which is not used there. While here, set console to include vidconsole in the loader.conf(5). r277384: Fix an indentation nit. No functional changes. r277393: Remove the pkg-clean(8) call from vm_extra_pre_umount() since the function is often overridden. Add vm_extra_pkg_rmcache() to call pkg-clean(8) to avoid duplicated code. r277394: Move resolv.conf(5) removal back to vm_extra_pre_umount() where it belongs. The GCE image needs resolv.conf(5) to exist (created as part of the image setup), so it cannot be removed. r277395: Comment the line that configures ttys(5) to 'off', which makes it impossible to test that the image boots. Add a note explaining why the line is commented, and not (yet) removed entirely. r277438: Move the 'install' bits that are specific to virtual machine images from the Makefile to Makefile.vm. Rename the 'install' target to 'release-install', and add a new 'vm-install' target. Add a new 'install' target that invokes the new targets. r277439: Add WITH_CLOUDWARE to the list of make(1) variables for the release build. r277447: Remove hw.vga.textmode=1 from the VM image loader.conf, which was included during test builds and not intended to be included when merging this project branch back to head. r277455: Remove mk-azure.sh, which is no longer needed. MFC after: 1 month X-MFC-To: stable/10 (requires mkimg(1)) Help from: cperciva, swills Relnotes: yes Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=277458
* Add a comment to note that setting hw.vga.textmode=1 isGlen Barber2015-01-141-0/+1
| | | | | | | | | temporary. Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-vmimage/; revision=277187
* Enable the textmode console by default for VM images,Glen Barber2015-01-141-0/+6
| | | | | | | | | | since there is no way to tell if the environment will be able to use the graphics-mode console. Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-vmimage/; revision=277183
* Fix indentation nit.Glen Barber2014-11-241-2/+2
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-vmimage/; revision=274946
* In vm_extra_install_packages(), only bootstrap pkg(8)Glen Barber2014-11-241-2/+7
| | | | | | | | | | | | | 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: svn path=/projects/release-vmimage/; revision=274945
* Revert r274773, after I *specifically* objected to this changeGlen Barber2014-11-211-10/+11
| | | | | | | | | numerous times. Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-vmimage/; revision=274775
* Change how packages are installed into VM images: Rather than chrootingColin Percival2014-11-211-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | into the image and running 'pkg install' from there, use 'pkg fetch' to download packages into a temporary location and then 'pkg add' to install them into the image. This simplifies the code by avoiding the need to copy /etc/resolv.conf into the image and then delete it later, and makes it possible to cross build (e.g., to create an amd64 image when running on i386 hardware; or in the future for building disk images for embedded platforms). Because pkg was implicitly installed when VM_EXTRA_PACKAGES was non-empty, add it to VM_EXTRA_PACKAGES in azure.conf and openstack.conf to maintain the current behaviour. By default repo-FreeBSD.sqlite is copied into the image, (a) to match previous behaviour, where the file would be downloaded by the chrooted pkg invocation; and (b) because it may be useful for testing purposes, e.g., to see why a package didn't get installed. Because this file is large (46 MB) and not likely to be useful in -RELEASE images which are being launched into Clouds several months later, it can be disabled by setting NOREPOSQLITE. As far as I know this commit does not change the disk images produced in any filesystem-visible way. Notes: svn path=/projects/release-vmimage/; revision=274773
* Add NOSWAP option which can be set by a vmimage.conf file to specify thatColin Percival2014-11-211-4/+9
| | | | | | | | | no swap space should be created in the image. This will be used by EC2 builds, since FreeBSD/EC2 allocates swap space on "ephemeral" disks which are physically attached to the Xen host node. Notes: svn path=/projects/release-vmimage/; revision=274771
* Silence errors when umounting the chroot's /dev, since it probably doesn'tColin Percival2014-11-191-2/+2
| | | | | | | | | exist when we're running this. Unmount filesystems before attempting to destroy the md which holds them. Notes: svn path=/projects/release-vmimage/; revision=274726
* In vm_install_base(), copy the host resolv.conf intoGlen Barber2014-11-191-0/+4
| | | | | | | | | | | | | | the build chroot before attempting to do anything that requires working DNS (i.e., pkg bootstrap). In vm_extra_pre_umount(), remove the resolv.conf before the disk image is unmounted from the backing md(4). Reported by: cperciva Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-vmimage/; revision=274725
* Set the boot partition type to 'apple-boot' for powerpc.Glen Barber2014-11-141-1/+1
| | | | | | | | Submitted by: jhibbits Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-vmimage/; revision=274533
* mount(8) and umount(8) devfs(5) as needed.Glen Barber2014-11-081-0/+6
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-vmimage/; revision=274292
* Fix scheme flag to mkimg(1).Glen Barber2014-11-081-2/+2
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-vmimage/; revision=274288
* Fix line continuation in write_partition_layout().Glen Barber2014-11-081-6/+2
| | | | | | | | | Remove variable test that is no longer needed. Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-vmimage/; revision=274287
* Move usage() from vmimage.subr to mk-vmimage.sh,Glen Barber2014-11-081-6/+0
| | | | | | | | | in case vmimage.subr has not been sourced. Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-vmimage/; revision=274284
* Add vm_extra_pre_umount() prototype to vmimage.subr.Glen Barber2014-11-081-0/+7
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-vmimage/; revision=274282
* Add write_partition_layout() used to populate theGlen Barber2014-11-071-13/+27
| | | | | | | | | | | | | | | | | | | final image. Fix duplicated mkimg(1) call in vm_create_disk(). Add primitive (untested) PowerPC/PowerPC64 VM image support. Note: As it is currently written, the /boot/pmbr and /boot/{gptboot,boot1.hfs} use the build host and not the target build. Fixing this is likely going to be a hack in itself. Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-vmimage/; revision=274211
* Initial rewrite to consolidate VM image build scripts into one.Glen Barber2014-11-051-0/+150
There may be some very sharp edges here while refactoring. - Move amd64/mk-vmimage.sh -> scripts/mk-vmimage.sh. - Remove vm-base target from Makefile.vm. - In vm-image target, use getopts flags for argument passing. - Create tools/vmimage.subr, containing default and prototype for the following functions that are used to drive the build, run in this order: vm_install_base() vm_extra_install_base() vm_extra_install_packages() vm_extra_install_ports() vm_extra_enable_services() vm_extra_pre_umount() vm_create_disk() vm_extra_create_disk() - In tools/azure.conf, override: vm_extra_install_base() vm_extra_pre_umount() vm_extra_create_disk() - In tools/openstack.conf, override: vm_extra_install_base() vm_extra_pre_umount() Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-vmimage/; revision=274134