Home | History | Annotate | Line # | Download | only in bootfs
Makefile revision 1.30
      1 #	$NetBSD: Makefile,v 1.30 2001/10/23 16:30:35 tv 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 MDSETIMAGE?=	mdsetimage
     31 OBJCOPY?=	objcopy
     32 
     33 LISTS=		${.CURDIR}/list
     34 RAMDISK!=	cd ${TOP}/ramdisk/; \
     35 		printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}/ramdisk.fs\n" |\
     36 		${MAKE} -s -f-
     37 
     38 # Some reasonable values for the -i parameter to newfs are:
     39 #
     40 #   6144	1147k, 189 inodes free
     41 #  16384	1159k,  93 inodes free
     42 # 204800	1167k,  29 inodes free
     43 INO_BYTES=	204800
     44 
     45 BLOCKSIZE=512
     46 FSSIZE!= expr ${BLOCKSIZE} \* 18 \* 2 \* 80
     47 
     48 GEOM=${BLOCKSIZE}/18/2/80
     49 
     50 CLEANFILES+=	netbsd.ram netbsd.ram.aout netbsd.tmp
     51 
     52 .MAIN: all
     53 
     54 all:	netbsd.ram netbsd.ram.aout
     55 	dd if=/dev/zero of=${IMAGE} bs=${FSSIZE} count=1
     56 	vnconfig -v -c ${VND_CDEV} ${IMAGE} ${GEOM}
     57 	newfs -B be -m 0 -o space -i ${INO_BYTES} -c 80 ${VND_RDEV}
     58 	mount ${VND_DEV} ${MOUNT_POINT}
     59 	gzip -9 < netbsd.ram > ${MOUNT_POINT}/netbsd
     60 	@echo ""
     61 	@df -i ${MOUNT_POINT}
     62 	@echo ""
     63 	@echo "installing new bootblocks"
     64 	-rm -f ${MOUNT_POINT}/boot
     65 	${MDEC}/binstall -m ${MDEC} -f ${IMAGE} -v ffs ${MOUNT_POINT}
     66 	umount ${MOUNT_POINT}
     67 	vnconfig -u ${VND_CDEV}
     68 
     69 unconfig:
     70 	-umount -f ${MOUNT_POINT}
     71 	-vnconfig -u ${VND_DEV}
     72 
     73 netbsd.ram: ${KERN} ${RAMDISK}
     74 	cp ${KERN} netbsd.tmp
     75 	${MDSETIMAGE} -v netbsd.tmp ${RAMDISK}
     76 	strip netbsd.tmp
     77 	mv netbsd.tmp ${.TARGET}
     78 
     79 
     80 # conjure up a magic header that is accepted by all Sun PROMS;
     81 # see sys/arch/sparc/stand/installboot/installboot.c for details.
     82 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'
     83 
     84 netbsd.ram.aout: netbsd.ram
     85 	${OBJCOPY} -O binary ${.ALLSRC} netbsd.ram.raw
     86 	(printf ${SUN_MAGIC_HEADER}; cat netbsd.ram.raw)  > ${.TARGET}
     87 	rm -f netbsd.ram.raw
     88 
     89 clean cleandir distclean:
     90 	/bin/rm -f *.core ${IMAGE} ${CLEANFILES}
     91 
     92 depend install:
     93 
     94 real-floppy:
     95 	dd if=${IMAGE} of=${FD_RDEV} bs=32k
     96 
     97 .ifndef RELEASEDIR
     98 release:
     99 	@echo setenv RELEASEDIR first
    100 	@false
    101 .else
    102 release: $(IMAGE)
    103 	gzip -c -9 < $(.OBJDIR)/boot.fs \
    104 		> $(RELEASEDIR)/installation/bootfs/boot.fs.gz
    105 	gzip -c -9 < $(.OBJDIR)/netbsd.ram.aout \
    106 		> $(RELEASEDIR)/installation/bootfs/netbsd.ram.aout.gz
    107 .endif	# RELEASEDIR check
    108 
    109 .include <bsd.obj.mk>
    110 .include <bsd.subdir.mk>
    111