Commit Graph

178 Commits

Author SHA1 Message Date
Colin Percival
32dbc82982 Change how packages are installed into VM images: Rather than chrooting
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.
2014-11-21 02:13:12 +00:00
Colin Percival
4e7bc9f0f7 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.
2014-11-21 01:53:40 +00:00
Colin Percival
7d97075f02 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.
2014-11-19 22:17:22 +00:00
Glen Barber
91333d6a2d 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).

Reported by:	cperciva
Sponsored by:	The FreeBSD Foundation
2014-11-19 20:19:53 +00:00
Glen Barber
9d3df3bdb7 Set the boot partition type to 'apple-boot' for powerpc.
Submitted by:	jhibbits
Sponsored by:	The FreeBSD Foundation
2014-11-14 22:29:33 +00:00
Glen Barber
e6f3489c36 mount(8) and umount(8) devfs(5) as needed.
Sponsored by:	The FreeBSD Foundation
2014-11-08 16:26:17 +00:00
Glen Barber
7d565d608f Fix scheme flag to mkimg(1).
Sponsored by:	The FreeBSD Foundation
2014-11-08 13:49:59 +00:00
Glen Barber
38d59ac708 Fix line continuation in write_partition_layout().
Remove variable test that is no longer needed.

Sponsored by:	The FreeBSD Foundation
2014-11-08 13:49:18 +00:00
Glen Barber
144d107fcd Move usage() from vmimage.subr to mk-vmimage.sh,
in case vmimage.subr has not been sourced.

Sponsored by:	The FreeBSD Foundation
2014-11-08 12:47:21 +00:00
Glen Barber
a02bfc8327 Add vm_extra_pre_umount() prototype to vmimage.subr.
Sponsored by:	The FreeBSD Foundation
2014-11-08 12:45:02 +00:00
Glen Barber
efeb11a772 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.

Sponsored by:	The FreeBSD Foundation
2014-11-07 01:48:12 +00:00
Glen Barber
1e7c1f1742 Initial rewrite to consolidate VM image build scripts into one.
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
2014-11-05 13:22:19 +00:00
Glen Barber
35d8a6aa42 Uncomment the cloudinit rc.conf(5) line.
Sponsored by:	The FreeBSD Foundation
2014-11-01 20:41:47 +00:00
Glen Barber
573e7cca4b Initial commit providing a mechanism to create
openstack images as part of the release build.

This mimics the way Microsoft Azure images are
built, with the addition of installing the
net/cloud-init package and adding a (commented)
rc.conf(5) entry for cloudinit.

Sponsored by:	The FreeBSD Foundation
2014-10-29 17:04:09 +00:00
Glen Barber
e4cd478e9f Merge the following from ^/projects/release-vmimage:
r273076, r273077, r273079, r273095:

r273076:
  Add a separate make(1) target to release/Makefile to
  build FreeBSD virtual machine disk images for use on
  the Microsoft Azure service.

  For now, this target is not directly connected to the
  build, however can be manually invoked.

  The 'vm-azure' target invokes {amd64,i386}/mk-azure.sh,
  which does the heavy lifting to produce proper VHDs.
  mk-azure.sh uses a configuration file, defaulting to
  tools/azure.conf if otherwise unset.

r273077:
  Clear VM_RC_LIST.

r273079:
  Fix signal list to trigger umount(8).

r273095:
  Output an informational message when mkimg(1) runs, so it
  does not appear that the process has stopped while waiting
  for a 'y/n' response when waagent is deprovisioned.

Tested on:	releng/10.1@r272876
MFC after:	3 days
X-MFC-10.1:	yes
Sponsored by:	The FreeBSD Foundation
2014-10-14 15:22:46 +00:00
Glen Barber
f460f3b974 Clear VM_RC_LIST.
Sponsored by:	The FreeBSD Foundation
2014-10-14 12:04:50 +00:00
Glen Barber
3991f309ed Add a separate make(1) target to release/Makefile to
build FreeBSD virtual machine disk images for use on
the Microsoft Azure service.

For now, this target is not directly connected to the
build, however can be manually invoked.

