Build the packages for our our LiveCD/DVD with options "dri" & "inet6".
[dragonfly.git] / nrelease / Makefile
CommitLineData
bfe20b28 1# $DragonFly: src/nrelease/Makefile,v 1.90 2008/09/01 21:20:30 swildner Exp $
6ca9a59c 2#
5b22b655 3
9b29c40a
MD
4#########################################################################
5# ENHANCEMENTS #
6#########################################################################
7
f4ec1279 8# New method e.g. 'make gui release'. A series of enhancement
9b29c40a
MD
9# targes may be specified which set make variables which enhance
10# the build in various ways.
11#
b9c3e754 12gui installer img:
9b29c40a 13
9b29c40a
MD
14#########################################################################
15# SETUP #
16#########################################################################
17
6ca9a59c 18ISODIR ?= /usr/release
5ec00f8a 19ISOROOT ?= ${ISODIR}/root
6ca9a59c 20OBJSYS= ${.OBJDIR}/../sys
bfe20b28
SW
21
22.if make(gui)
23KERNCONF ?= DFLYLIVE VKERNEL DFLYLIVE-SMP DFLYLIVE-SMP-NOAPIC
24.else
1d3eb8c5 25KERNCONF ?= GENERIC VKERNEL
bfe20b28 26.endif
6ca9a59c 27
cc224c64 28PKGSRC_PREFIX?= /usr/pkg
bce110a5 29PKGBIN_PKG_ADD?= ${PKGSRC_PREFIX}/sbin/pkg_add
95b64753 30PKGBIN_PKG_DELETE?= ${PKGSRC_PREFIX}/sbin/pkg_delete
c791834f 31PKGBIN_PKG_ADMIN?= ${PKGSRC_PREFIX}/sbin/pkg_admin
bce110a5
MD
32PKGBIN_MKISOFS?= ${PKGSRC_PREFIX}/bin/mkisofs
33PKGSRC_PKG_PATH?= ${ISODIR}/packages
34PKGSRC_DB?= /var/db/pkg
af88d908 35PKGSRC_BOOTSTRAP_URL?= http://avalon.dragonflybsd.org/DragonFly-pkgsrc-packages/i386/1.12.0-RELEASE-BUILD
4b08f3df 36CVSUP_BOOTSTRAP_KIT?= cvsup-bootstrap-20070716
bce110a5 37
cc55a235
SS
38# We use env -i in the chroot, so that environment variables won't
39# disturb any (pkgsrc) build. This has happened for TARGET_ARCH,
40# which is used by gmake in completely different context.
e2dbfa0b 41#
cc55a235
SS
42CHROOT_CMD?= env -i CCVER=${CCVER:Q} /usr/sbin/chroot ${ISOROOT} sh -c
43
8abe78a1 44# User may specify extra packages in addition to the defaults
95b64753 45#
8abe78a1
MD
46PKGSRC_EXTRA_PACKAGES?=
47
48# Pkgsrc packages to be built and installed on the release ISO
49#
50PKGSRC_PACKAGES?= pkgtools/pkg_leaves \
51 pkgtools/pkg_tarup \
52 devel/scmgit \
fbc26094
SW
53 net/isc-dhcp4 \
54 net/isc-dhcpd4 \
8abe78a1
MD
55 sysutils/cdrtools \
56 ${PKGSRC_EXTRA_PACKAGES}
fbc26094
SW
57
58# pkgsrc options to use when building packages
59#
9ecb41e5 60PKGSRC_OPTIONS+= PKG_DEFAULT_OPTIONS='dri inet6'
fbc26094 61.if !make(gui)
9ecb41e5 62PKGSRC_OPTIONS+= PKG_OPTIONS.scmgit=-scmgit-gui
fbc26094 63.endif
8188de86 64
95b64753
MD
65# Even though buildiso wipes the packages, our check target has to run
66# first and old packages (listed as they appear in pkg_info) must be
67# cleaned out in order for the pkg_add -n test we use in the check target
68# to operate properly.
69#
fbc26094
SW
70OLD_PKGSRC_PACKAGES?= cdrtools-2.01.01.27nb1 \
71 cdrecord-2.00.3nb2 \
72 bootstrap-kit-20070205 \
73 dfuibe_installer-1.1.6 \
74 gettext-lib-0.14.5 \
75 dfuibe_installer-1.1.7nb1 \
76 dfuife_curses-1.5 \
77 gettext-lib-0.14.6 \
78 gettext-tools-0.14.6nb1 \
79 libaura-3.1 \
80 libdfui-4.2 \
81 libinstaller-5.1 \
82 bootstrap-kit-20080211 \
83 cdrtools-ossdvd-2.01.1.36nb2 \
84 isc-dhcp-base-4.0.0 \
85 isc-dhcp-server-4.0.0
95b64753 86
8188de86 87# Specify which root skeletons are required, and let the user include
e2dbfa0b 88# their own. They are copied into ISODIR during the `customizeiso'
8188de86
MD
89# target; each overwrites the last.
90#
fbc26094
SW
91REQ_ROOTSKELS= ${.CURDIR}/root \
92 ${.CURDIR}/installer
cc224c64
JS
93ROOTSKELS?= ${REQ_ROOTSKELS}
94
fbc26094 95.if make(gui)
3f279b9e 96ISOFILE?= ${ISODIR}/dfly-gui.iso
b9c3e754 97IMGFILE?= ${ISODIR}/dfly-gui.img
0936984e
MD
98PKGSRC_PACKAGES+= meta-pkgs/modular-xorg-apps \
99 meta-pkgs/modular-xorg-drivers \
100 meta-pkgs/modular-xorg-fonts \
101 meta-pkgs/modular-xorg-libs \
fbc26094 102 wm/fluxbox \
0936984e 103 wm/fvwm \
fbc26094
SW
104 www/firefox3 \
105 print/xpdf \
106 shells/zsh \
107 editors/emacs \
108 editors/vim \
109 chat/pidgin \
110 chat/irssi \
111 chat/xchat \
0936984e 112 x11/modular-xorg-server \
fbc26094
SW
113 x11/rxvt-unicode \
114 x11/eterm \
115 lang/perl5 \
116 editors/nano \
117 shells/bash \
118 devel/exctags \
119 archivers/zip \
120 security/sudo \
121 www/links-gui \
122 net/nmap \
123 net/wget \
124 fonts/terminus-font \
125 net/rsync \
126 sysutils/idesk \
0936984e 127 time/asclock \
fbc26094 128 misc/screen
3f279b9e
SW
129ROOTSKELS+= ${.CURDIR}/gui
130.endif
131
3f279b9e 132ISOFILE ?= ${ISODIR}/dfly.iso
b9c3e754
MN
133IMGFILE ?= ${ISODIR}/dfly.img
134
60b68cbb 135IMGMNT ?= ${ISODIR}/mnt
b9c3e754 136IMGUSBDEV ?= /dev/da0
3f279b9e 137
5b22b655
MD
138# note: we use the '${NRLOBJDIR}/nrelease' construct, that is we add
139# the additional '/nrelease' manually, as a safety measure.
140#
141NRLOBJDIR?= /usr/obj
142
8188de86
MD
143#########################################################################
144# BASE ISO TARGETS #
145#########################################################################
146
7ebbae99 147release: check clean buildworld1 buildkernel1 \
03e2a3c5 148 buildiso srcs customizeiso mklocatedb \
0936984e 149 mkiso mkimg
8188de86 150
7ebbae99 151quickrel: check clean buildworld2 buildkernel2 \
03e2a3c5 152 buildiso srcs customizeiso mklocatedb \
0936984e 153 mkiso mkimg
2e3f8f38 154
03e2a3c5
SW
155realquickrel: check clean \
156 buildiso srcs customizeiso mklocatedb \
0936984e 157 mkiso mkimg
6ca9a59c 158
03e2a3c5 159restartpkgs: check customizeiso mklocatedb mkiso mkimg
5af45f85 160
9b29c40a
MD
161quick: quickrel
162
163realquick: realquickrel
164
5af45f85 165
9b29c40a
MD
166#########################################################################
167# CORE SUPPORT TARGETS #
168#########################################################################
169
d2582113 170check:
0936984e
MD
171.if !exists(${PKGBIN_PKG_ADMIN})
172 @echo "You never bootstrapped pkgsrc on your machine. You can install it with:"
173 @echo " make pkgsrc_bootstrap"
174.endif
0a1628e7
MD
175.if !exists(${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}.tgz)
176 @echo "The cvsup bootstrap kit is not installed. You can install it with:"
f4ec1279 177 @echo " make fetch"
0936984e
MD
178.endif
179.if !exists (${PKGBIN_MKISOFS})
180 @echo
181 @echo "Your machine does not have cdrtools installed. You can install it with:"
182 @echo " make pkgsrc_cdrecord"
0a1628e7 183.endif
fbc26094
SW
184.if !defined(PKGSRC_PATH)
185 @echo "Please set PKGSRC_PATH to the pkgsrc tree that shall be used for"
5af45f85
MD
186 @echo "package building. For example /usr/pkgsrc. See the Makefile"
187 @echo "in /usr if you are unfamiliar with pkgsrc."
0936984e
MD
188.endif
189.if !exists(${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}.tgz)
190 @exit 1
191.endif
192.if !exists (${PKGBIN_MKISOFS})
193 @exit 1
194.endif
195.if !defined(PKGSRC_PATH)
fbc26094
SW
196 @exit 1
197.endif
2e3f8f38 198
588a679c 199buildworld1 buildworld2:
f4ec1279 200 cd ${.CURDIR}/..; ${WORLD_CCVER:C/^..*$/WORLD_CCVER=/}${WORLD_CCVER} make -DWANT_INSTALLER ${.TARGET:C/build(.*)2/quick\1/:C/1//}
6ca9a59c 201
588a679c 202buildkernel1 buildkernel2:
bfe20b28
SW
203.if make(gui)
204 cd ${.CURDIR}/..; \
205 for kernconf in ${KERNCONF}; do \
448b21e7 206 ${WORLD_CCVER:C/^..*$/WORLD_CCVER=/}${WORLD_CCVER} \
82f56cac 207 make ${.TARGET:C/build(.*)2/quick\1/:C/1//} \
bfe20b28
SW
208 KERNCONF=$${kernconf} KERNCONFDIR=${.CURDIR}/gui/root; \
209 done
210.else
588a679c
SS
211 cd ${.CURDIR}/..; \
212 first=; \
213 for kernconf in ${KERNCONF}; do \
448b21e7 214 ${WORLD_CCVER:C/^..*$/WORLD_CCVER=/}${WORLD_CCVER} \
82f56cac 215 make ${.TARGET:C/build(.*)2/quick\1/:C/1//} \
588a679c
SS
216 KERNCONF=$${kernconf} \
217 $${first:+-DNO_MODULES}; \
218 first=done; \
219 done
bfe20b28 220.endif
6ca9a59c 221
5b22b655
MD
222# note that we do not want to mess with any /usr/obj directories not related
223# to buildworld, buildkernel, or nrelease, so we must supply the proper
224# MAKEOBJDIRPREFIX for targets that are not run through the buildworld and
225# buildkernel mechanism.
226#
6ca9a59c
MD
227buildiso:
228 if [ ! -d ${ISOROOT} ]; then mkdir -p ${ISOROOT}; fi
5b22b655 229 if [ ! -d ${NRLOBJDIR}/nrelease ]; then mkdir -p ${NRLOBJDIR}/nrelease; fi
f4ec1279 230 ( cd ${.CURDIR}/..; make -DWANT_INSTALLER DESTDIR=${ISOROOT} installworld )
ab64cf06
SS
231 ( cd ${.CURDIR}/../etc; MAKEOBJDIRPREFIX=${NRLOBJDIR}/nrelease \
232 make -m ${.CURDIR}/../share/mk DESTDIR=${ISOROOT} distribution )
21aa02d0 233 cpdup ${ISOROOT}/etc ${ISOROOT}/etc.hdd
bfe20b28 234.if make(gui)
fbc26094 235 if [ ! -d ${ISOROOT}/kernel.smp/boot ]; then mkdir -p ${ISOROOT}/kernel.smp/boot; fi
bfe20b28
SW
236 cd ${.CURDIR}/..; \
237 make installkernel DESTDIR=${ISOROOT} \
238 KERNCONF=DFLYLIVE DESTKERNNAME=kernel KERNCONFDIR=${.CURDIR}/gui/root; \
239 cd ${.CURDIR}/..; \
240 make installkernel DESTDIR=${ISOROOT} \
241 KERNCONF=VKERNEL DESTKERNNAME=kernel.VKERNEL -DNO_MODULES KERNCONFDIR=${.CURDIR}/gui/root; \
242 cd ${.CURDIR}/..; \
243 make installkernel DESTDIR=${ISOROOT}/kernel.smp \
244 KERNCONF=DFLYLIVE-SMP DESTKERNNAME=kernel KERNCONFDIR=${.CURDIR}/gui/root; \
245 cd ${.CURDIR}/..; \
246 make installkernel DESTDIR=${ISOROOT}/kernel.smp \
247 KERNCONF=DFLYLIVE-SMP-NOAPIC DESTKERNNAME=kernel.noapic \
248 KERNCONFDIR=${.CURDIR}/gui/root -DNO_MODULES;
249.else
588a679c
SS
250 cd ${.CURDIR}/..; \
251 first=; \
252 for kernconf in ${KERNCONF}; do \
253 make DESTDIR=${ISOROOT} \
254 installkernel KERNCONF=$${kernconf} \
255 $${first:+DESTKERNNAME=kernel.$${kernconf}} \
256 $${first:+-DNO_MODULES}; \
257 first=done; \
258 done
bfe20b28 259.endif
3f6dbfa9 260 ln -s kernel ${ISOROOT}/boot/kernel.BOOTP
6ca9a59c
MD
261 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.local.dist -p ${ISOROOT}/usr/local/
262 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.var.dist -p ${ISOROOT}/var
263 dev_mkdb -f ${ISOROOT}/var/run/dev.db ${ISOROOT}/dev
8188de86 264
e2dbfa0b
TN
265# Release CD: Kernel sources (~16M) and the full pkgsrc tree (~27M)
266# Release DVD: Full sources (~90M) and the full pkgsrc tree (~27M)
19d86faa 267#
e2dbfa0b
TN
268srcs:
269.if !defined(WITHOUT_SRCS)
270 rm -f ${ISOROOT}/usr/pkgsrc-all.tgz
271 cd ${PKGSRC_PATH} && tar --exclude distfiles --exclude packages --exclude work --exclude CVS --exclude .git \
c19c746b
MD
272 -czf ${ISOROOT}/usr/pkgsrc-all.tgz .
273.if make(gui)
e2dbfa0b 274 rm -f ${ISOROOT}/usr/src-all.tgz
3617b2c9
SW
275 cd ${.CURDIR}/.. && tar --exclude .git --exclude CVS -s '/^\./src/' \
276 -czf ${ISOROOT}/usr/src-all.tgz .
c19c746b 277.else
e2dbfa0b 278 rm -f ${ISOROOT}/usr/src-sys.tgz
3617b2c9
SW
279 cd ${.CURDIR}/.. && tar --exclude .git --exclude CVS -s '/^\./src/' \
280 -czf ${ISOROOT}/usr/src-sys.tgz ./Makefile ./Makefile.inc1 ./sys
c19c746b 281.endif
66b79064 282.endif
19d86faa 283
5af45f85
MD
284# Customize the ISO by copying rootskels in reverse priority order,
285# building packages, and doing other post-install tasks.
286#
8188de86 287customizeiso:
5af45f85
MD
288 # Copy the rootskels. Allow sources to be owned by someone other
289 # then root (as is common when checked out via git).
290 #
8188de86
MD
291.for ROOTSKEL in ${ROOTSKELS}
292 cpdup -X cpignore -o ${ROOTSKEL} ${ISOROOT}
5af45f85
MD
293 @test -O ${.CURDIR} || echo "chowning copied files to root:wheel"
294 @test -O ${.CURDIR} || ((cd ${ROOTSKEL} && find .) | fgrep -v cpignore | (cd ${ISOROOT} && xargs chown root:wheel))
8188de86 295.endfor
fbc26094 296 (cd ${PKGSRC_PKG_PATH}; tar xzpf ${CVSUP_BOOTSTRAP_KIT}.tgz)
0a1628e7 297 cp -p ${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}/usr/local/bin/cvsup ${ISOROOT}/usr/local/bin/cvsup
c751e497 298 cp -p ${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}/usr/local/man/man1/cvsup.1 ${ISOROOT}/usr/local/man/man1/cvsup.1
7249926b 299 pwd_mkdb -p -d ${ISOROOT}/etc ${ISOROOT}/etc/master.passwd
4fba3387
CP
300.for UPGRADE_ITEM in Makefile \
301 etc.${MACHINE_ARCH} \
302 isdn/Makefile \
303 rc.d/Makefile \
304 periodic/Makefile \
305 periodic/daily/Makefile \
306 periodic/security/Makefile \
307 periodic/weekly/Makefile \
308 periodic/monthly/Makefile
309 cp -R ${.CURDIR}/../etc/${UPGRADE_ITEM} ${ISOROOT}/etc/${UPGRADE_ITEM}
310.endfor
8abe78a1
MD
311 #
312 # Setup some things & mount pkgsrc tree. Use defensive umounts and
313 # rm -rf's to allow restarts. Allow /usr/pkgsrc to be read-only.
314 #
315 # If we did not get past the bootstrap we clean out the entire
316 # /usr/pkg infrastructure. Otherwise we attempt to pick up where
317 # we left off.
318 #
fbc26094 319 cp -p /etc/resolv.conf ${ISOROOT}/etc
cc55a235 320 ${CHROOT_CMD} "ldconfig -elf /usr/lib /usr/lib/gcc* /usr/lib/compat"
8abe78a1
MD
321 -@umount ${ISOROOT}/usr/pkgsrc/distfiles
322 -@umount ${ISOROOT}/usr/pkgsrc
323 mkdir -p ${ISODIR}/distfiles
324 rm -rf ${ISOROOT}/usr/pkgobj
8abe78a1
MD
325 #
326 # Mount /usr/pkgsrc, make sure /usr/pkgsrc/distfiles is writable
327 #
328 mkdir -p ${ISOROOT}/usr/pkgobj
3aa2328e 329 mkdir -p ${ISOROOT}/usr/pkgobj/bootstrap
8abe78a1 330 mkdir -p ${ISOROOT}/usr/pkgsrc
fbc26094 331 mount_null ${PKGSRC_PATH} ${ISOROOT}/usr/pkgsrc
5af45f85
MD
332 cp /etc/shells ${ISOROOT}/usr/pkgsrc/distfiles/.test > /dev/null 2>&1 \
333 || mount_null ${ISODIR}/distfiles ${ISOROOT}/usr/pkgsrc/distfiles
8abe78a1 334 #
5af45f85 335 # Bootstrap, if not already installed, and add licenses needed
ee3561ee 336 # for the gui release
8abe78a1 337 #
c19c746b
MD
338 test -e ${ISODIR}/.didbootstrap || \
339 rm -rf ${ISOROOT}/usr/pkg ${ISOROOT}/var/db/pkg \
340 ${ISOROOT}/var/db/pkg.refcount
341 test -e ${ISODIR}/.didbootstrap || \
342 ${CHROOT_CMD} "cd /usr/pkgsrc/bootstrap; \
8abe78a1 343 ./bootstrap --workdir /usr/pkgobj/bootstrap/work"
c19c746b
MD
344 test -e ${ISODIR}/.didbootstrap || \
345 echo ".ifdef BSD_PKG_MK # added by nrelease" \
ee3561ee 346 >> ${ISOROOT}/usr/pkg/etc/mk.conf
c19c746b
MD
347 test -e ${ISODIR}/.didbootstrap || \
348 echo "ACCEPTABLE_LICENSES+=openmotif-license" \
ee3561ee 349 >> ${ISOROOT}/usr/pkg/etc/mk.conf
c19c746b
MD
350 test -e ${ISODIR}/.didbootstrap || \
351 echo "ACCEPTABLE_LICENSES+=vim-license" \
ee3561ee 352 >> ${ISOROOT}/usr/pkg/etc/mk.conf
c19c746b
MD
353 test -e ${ISODIR}/.didbootstrap || \
354 echo ".endif # added by nrelease" \
ee3561ee 355 >> ${ISOROOT}/usr/pkg/etc/mk.conf
c19c746b
MD
356 test -e ${ISODIR}/.didbootstrap || sync
357 test -e ${ISODIR}/.didbootstrap || touch ${ISODIR}/.didbootstrap
8abe78a1
MD
358 #
359 # Build and install packages, skip packages already installed
360 #
bce110a5 361.for PKG in ${PKGSRC_PACKAGES}
8abe78a1
MD
362 ${CHROOT_CMD} "cd /usr/pkgsrc/${PKG} && \
363 (bmake WRKOBJDIR=/usr/pkgobj check > /dev/null 2>&1 || \
364 bmake WRKOBJDIR=/usr/pkgobj ${PKGSRC_OPTIONS} clean build install)"
8188de86 365.endfor
8abe78a1
MD
366 #
367 # Remove packages which nothing depends on and clean up
368 #
cc55a235 369 ${CHROOT_CMD} "pkg_leaves | xargs pkg_delete -R"
8abe78a1 370 -umount ${ISOROOT}/usr/pkgsrc/distfiles
fbc26094
SW
371 umount ${ISOROOT}/usr/pkgsrc
372 rmdir ${ISOROOT}/usr/pkgsrc
589a5738 373 rm -rf ${ISOROOT}/usr/pkgobj
fbc26094 374 rm -f ${ISOROOT}/etc/resolv.conf
3652f053
SW
375 makewhatis ${ISOROOT}/usr/local/man
376 makewhatis ${ISOROOT}/usr/pkg/man
6ca9a59c 377
0936984e
MD
378# So locate works
379#
8398ca17
SW
380mklocatedb:
381 ( find -s ${ISOROOT} -path ${ISOROOT}/tmp -or \
382 -path ${ISOROOT}/usr/tmp -or -path ${ISOROOT}/var/tmp \
383 -prune -o -print | sed -e 's#^${ISOROOT}##g' | \
384 /usr/libexec/locate.mklocatedb \
385 -presort >${ISOROOT}/var/db/locate.database )
386
6ca9a59c 387mkiso:
bce110a5 388 ( cd ${ISOROOT}; ${PKGBIN_MKISOFS} -b boot/cdboot -no-emul-boot \
74ec6a9d
SW
389 -R -J -o ${ISOFILE} \
390 -V DragonFly-`${.CURDIR}/../tools/gitrev.sh | cut -c -22` . )
6ca9a59c 391
b9c3e754
MN
392
393mkimg:
fbc26094 394.if make(img)
60b68cbb
MN
395 if [ ! -d ${IMGMNT} ]; then mkdir -p ${IMGMNT}; fi
396
397 echo "determine required image size" > /dev/null; \
398 sz=`du -ck ${ISOROOT} | tail -n 1 | cut -f 1`; \
e6b76e22
MN
399 echo "add 15% more space as required" > /dev/null; \
400 sz=`bc -e "(($${sz}) / 1024) * 1.15" -equit | cut -f1 -d.`; \
60b68cbb
MN
401 dd if=/dev/zero of=${IMGFILE} bs=1m count=$${sz}; \
402 fdisk -IB -p ${IMGFILE}; \
403 echo "determine free vn device" > /dev/null; \
404 vn=`vnconfig -l | grep "not in use" | head -n 1 | cut -f 1 -d:`; \
405 vnconfig -e -s labels $${vn} ${IMGFILE}; \
406 echo "write standard disklabel" > /dev/null; \
407 disklabel -w -r $${vn}s1 auto; \
408 echo "read disklabel back" > /dev/null; \
409 disklabel -r $${vn}s1 > ${IMGFILE}.label; \
410 echo "determine number of sectors of whole disk" > /dev/null; \
411 secs=`tail -n 1 ${IMGFILE}.label | cut -f 3 -w`; \
412 echo "and add a: partition" > /dev/null; \
413 echo " a: $${secs} 0 4.2BSD" >> ${IMGFILE}.label; \
414 echo "write modified disklabel back" > /dev/null; \
415 disklabel -R -r $${vn}s1 ${IMGFILE}.label; \
416 rm ${IMGFILE}.label; \
417 echo "write bootsector" > /dev/null; \
418 disklabel -B $${vn}s1; \
419 newfs /dev/$${vn}s1a; \
420 mount /dev/$${vn}s1a ${IMGMNT}; \
421 cpdup -vvv ${ISOROOT} ${IMGMNT}; \
422 echo "fix /etc/fstab" > /dev/null; \
b72c2692
MN
423 echo "${IMGUSBDEV}s1a / ufs rw 0 0" > ${IMGMNT}/etc/fstab; \
424 echo "proc /proc procfs rw 0 0" >> ${IMGMNT}/etc/fstab; \
bccaed73 425 df ${IMGMNT}; \
60b68cbb
MN
426 umount ${IMGMNT}; \
427 vnconfig -u $${vn}; \
428 rmdir ${IMGMNT}
b9c3e754
MN
429.endif
430
6ca9a59c 431clean:
c19c746b
MD
432 -umount ${ISOROOT}/usr/pkgsrc/distfiles > /dev/null 2>&1
433 -umount ${ISOROOT}/usr/pkgsrc > /dev/null 2>&1
6ca9a59c 434 if [ -d ${ISOROOT} ]; then chflags -R noschg ${ISOROOT}; fi
c19c746b
MD
435 rm -rf ${ISOROOT}
436 rm -rf ${NRLOBJDIR}/nrelease
8abe78a1 437 rm -f ${ISODIR}/.didbootstrap
6ca9a59c
MD
438
439realclean: clean
3ebedc5e 440 rm -rf ${OBJSYS}/${KERNCONF}
8abe78a1 441 #
bce110a5
MD
442 # do not use PKGSRC_PKG_PATH here, we do not want to destroy an
443 # override location.
8abe78a1 444 #
c19c746b
MD
445 rm -rf ${ISODIR}/packages
446 rm -rf ${ISODIR}/distfiles
6ca9a59c 447
cc224c64 448fetch:
9b29c40a 449 @if [ ! -d ${PKGSRC_PKG_PATH} ]; then mkdir -p ${PKGSRC_PKG_PATH}; fi
0a1628e7
MD
450.if !exists(${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}.tgz)
451 (cd ${PKGSRC_PKG_PATH}; fetch ${PKGSRC_BOOTSTRAP_URL}/${CVSUP_BOOTSTRAP_KIT}.tgz)
452.endif
bce110a5
MD
453
454pkgsrc_bootstrap:
bce110a5 455.if !exists(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
0936984e
MD
456 mkdir -p /usr/release/bootstrap
457 (cd ${PKGSRC_PATH}/bootstrap; ./bootstrap --workdir /usr/release/bootstrap)
bce110a5 458.endif
bce110a5 459
bce110a5
MD
460pkgsrc_cdrecord:
461.if !exists (${PKGBIN_MKISOFS})
0936984e 462 (cd ${PKGSRC_PATH}/sysutils/cdrtools; bmake clean build install)
bce110a5 463.endif
cc224c64 464
e2dbfa0b 465help all:
5af45f85
MD
466 @echo "make [gui] release - complete build from scratch"
467 @echo "make [gui] quick - attempt to do an incremental rebuild"
468 @echo "make [gui] realquick - attempt to restart after world & kernel"
469 @echo "make [gui] restartpkgs - attempt to restart at the pkg building stage"
8abe78a1
MD
470 @echo ""
471 @echo "Extra packages may be specified with PKGSRC_EXTRA_PACKAGES"
588a679c 472
e2dbfa0b
TN
473.PHONY: release quickrel realquickrel
474.PHONY: installer
9b29c40a 475.PHONY: quick realquick
e2dbfa0b 476.PHONY: check buildworld1 buildworld2
b9c3e754 477.PHONY: buildkernel1 buildkernel2 buildiso customizeiso mklocatedb mkiso mkimg
03e2a3c5 478.PHONY: clean realclean fetch help all srcs
cc224c64 479
6ca9a59c 480.include <bsd.prog.mk>