<sys/elf_common.h>: Add GNU note types and NT_GNU_PROPERTY_TYPE_0 bits.
[dragonfly.git] / nrelease / Makefile
CommitLineData
9b29c40a 1#########################################################################
e79a303f 2# ENHANCEMENTS #
9b29c40a
MD
3#########################################################################
4
aac6f66e 5# Optional targets may be specified which set make variables which enhance
9b29c40a
MD
6# the build in various ways.
7#
632d862b 8gui nopkgs binpkgs:
9b29c40a 9
9b29c40a 10#########################################################################
083f5c48 11# SETUP #
9b29c40a
MD
12#########################################################################
13
0f8dfe63
AL
14SRCDIR= ${.CURDIR}/..
15
bd0ab7aa 16DPORTS_PATH?= /usr/dports
a291abfb 17ISODIR?= /usr/obj/release
3fff415b 18ISOROOT?= ${ISODIR}/root
8126e4ef
AL
19GITURL_SRC?= git://git.dragonflybsd.org/dragonfly.git
20GITURL_DPORTS?= git://mirror-master.dragonflybsd.org/dports.git
834a1306 21NREL_MAKE_JOBS?= $$(sysctl -n hw.ncpu)
9758d73a
SW
22.if !defined(NOFSCHG)
23MTREE_FSCHG= -i
24.endif
bfe20b28 25
0f8dfe63 26GITREV!= sh ${SRCDIR}/tools/gitrev.sh
9d8dda4a 27
3ac64890
AL
28# The label/name of the disklabel64(5) slice in the ".img" file. This is
29# used to identify the USB device with DragonFly installation image, avoiding
30# hardcoding the USB device name (e.g., "da8").
31#
9d8dda4a
AL
32# This label is also used as the volume ID of the ".iso" file.
33#
34LABEL?= DragonFly_${GITREV}
3ac64890 35
083f5c48
AL
36CHROOT_CMD?= /usr/sbin/chroot ${ISOROOT} sh -c
37
38ISOFILE?= ${ISODIR}/dfly.iso
39IMGFILE?= ${ISODIR}/dfly.img
40IMGMNT?= ${ISODIR}/mnt
41
165b1c14 42.if !make(nopkgs)
8abe78a1 43# User may specify extra packages in addition to the defaults
95b64753 44#
c36c5990 45DPORTS_EXTRA_PACKAGES?=
8abe78a1 46
c36c5990
SW
47# dports packages to be built and installed on the release ISO
48#
71832315 49DPORTS_PACKAGES?= security/ca_root_nss \
d25c1efd 50 devel/git-lite \
0e561611 51 dns/bind-tools \
20d2e8bd 52 net/isc-dhcp44-server \
8abe78a1 53 sysutils/cdrtools \
44c4f44a 54 ${DPORTS_EXTRA_PACKAGES}
fbc26094 55
c36c5990 56# dports options to use when building packages
fbc26094 57#
d25c1efd
SW
58DPORTS_OPTIONS+= -DBATCH
59DPORTS_OPTIONS+= dns_bind-tools_UNSET=PYTHON
165b1c14 60.endif
8188de86
MD
61
62# Specify which root skeletons are required, and let the user include
e2dbfa0b 63# their own. They are copied into ISODIR during the `customizeiso'
8188de86
MD
64# target; each overwrites the last.
65#
8f51ac0b 66REQ_ROOTSKELS= ${.CURDIR}/root
cc224c64
JS
67ROOTSKELS?= ${REQ_ROOTSKELS}
68
255a0279 69.if make(gui)
3f279b9e 70ISOFILE?= ${ISODIR}/dfly-gui.iso
b9c3e754 71IMGFILE?= ${ISODIR}/dfly-gui.img
88821fa4 72
083f5c48 73.if !make(nopkgs)
0e176309
MD
74# NOTE: order important, do not sort package list
75#
255a0279
MN
76DPORTS_PACKAGES+= x11/xorg \
77 x11-wm/fluxbox \
78 x11-wm/fvwm \
30e27f66 79 www/firefox \
255a0279 80 graphics/xpdf \
fbc26094
SW
81 shells/zsh \
82 editors/emacs \
83 editors/vim \
255a0279 84 irc/irssi \
fbc26094
SW
85 lang/perl5 \
86 editors/nano \
87 shells/bash \
255a0279 88 devel/ctags \
fbc26094
SW
89 archivers/zip \
90 security/sudo \
255a0279
MN
91 www/links \
92 ftp/wget \
93 x11-fonts/terminus-font \
fbc26094 94 net/rsync \
255a0279
MN
95 x11-clocks/asclock \
96 sysutils/screen
88821fa4
MD
97.endif
98
3f279b9e 99ROOTSKELS+= ${.CURDIR}/gui
0f8dfe63 100.endif # make(gui)
3f279b9e 101
632d862b
AL
102# one port may have multiple binary packages (e.g., Python flavors) or have a
103# different name that may not be found by pkg(8), therefore, allow to specify
104# the exact binary package name for a port by setting 'PKG_<port>=<pkg-name>'.
105#
106.for PORT in ${DPORTS_PACKAGES}
107.if defined(PKG_${PORT})
108PACKAGES+= ${PKG_${PORT}}
109.else
110PACKAGES+= ${PORT}
111.endif
112.endfor
113
8188de86 114#########################################################################
e79a303f 115# BASE ISO TARGETS #
8188de86
MD
116#########################################################################
117
7ebbae99 118release: check clean buildworld1 buildkernel1 \
1968392d 119 buildiso customizeiso pkgs srcs mkiso mkimg
8188de86 120
7ebbae99 121quickrel: check clean buildworld2 buildkernel2 \
1968392d 122 buildiso customizeiso pkgs srcs mkiso mkimg
2e3f8f38 123
03e2a3c5 124realquickrel: check clean \
1968392d 125 buildiso customizeiso pkgs srcs mkiso mkimg
6ca9a59c 126
1968392d 127restartpkgs: check pkgs srcs mkiso mkimg
5af45f85 128
9b29c40a
MD
129quick: quickrel
130
131realquick: realquickrel
132
133#########################################################################
083f5c48 134# CORE SUPPORT TARGETS #
9b29c40a
MD
135#########################################################################
136
d2582113 137check:
c36c5990 138.if !exists(/usr/local/bin/mkisofs) && !exists(/usr/pkg/bin/mkisofs)
0936984e
MD
139 @echo
140 @echo "Your machine does not have cdrtools installed. You can install it with:"
218b6b69 141 @echo " pkg install cdrtools"
0936984e 142.endif
aa3eeb12
SW
143 @if [ ! -d ${DPORTS_PATH} ]; then \
144 echo "${DPORTS_PATH} does not exist."; \
145 echo ""; \
146 echo "Please set DPORTS_PATH to the dports tree that shall be used for"; \
147 echo "package building. The default is /usr/dports. See the Makefile in"; \
148 echo "/usr if you are unfamiliar with dports."; \
149 /usr/bin/false; \
150 fi
c36c5990 151.if !exists(/usr/local/bin/mkisofs) && !exists(/usr/pkg/bin/mkisofs)
3da8e88f 152 @/usr/bin/false
fbc26094 153.endif
aa3eeb12 154 @echo "Using ${DPORTS_PATH} as the dports tree."
2e3f8f38 155
588a679c 156buildworld1 buildworld2:
0f8dfe63
AL
157 ( cd ${SRCDIR}; \
158 ${WORLD_CCVER:C/^..*$/WORLD_CCVER=/}${WORLD_CCVER} \
834a1306 159 make -j ${NREL_MAKE_JOBS} -DWANT_INSTALLER \
0f8dfe63 160 ${.TARGET:C/build(.*)2/quick\1/:C/1//} )
6ca9a59c 161
588a679c 162buildkernel1 buildkernel2:
0f8dfe63
AL
163 ( cd ${SRCDIR}; \
164 ${WORLD_CCVER:C/^..*$/WORLD_CCVER=/}${WORLD_CCVER} \
834a1306 165 make -j ${NREL_MAKE_JOBS} \
0f8dfe63 166 ${.TARGET:C/build(.*)2/quick\1/:C/1//} )
6ca9a59c 167
2b43b38c 168# Unconditionally clean out ${ISOROOT} so a previous img build
92b0ebb9
MD
169# does not blow up a future quick iso build
170#
6ca9a59c 171buildiso:
92b0ebb9
MD
172 -chflags -R noschg ${ISOROOT}
173 rm -rf ${ISOROOT}
174 mkdir -p ${ISOROOT}
0f8dfe63
AL
175 ( cd ${SRCDIR}; \
176 make -DWANT_INSTALLER DESTDIR=${ISOROOT} installworld )
8f5a7f62
AL
177 # Do not mess with any /usr/obj directories not related to
178 # buildworld, buildkernel, or nrelease.
0f8dfe63 179 ( cd ${SRCDIR}/etc && \
8f5a7f62
AL
180 tmpdir=`mktemp -d -t nrelease` && \
181 MAKEOBJDIRPREFIX=$${tmpdir} \
0f8dfe63 182 make -m ${SRCDIR}/share/mk \
8f5a7f62
AL
183 DESTDIR=${ISOROOT} distribution && \
184 rm -rf $${tmpdir} )
21aa02d0 185 cpdup ${ISOROOT}/etc ${ISOROOT}/etc.hdd
0f8dfe63 186 ( cd ${SRCDIR}; make DESTDIR=${ISOROOT} reinstallkernel )
91856cf5 187 rm -rf ${ISOROOT}/boot/kernel.old
1c9d98d0 188 ln -sf kernel ${ISOROOT}/boot/kernel/kernel.BOOTP
0f8dfe63 189 mtree ${MTREE_FSCHG} -deU -f ${SRCDIR}/etc/mtree/BSD.var.dist \
9758d73a 190 -p ${ISOROOT}/var
6ca9a59c 191 dev_mkdb -f ${ISOROOT}/var/run/dev.db ${ISOROOT}/dev
1968392d 192 ${CHROOT_CMD} "rcrestart ldconfig"
8188de86 193
699b6cdc
AL
194# The GUI build includes the full system source (~500 MB) and the full
195# dports tree (~250 MB). The nominal release build only includes the
196# kernel source (~30 MB).
19d86faa 197#
e2dbfa0b 198srcs:
699b6cdc
AL
199 rm -rf ${ISOROOT}/usr/dports
200 rm -f ${ISOROOT}/usr/src-sys.tar.bz2
e2dbfa0b 201.if !defined(WITHOUT_SRCS)
255a0279 202.if make(gui)
699b6cdc
AL
203 ( cd ${ISOROOT}/usr && \
204 make dports-create-shallow GITURL_DPORTS=${GITURL_DPORTS} )
205 ( cd ${ISOROOT}/usr && \
206 make src-create-shallow GITURL_SRC=${GITURL_SRC} )
c19c746b 207.else
0f8dfe63 208 ( cd ${SRCDIR} && \
699b6cdc 209 tar --exclude .git -s '/^\./src/' -cf - \
c488485f 210 ./Makefile ./Makefile.inc1 ./sys \
211 ./share/syscons/fonts | \
699b6cdc 212 bzip2 -9 > ${ISOROOT}/usr/src-sys.tar.bz2 )
c19c746b 213.endif
66b79064 214.endif
19d86faa 215
1968392d 216# Customize the ISO by copying rootskels in reverse priority order.
5af45f85 217#
8188de86 218customizeiso:
5af45f85 219 # Copy the rootskels. Allow sources to be owned by someone other
3cf4b4a1 220 # than root (as is common when checked out via git).
5af45f85 221 #
8188de86
MD
222.for ROOTSKEL in ${ROOTSKELS}
223 cpdup -X cpignore -o ${ROOTSKEL} ${ISOROOT}
5af45f85
MD
224 @test -O ${.CURDIR} || echo "chowning copied files to root:wheel"
225 @test -O ${.CURDIR} || ((cd ${ROOTSKEL} && find .) | fgrep -v cpignore | (cd ${ISOROOT} && xargs chown root:wheel))
8188de86 226.endfor
04e94b32 227
7249926b 228 pwd_mkdb -p -d ${ISOROOT}/etc ${ISOROOT}/etc/master.passwd
04e94b32
AL
229 pw -V ${ISOROOT}/etc useradd installer -o -u 0 -g 0 \
230 -c "DragonFly Installer" -d /root -s /usr/sbin/installer
231 ${CHROOT_CMD} "chpass -p '' root"
232 ${CHROOT_CMD} "chpass -p '' installer"
233
4fba3387
CP
234.for UPGRADE_ITEM in Makefile \
235 etc.${MACHINE_ARCH} \
4fba3387
CP
236 rc.d/Makefile \
237 periodic/Makefile \
238 periodic/daily/Makefile \
239 periodic/security/Makefile \
240 periodic/weekly/Makefile \
241 periodic/monthly/Makefile
0f8dfe63 242 cp -R ${SRCDIR}/etc/${UPGRADE_ITEM} ${ISOROOT}/etc/${UPGRADE_ITEM}
20585f87 243.endfor
1968392d 244
632d862b 245# Install packages by using pkg(8) or building from dports.
1968392d
AL
246#
247pkgs:
165b1c14 248.if !empty(DPORTS_PACKAGES)
1c9d98d0 249 cp /etc/resolv.conf ${ISOROOT}/etc
1968392d
AL
250 -@umount ${ISOROOT}/dev
251 mount_null /dev ${ISOROOT}/dev
252
632d862b
AL
253.if make(binpkgs)
254 ${CHROOT_CMD} "cd /usr && make pkg-bootstrap-force"
255 ${CHROOT_CMD} "pkg update"
256.for PKG in ${PACKAGES}
257 @${CHROOT_CMD} "pkg search --exact --search name ${PKG}" || \
258 ${CHROOT_CMD} "pkg search --exact --search origin ${PKG}" || \
259 { \
260 echo "ERROR: Cannot find the package for port '${PKG}'!"; \
c2dc3938 261 echo "-----> Use 'PKG_${PKG}=<pkg-name>' to specify the package name."; \
632d862b
AL
262 false; \
263 }
264.endfor
265 ${CHROOT_CMD} "pkg install --yes ${PACKAGES}"
266
267.else # !make(binpkgs)
5e885f07 268 -@umount ${ISOROOT}/usr/distfiles
2f36664e 269 -@umount ${ISOROOT}/usr/dports
2f36664e 270 rm -rf ${ISOROOT}/usr/obj/dports
1968392d 271
2f36664e 272 mkdir -p ${ISOROOT}/usr/dports
5e885f07 273 mkdir -p ${ISOROOT}/usr/distfiles
1968392d
AL
274
275 # Mount /usr/dports read-only for safety, else a failed umount
276 # and our rm -rf will do bad things.
2f36664e 277 mount_null -o ro ${DPORTS_PATH} ${ISOROOT}/usr/dports
1968392d
AL
278
279 # Make sure /usr/distfiles is writable
c36c5990
SW
280 cp /etc/shells ${ISOROOT}/usr/distfiles/.test > /dev/null 2>&1 \
281 || mount_null ${ISODIR}/distfiles ${ISOROOT}/usr/distfiles
1968392d 282
2f36664e 283.for PKG in ${DPORTS_PACKAGES}
333a466d
AL
284.if make(restartpkgs)
285 ${CHROOT_CMD} "cd /usr/dports/${PKG} && make ${DPORTS_OPTIONS} deinstall"
286.endif
d25c1efd 287 ${CHROOT_CMD} "cd /usr/dports/${PKG} && make ${DPORTS_OPTIONS} install"
2f36664e
SW
288.endfor
289.for PKG in ${DPORTS_PACKAGES}
c36c5990 290 ${CHROOT_CMD} "cd /usr/dports/${PKG} && make ${DPORTS_OPTIONS} clean"
8188de86 291.endfor
1968392d 292
22e9b157 293 ${CHROOT_CMD} "pkg autoremove --yes"
1968392d 294
5e885f07 295 -umount ${ISOROOT}/usr/distfiles
2f36664e 296 umount ${ISOROOT}/usr/dports
1968392d 297
5e885f07 298 rm -rf ${ISOROOT}/usr/dports
5e885f07 299 rm -rf ${ISOROOT}/usr/distfiles
1968392d 300 rm -rf ${ISOROOT}/usr/obj/dports
632d862b 301.endif # make(binpkgs)
1968392d
AL
302
303 # Update the locate(8) and whatis(1) databases, allow ISODIR
b34d3b9b 304 # to be on tmpfs (fails to create locate database then)
2f36664e 305 #
b34d3b9b 306 -${CHROOT_CMD} /etc/periodic/weekly/310.locate
1968392d
AL
307 -${CHROOT_CMD} /etc/periodic/weekly/320.whatis
308
31d5c88c 309 umount ${ISOROOT}/dev
1968392d
AL
310 rm -f ${ISOROOT}/etc/resolv.conf
311
a4527c0f
AL
312.if exists(${ISOROOT}/usr/local/etc)
313 echo "dummy /usr/local/etc tmpfs rw,-C 0 0" >> ${ISOROOT}/etc/fstab
314.endif
315
44c4f44a 316 # Recopy files that dports may have updated in /etc into /etc.hdd
d68fa6c5
MD
317 #
318 cpdup ${ISOROOT}/etc/shells ${ISOROOT}/etc.hdd/shells
319 cpdup ${ISOROOT}/etc/group ${ISOROOT}/etc.hdd/group
22e9b157
AL
320 cpdup ${ISOROOT}/etc/passwd ${ISOROOT}/etc.hdd/passwd
321 cpdup ${ISOROOT}/etc/master.passwd ${ISOROOT}/etc.hdd/master.passwd
a4527c0f 322.endif # !empty(DPORTS_PACKAGES)
d68fa6c5 323
6ca9a59c 324mkiso:
5fa778d7
SW
325 if [ ! -d ${IMGMNT} ]; then mkdir -p ${IMGMNT}; fi
326 -if [ -f ${ISODIR}/vn.which ]; then umount ${IMGMNT}; \
327 vnconfig -u `cat ${ISODIR}/vn.which`; fi
328 newfs_msdos -C 400k -F 12 -L EFI -m 0xf8 ${ISOROOT}/boot/efiboot.img
329 vnconfig -l | grep "not in use" | head -n 1 | \
330 cut -f 1 -d: > ${ISODIR}/vn.which
fc3c0f63 331 vnconfig -e `cat ${ISODIR}/vn.which` ${ISOROOT}/boot/efiboot.img
5fa778d7
SW
332 mount_msdos /dev/`cat ${ISODIR}/vn.which` ${IMGMNT}
333 mkdir -p ${IMGMNT}/EFI/BOOT
334 cp ${ISOROOT}/boot/loader.efi ${IMGMNT}/EFI/BOOT/BOOTX64.EFI
335 umount ${IMGMNT}
336 ( cd ${ISOROOT}; mkisofs -R -J -o ${ISOFILE} \
9d8dda4a
AL
337 -b boot/cdboot -no-emul-boot \
338 -eltorito-alt-boot -eltorito-platform efi \
339 -eltorito-boot boot/efiboot.img -no-emul-boot \
340 -V ${LABEL:C/(^.{32}).*/\1/} . ) # cut label to <= 32 characters
5fa778d7 341 rm -f ${ISOROOT}/boot/efiboot.img
b9c3e754
MN
342
343mkimg:
60b68cbb 344 if [ ! -d ${IMGMNT} ]; then mkdir -p ${IMGMNT}; fi
9a122c9a
MD
345 -if [ -f ${ISODIR}/vn.which ]; then umount ${IMGMNT}; \
346 vnconfig -u `cat ${ISODIR}/vn.which`; fi
fe70af21
MD
347.ifdef IMGSIZE
348 @echo "STEP: use an image size of ${IMGSIZE} 512-byte sectors"
349 rm -f ${IMGFILE}
350 sz=`bc -e "((${IMGSIZE}) * 512)" -equit`; truncate -s $${sz} ${IMGFILE}
351.else
3342e40a
MD
352 @echo "STEP: Determine required image size in 1GB steps"
353 @echo " Leave ~600MB of unused space"
60b68cbb 354 sz=`du -ck ${ISOROOT} | tail -n 1 | cut -f 1`; \
3342e40a 355 sz=`bc -e "(($${sz}) * 1.15 + 999999 + 600000) / 1000000" -equit | \
fe70af21 356 cut -f1 -d.`; \
c843f8b0 357 sz=`bc -e "(($${sz}) * 953)" -equit | cut -f1 -d.`; \
fe70af21
MD
358 rm -f ${IMGFILE}; \
359 truncate -s $${sz}M ${IMGFILE};
360.endif
9a122c9a
MD
361 @echo "STEP: determine free vn device"
362 vnconfig -l | grep "not in use" | head -n 1 | \
363 cut -f 1 -d: > ${ISODIR}/vn.which
fc3c0f63 364 vnconfig -e `cat ${ISODIR}/vn.which` ${IMGFILE}
5fa778d7 365 @echo "STEP: set up legacy MBR"
cc3c231b 366 fdisk -b ${ISOROOT}/boot/mbr -IB `cat ${ISODIR}/vn.which`
5fa778d7
SW
367 fdisk -s `cat ${ISODIR}/vn.which` >${ISODIR}/fdisk.dat
368 awk '(NR==1){printf("g c%s h%s s%s\n", $$2, $$4, $$6);}' \
369 ${ISODIR}/fdisk.dat >${ISODIR}/fdisk.conf
370 echo "p 1 239 63 257985" >>${ISODIR}/fdisk.conf
7d89978d 371 awk '($$1=="1:"){printf("p 2 108 258048 %lu\n", $$3 - 258528);}' \
5fa778d7
SW
372 ${ISODIR}/fdisk.dat >>${ISODIR}/fdisk.conf
373 echo "a 2" >>${ISODIR}/fdisk.conf
374 fdisk -iv -f ${ISODIR}/fdisk.conf `cat ${ISODIR}/vn.which`
375 rm ${ISODIR}/fdisk.conf ${ISODIR}/fdisk.dat
376 newfs_msdos -F 32 -c 2 -L EFI -m 0xf8 `cat ${ISODIR}/vn.which`s1
377 mount_msdos /dev/`cat ${ISODIR}/vn.which`s1 ${IMGMNT}
378 mkdir -p ${IMGMNT}/EFI/BOOT
379 cp ${ISOROOT}/boot/boot1.efi ${IMGMNT}/EFI/BOOT/BOOTX64.EFI
380 umount ${IMGMNT}
9a122c9a 381 @echo "STEP: write standard disklabel"
5fa778d7 382 disklabel -w -r `cat ${ISODIR}/vn.which`s2 auto
9a122c9a 383 @echo "STEP: read disklabel back"
5fa778d7 384 disklabel -r `cat ${ISODIR}/vn.which`s2 > ${IMGFILE}.label
3ac64890
AL
385 @echo "STEP: set disklabel name"
386 echo "label: ${LABEL}" >> ${IMGFILE}.label
387 @echo "STEP: add slice parition"
388 echo "a: * * 4.2BSD" >> ${IMGFILE}.label;
9a122c9a 389 @echo "STEP: write modified disklabel back"
5fa778d7 390 disklabel -R -r `cat ${ISODIR}/vn.which`s2 ${IMGFILE}.label
9a122c9a 391 rm ${IMGFILE}.label
cc3c231b
MD
392 disklabel -B -b ${ISOROOT}/boot/boot1_64 -s ${ISOROOT}/boot/boot2_64 \
393 `cat ${ISODIR}/vn.which`s2
5fa778d7
SW
394 newfs /dev/`cat ${ISODIR}/vn.which`s2a
395 mount /dev/`cat ${ISODIR}/vn.which`s2a ${IMGMNT}
9a122c9a
MD
396 cpdup ${ISOROOT} ${IMGMNT}
397 @echo "STEP: fixup ${IMGMNT}/etc/fstab"
3ac64890 398 echo "/dev/part-by-label/${LABEL}.a / ufs rw,noatime 0 1" > ${IMGMNT}/etc/fstab
3342e40a
MD
399 echo "dummy /tmp tmpfs rw 0 0" >> ${IMGMNT}/etc/fstab
400 echo "dummy /var/tmp tmpfs rw 0 0" >> ${IMGMNT}/etc/fstab
d4c25c30 401 echo "dummy /var/run tmpfs rw,-C 0 0" >> ${IMGMNT}/etc/fstab
3342e40a 402 echo "dummy /usr/obj tmpfs rw 0 0" >> ${IMGMNT}/etc/fstab
9a122c9a
MD
403 echo "proc /proc procfs rw 0 0" >> ${IMGMNT}/etc/fstab
404 @echo "STEP: fixup ${IMGMNT}/boot/loader.conf"
405 -fgrep -v kernel_options ${IMGMNT}/boot/loader.conf > ${IMGMNT}/boot/loader.conf.new
3ac64890 406 echo 'vfs.root.mountfrom="ufs:part-by-label/${LABEL}.a"' >> ${IMGMNT}/boot/loader.conf.new
9a122c9a
MD
407 mv ${IMGMNT}/boot/loader.conf.new ${IMGMNT}/boot/loader.conf
408 @echo "STEP: cleanup"
409 df ${IMGMNT}
836f3129
MD
410 sync
411 sleep 1
9a122c9a
MD
412 umount ${IMGMNT}
413 vnconfig -u `cat ${ISODIR}/vn.which`
414 rm -f ${ISODIR}/vn.which
60b68cbb 415 rmdir ${IMGMNT}
a4911276 416 @echo "STEP: done, image files are in ${ISODIR}"
b9c3e754 417
6ca9a59c 418clean:
836f3129
MD
419 sync
420 sleep 1
5e885f07 421 -umount ${ISOROOT}/usr/distfiles > /dev/null 2>&1
2f36664e 422 -umount ${ISOROOT}/usr/dports > /dev/null 2>&1
9a122c9a
MD
423 -umount ${ISOROOT}/dev > /dev/null 2>&1
424 -if [ -f ${ISODIR}/vn.which ]; then umount ${IMGMNT}; \
425 vnconfig -u `cat ${ISODIR}/vn.which`; fi
6ca9a59c 426 if [ -d ${ISOROOT} ]; then chflags -R noschg ${ISOROOT}; fi
c19c746b 427 rm -rf ${ISOROOT}
9a122c9a 428 rm -f ${ISODIR}/.didbootstrap ${ISODIR}/vn.which
6ca9a59c
MD
429
430realclean: clean
c19c746b
MD
431 rm -rf ${ISODIR}/packages
432 rm -rf ${ISODIR}/distfiles
6ca9a59c 433
dade4a2e
AL
434.MAIN: help
435help:
8126e4ef
AL
436 @echo "Targets:"
437 @echo " release - full build from scratch"
438 @echo " quick - attempt to do an incremental rebuild"
439 @echo " realquick - attempt to restart after world & kernel"
440 @echo " restartpkgs - attempt to restart at the pkg building stage"
aac6f66e
AL
441 @echo ""
442 @echo "Optional targets:"
443 @echo " nopkgs - do not install any packages"
632d862b 444 @echo " binpkgs - use binary packages with pkg(8)"
aac6f66e 445 @echo " gui - do a GUI release"
8abe78a1 446 @echo ""
8126e4ef
AL
447 @echo "Variables:"
448 @echo " DPORTS_EXTRA_PACKAGES: add additional packages"
449 @echo " GITURL_SRC: override the Git URL to source repository"
450 @echo " GITURL_DPORTS: override the Git URL to dports repository"
451 @echo " IMGSIZE: override the size of .img (in 512-byte sectors)"
834a1306 452 @echo " NREL_MAKE_JOBS: override the default value (sysctl hw.ncpu)"
632d862b
AL
453 @echo " PKG_<port>: specify the package name for port <port>"
454 @echo " WITHOUT_SRCS: do not package source code if set"
aac6f66e 455 @echo ""
588a679c 456
e2dbfa0b 457.PHONY: release quickrel realquickrel
9b29c40a 458.PHONY: quick realquick
e2dbfa0b 459.PHONY: check buildworld1 buildworld2
31d5c88c 460.PHONY: buildkernel1 buildkernel2 buildiso customizeiso mkiso mkimg
1968392d 461.PHONY: clean realclean help all srcs pkgs