Home | History | Annotate | Line # | Download | only in bootfs
Makefile revision 1.25
      1 #	$NetBSD: Makefile,v 1.25 2000/10/20 11:56:57 pk Exp $
      2 #
      3 # boot.fs is the image for disk 1 of the two-set floppy based installation
      4 # method.
      5 #
      6 # It is constructed by injecting the microroot filesystem `ramdisk.fs'
      7 # into the md based kernel built from the INSTALL kernel configuration file.
      8 #
      9 
     10 TOP=		${.CURDIR}/..
     11 MINIROOT=	${.CURDIR}/../../miniroot
     12 
     13 .include "${TOP}/Makefile.inc"
     14 
     15 .include <bsd.own.mk>	# So we use /etc/mk.conf.
     16 .include <bsd.kernobj.mk>
     17 
     18 KERN?=		${KERNOBJDIR}/INSTALL/netbsd
     19 
     20 MOUNT_POINT?=	/mnt
     21 VND?=		vnd0
     22 VND_DEV=	/dev/${VND}a
     23 VND_RDEV=	/dev/r${VND}a
     24 VND_CDEV=	/dev/${VND}c
     25 VND_CRDEV=	/dev/r${VND}c
     26 FD?=		fd0
     27 FD_RDEV=	/dev/r${FD}a
     28 IMAGE?=		boot.fs
     29 MDEC=		${DESTDIR}/usr/mdec
     30 
     31 LISTS=		${.CURDIR}/list
     32 RAMDISK!=	cd ${TOP}/ramdisk/; \
     33 		printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}/ramdisk.fs\n" |\
     34 		${MAKE} -s -f-
     35 
     36 # Some reasonable values for the -i parameter to newfs are:
     37 #
     38 #   6144	1147k, 189 inodes free
     39 #  16384	1159k,  93 inodes free
     40 # 204800	1167k,  29 inodes free
     41 INO_BYTES=	204800
     42 
     43 BLOCKSIZE=512
     44 FSSIZE!= expr ${BLOCKSIZE} \* 18 \* 2 \* 80
     45 
     46 GEOM=${BLOCKSIZE}/18/2/80
     47 
     48 CLEANFILES+=	netbsd.ram.gz netbsd.tmp disktab.tmp
     49 
     50 .MAIN: all
     51 
     52 all:	netbsd.ram.gz
     53 	dd if=/dev/zero of=${IMAGE} bs=${FSSIZE} count=1
     54 	vnconfig -v -c ${VND_CDEV} ${IMAGE} ${GEOM}
     55 	#newfs -B be -m 0 -o space -i ${INO_BYTES} -c 80 ${VND_RDEV}
     56 	newfs -B be -m 0 -o space -i ${INO_BYTES} -c 80 ${VND_RDEV}
     57 	mount ${VND_DEV} ${MOUNT_POINT}
     58 	TOPDIR=${TOP} CURDIR=${MINIROOT} OBJDIR=${.OBJDIR} \
     59 	    KERNOBJDIR=${KERNOBJDIR} \
     60 	    TARGDIR=${MOUNT_POINT} sh ${MINIROOT}/runlist.sh ${LISTS}
     61 	@echo ""
     62 	@df -i ${MOUNT_POINT}
     63 	@echo ""
     64 	@echo "installing new bootblocks"
     65 	-rm -f ${MOUNT_POINT}/boot
     66 	${MDEC}/binstall -m ${MDEC} -v ffs ${MOUNT_POINT}
     67 	umount ${MOUNT_POINT}
     68 	vnconfig -u ${VND_CDEV}
     69 
     70 unconfig:
     71 	-umount -f ${MOUNT_POINT}
     72 	-vnconfig -u ${VND_DEV}
     73 
     74 netbsd.ram.gz: ${KERN} ${RAMDISK}
     75 	cp ${KERN} netbsd.tmp
     76 	mdsetimage -v netbsd.tmp ${RAMDISK}
     77 	strip netbsd.tmp
     78 	gzip -9 netbsd.tmp
     79 	mv netbsd.tmp.gz ${.TARGET}
     80 
     81 clean cleandir distclean:
     82 	/bin/rm -f *.core ${IMAGE} ${CLEANFILES}
     83 
     84 depend install:
     85 
     86 real-floppy:
     87 	dd if=${IMAGE} of=${FD_RDEV} bs=32k
     88 
     89 .ifndef RELEASEDIR
     90 release:
     91 	@echo setenv RELEASEDIR first
     92 	@false
     93 .else
     94 release: $(IMAGE)
     95 	gzip -c -9 < $(.OBJDIR)/boot.fs \
     96 		> $(RELEASEDIR)/installation/bootfs/boot.fs.gz
     97 .endif	# RELEASEDIR check
     98 
     99 .include <bsd.obj.mk>
    100