Home | History | Annotate | Line # | Download | only in bootfs
Makefile revision 1.18
      1 #	$NetBSD: Makefile,v 1.18 2000/05/02 07:10:19 sjg Exp $
      2 
      3 TOP=		${.CURDIR}/..
      4 MINIROOT=	${.CURDIR}/../../miniroot
      5 
      6 .include "${TOP}/Makefile.inc"
      7 
      8 .include <bsd.own.mk>	# So we use /etc/mk.conf.
      9 .include <bsd.kernobj.mk>
     10 KERN?=		${KERNOBJDIR}/INSTALL/netbsd
     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?=		boot.fs
     21 MDEC=		${DESTDIR}/usr/mdec
     22 
     23 LISTS=		${.CURDIR}/list
     24 RAMDISK!=	cd ${TOP}/ramdisk/; \
     25 		printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}/ramdisk.fs\n" |\
     26 		${MAKE} -s -f-
     27 
     28 DISKTYPE=	floppy
     29 
     30 # Some reasonable values for the -i parameter to newfs are:
     31 #
     32 #   6144	1147k, 189 inodes free
     33 #  16384	1159k,  93 inodes free
     34 # 204800	1167k,  29 inodes free
     35 INO_BYTES=	204800
     36 
     37 CLEANFILES+=	netbsd.ram.gz netbsd.tmp
     38 
     39 all:	netbsd.ram.gz
     40 	dd if=/dev/zero of=${IMAGE} bs=1440k count=1
     41 	vnconfig -t ${DISKTYPE} -v -c ${VND_CDEV} ${IMAGE}
     42 	disklabel -rw ${VND_CDEV} ${DISKTYPE}
     43 	disklabel -W ${VND_CDEV}
     44 	newfs -B be -m 0 -o space -i ${INO_BYTES} -c 80 ${VND_RDEV}
     45 	mount ${VND_DEV} ${MOUNT_POINT}
     46 	TOPDIR=${TOP} CURDIR=${MINIROOT} OBJDIR=${.OBJDIR} \
     47 	    TARGDIR=${MOUNT_POINT} sh ${MINIROOT}/runlist.sh ${LISTS}
     48 	@echo ""
     49 	@df -i ${MOUNT_POINT}
     50 	@echo ""
     51 	@echo "installing new bootblocks"
     52 	-rm -f ${MOUNT_POINT}/boot
     53 	/usr/mdec/binstall -v -b boot.700000 ffs ${MOUNT_POINT}
     54 	umount ${MOUNT_POINT}
     55 	vnconfig -u ${VND_CDEV}
     56 
     57 unconfig:
     58 	-umount -f ${MOUNT_POINT}
     59 	-vnconfig -u ${VND_DEV}
     60 
     61 netbsd.ram: ${KERN} ${RAMDISK}
     62 	cp ${KERN} netbsd.tmp
     63 	mdsetimage -v netbsd.tmp ${RAMDISK}
     64 	mv netbsd.tmp ${.TARGET}
     65 
     66 netbsd.ram.gz: ${KERN} ${RAMDISK}
     67 	cp ${KERN} netbsd.tmp
     68 	mdsetimage -v netbsd.tmp ${RAMDISK}
     69 	gzip -9 netbsd.tmp
     70 	mv netbsd.tmp.gz ${.TARGET}
     71 
     72 clean cleandir distclean:
     73 	/bin/rm -f *.core ${IMAGE} ${CLEANFILES}
     74 
     75 depend install:
     76 
     77 real-floppy:
     78 	dd if=${IMAGE} of=${FD_RDEV} bs=32k
     79 
     80 .ifndef RELEASEDIR
     81 release:
     82 	@echo setenv RELEASEDIR first
     83 	@false
     84 .else
     85 release: $(IMAGE)
     86 	gzip -c -9 < $(.OBJDIR)/boot.fs \
     87 		> $(RELEASEDIR)/installation/bootfs/boot.fs.gz
     88 .endif	# RELEASEDIR check
     89 
     90 .include <bsd.obj.mk>
     91