| Commit | Line | Data |
|---|---|---|
| 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 | 12 | gui installer img: |
| 9b29c40a | 13 | |
| 9b29c40a MD |
14 | ######################################################################### |
| 15 | # SETUP # | |
| 16 | ######################################################################### | |
| 17 | ||
| 6ca9a59c | 18 | ISODIR ?= /usr/release |
| 5ec00f8a | 19 | ISOROOT ?= ${ISODIR}/root |
| 6ca9a59c | 20 | OBJSYS= ${.OBJDIR}/../sys |
| bfe20b28 SW |
21 | |
| 22 | .if make(gui) | |
| 23 | KERNCONF ?= DFLYLIVE VKERNEL DFLYLIVE-SMP DFLYLIVE-SMP-NOAPIC | |
| 24 | .else | |
| 1d3eb8c5 | 25 | KERNCONF ?= GENERIC VKERNEL |
| bfe20b28 | 26 | .endif |
| 6ca9a59c | 27 | |
| cc224c64 | 28 | PKGSRC_PREFIX?= /usr/pkg |
| bce110a5 | 29 | PKGBIN_PKG_ADD?= ${PKGSRC_PREFIX}/sbin/pkg_add |
| 95b64753 | 30 | PKGBIN_PKG_DELETE?= ${PKGSRC_PREFIX}/sbin/pkg_delete |
| c791834f | 31 | PKGBIN_PKG_ADMIN?= ${PKGSRC_PREFIX}/sbin/pkg_admin |
| bce110a5 MD |
32 | PKGBIN_MKISOFS?= ${PKGSRC_PREFIX}/bin/mkisofs |
| 33 | PKGSRC_PKG_PATH?= ${ISODIR}/packages | |
| 34 | PKGSRC_DB?= /var/db/pkg | |
| 18b332b2 | 35 | PKGSRC_BOOTSTRAP_URL?= http://pkgbox.dragonflybsd.org/DragonFly-pkgsrc-packages/i386/1.12.0-RELEASE-BUILD |
| 4b08f3df | 36 | CVSUP_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 |
42 | CHROOT_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 |
46 | PKGSRC_EXTRA_PACKAGES?= |
| 47 | ||
| 48 | # Pkgsrc packages to be built and installed on the release ISO | |
| 49 | # | |
| 50 | PKGSRC_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) | |
| 61 | PKGSRC_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 |
69 | OLD_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 |
90 | REQ_ROOTSKELS= ${.CURDIR}/root \ |
| 91 | ${.CURDIR}/installer | |
| cc224c64 JS |
92 | ROOTSKELS?= ${REQ_ROOTSKELS} |
| 93 | ||
| fbc26094 | 94 | .if make(gui) |
| 3f279b9e | 95 | ISOFILE?= ${ISODIR}/dfly-gui.iso |
| b9c3e754 | 96 | IMGFILE?= ${ISODIR}/dfly-gui.img |
| 0936984e MD |
97 | PKGSRC_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 |
128 | ROOTSKELS+= ${.CURDIR}/gui |
| 129 | .endif | |
| 130 | ||
| 3f279b9e | 131 | ISOFILE ?= ${ISODIR}/dfly.iso |
| b9c3e754 MN |
132 | IMGFILE ?= ${ISODIR}/dfly.img |
| 133 | ||
| 60b68cbb | 134 | IMGMNT ?= ${ISODIR}/mnt |
| b9c3e754 | 135 | IMGUSBDEV ?= /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 | # | |
| 140 | NRLOBJDIR?= /usr/obj | |
| 141 | ||
| 8188de86 MD |
142 | ######################################################################### |
| 143 | # BASE ISO TARGETS # | |
| 144 | ######################################################################### | |
| 145 | ||
| 7ebbae99 | 146 | release: check clean buildworld1 buildkernel1 \ |
| e2dbfa0b | 147 | buildiso srcs customizeiso mkaliases mklocatedb \ |
| 0936984e | 148 | mkiso mkimg |
| 8188de86 | 149 | |
| 7ebbae99 | 150 | quickrel: check clean buildworld2 buildkernel2 \ |
| e2dbfa0b | 151 | buildiso srcs customizeiso mkaliases mklocatedb \ |
| 0936984e | 152 | mkiso mkimg |
| 2e3f8f38 | 153 | |
| e2dbfa0b | 154 | realquickrel: check clean buildiso srcs customizeiso \ |
| 0936984e MD |
155 | mkaliases mklocatedb \ |
| 156 | mkiso mkimg | |
| 6ca9a59c | 157 | |
| 5af45f85 MD |
158 | restartpkgs: check customizeiso mkaliases mklocatedb mkiso mkimg |
| 159 | ||
| 9b29c40a MD |
160 | quick: quickrel |
| 161 | ||
| 162 | realquick: realquickrel | |
| 163 | ||
| 5af45f85 | 164 | |
| 9b29c40a MD |
165 | ######################################################################### |
| 166 | # CORE SUPPORT TARGETS # | |
| 167 | ######################################################################### | |
| 168 | ||
| d2582113 | 169 | check: |
| 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 | 198 | buildworld1 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 | 201 | buildkernel1 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 |
226 | buildiso: |
| 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 |
267 | srcs: |
| 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 |
| c19c746b MD |
274 | cd ${.CURDIR}/../.. && tar --exclude .git --exclude CVS \ |
| 275 | -czf ${ISOROOT}/usr/src-all.tgz src | |
| 276 | .else | |
| e2dbfa0b | 277 | rm -f ${ISOROOT}/usr/src-sys.tgz |
| c19c746b MD |
278 | cd ${.CURDIR}/../.. && tar --exclude .git --exclude CVS \ |
| 279 | -czf ${ISOROOT}/usr/src-sys.tgz src/Makefile src/Makefile.inc1 src/sys | |
| 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 | 286 | customizeiso: |
| 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} | |
| 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 | |
| 589a5738 | 328 | mkdir -p ${ISOROOT}/usr/pkgobj/bootstrap/work |
| 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 a CD boot does not complain about a missing aliases database |
| 378 | # | |
| 379 | mkaliases: | |
| 380 | ${CHROOT_CMD} "newaliases" | |
| 381 | ||
| 382 | # So locate works | |
| 383 | # | |
| 8398ca17 SW |
384 | mklocatedb: |
| 385 | ( find -s ${ISOROOT} -path ${ISOROOT}/tmp -or \ | |
| 386 | -path ${ISOROOT}/usr/tmp -or -path ${ISOROOT}/var/tmp \ | |
| 387 | -prune -o -print | sed -e 's#^${ISOROOT}##g' | \ | |
| 388 | /usr/libexec/locate.mklocatedb \ | |
| 389 | -presort >${ISOROOT}/var/db/locate.database ) | |
| 390 | ||
| 6ca9a59c | 391 | mkiso: |
| bce110a5 | 392 | ( cd ${ISOROOT}; ${PKGBIN_MKISOFS} -b boot/cdboot -no-emul-boot \ |
| 74ec6a9d SW |
393 | -R -J -o ${ISOFILE} \ |
| 394 | -V DragonFly-`${.CURDIR}/../tools/gitrev.sh | cut -c -22` . ) | |
| 6ca9a59c | 395 | |
| b9c3e754 MN |
396 | |
| 397 | mkimg: | |
| fbc26094 | 398 | .if make(img) |
| 60b68cbb MN |
399 | if [ ! -d ${IMGMNT} ]; then mkdir -p ${IMGMNT}; fi |
| 400 | ||
| 401 | echo "determine required image size" > /dev/null; \ | |
| 402 | sz=`du -ck ${ISOROOT} | tail -n 1 | cut -f 1`; \ | |
| e6b76e22 MN |
403 | echo "add 15% more space as required" > /dev/null; \ |
| 404 | sz=`bc -e "(($${sz}) / 1024) * 1.15" -equit | cut -f1 -d.`; \ | |
| 60b68cbb MN |
405 | dd if=/dev/zero of=${IMGFILE} bs=1m count=$${sz}; \ |
| 406 | fdisk -IB -p ${IMGFILE}; \ | |
| 407 | echo "determine free vn device" > /dev/null; \ | |
| 408 | vn=`vnconfig -l | grep "not in use" | head -n 1 | cut -f 1 -d:`; \ | |
| 409 | vnconfig -e -s labels $${vn} ${IMGFILE}; \ | |
| 410 | echo "write standard disklabel" > /dev/null; \ | |
| 411 | disklabel -w -r $${vn}s1 auto; \ | |
| 412 | echo "read disklabel back" > /dev/null; \ | |
| 413 | disklabel -r $${vn}s1 > ${IMGFILE}.label; \ | |
| 414 | echo "determine number of sectors of whole disk" > /dev/null; \ | |
| 415 | secs=`tail -n 1 ${IMGFILE}.label | cut -f 3 -w`; \ | |
| 416 | echo "and add a: partition" > /dev/null; \ | |
| 417 | echo " a: $${secs} 0 4.2BSD" >> ${IMGFILE}.label; \ | |
| 418 | echo "write modified disklabel back" > /dev/null; \ | |
| 419 | disklabel -R -r $${vn}s1 ${IMGFILE}.label; \ | |
| 420 | rm ${IMGFILE}.label; \ | |
| 421 | echo "write bootsector" > /dev/null; \ | |
| 422 | disklabel -B $${vn}s1; \ | |
| 423 | newfs /dev/$${vn}s1a; \ | |
| 424 | mount /dev/$${vn}s1a ${IMGMNT}; \ | |
| 425 | cpdup -vvv ${ISOROOT} ${IMGMNT}; \ | |
| 426 | echo "fix /etc/fstab" > /dev/null; \ | |
| b72c2692 MN |
427 | echo "${IMGUSBDEV}s1a / ufs rw 0 0" > ${IMGMNT}/etc/fstab; \ |
| 428 | echo "proc /proc procfs rw 0 0" >> ${IMGMNT}/etc/fstab; \ | |
| bccaed73 | 429 | df ${IMGMNT}; \ |
| 60b68cbb MN |
430 | umount ${IMGMNT}; \ |
| 431 | vnconfig -u $${vn}; \ | |
| 432 | rmdir ${IMGMNT} | |
| b9c3e754 MN |
433 | .endif |
| 434 | ||
| 6ca9a59c | 435 | clean: |
| c19c746b MD |
436 | -umount ${ISOROOT}/usr/pkgsrc/distfiles > /dev/null 2>&1 |
| 437 | -umount ${ISOROOT}/usr/pkgsrc > /dev/null 2>&1 | |
| 6ca9a59c | 438 | if [ -d ${ISOROOT} ]; then chflags -R noschg ${ISOROOT}; fi |
| c19c746b MD |
439 | rm -rf ${ISOROOT} |
| 440 | rm -rf ${NRLOBJDIR}/nrelease | |
| 8abe78a1 | 441 | rm -f ${ISODIR}/.didbootstrap |
| 6ca9a59c MD |
442 | |
| 443 | realclean: clean | |
| 3ebedc5e | 444 | rm -rf ${OBJSYS}/${KERNCONF} |
| 8abe78a1 | 445 | # |
| bce110a5 MD |
446 | # do not use PKGSRC_PKG_PATH here, we do not want to destroy an |
| 447 | # override location. | |
| 8abe78a1 | 448 | # |
| c19c746b MD |
449 | rm -rf ${ISODIR}/packages |
| 450 | rm -rf ${ISODIR}/distfiles | |
| 6ca9a59c | 451 | |
| cc224c64 | 452 | fetch: |
| 9b29c40a | 453 | @if [ ! -d ${PKGSRC_PKG_PATH} ]; then mkdir -p ${PKGSRC_PKG_PATH}; fi |
| 0a1628e7 MD |
454 | .if !exists(${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}.tgz) |
| 455 | (cd ${PKGSRC_PKG_PATH}; fetch ${PKGSRC_BOOTSTRAP_URL}/${CVSUP_BOOTSTRAP_KIT}.tgz) | |
| 456 | .endif | |
| bce110a5 MD |
457 | |
| 458 | pkgsrc_bootstrap: | |
| bce110a5 | 459 | .if !exists(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz) |
| 0936984e MD |
460 | mkdir -p /usr/release/bootstrap |
| 461 | (cd ${PKGSRC_PATH}/bootstrap; ./bootstrap --workdir /usr/release/bootstrap) | |
| bce110a5 | 462 | .endif |
| bce110a5 | 463 | |
| bce110a5 MD |
464 | pkgsrc_cdrecord: |
| 465 | .if !exists (${PKGBIN_MKISOFS}) | |
| 0936984e | 466 | (cd ${PKGSRC_PATH}/sysutils/cdrtools; bmake clean build install) |
| bce110a5 | 467 | .endif |
| cc224c64 | 468 | |
| e2dbfa0b | 469 | help all: |
| 5af45f85 MD |
470 | @echo "make [gui] release - complete build from scratch" |
| 471 | @echo "make [gui] quick - attempt to do an incremental rebuild" | |
| 472 | @echo "make [gui] realquick - attempt to restart after world & kernel" | |
| 473 | @echo "make [gui] restartpkgs - attempt to restart at the pkg building stage" | |
| 8abe78a1 MD |
474 | @echo "" |
| 475 | @echo "Extra packages may be specified with PKGSRC_EXTRA_PACKAGES" | |
| 588a679c | 476 | |
| e2dbfa0b TN |
477 | .PHONY: release quickrel realquickrel |
| 478 | .PHONY: installer | |
| 9b29c40a | 479 | .PHONY: quick realquick |
| e2dbfa0b | 480 | .PHONY: check buildworld1 buildworld2 |
| b9c3e754 | 481 | .PHONY: buildkernel1 buildkernel2 buildiso customizeiso mklocatedb mkiso mkimg |
| e2dbfa0b | 482 | .PHONY: clean realclean fetch help all mkaliases srcs |
| cc224c64 | 483 | |
| 6ca9a59c | 484 | .include <bsd.prog.mk> |