xref: /freebsd/release/Makefile (revision 32a79e8557f61a194472ffe431e0379ed64f019f)
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)
114afe7cf5SGlen Barber#  release: Invokes real-release, vm-release, and cloudware-release targets
124afe7cf5SGlen Barber#  real-release: Build all media and FTP distribution area
134afe7cf5SGlen Barber#  vm-release: Build all virtual machine image targets
144afe7cf5SGlen Barber#  cloudware-release: Build all cloud hosting provider targets
152d4ff62fSGlen Barber#  install: Invokes the release-install and vm-install targets
162d4ff62fSGlen Barber#  release-install: Copies all release installation media into ${DESTDIR}
172d4ff62fSGlen Barber#  vm-install: Copies all virtual machine images into ${DESTDIR}
18bd668f6fSPoul-Henning Kamp#
1912ad0bb1SNathan Whitehorn# Variables affecting the build process:
2012ad0bb1SNathan Whitehorn#  WORLDDIR: location of src tree -- must have built world and default kernel
2112ad0bb1SNathan Whitehorn#            (by default, the directory above this one)
2212ad0bb1SNathan Whitehorn#  PORTSDIR: location of ports tree to distribute (default: /usr/ports)
231b8a3e1dSDevin Teske#  XTRADIR:  xtra-bits-dir argument for <arch>/mkisoimages.sh
249d22cb2eSHiroki Sato#  NOPKG:    if set, do not distribute third-party packages
2512ad0bb1SNathan Whitehorn#  NOPORTS:  if set, do not distribute ports tree
2612ad0bb1SNathan Whitehorn#  NOSRC:    if set, do not distribute source tree
27f7f650c7SGlen Barber#  WITH_DVD: if set, generate dvd1.iso
2855af5cf1SGlen Barber#  WITH_COMPRESSED_IMAGES: if set, compress installation images with xz(1)
29cbc0e08aSGlen Barber#		(uncompressed images are not removed)
30a68d274bSGlen Barber#  WITH_VMIMAGES: if set, build virtual machine images with the release
31a9278c16SGlen Barber#  WITH_COMPRESSED_VMIMAGES: if set, compress virtual machine disk images
32a9278c16SGlen Barber#  		with xz(1) (extremely time consuming)
332d4ff62fSGlen Barber#  WITH_CLOUDWARE: if set, build cloud hosting disk images with the release
3412ad0bb1SNathan Whitehorn#  TARGET/TARGET_ARCH: architecture of built release
35b03ddec9SJohn Baldwin#
36ab0e9cdcSPoul-Henning Kamp
3712ad0bb1SNathan WhitehornWORLDDIR?=	${.CURDIR}/..
3812ad0bb1SNathan WhitehornPORTSDIR?=	/usr/ports
39fff8eb57SJohn Baldwin
406853d893SJessica Clarke.include "${WORLDDIR}/share/mk/bsd.compat.pre.mk"
416853d893SJessica Clarke
42464485c8SHiroki Sato.if !defined(TARGET) || empty(TARGET)
43464485c8SHiroki SatoTARGET=		${MACHINE}
44464485c8SHiroki Sato.endif
45464485c8SHiroki Sato.if !defined(TARGET_ARCH) || empty(TARGET_ARCH)
460bd47e83SNathan Whitehorn.if ${TARGET} == ${MACHINE}
47464485c8SHiroki SatoTARGET_ARCH=	${MACHINE_ARCH}
488f1f55e9SRuslan Ermilov.else
49464485c8SHiroki SatoTARGET_ARCH=	${TARGET}
50464485c8SHiroki Sato.endif
518f1f55e9SRuslan Ermilov.endif
5212ad0bb1SNathan WhitehornIMAKE=		${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
53876acefaSHiroki SatoDISTDIR=	dist
548f1f55e9SRuslan Ermilov
5508f1325dSGlen Barber# Define OSRELEASE by using newvers.sh
56de17cbccSHiroki Sato.if !defined(OSRELEASE) || empty(OSRELEASE)
57de17cbccSHiroki Sato.for _V in TYPE BRANCH REVISION
58de17cbccSHiroki Sato${_V}!=	eval $$(awk '/^${_V}=/{print}' ${.CURDIR}/../sys/conf/newvers.sh); echo $$${_V}
59de17cbccSHiroki Sato.endfor
60de17cbccSHiroki Sato.for _V in ${TARGET_ARCH}
61de17cbccSHiroki Sato.if !empty(TARGET:M${_V})
62de17cbccSHiroki SatoOSRELEASE=	${TYPE}-${REVISION}-${BRANCH}-${TARGET}
63745ca085SGlen BarberVOLUME_LABEL=	${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET}
64de17cbccSHiroki Sato.else
65de17cbccSHiroki SatoOSRELEASE=	${TYPE}-${REVISION}-${BRANCH}-${TARGET}-${TARGET_ARCH}
66745ca085SGlen BarberVOLUME_LABEL=	${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET_ARCH}
67de17cbccSHiroki Sato.endif
68de17cbccSHiroki Sato.endfor
69de17cbccSHiroki Sato.endif
70de17cbccSHiroki Sato
7169c7d069SGlen Barber.if !defined(VOLUME_LABEL) || empty(VOLUME_LABEL)
7269c7d069SGlen BarberVOLUME_LABEL=	FreeBSD_Install
7369c7d069SGlen Barber.endif
74ac23f460SGlen Barber
7512ad0bb1SNathan Whitehorn.if !exists(${PORTSDIR})
7612ad0bb1SNathan WhitehornNOPORTS= true
77dd1a1b3dSJoerg Wunsch.endif
78dd1a1b3dSJoerg Wunsch
7912ad0bb1SNathan WhitehornEXTRA_PACKAGES=
806daa108fSRuslan Ermilov.if !defined(NOPORTS)
8112ad0bb1SNathan WhitehornEXTRA_PACKAGES+= ports.txz
826daa108fSRuslan Ermilov.endif
834731faa3SJordan K. Hubbard.if !defined(NOSRC)
8412ad0bb1SNathan WhitehornEXTRA_PACKAGES+= src.txz
852e3a1557SKen Smith.endif
86b2200964SJohn Baldwin
8712ad0bb1SNathan WhitehornRELEASE_TARGETS= ftp
88876acefaSHiroki SatoIMAGES=
8912ad0bb1SNathan Whitehorn.if exists(${.CURDIR}/${TARGET}/mkisoimages.sh)
9012ad0bb1SNathan WhitehornRELEASE_TARGETS+= cdrom
918cec99b6SGlen BarberIMAGES+=	disc1.iso bootonly.iso
92d8824524SGlen Barber. if defined(WITH_DVD) && !empty(WITH_DVD)
93dc244562SGlen BarberRELEASE_TARGETS+= dvdrom
94dc244562SGlen BarberIMAGES+=	dvd1.iso
95dc244562SGlen Barber. endif
966daa108fSRuslan Ermilov.endif
9712ad0bb1SNathan Whitehorn.if exists(${.CURDIR}/${TARGET}/make-memstick.sh)
983c334738SGlen BarberRELEASE_TARGETS+= memstick.img
99a9da1707SGlen BarberRELEASE_TARGETS+= mini-memstick.img
1003c334738SGlen BarberIMAGES+=	memstick.img
101a9da1707SGlen BarberIMAGES+=	mini-memstick.img
102e738d1eaSJohn Baldwin.endif
103e738d1eaSJohn Baldwin
104a55e34ebSGlen BarberCLEANFILES=	packagesystem *.txz MANIFEST release ${IMAGES}
1050c535991SGlen Barber.if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES)
1060c535991SGlen Barber. for I in ${IMAGES}
10755af5cf1SGlen BarberCLEANFILES+=	${I}.xz
1080c535991SGlen Barber. endfor
1090c535991SGlen Barber.endif
110cd15d7f3SGlen Barber.if defined(WITH_DVD) && !empty(WITH_DVD)
111cd15d7f3SGlen BarberCLEANFILES+=	pkg-stage
112cd15d7f3SGlen Barber.endif
113a55e34ebSGlen BarberCLEANDIRS=	dist ftp disc1 bootonly dvd
11446b13263SHiroki Satobeforeclean:
11546b13263SHiroki Sato	chflags -R noschg .
1168eb4e096SRuslan Ermilov.include <bsd.obj.mk>
11746b13263SHiroki Satoclean: beforeclean
11812ad0bb1SNathan Whitehorn
11912ad0bb1SNathan Whitehornbase.txz:
120876acefaSHiroki Sato	mkdir -p ${DISTDIR}
121876acefaSHiroki Sato	cd ${WORLDDIR} && ${IMAKE} distributeworld DISTDIR=${.OBJDIR}/${DISTDIR}
122f36b5d8aSJessica Clarke# TODO: Add NO_ROOT mode to mm-tree.sh
12313cb0041SJessica Clarke.if !defined(NO_ROOT)
12412ad0bb1SNathan Whitehorn# Set up mergemaster root database
125672d7ddbSSean Bruno	sh ${.CURDIR}/scripts/mm-mtree.sh -m ${WORLDDIR} -F \
12654a03abbSBryan Drewery	    "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} ${.MAKE.JOBS:D-j${.MAKE.JOBS}}" \
12754a03abbSBryan Drewery	    -D "${.OBJDIR}/${DISTDIR}/base"
128f36b5d8aSJessica Clarke.endif
129e9ba25aaSJessica Clarke	sh ${WORLDDIR}/usr.sbin/etcupdate/etcupdate.sh extract -B \
130f3772439SJessica Clarke	    -m "${MAKE}" -M "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" \
131f36b5d8aSJessica Clarke	    -s ${WORLDDIR} -d "${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate" \
132f36b5d8aSJessica Clarke	    ${NO_ROOT:D-N}
133f36b5d8aSJessica Clarke.if defined(NO_ROOT)
134f36b5d8aSJessica Clarke	echo "./var/db/etcupdate type=dir uname=root gname=wheel mode=0755" >> ${.OBJDIR}/${DISTDIR}/base.meta
135f36b5d8aSJessica Clarke	sed -n 's,^\.,./var/db/etcupdate/current,p' ${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate/current/METALOG \
136f36b5d8aSJessica Clarke	    >> ${.OBJDIR}/${DISTDIR}/base.meta
137f36b5d8aSJessica Clarke	rm ${.OBJDIR}/${DISTDIR}/base/var/db/etcupdate/current/METALOG
13813cb0041SJessica Clarke.endif
139bfc3bab8SNathan Whitehorn# Package all components
140876acefaSHiroki Sato	cd ${WORLDDIR} && ${IMAKE} packageworld DISTDIR=${.OBJDIR}/${DISTDIR}
141876acefaSHiroki Sato	mv ${DISTDIR}/*.txz .
14212ad0bb1SNathan Whitehorn
14312ad0bb1SNathan Whitehornkernel.txz:
144876acefaSHiroki Sato	mkdir -p ${DISTDIR}
145876acefaSHiroki Sato	cd ${WORLDDIR} && ${IMAKE} distributekernel packagekernel DISTDIR=${.OBJDIR}/${DISTDIR}
146876acefaSHiroki Sato	mv ${DISTDIR}/kernel*.txz .
14712ad0bb1SNathan Whitehorn
14812ad0bb1SNathan Whitehornsrc.txz:
149876acefaSHiroki Sato	mkdir -p ${DISTDIR}/usr
15012ad0bb1SNathan Whitehorn	ln -fs ${WORLDDIR} ${DISTDIR}/usr/src
151fcf12081SJessica Clarke	cd ${DISTDIR} && ${TAR_CMD} cLvf - --exclude .svn --exclude .zfs \
152bd9cab6fSRui Paulo	    --exclude .git --exclude @ --exclude usr/src/release/dist usr/src | \
153bd9cab6fSRui Paulo	    ${XZ_CMD} > ${.OBJDIR}/src.txz
15412ad0bb1SNathan Whitehorn
15512ad0bb1SNathan Whitehornports.txz:
156876acefaSHiroki Sato	mkdir -p ${DISTDIR}/usr
15712ad0bb1SNathan Whitehorn	ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports
158fcf12081SJessica Clarke	cd ${DISTDIR} && ${TAR_CMD} cLvf - \
15923659c9dSGlen Barber	    --exclude .git --exclude .svn \
16012ad0bb1SNathan Whitehorn	    --exclude usr/ports/distfiles --exclude usr/ports/packages \
161bd9cab6fSRui Paulo	    --exclude 'usr/ports/INDEX*' --exclude work usr/ports | \
162bd9cab6fSRui Paulo	    ${XZ_CMD} > ${.OBJDIR}/ports.txz
16312ad0bb1SNathan Whitehorn
164a55e34ebSGlen Barberdisc1: packagesystem
16512ad0bb1SNathan Whitehorn# Install system
166a55e34ebSGlen Barber	mkdir -p ${.TARGET}
1674bbfa3d3SEd Maste	cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \
16813f7dbe8SEd Maste	    DESTDIR=${.OBJDIR}/${.TARGET} MK_AT=no \
1696853d893SJessica Clarke	    MK_INSTALLLIB=no MK_MAIL=no \
170*32a79e85SJessica Clarke	    ${_ALL_LIBCOMPATS:@v@MK_LIB$v=no@} \
171eacff37aSEd Maste	    MK_TOOLCHAIN=no MK_PROFILE=no \
1724c0ef5dbSNathan Whitehorn	    MK_RESCUE=no MK_DICT=no \
1732502c66bSRoger Pau Monné	    MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no \
1742502c66bSRoger Pau Monné	    -DDB_FROM_SRC
17512ad0bb1SNathan Whitehorn# Copy distfiles
176a55e34ebSGlen Barber	mkdir -p ${.TARGET}/usr/freebsd-dist
1776853d893SJessica Clarke	for dist in MANIFEST $$(ls *.txz | grep -vE -- '(${base ${_ALL_libcompats}:L:ts|})-dbg'); \
178a55e34ebSGlen Barber	    do cp $${dist} ${.TARGET}/usr/freebsd-dist; \
179ffc6fb79SGlen Barber	done
18013cb0041SJessica Clarke.if defined(NO_ROOT)
18113cb0041SJessica Clarke	echo "./usr/freebsd-dist type=dir uname=root gname=wheel mode=0755" >> ${.TARGET}/METALOG
1826853d893SJessica Clarke	for dist in MANIFEST $$(ls *.txz | grep -vE -- '(${base ${_ALL_libcompats}:L:ts|})-dbg'); \
18313cb0041SJessica Clarke	    do echo "./usr/freebsd-dist/$${dist} type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG; \
18413cb0041SJessica Clarke	done
18513cb0041SJessica Clarke.endif
18612ad0bb1SNathan Whitehorn# Set up installation environment
187a55e34ebSGlen Barber	ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf
188a55e34ebSGlen Barber	echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf
189a55e34ebSGlen Barber	echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf
1908c14a409SGlen Barber	echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf
191a55e34ebSGlen Barber	echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf
1926e49372eSKyle Evans	echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf
1932a90c47aSJessica Clarke	echo loader_menu_multi_user_prompt=\"Installer\" >> ${.TARGET}/boot/loader.conf
194a55e34ebSGlen Barber	cp ${.CURDIR}/rc.local ${.TARGET}/etc
19513cb0041SJessica Clarke.if defined(NO_ROOT)
19613cb0041SJessica Clarke	echo "./etc/resolv.conf type=link uname=root gname=wheel mode=0644 link=/tmp/bsdinstall_etc/resolv.conf" >> ${.TARGET}/METALOG
19713cb0041SJessica Clarke	echo "./etc/rc.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
19813cb0041SJessica Clarke	echo "./etc/sysctl.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
19913cb0041SJessica Clarke	echo "./boot/loader.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
20013cb0041SJessica Clarke	echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
20113cb0041SJessica Clarke.endif
202876acefaSHiroki Sato	touch ${.TARGET}
20312ad0bb1SNathan Whitehorn
20446c413feSNathan Whitehornbootonly: packagesystem
20546c413feSNathan Whitehorn# Install system
206a55e34ebSGlen Barber	mkdir -p ${.TARGET}
2074bbfa3d3SEd Maste	cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \
20813f7dbe8SEd Maste	    DESTDIR=${.OBJDIR}/${.TARGET} MK_AT=no \
209738919c0SBaptiste Daroussin	    MK_GAMES=no \
2106853d893SJessica Clarke	    MK_INSTALLLIB=no MK_MAIL=no \
211*32a79e85SJessica Clarke	    ${_ALL_LIBCOMPATS:@v@MK_LIB$v=no@} \
212eacff37aSEd Maste	    MK_TOOLCHAIN=no MK_PROFILE=no \
21301d57ec0SBryan Drewery	    MK_RESCUE=no MK_DICT=no \
2142502c66bSRoger Pau Monné	    MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no \
2152502c66bSRoger Pau Monné	    -DDB_FROM_SRC
21646c413feSNathan Whitehorn# Copy manifest only (no distfiles) to get checksums
217a55e34ebSGlen Barber	mkdir -p ${.TARGET}/usr/freebsd-dist
218a55e34ebSGlen Barber	cp MANIFEST ${.TARGET}/usr/freebsd-dist
21913cb0041SJessica Clarke.if defined(NO_ROOT)
22013cb0041SJessica Clarke	echo "./usr/freebsd-dist type=dir uname=root gname=wheel mode=0755" >> ${.TARGET}/METALOG
22113cb0041SJessica Clarke	echo "./usr/freebsd-dist/MANIFEST type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
22213cb0041SJessica Clarke.endif
22346c413feSNathan Whitehorn# Set up installation environment
224a55e34ebSGlen Barber	ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf
225a55e34ebSGlen Barber	echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf
226a55e34ebSGlen Barber	echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf
2278c14a409SGlen Barber	echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf
228a55e34ebSGlen Barber	echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf
2296e49372eSKyle Evans	echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf
2302a90c47aSJessica Clarke	echo loader_menu_multi_user_prompt=\"Installer\" >> ${.TARGET}/boot/loader.conf
231a55e34ebSGlen Barber	cp ${.CURDIR}/rc.local ${.TARGET}/etc
23213cb0041SJessica Clarke.if defined(NO_ROOT)
23313cb0041SJessica Clarke	echo "./etc/resolv.conf type=link uname=root gname=wheel mode=0644 link=/tmp/bsdinstall_etc/resolv.conf" >> ${.TARGET}/METALOG
23413cb0041SJessica Clarke	echo "./etc/rc.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
23513cb0041SJessica Clarke	echo "./etc/sysctl.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
23613cb0041SJessica Clarke	echo "./boot/loader.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
23713cb0041SJessica Clarke	echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
23813cb0041SJessica Clarke.endif
23946c413feSNathan Whitehorn
240a55e34ebSGlen Barberdvd: packagesystem
241dc244562SGlen Barber# Install system
242dc244562SGlen Barber	mkdir -p ${.TARGET}
2434bbfa3d3SEd Maste	cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \
244ba7bd912SGlen Barber		DESTDIR=${.OBJDIR}/${.TARGET} MK_RESCUE=no MK_KERNEL_SYMBOLS=no \
2452502c66bSRoger Pau Monné		MK_TESTS=no MK_DEBUG_FILES=no \
2462502c66bSRoger Pau Monné		-DDB_FROM_SRC
247dc244562SGlen Barber# Copy distfiles
248dc244562SGlen Barber	mkdir -p ${.TARGET}/usr/freebsd-dist
2496853d893SJessica Clarke	for dist in MANIFEST $$(ls *.txz | grep -v -- '(${base ${_ALL_libcompats}:L:ts|})-dbg'); \
250ffc6fb79SGlen Barber	    do cp $${dist} ${.TARGET}/usr/freebsd-dist; \
251ffc6fb79SGlen Barber	done
25213cb0041SJessica Clarke.if defined(NO_ROOT)
25313cb0041SJessica Clarke	echo "./usr/freebsd-dist type=dir uname=root gname=wheel mode=0755" >> ${.TARGET}/METALOG
2546853d893SJessica Clarke	for dist in MANIFEST $$(ls *.txz | grep -vE -- '(${base ${_ALL_libcompats}:L:ts|})-dbg'); \
25513cb0041SJessica Clarke	    do echo "./usr/freebsd-dist/$${dist} type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG; \
25613cb0041SJessica Clarke	done
25713cb0041SJessica Clarke.endif
258dc244562SGlen Barber# Set up installation environment
259dc244562SGlen Barber	ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf
260dc244562SGlen Barber	echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf
261dc244562SGlen Barber	echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf
2628c14a409SGlen Barber	echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf
2637f100614SGlen Barber	echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf
2646e49372eSKyle Evans	echo kernels_autodetect=\"NO\" >> ${.TARGET}/boot/loader.conf
2652a90c47aSJessica Clarke	echo loader_menu_multi_user_prompt=\"Installer\" >> ${.TARGET}/boot/loader.conf
266dc244562SGlen Barber	cp ${.CURDIR}/rc.local ${.TARGET}/etc
26713cb0041SJessica Clarke.if defined(NO_ROOT)
26813cb0041SJessica Clarke	echo "./etc/resolv.conf type=link uname=root gname=wheel mode=0644 link=/tmp/bsdinstall_etc/resolv.conf" >> ${.TARGET}/METALOG
26913cb0041SJessica Clarke	echo "./etc/rc.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
27013cb0041SJessica Clarke	echo "./etc/sysctl.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
27113cb0041SJessica Clarke	echo "./boot/loader.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
27213cb0041SJessica Clarke	echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG
27313cb0041SJessica Clarke.endif
274dc244562SGlen Barber	touch ${.TARGET}
275dc244562SGlen Barber
2768cec99b6SGlen Barberrelease.iso: disc1.iso
277a55e34ebSGlen Barberdisc1.iso: disc1
27813cb0041SJessica Clarke	cd disc1 && sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_CD ../${.TARGET} .${NO_ROOT:D/METALOG} ${XTRADIR}
27912ad0bb1SNathan Whitehorn
280dc244562SGlen Barberdvd1.iso: dvd pkg-stage
28113cb0041SJessica Clarke	cd dvd && sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_DVD ../${.TARGET} .${NO_ROOT:D/METALOG} ${XTRADIR}
282dc244562SGlen Barber
28346c413feSNathan Whitehornbootonly.iso: bootonly
28413cb0041SJessica Clarke	cd bootonly && sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_BO ../${.TARGET} .${NO_ROOT:D/METALOG} ${XTRADIR}
28546c413feSNathan Whitehorn
286cb95a96bSGlen Barbermemstick: memstick.img
287a55e34ebSGlen Barbermemstick.img: disc1
28813cb0041SJessica Clarke	cd disc1 && sh ${.CURDIR}/${TARGET}/make-memstick.sh .${NO_ROOT:D/METALOG} ../${.TARGET}
28912ad0bb1SNathan Whitehorn
290a9da1707SGlen Barbermini-memstick: mini-memstick.img
291a55e34ebSGlen Barbermini-memstick.img: bootonly
29213cb0041SJessica Clarke	cd bootonly && sh ${.CURDIR}/${TARGET}/make-memstick.sh .${NO_ROOT:D/METALOG} ../${.TARGET}
293a9da1707SGlen Barber
29412ad0bb1SNathan Whitehornpackagesystem: base.txz kernel.txz ${EXTRA_PACKAGES}
295876acefaSHiroki Sato	sh ${.CURDIR}/scripts/make-manifest.sh *.txz > MANIFEST
296299a8b95SNathan Whitehorn	touch ${.TARGET}
29712ad0bb1SNathan Whitehorn
298dc244562SGlen Barberpkg-stage:
29913cb0041SJessica Clarke# TODO: Support for -DNO_ROOT
3008f229143SGlen Barber.if !defined(NOPKG) || empty(NOPKG)
301fefd0439SGlen Barber	env PORTSDIR=${PORTSDIR} REPOS_DIR=${.CURDIR}/pkg_repos/ \
3026f50c4eaSGlen Barber		sh ${.CURDIR}/scripts/pkg-stage.sh
3030d0e89b7SGlen Barber	mkdir -p ${.OBJDIR}/dvd/packages/repos/
3040d0e89b7SGlen Barber	cp ${.CURDIR}/scripts/FreeBSD_install_cdrom.conf \
3050d0e89b7SGlen Barber		${.OBJDIR}/dvd/packages/repos/
306dc244562SGlen Barber.endif
3070d0e89b7SGlen Barber	touch ${.TARGET}
308dc244562SGlen Barber
3098cec99b6SGlen Barbercdrom: disc1.iso bootonly.iso
310dc244562SGlen Barberdvdrom: dvd1.iso
31112ad0bb1SNathan Whitehornftp: packagesystem
312299a8b95SNathan Whitehorn	rm -rf ftp
313876acefaSHiroki Sato	mkdir -p ftp
314299a8b95SNathan Whitehorn	cp *.txz MANIFEST ftp
31512ad0bb1SNathan Whitehorn
3164afe7cf5SGlen Barberrelease:	real-release vm-release cloudware-release
317fdbd473cSGlen Barber	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} release-done
318fdbd473cSGlen Barber	true
319fdbd473cSGlen Barber
320fdbd473cSGlen Barberrelease-done:
321fdbd473cSGlen Barber	touch release
3224afe7cf5SGlen Barber
3234afe7cf5SGlen Barberreal-release:
3240bd47e83SNathan Whitehorn	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj
3250bd47e83SNathan Whitehorn	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS}
32612ad0bb1SNathan Whitehorn
32732a4dda8SGlen Barberinstall:	release-install vm-install
3282d4ff62fSGlen Barber
3292d4ff62fSGlen Barberrelease-install:
330876acefaSHiroki Sato.if defined(DESTDIR) && !empty(DESTDIR)
331876acefaSHiroki Sato	mkdir -p ${DESTDIR}
332876acefaSHiroki Sato.endif
333de17cbccSHiroki Sato	cp -a ftp ${DESTDIR}/
3343083b412SMitchell Horne.if !empty(IMAGES)
335de17cbccSHiroki Sato.for I in ${IMAGES}
336de17cbccSHiroki Sato	cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I}
337510f3303SGlen Barber. if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES)
338bd9cab6fSRui Paulo	${XZ_CMD} -k ${DESTDIR}/${OSRELEASE}-${I}
339cbc0e08aSGlen Barber. endif
340de17cbccSHiroki Sato.endfor
34134187a08SGlen Barber	cd ${DESTDIR} && sha512 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA512
342de17cbccSHiroki Sato	cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256
3433083b412SMitchell Horne.endif
344a68d274bSGlen Barber
34529b282f3SGlen Barber.include "${.CURDIR}/Makefile.inc1"
3466513e474SGlen Barber.include "${.CURDIR}/Makefile.vm"
347