Home | History | Annotate | Line # | Download | only in bootfs
Makefile revision 1.34
      1 #	$NetBSD: Makefile,v 1.34 2002/05/02 18:02:53 lukem 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 .include <bsd.own.mk>
     11 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
     12 
     13 .include <bsd.kernobj.mk>
     14 
     15 TOP=		${.CURDIR}/..
     16 MINIROOT=	${.CURDIR}/../../miniroot
     17 
     18 
     19 KERN?=		${KERNOBJDIR}/INSTALL/netbsd
     20 
     21 MOUNT_POINT?=	/mnt
     22 VND?=		vnd0
     23 VND_DEV=	/dev/${VND}a
     24 VND_RDEV=	/dev/r${VND}a
     25 VND_CDEV=	/dev/${VND}c
     26 VND_CRDEV=	/dev/r${VND}c
     27 FD?=		fd0
     28 FD_RDEV=	/dev/r${FD}a
     29 IMAGE?=		boot.fs
     30 MDEC=		${DESTDIR}/usr/mdec
     31 MDSETIMAGE?=	mdsetimage
     32 OBJCOPY?=	objcopy
     33 
     34 LISTS=		${.CURDIR}/list
     35 
     36 RAMDISKDIR!=	cd ${TOP}/ramdisk && ${PRINTOBJDIR}
     37 RAMDISK=	${RAMDISKDIR}/ramdisk.fs
     38 
     39 # Some reasonable values for the -i parameter to newfs are:
     40 #
     41 #   6144	1147k, 189 inodes free
     42 #  16384	1159k,  93 inodes free
     43 # 204800	1167k,  29 inodes free
     44 INO_BYTES=	204800
     45 
     46 BLOCKSIZE=512
     47 FSSIZE!= expr ${BLOCKSIZE} \* 18 \* 2 \* 80
     48 
     49 GEOM=${BLOCKSIZE}/18/2/80
     50 
     51 CLEANFILES+=	netbsd.ram netbsd.ram.aout netbsd.tmp
     52 
     53 .MAIN: all
     54 
     55 all:	netbsd.ram netbsd.ram.aout
     56 	dd if=/dev/zero of=${IMAGE} bs=${FSSIZE} count=1
     57 	vnconfig -v -c ${VND} ${IMAGE} ${GEOM}
     58 	newfs -B be -m 0 -o space -i ${INO_BYTES} -c 80 ${VND_RDEV}
     59 	mount ${VND_DEV} ${MOUNT_POINT}
     60 	gzip -9 < netbsd.ram > ${MOUNT_POINT}/netbsd
     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} -f ${IMAGE} -v ffs ${MOUNT_POINT}
     67 	umount ${MOUNT_POINT}
     68 	vnconfig -u ${VND}
     69 
     70 unconfig:
     71 	-umount -f ${MOUNT_POINT}
     72 	-vnconfig -u ${VND}
     73 
     74 netbsd.ram: ${KERN} ${RAMDISK}
     75 	cp ${KERN} netbsd.tmp
     76 	${MDSETIMAGE} -v netbsd.tmp ${RAMDISK}
     77 	strip netbsd.tmp
     78 	mv netbsd.tmp ${.TARGET}
     79 
     80 
     81 # conjure up a magic header that is accepted by all Sun PROMS;
     82 # see sys/arch/sparc/stand/installboot/installboot.c for details.
     83 SUN_MAGIC_HEADER='\01\03\01\07\060\200\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0'
     84 
     85 netbsd.ram.aout: netbsd.ram
     86 	${OBJCOPY} -O binary ${.ALLSRC} netbsd.ram.raw
     87 	(printf ${SUN_MAGIC_HEADER}; cat netbsd.ram.raw)  > ${.TARGET}
     88 	rm -f netbsd.ram.raw
     89 
     90 clean cleandir distclean:
     91 	/bin/rm -f *.core ${IMAGE} ${CLEANFILES}
     92 
     93 depend install:
     94 
     95 real-floppy:
     96 	dd if=${IMAGE} of=${FD_RDEV} bs=32k
     97 
     98 release: check_RELEASEDIR .WAIT boot.fs netbsd.ram.aout
     99 	gzip -c -9 boot.fs > $(RELEASEDIR)/installation/bootfs/boot.fs.gz
    100 	gzip -c -9 netbsd.ram.aout > \
    101 	    $(RELEASEDIR)/installation/bootfs/netbsd.ram.aout.gz
    102 
    103 .include <bsd.prog.mk>
    104