Home | History | Annotate | Line # | Download | only in bootfloppy
Makefile revision 1.9
      1 #	$NetBSD: Makefile,v 1.9 2002/03/05 21:23:29 thorpej Exp $
      2 
      3 TOP=		${.CURDIR}/..
      4 
      5 .include "${TOP}/Makefile.inc"
      6 .include <bsd.own.mk>
      7 .include <bsd.subdir.mk>
      8 
      9 IMAGE=		boot.fs
     10 KERNDIR!=	cd ${.CURDIR}/../ramdisk-kernel && ${PRINTOBJDIR}
     11 KERN=		${KERNDIR}/netbsd.INSTALL.gz
     12 
     13 MOUNT_POINT?=	/mnt
     14 VND?=		vnd0
     15 VND_DEV=	/dev/${VND}a
     16 VND_RDEV=	/dev/r${VND}a
     17 VND_CDEV=	/dev/${VND}c
     18 VND_CRDEV=	/dev/r${VND}c
     19 FD?=		fd0
     20 FD_RDEV=	/dev/r${FD}a
     21 IMAGE?=		xxx.fs
     22 KERN?=		netbsd-xxx
     23 MDEC=		${DESTDIR}/usr/mdec
     24 
     25 DISKTYPE=	floppy
     26 
     27 # Some reasonable values for the -i parameter to newfs are:
     28 #
     29 #  8192		1387k, 189 inodes free
     30 # 16384		1399k,  93 inodes free
     31 # 65536		1407k,  29 inodes free
     32 INO_BYTES?=	65536
     33 
     34 all:	${KERN}
     35 	dd if=/dev/zero of=${IMAGE} bs=1440k count=1
     36 	vnconfig -t ${DISKTYPE} -v -c ${VND} ${IMAGE}
     37 	disklabel -rw ${VND} ${DISKTYPE}
     38 	newfs -B be -m 0 -o space -i ${INO_BYTES} -c 80 \
     39 	    -f 1024 -b 8192 ${VND_RDEV}
     40 	mount ${VND_DEV} ${MOUNT_POINT}
     41 	cp ${KERN} ${MOUNT_POINT}/netbsd
     42 	@echo ""
     43 	@df -i ${MOUNT_POINT}
     44 	@echo ""
     45 	@echo "installing new bootblocks"
     46 	-rm -f ${MOUNT_POINT}/boot
     47 	cp ${MDEC}/boot ${MOUNT_POINT}/boot
     48 	sync
     49 	${MDEC}/installboot -v ${MOUNT_POINT}/boot ${MDEC}/bootxx ${VND_CRDEV}
     50 	umount ${MOUNT_POINT}
     51 	vnconfig -u ${VND}
     52 
     53 unconfig:
     54 	-umount -f ${MOUNT_POINT}
     55 	-vnconfig -u ${VND}
     56 
     57 .ifndef RELEASEDIR
     58 release:
     59 	@echo set RELEASEDIR first!
     60 	@false
     61 .else
     62 release:
     63 	-mkdir -p ${RELEASEDIR}/installation/floppy
     64 	cp -p ${IMAGE} ${RELEASEDIR}/installation/floppy
     65 	gzip -c -9 ${IMAGE} > ${RELEASEDIR}/installation/floppy/${IMAGE}.gz
     66 .endif
     67 
     68 clean cleandir distclean:
     69 	rm -f *.core ${IMAGE} ${CLEANFILES}
     70 
     71 real-floppy:
     72 	dd if=${IMAGE} of=${FD_RDEV} bs=45k
     73 
     74 .include <bsd.obj.mk>
     75