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