1 # $DragonFly: src/nrelease/Makefile,v 1.17 2004/08/25 03:12:14 cpressey Exp $
5 ISOFILE ?= ${ISODIR}/dfly.iso
6 ISOROOT = ${ISODIR}/root
7 OBJSYS= ${.OBJDIR}/../sys
10 # Specify which packages are required on the ISO, and let the user
11 # specify additional packages to include. During the `pkgaddiso'
12 # target, the packages are obtained from PACKAGES_LOC.
14 REQ_PACKAGES= cdrtools-2.0.3_3 cvsup-without-gui-16.1h
15 PACKAGES?= ${REQ_PACKAGES} ${EXTRA_PACKAGES}
16 PACKAGES_LOC?= /usr/ports/packages/All
18 # Specify which root skeletons are required, and let the user include
19 # their own. They are copied into ISODIR during the `pkgcustomizeiso'
20 # target; each overwrites the last.
22 REQ_ROOTSKELS= ${.CURDIR}/root
23 ROOTSKELS?= ${REQ_ROOTSKELS} ${EXTRA_ROOTSKELS}
25 # note: we use the '${NRLOBJDIR}/nrelease' construct, that is we add
26 # the additional '/nrelease' manually, as a safety measure.
30 WORLD_CCVER ?= ${CCVER}
31 KERNEL_CCVER ?= ${CCVER}
33 #########################################################################
35 #########################################################################
37 release: check clean buildworld1 buildkernel1 \
38 buildiso customizeiso pkgaddiso mkiso
40 quickrel: check clean buildworld2 buildkernel2 \
41 buildiso customizeiso pkgaddiso mkiso
43 realquickrel: check clean \
44 buildiso customizeiso pkgaddiso mkiso
46 #########################################################################
47 # ISO TARGETS WITH INSTALLER #
48 #########################################################################
50 INSTALLER_PKGS= libaura-1.0 libdfui-2.0 libinstaller-2.0 \
51 dfuibe_installer-1.1.1 dfuife_curses-1.1 \
52 thttpd-notimeout-2.24 dfuife_cgi-1.1
53 INSTALLER_SKELS= installer
55 INSTALLER_ENV= EXTRA_PACKAGES="${INSTALLER_PKGS}" \
56 EXTRA_ROOTSKELS="${INSTALLER_SKELS}"
59 @${INSTALLER_ENV} ${MAKE} check
62 @${INSTALLER_ENV} ${MAKE} fetchpkgs
65 ${INSTALLER_ENV} ${MAKE} release
68 ${INSTALLER_ENV} ${MAKE} quickrel
70 installer_realquickrel:
71 ${INSTALLER_ENV} ${MAKE} realquickrel
73 #########################################################################
75 #########################################################################
78 @if [ ! -f /usr/local/bin/mkisofs ]; then \
79 echo "You need to install the mkisofs port for this target"; \
82 .for PKG in ${PACKAGES}
83 @if [ ! -f ${PACKAGES_LOC}/${PKG}.tgz ]; then \
84 echo "Unable to find ${PACKAGES_LOC}/${PKG}.tgz. This is"; \
85 echo "typically accomplished by cd'ing into the appropriate"; \
86 echo "port and typing 'make package'"; \
88 echo "If you are trying to build the installer, the"; \
89 echo "required packages can be obtained from:"; \
90 echo "http://www.bsdinstaller.org/packages/"; \
94 @echo "check: all preqs found"
97 .for PKG in ${PACKAGES}
98 @if [ ! -f ${PACKAGES_LOC}/${PKG}.tgz ]; then \
99 cd ${PACKAGES_LOC} && \
100 echo "fetching ${PKG}..." && \
101 fetch http://www.bsdinstaller.org/packages/${PKG}.tgz; \
106 ( cd ${.CURDIR}/..; make buildworld CCVER=${WORLD_CCVER} )
109 ( cd ${.CURDIR}/..; make -DNOTOOLS -DNOCLEAN buildworld CCVER=${WORLD_CCVER} )
112 ( cd ${.CURDIR}/..; make buildkernel KERNCONF=${KERNCONF} CCVER=${KERNEL_CCVER} )
115 ( cd ${.CURDIR}/..; make -DNOCLEAN buildkernel KERNCONF=${KERNCONF} CCVER=${KERNEL_CCVER} )
117 # note that we do not want to mess with any /usr/obj directories not related
118 # to buildworld, buildkernel, or nrelease, so we must supply the proper
119 # MAKEOBJDIRPREFIX for targets that are not run through the buildworld and
120 # buildkernel mechanism.
123 if [ ! -d ${ISOROOT} ]; then mkdir -p ${ISOROOT}; fi
124 if [ ! -d ${NRLOBJDIR}/nrelease ]; then mkdir -p ${NRLOBJDIR}/nrelease; fi
125 ( cd ${.CURDIR}/..; make DESTDIR=${ISOROOT} installworld )
126 ( cd ${.CURDIR}/../etc; MAKEOBJDIRPREFIX=${NRLOBJDIR}/nrelease make DESTDIR=${ISOROOT} distribution )
127 ( cd ${.CURDIR}/..; make DESTDIR=${ISOROOT} \
128 installkernel KERNCONF=${KERNCONF} )
129 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.local.dist -p ${ISOROOT}/usr/local/
130 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.var.dist -p ${ISOROOT}/var
131 dev_mkdb -f ${ISOROOT}/var/run/dev.db ${ISOROOT}/dev
134 .for ROOTSKEL in ${ROOTSKELS}
135 cpdup -X cpignore -o ${ROOTSKEL} ${ISOROOT}
137 rm -rf `find ${ISOROOT} -type d -name CVS -print`
138 pwd_mkdb -p -d ${ISOROOT}/etc ${ISOROOT}/etc/master.passwd
141 rm -f ${ISOROOT}/tmp/chrootscript
142 echo "#!/bin/sh" > ${ISOROOT}/tmp/chrootscript
143 .for PKG in ${PACKAGES}
144 echo "pkg_delete -f ${PKG}" >> ${ISOROOT}/tmp/chrootscript
146 chmod a+x ${ISOROOT}/tmp/chrootscript
147 chroot ${ISOROOT}/ /tmp/chrootscript || exit 0
148 rm ${ISOROOT}/tmp/chrootscript
151 rm -f ${ISOROOT}/tmp/chrootscript
152 echo "#!/bin/sh" > ${ISOROOT}/tmp/chrootscript
153 .for PKG in ${PACKAGES}
154 cp ${PACKAGES_LOC}/${PKG}.tgz ${ISOROOT}/tmp/${PKG}.tgz
155 echo "echo 'Installing package ${PKG}...'" >> ${ISOROOT}/tmp/chrootscript
156 echo "pkg_add /tmp/${PKG}.tgz" >> ${ISOROOT}/tmp/chrootscript
158 chmod a+x ${ISOROOT}/tmp/chrootscript
159 chroot ${ISOROOT}/ /tmp/chrootscript
160 rm ${ISOROOT}/tmp/chrootscript
161 .for PKG in ${PACKAGES}
162 rm -f ${ISOROOT}/tmp/${PKG}.tgz
166 ( cd ${ISOROOT}; mkisofs -b boot/cdboot -no-emul-boot \
167 -R -J -V DragonFly -o ${ISOFILE} . )
170 if [ -d ${ISOROOT} ]; then chflags -R noschg ${ISOROOT}; fi
171 if [ -d ${ISOROOT} ]; then rm -rf ${ISOROOT}/*; fi
172 if [ -d ${NRLOBJDIR}/nrelease ]; then rm -rf ${NRLOBJDIR}/nrelease; fi
175 rm -rf ${OBJSYS}/${KERNCONF}
177 .include <bsd.prog.mk>