aboutsummaryrefslogtreecommitdiff
path: root/release/tools/vmimage.subr
Commit message (Collapse)AuthorAgeFilesLines
* 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