Makefile revision 1.11
1#	$NetBSD: Makefile,v 1.11 2001/11/08 02:10:26 christos Exp $
2
3TOP=	${.CURDIR}/..
4
5.include "${TOP}/Makefile.inc"
6
7COMMONDIR=	${TOP}/bootfloppy-common
8IMAGE=	boot-big.fs
9KERN!=	cd $(.CURDIR)/../kernel-ramdisk/; \
10        printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}/netbsd.INSTALL.gz\n" | \
11	${MAKE} -s -f-
12
13# This Makefile builds a boot image on a 2.88M-sized image.
14#
15# Since NetBSD currently can't write 2.88M diskettes, it's only
16# use is as a boot image for El Torito bootable CD-ROM images.
17#
18# To prepare a CD, do the following steps:
19# 1) create a release(7) tree called NetBSD-1.3I
20# 2) create NetBSD-1.3I/boot.i386/ and place boot.fs in that directory
21# 3) do ``mkisofs -A "NetBSD ${version}" -b boot.i386/boot.fs -f \
22#	-o i386-cd.img -r -T NetBSD-1.3I''
23#    (you may omit '-f' if you're not using symlinks in the release tree)
24# This should place the image in i386-cd.img, which can hopefully
25# be used to burn a CD.
26
27DISKTYPE=	floppy288
28DISKSIZE=	5760
29METAFILE!=	printf "USTAR.volsize.%o" ${DISKSIZE}
30BLOCK8K=	359
31PAD=yes
32
33MOUNT_POINT?=	/mnt
34VND?=		vnd0
35VND_DEV=	/dev/${VND}a
36VND_RDEV=	/dev/r${VND}a
37MDEC=		${DESTDIR}/usr/mdec
38BOOTCODE=	${MDEC}/biosboot.sym
39STRIP?=		strip
40
41LISTS?=		${COMMONDIR}/list
42
43# Some reasonable values for the -i parameter to newfs are:
44#
45#   6144	1147k, 189 inodes free
46#  16384	1159k,  93 inodes free
47# on 1.44M:
48# 204800	1407k,  27 inodes free
49# (with a 4k blocksize, one cannot get fewer than ~32 inodes allocated)
50
51INO_BYTES?=	204800
52
53CLEANFILES+=	netbsd
54
55realall:	netbsd
56	-rm -f ${IMAGE}.tmp
57	dd if=/dev/zero of=${IMAGE}.tmp count=${DISKSIZE}
58	vnconfig -t ${DISKTYPE} -v -c ${VND} ${IMAGE}.tmp
59	disklabel -rw ${VND} ${DISKTYPE}
60	newfs -B le -m 0 -o space -i ${INO_BYTES} -c 80 ${VND_RDEV}
61	${MDEC}/installboot -v -f ${BOOTCODE} ${VND_RDEV}
62	mount ${VND_DEV} ${MOUNT_POINT}
63	TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \
64	    TARGDIR=${MOUNT_POINT} sh ${TOP}/runlist.sh ${LISTS}
65	@echo ""
66	@df -i ${MOUNT_POINT}
67	umount ${MOUNT_POINT}
68	vnconfig -u ${VND}
69	mv -f ${IMAGE}.tmp ${IMAGE}
70
71unconfig:
72	-umount -f ${MOUNT_POINT}
73	-vnconfig -u ${VND}
74	-/bin/rm -f ${IMAGE} ${IMAGE}.tmp
75
76netbsd: ${KERN}
77	rm -f netbsd
78	cp ${KERN} netbsd
79
80release:
81	-mkdir -p ${RELEASEDIR}/installation/floppy
82	cp -p ${IMAGE} ${RELEASEDIR}/installation/floppy
83	gzip <${IMAGE} >${RELEASEDIR}/installation/floppy/${IMAGE}.gz
84
85clean cleandir distclean:
86	/bin/rm -f *.core ${CLEANFILES} ${IMAGE} ${IMAGE}.tmp
87
88.include <bsd.own.mk>
89.include <bsd.obj.mk>
90.include <bsd.subdir.mk>
91