197d92980SPeter Wemm# $FreeBSD$ 20202c140SRodney W. Grimes# 312ad0bb1SNathan Whitehorn# Makefile for building releases and release media. 4bd668f6fSPoul-Henning Kamp# 512ad0bb1SNathan Whitehorn# User-driven targets: 68cec99b6SGlen Barber# cdrom: Builds release CD-ROM media (disc1.iso) 75d27274aSGlen Barber# dvdrom: Builds release DVD-ROM media (dvd1.iso) 83c334738SGlen Barber# memstick: Builds memory stick image (memstick.img) 9a9da1707SGlen Barber# mini-memstick: Builds minimal memory stick image (mini-memstick.img) 1012ad0bb1SNathan Whitehorn# ftp: Sets up FTP distribution area (ftp) 1112ad0bb1SNathan Whitehorn# release: Build all media and FTP distribution area 12299a8b95SNathan Whitehorn# install: Copies all release media into ${DESTDIR} 13bd668f6fSPoul-Henning Kamp# 1412ad0bb1SNathan Whitehorn# Variables affecting the build process: 1512ad0bb1SNathan Whitehorn# WORLDDIR: location of src tree -- must have built world and default kernel 1612ad0bb1SNathan Whitehorn# (by default, the directory above this one) 1712ad0bb1SNathan Whitehorn# PORTSDIR: location of ports tree to distribute (default: /usr/ports) 1812ad0bb1SNathan Whitehorn# DOCDIR: location of doc tree (default: /usr/doc) 199d22cb2eSHiroki Sato# NOPKG: if set, do not distribute third-party packages 2012ad0bb1SNathan Whitehorn# NOPORTS: if set, do not distribute ports tree 2112ad0bb1SNathan Whitehorn# NOSRC: if set, do not distribute source tree 2212ad0bb1SNathan Whitehorn# NODOC: if set, do not generate release documentation 23f7f650c7SGlen Barber# WITH_DVD: if set, generate dvd1.iso 2455af5cf1SGlen Barber# WITH_COMPRESSED_IMAGES: if set, compress installation images with xz(1) 25cbc0e08aSGlen Barber# (uncompressed images are not removed) 26a68d274bSGlen Barber# WITH_VMIMAGES: if set, build virtual machine images with the release 27a9278c16SGlen Barber# WITH_COMPRESSED_VMIMAGES: if set, compress virtual machine disk images 28a9278c16SGlen Barber# with xz(1) (extremely time consuming) 2912ad0bb1SNathan Whitehorn# TARGET/TARGET_ARCH: architecture of built release 30b03ddec9SJohn Baldwin# 31ab0e9cdcSPoul-Henning Kamp 3212ad0bb1SNathan WhitehornWORLDDIR?= ${.CURDIR}/.. 3312ad0bb1SNathan WhitehornPORTSDIR?= /usr/ports 3412ad0bb1SNathan WhitehornDOCDIR?= /usr/doc 3512ad0bb1SNathan WhitehornRELNOTES_LANG?= en_US.ISO8859-1 363b485e46SGlen BarberXZCMD?= /usr/bin/xz 37fff8eb57SJohn Baldwin 38464485c8SHiroki Sato.if !defined(TARGET) || empty(TARGET) 39464485c8SHiroki SatoTARGET= ${MACHINE} 40464485c8SHiroki Sato.endif 41464485c8SHiroki Sato.if !defined(TARGET_ARCH) || empty(TARGET_ARCH) 420bd47e83SNathan Whitehorn.if ${TARGET} == ${MACHINE} 43464485c8SHiroki SatoTARGET_ARCH= ${MACHINE_ARCH} 448f1f55e9SRuslan Ermilov.else 45464485c8SHiroki SatoTARGET_ARCH= ${TARGET} 46464485c8SHiroki Sato.endif 478f1f55e9SRuslan Ermilov.endif 4812ad0bb1SNathan WhitehornIMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} 49876acefaSHiroki SatoDISTDIR= dist 508f1f55e9SRuslan Ermilov 51de17cbccSHiroki Sato# Define OSRELEASE by using newvars.sh 52de17cbccSHiroki Sato.if !defined(OSRELEASE) || empty(OSRELEASE) 53de17cbccSHiroki Sato.for _V in TYPE BRANCH REVISION 54de17cbccSHiroki Sato${_V}!= eval $$(awk '/^${_V}=/{print}' ${.CURDIR}/../sys/conf/newvers.sh); echo $$${_V} 55de17cbccSHiroki Sato.endfor 56de17cbccSHiroki Sato.for _V in ${TARGET_ARCH} 57de17cbccSHiroki Sato.if !empty(TARGET:M${_V}) 58de17cbccSHiroki SatoOSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET} 59*745ca085SGlen BarberVOLUME_LABEL= ${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET} 60de17cbccSHiroki Sato.else 61de17cbccSHiroki SatoOSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET}-${TARGET_ARCH} 62*745ca085SGlen BarberVOLUME_LABEL= ${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET_ARCH} 63de17cbccSHiroki Sato.endif 64de17cbccSHiroki Sato.endfor 65de17cbccSHiroki Sato.endif 66de17cbccSHiroki Sato 6769c7d069SGlen Barber.if !defined(VOLUME_LABEL) || empty(VOLUME_LABEL) 6869c7d069SGlen BarberVOLUME_LABEL= FreeBSD_Install 6969c7d069SGlen Barber.endif 70ac23f460SGlen Barber 7112ad0bb1SNathan Whitehorn.if !exists(${DOCDIR}) 7212ad0bb1SNathan WhitehornNODOC= true 7312ad0bb1SNathan Whitehorn.endif 7412ad0bb1SNathan Whitehorn.if !exists(${PORTSDIR}) 7512ad0bb1SNathan WhitehornNOPORTS= true 76dd1a1b3dSJoerg Wunsch.endif 77dd1a1b3dSJoerg Wunsch 7812ad0bb1SNathan WhitehornEXTRA_PACKAGES= 796daa108fSRuslan Ermilov.if !defined(NOPORTS) 8012ad0bb1SNathan WhitehornEXTRA_PACKAGES+= ports.txz 816daa108fSRuslan Ermilov.endif 824731faa3SJordan K. Hubbard.if !defined(NOSRC) 8312ad0bb1SNathan WhitehornEXTRA_PACKAGES+= src.txz 842e3a1557SKen Smith.endif 85a1b193b5SJohn Baldwin.if !defined(NODOC) 8612ad0bb1SNathan WhitehornEXTRA_PACKAGES+= reldoc 87b2200964SJohn Baldwin.endif 88b2200964SJohn Baldwin 8912ad0bb1SNathan WhitehornRELEASE_TARGETS= ftp 90876acefaSHiroki SatoIMAGES= 9112ad0bb1SNathan Whitehorn.if exists(${.CURDIR}/${TARGET}/mkisoimages.sh) 9212ad0bb1SNathan WhitehornRELEASE_TARGETS+= cdrom 938cec99b6SGlen BarberIMAGES+= disc1.iso bootonly.iso 94d8824524SGlen Barber. if defined(WITH_DVD) && !empty(WITH_DVD) 95dc244562SGlen BarberRELEASE_TARGETS+= dvdrom 96dc244562SGlen BarberIMAGES+= dvd1.iso 97dc244562SGlen Barber. endif 986daa108fSRuslan Ermilov.endif 9912ad0bb1SNathan Whitehorn.if exists(${.CURDIR}/${TARGET}/make-memstick.sh) 1003c334738SGlen BarberRELEASE_TARGETS+= memstick.img 101a9da1707SGlen BarberRELEASE_TARGETS+= mini-memstick.img 1023c334738SGlen BarberIMAGES+= memstick.img 103a9da1707SGlen BarberIMAGES+= mini-memstick.img 104e738d1eaSJohn Baldwin.endif 105e738d1eaSJohn Baldwin 106a68d274bSGlen BarberVMTARGETS= vm-base vm-image 107a68d274bSGlen BarberVMFORMATS?= vhd vmdk qcow2 raw 108cadb91b0SGlen BarberVMSIZE?= 20G 109cadb91b0SGlen BarberVMBASE?= vm 1103991f309SGlen BarberAZURECONF?= ${.CURDIR}/tools/azure.conf 111a68d274bSGlen Barber 11246b13263SHiroki SatoCLEANFILES= packagesystem *.txz MANIFEST system ${IMAGES} 1130c535991SGlen Barber.if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES) 1140c535991SGlen Barber. for I in ${IMAGES} 11555af5cf1SGlen BarberCLEANFILES+= ${I}.xz 1160c535991SGlen Barber. endfor 1170c535991SGlen Barber.endif 118cd15d7f3SGlen Barber.if defined(WITH_DVD) && !empty(WITH_DVD) 119cd15d7f3SGlen BarberCLEANFILES+= pkg-stage 120cd15d7f3SGlen Barber.endif 121a68d274bSGlen Barber.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) 122a68d274bSGlen BarberCLEANFILES+= ${VMBASE}.img 123a68d274bSGlen Barber. for FORMAT in ${VMFORMATS} 124c9250956SGlen BarberCLEANFILES+= ${VMBASE}.${FORMAT} 125a68d274bSGlen Barber. endfor 126a68d274bSGlen Barber.endif 12746b13263SHiroki SatoCLEANDIRS= dist ftp release bootonly dvd 128a68d274bSGlen Barber.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) 129a68d274bSGlen BarberCLEANDIRS+= ${VMTARGETS} 130a68d274bSGlen Barber.endif 1313991f309SGlen Barber.if exists(${.CURDIR}/${TARGET}/mk-azure.sh) 1323991f309SGlen BarberCLEANFILES+= ${OSRELEASE}.vhd \ 1333991f309SGlen Barber ${OSRELEASE}.vhd.raw \ 1343991f309SGlen Barber azure.img 1353991f309SGlen BarberCLEANDIRS+= vm-azure 1363991f309SGlen Barber.endif 13746b13263SHiroki Satobeforeclean: 13846b13263SHiroki Sato chflags -R noschg . 1398eb4e096SRuslan Ermilov.include <bsd.obj.mk> 14046b13263SHiroki Satoclean: beforeclean 14112ad0bb1SNathan Whitehorn 14212ad0bb1SNathan Whitehornbase.txz: 143876acefaSHiroki Sato mkdir -p ${DISTDIR} 144876acefaSHiroki Sato cd ${WORLDDIR} && ${IMAKE} distributeworld DISTDIR=${.OBJDIR}/${DISTDIR} 14512ad0bb1SNathan Whitehorn# Set up mergemaster root database 146672d7ddbSSean Bruno sh ${.CURDIR}/scripts/mm-mtree.sh -m ${WORLDDIR} -F \ 147876acefaSHiroki Sato "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" -D "${.OBJDIR}/${DISTDIR}/base" 148e9120a25SGlen Barber etcupdate extract -B -M "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" \ 149d6d73d47SJohn Hay -s ${WORLDDIR} -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate" 150bfc3bab8SNathan Whitehorn# Package all components 151876acefaSHiroki Sato cd ${WORLDDIR} && ${IMAKE} packageworld DISTDIR=${.OBJDIR}/${DISTDIR} 152876acefaSHiroki Sato mv ${DISTDIR}/*.txz . 15312ad0bb1SNathan Whitehorn 15412ad0bb1SNathan Whitehornkernel.txz: 155876acefaSHiroki Sato mkdir -p ${DISTDIR} 156876acefaSHiroki Sato cd ${WORLDDIR} && ${IMAKE} distributekernel packagekernel DISTDIR=${.OBJDIR}/${DISTDIR} 157876acefaSHiroki Sato mv ${DISTDIR}/kernel*.txz . 15812ad0bb1SNathan Whitehorn 15912ad0bb1SNathan Whitehornsrc.txz: 160876acefaSHiroki Sato mkdir -p ${DISTDIR}/usr 16112ad0bb1SNathan Whitehorn ln -fs ${WORLDDIR} ${DISTDIR}/usr/src 1629f5907dbSGlen Barber cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/src.txz --exclude .svn --exclude .zfs \ 16323659c9dSGlen Barber --exclude .git --exclude @ --exclude usr/src/release/dist usr/src 16412ad0bb1SNathan Whitehorn 16512ad0bb1SNathan Whitehornports.txz: 166876acefaSHiroki Sato mkdir -p ${DISTDIR}/usr 16712ad0bb1SNathan Whitehorn ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports 16812ad0bb1SNathan Whitehorn cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz \ 16923659c9dSGlen Barber --exclude .git --exclude .svn \ 17012ad0bb1SNathan Whitehorn --exclude usr/ports/distfiles --exclude usr/ports/packages \ 17112ad0bb1SNathan Whitehorn --exclude 'usr/ports/INDEX*' --exclude work usr/ports 17212ad0bb1SNathan Whitehorn 17312ad0bb1SNathan Whitehornreldoc: 17412ad0bb1SNathan Whitehorn cd ${.CURDIR}/doc && ${MAKE} all install clean 'FORMATS=html txt' \ 17512ad0bb1SNathan Whitehorn INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc 176876acefaSHiroki Sato mkdir -p reldoc 17712ad0bb1SNathan Whitehorn.for i in hardware readme relnotes errata 17853089271STijl Coosemans ln -f rdoc/${RELNOTES_LANG}/${i}/article.txt reldoc/${i:tu}.TXT 17953089271STijl Coosemans ln -f rdoc/${RELNOTES_LANG}/${i}/article.html reldoc/${i:tu}.HTM 18012ad0bb1SNathan Whitehorn.endfor 181876acefaSHiroki Sato cp rdoc/${RELNOTES_LANG}/readme/docbook.css reldoc 18212ad0bb1SNathan Whitehorn 18312ad0bb1SNathan Whitehornsystem: packagesystem 18412ad0bb1SNathan Whitehorn# Install system 185876acefaSHiroki Sato mkdir -p release 1866e352319SNathan Whitehorn cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ 187ba7bd912SGlen Barber DESTDIR=${.OBJDIR}/release MK_RESCUE=no MK_KERNEL_SYMBOLS=no \ 188ffc6fb79SGlen Barber MK_PROFILE=no MK_SENDMAIL=no MK_TESTS=no MK_LIB32=no \ 189ffc6fb79SGlen Barber MK_DEBUG_FILES=no 19012ad0bb1SNathan Whitehorn# Copy distfiles 191876acefaSHiroki Sato mkdir -p release/usr/freebsd-dist 192ffc6fb79SGlen Barber for dist in MANIFEST $$(ls *.txz | grep -v -- '-dbg'); \ 193ffc6fb79SGlen Barber do cp $${dist} release/usr/freebsd-dist; \ 194ffc6fb79SGlen Barber done 19512ad0bb1SNathan Whitehorn# Copy documentation, if generated 19612ad0bb1SNathan Whitehorn.if !defined(NODOC) 197876acefaSHiroki Sato cp reldoc/* release 19812ad0bb1SNathan Whitehorn.endif 19912ad0bb1SNathan Whitehorn# Set up installation environment 200de17cbccSHiroki Sato ln -fs /tmp/bsdinstall_etc/resolv.conf release/etc/resolv.conf 201876acefaSHiroki Sato echo sendmail_enable=\"NONE\" > release/etc/rc.conf 202876acefaSHiroki Sato echo hostid_enable=\"NO\" >> release/etc/rc.conf 20373e46dbaSGlen Barber echo debug.witness.trace=0 >> release/etc/sysctl.conf 204876acefaSHiroki Sato cp ${.CURDIR}/rc.local release/etc 205876acefaSHiroki Sato touch ${.TARGET} 20612ad0bb1SNathan Whitehorn 20746c413feSNathan Whitehornbootonly: packagesystem 20846c413feSNathan Whitehorn# Install system 209876acefaSHiroki Sato mkdir -p bootonly 21046c413feSNathan Whitehorn cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ 211ba7bd912SGlen Barber DESTDIR=${.OBJDIR}/bootonly MK_AMD=no MK_AT=no \ 212ba7bd912SGlen Barber MK_GAMES=no MK_GROFF=no \ 213ba7bd912SGlen Barber MK_INSTALLLIB=no MK_LIB32=no MK_MAIL=no \ 214ba7bd912SGlen Barber MK_NCP=no MK_TOOLCHAIN=no MK_PROFILE=no \ 215ba7bd912SGlen Barber MK_INSTALLIB=no MK_RESCUE=no MK_DICT=no \ 216ffc6fb79SGlen Barber MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no 21746c413feSNathan Whitehorn# Copy manifest only (no distfiles) to get checksums 218876acefaSHiroki Sato mkdir -p bootonly/usr/freebsd-dist 219876acefaSHiroki Sato cp MANIFEST bootonly/usr/freebsd-dist 22046c413feSNathan Whitehorn# Copy documentation, if generated 22146c413feSNathan Whitehorn.if !defined(NODOC) 222876acefaSHiroki Sato cp reldoc/* bootonly 22346c413feSNathan Whitehorn.endif 22446c413feSNathan Whitehorn# Set up installation environment 225de17cbccSHiroki Sato ln -fs /tmp/bsdinstall_etc/resolv.conf bootonly/etc/resolv.conf 226876acefaSHiroki Sato echo sendmail_enable=\"NONE\" > bootonly/etc/rc.conf 227876acefaSHiroki Sato echo hostid_enable=\"NO\" >> bootonly/etc/rc.conf 22873e46dbaSGlen Barber echo debug.witness.trace=0 >> bootonly/etc/sysctl.conf 229876acefaSHiroki Sato cp ${.CURDIR}/rc.local bootonly/etc 23046c413feSNathan Whitehorn 231dc244562SGlen Barberdvd: 232dc244562SGlen Barber# Install system 233dc244562SGlen Barber mkdir -p ${.TARGET} 234dc244562SGlen Barber cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ 235ba7bd912SGlen Barber DESTDIR=${.OBJDIR}/${.TARGET} MK_RESCUE=no MK_KERNEL_SYMBOLS=no \ 236ffc6fb79SGlen Barber MK_TESTS=no MK_DEBUG_FILES=no 237dc244562SGlen Barber# Copy distfiles 238dc244562SGlen Barber mkdir -p ${.TARGET}/usr/freebsd-dist 239ffc6fb79SGlen Barber for dist in MANIFEST $$(ls *.txz | grep -v -- '-dbg'); \ 240ffc6fb79SGlen Barber do cp $${dist} ${.TARGET}/usr/freebsd-dist; \ 241ffc6fb79SGlen Barber done 242dc244562SGlen Barber# Copy documentation, if generated 243dc244562SGlen Barber.if !defined(NODOC) 244dc244562SGlen Barber cp reldoc/* ${.TARGET} 245dc244562SGlen Barber.endif 246dc244562SGlen Barber# Set up installation environment 247dc244562SGlen Barber ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf 248dc244562SGlen Barber echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf 249dc244562SGlen Barber echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf 25073e46dbaSGlen Barber echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf 251dc244562SGlen Barber cp ${.CURDIR}/rc.local ${.TARGET}/etc 252dc244562SGlen Barber touch ${.TARGET} 253dc244562SGlen Barber 2548cec99b6SGlen Barberrelease.iso: disc1.iso 2558cec99b6SGlen Barberdisc1.iso: system 256ac23f460SGlen Barber sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_CD ${.TARGET} release 25712ad0bb1SNathan Whitehorn 258dc244562SGlen Barberdvd1.iso: dvd pkg-stage 259ac23f460SGlen Barber sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_DVD ${.TARGET} dvd 260dc244562SGlen Barber 26146c413feSNathan Whitehornbootonly.iso: bootonly 262ac23f460SGlen Barber sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_BO ${.TARGET} bootonly 26346c413feSNathan Whitehorn 264cb95a96bSGlen Barbermemstick: memstick.img 2653c334738SGlen Barbermemstick.img: system 266876acefaSHiroki Sato sh ${.CURDIR}/${TARGET}/make-memstick.sh release ${.TARGET} 26712ad0bb1SNathan Whitehorn 268a9da1707SGlen Barbermini-memstick: mini-memstick.img 269a9da1707SGlen Barbermini-memstick.img: system 270a9da1707SGlen Barber sh ${.CURDIR}/${TARGET}/make-memstick.sh bootonly ${.TARGET} 271a9da1707SGlen Barber 27212ad0bb1SNathan Whitehornpackagesystem: base.txz kernel.txz ${EXTRA_PACKAGES} 273876acefaSHiroki Sato sh ${.CURDIR}/scripts/make-manifest.sh *.txz > MANIFEST 274299a8b95SNathan Whitehorn touch ${.TARGET} 27512ad0bb1SNathan Whitehorn 276dc244562SGlen Barberpkg-stage: 2776f50c4eaSGlen Barber.if !defined(NOPKG) 2786f50c4eaSGlen Barber env REPOS_DIR=${.CURDIR}/pkg_repos/ \ 2796f50c4eaSGlen Barber sh ${.CURDIR}/scripts/pkg-stage.sh 2800d0e89b7SGlen Barber mkdir -p ${.OBJDIR}/dvd/packages/repos/ 2810d0e89b7SGlen Barber cp ${.CURDIR}/scripts/FreeBSD_install_cdrom.conf \ 2820d0e89b7SGlen Barber ${.OBJDIR}/dvd/packages/repos/ 283dc244562SGlen Barber.endif 2840d0e89b7SGlen Barber touch ${.TARGET} 285dc244562SGlen Barber 2868cec99b6SGlen Barbercdrom: disc1.iso bootonly.iso 287dc244562SGlen Barberdvdrom: dvd1.iso 28812ad0bb1SNathan Whitehornftp: packagesystem 289299a8b95SNathan Whitehorn rm -rf ftp 290876acefaSHiroki Sato mkdir -p ftp 291299a8b95SNathan Whitehorn cp *.txz MANIFEST ftp 29212ad0bb1SNathan Whitehorn 2930bd47e83SNathan Whitehornrelease: 2940bd47e83SNathan Whitehorn ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj 2950bd47e83SNathan Whitehorn ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS} 2964e187d25SGlen Barber.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) 2974e187d25SGlen Barber ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${VMTARGETS} 2984e187d25SGlen Barber.endif 29912ad0bb1SNathan Whitehorn 300299a8b95SNathan Whitehorninstall: 301876acefaSHiroki Sato.if defined(DESTDIR) && !empty(DESTDIR) 302876acefaSHiroki Sato mkdir -p ${DESTDIR} 303876acefaSHiroki Sato.endif 304de17cbccSHiroki Sato cp -a ftp ${DESTDIR}/ 305de17cbccSHiroki Sato.for I in ${IMAGES} 306de17cbccSHiroki Sato cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I} 307510f3303SGlen Barber. if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES) 3083b485e46SGlen Barber ${XZCMD} -k ${DESTDIR}/${OSRELEASE}-${I} 309cbc0e08aSGlen Barber. endif 310de17cbccSHiroki Sato.endfor 311de17cbccSHiroki Sato cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256 312de17cbccSHiroki Sato cd ${DESTDIR} && md5 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.MD5 313a68d274bSGlen Barber.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) 314a68d274bSGlen Barber mkdir -p ${DESTDIR}/vmimages 315a68d274bSGlen Barber. for FORMAT in ${VMFORMATS} 316a68d274bSGlen Barber cp -p ${VMBASE}.${FORMAT} \ 317a68d274bSGlen Barber ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT} 318a68d274bSGlen Barber. endfor 319a9278c16SGlen Barber. if defined(WITH_COMPRESSED_VMIMAGES) && !empty(WITH_COMPRESSED_VMIMAGES) 320a68d274bSGlen Barber# This is very time consuming, so defer it after the images are moved to 321a68d274bSGlen Barber# the DESTDIR. 322a68d274bSGlen Barber. for FORMAT in ${VMFORMATS} 323a68d274bSGlen Barber # Don't keep the originals. There is a copy in ${.OBJDIR} if needed. 324a68d274bSGlen Barber ${XZCMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT} 325a68d274bSGlen Barber. endfor 326a68d274bSGlen Barber. endif 327a68d274bSGlen Barber cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \ 328a68d274bSGlen Barber ${DESTDIR}/vmimages/CHECKSUM.SHA256 329a68d274bSGlen Barber cd ${DESTDIR}/vmimages && md5 ${OSRELEASE}* > \ 330a68d274bSGlen Barber ${DESTDIR}/vmimages/CHECKSUM.MD5 331a68d274bSGlen Barber.endif 332a68d274bSGlen Barber 333a68d274bSGlen Barbervm-base: 334a68d274bSGlen Barber.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) 335a2950cc4SGlen Barber. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh) 3360bc9be5eSGlen Barber env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ 3370bc9be5eSGlen Barber ${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \ 3380bc9be5eSGlen Barber ${VMBASE}.img ${WORLDDIR} ${.OBJDIR}/${.TARGET} ${VMSIZE} 339a68d274bSGlen Barber. endif 340a2950cc4SGlen Barber.endif 341a68d274bSGlen Barber touch ${.TARGET} 342a68d274bSGlen Barber 343a68d274bSGlen Barbervm-image: vm-base 344a68d274bSGlen Barber.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) 345a2950cc4SGlen Barber. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh) 346a68d274bSGlen Barber. for FORMAT in ${VMFORMATS} 3470bc9be5eSGlen Barber env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ 3480bc9be5eSGlen Barber ${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \ 3490bc9be5eSGlen Barber ${VMBASE}.img ${FORMAT} ${VMBASE}.${FORMAT} 350a68d274bSGlen Barber. endfor 351a68d274bSGlen Barber. endif 352a2950cc4SGlen Barber.endif 353a68d274bSGlen Barber touch ${.TARGET} 3543991f309SGlen Barber 3553991f309SGlen Barbervm-azure: 3563991f309SGlen Barber.if exists(${.CURDIR}/${TARGET}/mk-azure.sh) 3573991f309SGlen Barber env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} AZURECONF=${AZURECONF} \ 3583991f309SGlen Barber ${.CURDIR}/${TARGET}/mk-azure.sh ${.TARGET} azure.img \ 3593991f309SGlen Barber ${WORLDDIR} ${.TARGET} ${VMSIZE} ${OSRELEASE}.vhd 3603991f309SGlen Barber.endif 3613991f309SGlen Barber touch ${.TARGET} 362