The 'vm-azure' target invokes {amd64,i386}/mk-azure.sh,
which does the heavy lifting to produce proper VHDs.
mk-azure.sh uses a configuration file, defaulting to
tools/azure.conf if otherwise unset.

Sponsored by:	The FreeBSD Foundation
2014-10-14 11:48:28 +00:00
Glen Barber
fde4d9a822 Merge r262907 from ^/projects/release-embedded:
Add ZEDBOARD support for release builds.

Sponsored by:	The FreeBSD Foundation
2014-04-04 07:02:38 +00:00
Glen Barber
b719fba2ea Update board definition for WANDBOARD-QUAD to match crochet.
Sponsored by:	The FreeBSD Foundation
2014-03-09 02:00:48 +00:00
Glen Barber
a193d6a320 Add ZEDBOARD.
Tested against:	stable/10@r262905 (build only)
Sponsored by:	The FreeBSD Foundation
2014-03-07 22:14:39 +00:00
Glen Barber
d91104f02e Add configurations for WANDBOARD-QUAD images.
Tested against:	head@r261642 (build only)
Sponsored by:	The FreeBSD Foundation
2014-02-21 21:46:54 +00:00
Glen Barber
7bcf52bd4d Export WORLD_FLAGS and KERNEL_FLAGS for buildworld/buildkernel.
Sponsored by:	The FreeBSD Foundation
2014-02-03 22:51:30 +00:00
Glen Barber
0dc54b44a8 Include 'TARGET-TARGET_ARCH' in the resulting image name similar
to 'make -V OSRELEASE' output.

This probably should use 'make -V OSRELEASE' directly, but for
now, this keeps the line length reasonable for readability.

Sponsored by:	The FreeBSD Foundation
2014-01-28 17:27:56 +00:00
Glen Barber
f2d505cd53 Add initial support for the PANDABOARD.
Sponsored by:	The FreeBSD Foundation
2014-01-28 03:09:57 +00:00
Glen Barber
f8089757bb Fix TARGET_ARCH and XDEV_ARCH for BEAGLEBONE, should be arm/armv6.
Sponsored by:	The FreeBSD Foundation
2014-01-25 23:59:20 +00:00
Glen Barber
45935e14a0 Explicitly set XDEV_ARCH and TARGET_ARCH to 'armv6', which resolves
boot-time issues when building 10.0-RELEASE images.

Sponsored by:	The FreeBSD Foundation
2014-01-25 09:07:55 +00:00
Glen Barber
d725697e06 Add initial support for building arm BEAGLEBONE images.
- In arm/release.sh:
   - Move crochet work directory creation to occur earlier,
     since its parent directory is needed to store a fetched
     u-boot version.

   - Add a before_build() function as a quick hack to run
     board-specific (kernel configuration specific, really)
     commands, if any.

   - For the BEAGLEBONE kernel, a specific version of u-boot
     source is needed.  Fetch the source in before_build() for
     this case.  Unfortunately, there are no checksums available
     (that I can find) for these sources.  For a quick solution,
     add the hard-coded sha256 of the tarball, and fetch from
     my public_html/ directory.  A more permanent solution for
     this needs to be found.

Add initial release.sh and crochet configuration files for the
BEAGLEBONE build.

Sponsored by:	The FreeBSD Foundation
2014-01-24 22:12:59 +00:00
Glen Barber
37c587b8a1 Move tools/release/${XDEV}/ to release/tools/${XDEV}/.
In general, the workflow used for the latest releases has been
to checkout head/release/ to a directory outside of any build
environments, modify the release.conf accordingly, and run:

	# ./release.sh -c ./release.conf

By moving tools/release/${XDEV}/ (for RPI-B build testing, in
this case), any dependency on a different branch of the source
tree can be removed.  In particular, release.sh expects the
tools/release/${XDEV}/crochet-${KERNEL}.conf file to exist, so
by moving the crochet configuration file to a directory in
release/, it becomes possible to build images for branches that
do not yet have the necessary configuration files and/or scripts.

Sponsored by:	The FreeBSD Foundation
2014-01-19 22:01:08 +00:00