diff --git a/release/Makefile.vm b/release/Makefile.vm index 3bfe2d8bfee0..ba57601c1f6c 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -1,286 +1,286 @@ # # # # Makefile for building virtual machine and cloud provider disk images. # VMTARGETS= vm-image VMFORMATS?= vhd vmdk qcow2 raw VMSIZE?= 5120m VMFS?= ufs VMFSLIST?= ufs zfs SWAPSIZE?= 1g VMBASE?= vm VHD_DESC= Azure, VirtualPC, Hyper-V, Xen disk image VMDK_DESC= VMWare, VirtualBox disk image QCOW2_DESC= Qemu, KVM disk image RAW_DESC= Unformatted raw disk image CLOUDWARE_TYPES?= AZURE \ BASIC-CI \ BASIC-CLOUDINIT \ EC2 \ GCE \ - OCI \ + ORACLE \ VAGRANT AZURE_FORMAT= vhdf AZURE_FSLIST?= ufs zfs AZURE_DESC= Microsoft Azure platform image BASIC-CI_FORMAT= raw BASIC-CI_FSLIST?= ufs BASIC-CI_DESC= Image for CI BASIC-CLOUDINIT_FORMAT= raw qcow2 BASIC-CLOUDINIT_FSLIST?= ufs zfs BASIC-CLOUDINIT_DESC?= Images for VM with cloudinit disk config support EC2_FORMAT= raw EC2_FSLIST?= ufs zfs EC2_FLAVOURS?= BASE CLOUD-INIT SMALL EC2-BASE_DESC= Amazon EC2 image EC2-CLOUD-INIT_DESC= Amazon EC2 Cloud-Init image EC2-SMALL_DESC= Amazon EC2 small image GCE_FORMAT= raw GCE_FSLIST?= ufs zfs GCE_DESC= Google Compute Engine image -OCI_FORMAT= qcow2 -OCI_FSLIST?= ufs -OCI_DESC= Oracle Cloud Infrastructure image +ORACLE_FORMAT= qcow2 +ORACLE_FSLIST?= ufs +ORACLE_DESC= Oracle Cloud Infrastructure image OPENSTACK_FORMAT=qcow2 OPENSTACK_FSLIST?= ufs OPENSTACK_DESC= OpenStack platform image VAGRANT_FORMAT= vmdk VAGRANT_FSLIST?= ufs VAGRANT_FLAVOURS?= VIRTUALBOX VMWARE VAGRANT-VIRTUALBOX_DESC= Vagrant Image for VirtualBox VAGRANT-VMWARE_DESC= Vagrant Image for VMWare .for _CWT in ${CLOUDWARE_TYPES} . if defined(${_CWT}_FLAVOURS) . for _CWF in ${${_CWT}_FLAVOURS} CLOUDWARE_GEN+= ${_CWT}-${_CWF} ${_CWT}-${_CWF}_FORMAT?= ${${_CWT}_FORMAT} ${_CWT}-${_CWF}_FSLIST?= ${${_CWT}_FSLIST} ${_CWT}-${_CWF}_DESC?= ${${_CWT}_DESC} . endfor . else CLOUDWARE_GEN+= ${_CWT} . endif .endfor CLOUDWARE?= ${CLOUDWARE_GEN} .for _V in TYPE BRANCH REVISION . if !defined(${_V}) || empty(${_V}) ${_V}!= eval $$(awk '/^${_V}=/{print}' ${.CURDIR}/../sys/conf/newvers.sh); echo $$${_V} . endif .endfor emulator-portinstall: .if !exists(/usr/local/bin/qemu-${TARGET_ARCH}-static) .if exists(${PORTSDIR}/emulators/qemu-user-static/Makefile) env - UNAME_r=${UNAME_r} PATH=$$PATH \ make -C ${PORTSDIR}/emulators/qemu-user-static \ BATCH=1 WRKDIRPREFIX=/tmp/ports DISTDIR=/tmp/distfiles \ all install clean .else .if !exists(/usr/local/sbin/pkg-static) env ASSUME_ALWAYS_YES=yes pkg bootstrap -y .endif env ASSUME_ALWAYS_YES=yes pkg install -y emulators/qemu-user-static .endif .endif touch ${.TARGET} .if ${TARGET_ARCH} != ${MACHINE_ARCH} .if ( ${TARGET_ARCH} != "i386" ) || ( ${MACHINE_ARCH} != "amd64" ) QEMUSTATIC=/usr/local/bin/qemu-${TARGET_ARCH}-static QEMUTGT=emulator-portinstall .endif .endif QEMUTGT?= .if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE) . for _CW in ${CLOUDWARE} . if exists(${.CURDIR}/tools/${_CW:tl}.conf) && !defined(${_CW:tu}CONF) ${_CW:tu}CONF?= ${.CURDIR}/tools/${_CW:tl}.conf . endif . for _FS in ${${_CW:tu}_FSLIST} . for _FMT in ${${_CW:tu}_FORMAT} CLOUDTARGETS+= cw-${_CW:tl}-${_FS}-${_FMT} CLEANDIRS+= cw-${_CW:tl}-${_FS}-${_FMT} CLEANFILES+= ${_CW:tl}.${_FS}.${_FMT}.img \ ${_CW:tl}.${_FS}.${_FMT} \ ${_CW:tl}.${_FS}.${_FMT}.raw ${_CW:tu}${_FS:tu}${_FMT:tu}IMAGE= ${_CW:tl}.${_FS}.${_FMT} cw-${_CW:tl}-${_FS}-${_FMT}: ${QEMUTGT} mkdir -p ${.OBJDIR}/${.TARGET} env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} SWAPSIZE=${SWAPSIZE} \ QEMUSTATIC=${QEMUSTATIC} \ ${.CURDIR}/scripts/mk-vmimage.sh \ -C ${.CURDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} -F ${_FS} \ -i ${.OBJDIR}/${_CW:tl}.${_FS}.${_FMT}.img -s ${VMSIZE} -f ${_FMT} \ -S ${WORLDDIR} -o ${.OBJDIR}/${${_CW:tu}${_FS:tu}${_FMT:tu}IMAGE} -c ${${_CW:tu}CONF} touch ${.TARGET} . endfor . endfor # Hardlinks from "foo.${FMT}" to "foo-${VMFS}.${FMT}". These can go away once # all of the cloudware code knows how to handle multiple filesystem images (or # at least knows the name of the UFS image). . for _FMT in ${${_CW:tu}_FORMAT} CLOUDTARGETS+= cw-${_CW:tl}-${_FMT} CLEANFILES+= ${_CW:tl}.${_FMT} ${_CW:tu}${_FMT:tu}IMAGE= ${_CW:tl}.${_FMT} cw-${_CW:tl}-${_FMT}: cw-${_CW:tl}-${VMFS}-${_FMT} ln -f ${${_CW:tu}${VMFS:tu}${_FMT:tu}IMAGE} ${${_CW:tu}${_FMT:tu}IMAGE} . endfor # Targets without a disk format listed are the first disk format on the list . for _FS in ${${_CW:tu}_FSLIST} ${_CW:tu}${_FS:tu}IMAGE= ${_CW:tl}.${_FS}.${${_CW:tu}_FORMAT:[1]} cw-${_CW:tl}-${_FS}: cw-${_CW:tl}-${_FS}-${${_CW:tu}_FORMAT:[1]} . endfor ${_CW:tu}IMAGE= ${_CW:tl}.${${_CW:tu}_FORMAT:[1]} cw-${_CW:tl}: cw-${_CW:tl}-${${_CW:tu}_FORMAT:[1]} . endfor .endif .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) CLEANFILES+= vm-image . for FORMAT in ${VMFORMATS} . for FS in ${VMFSLIST} CLEANDIRS+= vm-image-${FORMAT}-${FS} CLEANFILES+= ${FORMAT}.${FS}.img CLEANFILES+= ${VMBASE}.${FS}.${FORMAT} . endfor . endfor .endif vm-base: vm-image vm-image: ${QEMUTGT} .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) . for FORMAT in ${VMFORMATS} . for FS in ${VMFSLIST} mkdir -p ${.OBJDIR}/${.TARGET}-${FORMAT}-${FS} env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} SWAPSIZE=${SWAPSIZE} \ QEMUSTATIC=${QEMUSTATIC} \ ${.CURDIR}/scripts/mk-vmimage.sh \ -C ${.CURDIR}/tools/vmimage.subr \ -d ${.OBJDIR}/${.TARGET}-${FORMAT}-${FS} -F ${FS} \ -i ${.OBJDIR}/${FORMAT}.${FS}.img -s ${VMSIZE} -f ${FORMAT} \ -S ${WORLDDIR} -o ${.OBJDIR}/${VMBASE}.${FS}.${FORMAT} . endfor . endfor .endif touch ${.TARGET} vm-cloudware: ${CLOUDTARGETS} list-vmtargets: list-cloudware @${ECHO} @${ECHO} "Supported virtual machine disk image formats:" .for FORMAT in ${VMFORMATS:tu} @${ECHO} " ${FORMAT:tl}: ${${FORMAT}_DESC}" .endfor list-cloudware: .if !empty(CLOUDWARE) @${ECHO} @${ECHO} "Supported cloud hosting provider images:" . for _CW in ${CLOUDWARE} @${ECHO} " ${_CW:tu}: ${${_CW:tu}_DESC}" . endfor .endif vm-install: .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) mkdir -p ${DESTDIR}/vmimages . for FORMAT in ${VMFORMATS} . for FS in ${VMFSLIST} cp -p ${VMBASE}.${FS}.${FORMAT} \ ${DESTDIR}/vmimages/${OSRELEASE}-${FS}.${FORMAT} . endfor . endfor . if defined(WITH_COMPRESSED_VMIMAGES) && !empty(WITH_COMPRESSED_VMIMAGES) . for FORMAT in ${VMFORMATS} . for FS in ${VMFSLIST} # Don't keep the originals. There is a copy in ${.OBJDIR} if needed. ${XZ_CMD} ${DESTDIR}/vmimages/${OSRELEASE}-${FS}.${FORMAT} . endfor . endfor . endif # Compatibility hardlinks from "foo.bar" to "foo-${VMFS}.bar". . for FORMAT in ${VMFORMATS} . if defined(WITH_COMPRESSED_VMIMAGES) && !empty(WITH_COMPRESSED_VMIMAGES) ln -f ${DESTDIR}/vmimages/${OSRELEASE}-${VMFS}.${FORMAT}.xz ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}.xz . else ln -f ${DESTDIR}/vmimages/${OSRELEASE}-${VMFS}.${FORMAT} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT} . endif . endfor cd ${DESTDIR}/vmimages && sha512 ${OSRELEASE}* > \ ${DESTDIR}/vmimages/CHECKSUM.SHA512 cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \ ${DESTDIR}/vmimages/CHECKSUM.SHA256 .endif cloud-install-BASIC-CI: mkdir -p ${DESTDIR}/ciimages .for _FS in ${BASIC-CI_FSLIST} . for _FMT in ${BASIC-CI_FORMAT} cp -p ${.OBJDIR}/${BASIC-CI${_FS:tu}${_FMT:tu}IMAGE} \ ${DESTDIR}/ciimages/${OSRELEASE}-BASIC-CI-${_FS}.${_FMT} ${XZ_CMD} ${DESTDIR}/ciimages/${OSRELEASE}-BASIC-CI-${_FS}.${_FMT} . endfor .endfor .for _FMT in ${BASIC-CI_FORMAT} ln -f ${DESTDIR}/ciimages/${OSRELEASE}-BASIC-CI-${VMFS}.${_FMT}.xz \ ${DESTDIR}/ciimages/${OSRELEASE}-BASIC-CI.${_FMT}.xz .endfor cd ${DESTDIR}/ciimages && sha512 ${OSRELEASE}* > \ ${DESTDIR}/ciimages/CHECKSUM.SHA512 cd ${DESTDIR}/ciimages && sha256 ${OSRELEASE}* > \ ${DESTDIR}/ciimages/CHECKSUM.SHA256 cloud-install-BASIC-CLOUDINIT: mkdir -p ${DESTDIR}/vmimages .for _FS in ${BASIC-CLOUDINIT_FSLIST} . for _FMT in ${BASIC-CLOUDINIT_FORMAT} cp -p ${.OBJDIR}/${BASIC-CLOUDINIT${_FS:tu}${_FMT:tu}IMAGE} \ ${DESTDIR}/vmimages/${OSRELEASE}-BASIC-CLOUDINIT.${_FS}.${_FMT} ${XZ_CMD} ${DESTDIR}/vmimages/${OSRELEASE}-BASIC-CLOUDINIT.${_FS}.${_FMT} . endfor .endfor cd ${DESTDIR}/vmimages && sha512 ${OSRELEASE}* > \ ${DESTDIR}/vmimages/CHECKSUM.SHA512 cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \ ${DESTDIR}/vmimages/CHECKSUM.SHA256 CLOUD_INSTALL_TGTS= .if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) . for _CW in ${CLOUDWARE} . if target(cloud-install-${_CW}) CLOUD_INSTALL_TGTS+= cloud-install-${_CW} . endif . endfor .endif cloud-install: ${CLOUD_INSTALL_TGTS} .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) vm-release: ${VMTARGETS} .else vm-release: .endif .if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE) cloudware-release: ${CLOUDTARGETS} .else cloudware-release: .endif .include "${.CURDIR}/Makefile.azure" .include "${.CURDIR}/Makefile.ec2" .include "${.CURDIR}/Makefile.firecracker" .include "${.CURDIR}/Makefile.gce" .include "${.CURDIR}/Makefile.vagrant" .include "${.CURDIR}/Makefile.inc1" diff --git a/release/release.conf.sample b/release/release.conf.sample index ac9c1aaa254e..351496dcf6a4 100644 --- a/release/release.conf.sample +++ b/release/release.conf.sample @@ -1,116 +1,116 @@ #!/bin/sh # ## Redefine environment variables here to override prototypes ## defined in release.sh. #load_chroot_env() { } #load_target_env() { } #buildenv_setup() { } ## Set the directory within which the release will be built. CHROOTDIR="/scratch" ## Do not explicitly require the devel/git port to be installed. #NOGIT=1 ## Set the version control system host. GITROOT="https://git.freebsd.org/" GITSRC="src.git" GITPORTS="ports.git" ## Set the src/, ports/, and doc/ branches or tags. SRCBRANCH="stable/14" PORTBRANCH="main" ## Sample configuration for using git from ports. #GITCMD="/usr/local/bin/git clone -q --branch main" ## Set to override the default target architecture. #TARGET="amd64" #TARGET_ARCH="amd64" #KERNEL="GENERIC" ## Multiple kernels may be set. #KERNEL="GENERIC XENHVM" ## Set to specify a custom make.conf and/or src.conf #MAKE_CONF="/etc/local/make.conf" #SRC_CONF="/etc/local/src.conf" ## Set to use make(1) flags. #MAKE_FLAGS="-s" ## Set to use world- and kernel-specific make(1) flags. #WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" #KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" ## Set miscellaneous 'make release' settings. #NOPORTS= #NOSRC= #WITH_DVD= #WITH_COMPRESSED_IMAGES= ## Set to '1' to disable multi-threaded xz(1) compression. #XZ_THREADS=0 ## Set when building embedded images. #EMBEDDEDBUILD= ## Set to a list of ports required to build embedded system-on-chip ## images, such as sysutils/u-boot-rpi. #EMBEDDEDPORTS= ## Set to the hardware platform of the target userland. This value ## is passed to make(1) to set the TARGET (value of uname -m) to cross ## build. #EMBEDDED_TARGET= ## Set to the machine processor architecture of the target userland. ## This value is passed to make(1) to set the TARGET_ARCH (value of uname -p) ## to cross build. #EMBEDDED_TARGET_ARCH= ## Set to skip the chroot environment buildworld/installworld/distribution ## step if it is expected the build environment will exist via alternate ## means. #CHROOTBUILD_SKIP= ## Set to a non-empty value skip checkout or update of /usr/src in ## the chroot. This is intended for use when /usr/src already exists. #SRC_UPDATE_SKIP= ## Set to a non-empty value skip checkout or update of /usr/ports in ## the chroot. This is intended for use when /usr/ports already exists. #PORTS_UPDATE_SKIP= ## Set to pass additional flags to make(1) for the build chroot setup, such ## as TARGET/TARGET_ARCH. #CHROOT_MAKEENV= ## Set to a non-empty value to build virtual machine images as part of the ## release build. #WITH_VMIMAGES= ## Set to a non-empty value to compress virtual machine images with xz(1) ## as part of the release build. #WITH_COMPRESSED_VMIMAGES= ## If WITH_VMIMAGES is set to a non-empty value, this is the name of the ## file to use for the installed userland/kernel. #VMBASE="vm" ## If WITH_VMIMAGES is set to a non-empty value, this is the size of the ## virtual machine disk filesystem. Valid size values are described in ## the makefs(8) manual page. #VMSIZE="20g" ## If WITH_VMIMAGES is set to a non-empty value, this is a list of disk ## image formats to create. Valid values are listed in the mkimg(1) ## manual page, as well as 'mkimg --formats' output. #VMFORMATS="vhdf vmdk qcow2 raw" ## Set to a non-empty value to build virtual machine images for various ## cloud providers as part of the release build. #WITH_CLOUDWARE= ## If WITH_CLOUDWARE is set to a non-empty value, this is a list of providers ## to create disk images. -#CLOUDWARE="EC2 GCE OCI VAGRANT-VIRTUALBOX VAGRANT-VMWARE" +#CLOUDWARE="EC2 GCE ORACLE VAGRANT-VIRTUALBOX VAGRANT-VMWARE" diff --git a/release/tools/oci.conf b/release/tools/oracle.conf similarity index 94% rename from release/tools/oci.conf rename to release/tools/oracle.conf index a4fe54ad3031..d3b4eb351107 100644 --- a/release/tools/oci.conf +++ b/release/tools/oracle.conf @@ -1,94 +1,94 @@ #!/bin/sh # Set to a list of packages to install. export VM_EXTRA_PACKAGES=" comms/py-pyserial converters/base64 devel/oci-cli devel/py-babel devel/py-iso8601 devel/py-pbr devel/py-six ftp/curl lang/python lang/python3 net/cloud-init net/py-eventlet net/py-netaddr net/py-netifaces net/py-oauth net/rsync panicmail security/ca_root_nss security/sudo sysutils/firstboot-freebsd-update sysutils/firstboot-pkgs sysutils/panicmail textproc/jq " # Should be enough for base image, image can be resized in needed export VMSIZE=6g # Set to a list of third-party software to enable in rc.conf(5). export VM_RC_LIST=" cloudinit firstboot_pkgs firstboot_freebsd_update growfs ntpd ntpd_sync_on_start sshd zfs" vm_extra_pre_umount() { cat <<-'EOF' >> ${DESTDIR}/etc/rc.conf dumpdev=AUTO sendmail_enable=NONE EOF cat <<-'EOF' >> ${DESTDIR}/boot/loader.conf autoboot_delay="5" beastie_disable="YES" boot_serial="YES" loader_logo="none" cryptodev_load="YES" opensolaris_load="YES" xz_load="YES" zfs_load="YES" EOF cat <<-'EOF' >> ${DESTDIR}/etc/ssh/sshd_config # S11 Configure the SSH service to prevent password-based login PermitRootLogin prohibit-password PasswordAuthentication no KbdInteractiveAuthentication no PermitEmptyPasswords no UseDNS no EOF # S14 Root user login must be disabled on serial-over-ssh console pw -R ${DESTDIR} usermod root -w no - # OCI requirements override the default FreeBSD cloud-init settings - cat <<-'EOF' >> ${DESTDIR}/usr/local/etc/cloud/cloud.cfg.d/98_oci.cfg + # Oracle requirements override the default FreeBSD cloud-init settings + cat <<-'EOF' >> ${DESTDIR}/usr/local/etc/cloud/cloud.cfg.d/98_oracle.cfg disable_root: true system_info: distro: freebsd default_user: name: freebsd lock_passwd: True - gecos: "OCI Default User" + gecos: "Oracle Cloud Default User" groups: [wheel] sudo: ["ALL=(ALL) NOPASSWD:ALL"] shell: /bin/sh network: renderers: ['freebsd'] EOF # Use Oracle Cloud Infrastructure NTP server sed -i '' -E -e 's/^pool.*iburst/server 169.254.169.254 iburst/' \ ${DESTDIR}/etc/ntp.conf touch ${DESTDIR}/firstboot return 0 }