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