Home | History | Annotate | Line # | Download | only in bootfs
Makefile revision 1.26
      1 #	$NetBSD: Makefile,v 1.26 2000/10/31 20:59:00 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 netbsd.ram.aout netbsd.tmp
     49 
     50 .MAIN: all
     51 
     52 all:	netbsd.ram netbsd.ram.aout
     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 	mount ${VND_DEV} ${MOUNT_POINT}
     57 	gzip -9 < netbsd.ram > ${MOUNT_POINT}/netbsd
     58 	@echo ""
     59 	@df -i ${MOUNT_POINT}
     60 	@echo ""
     61 	@echo "installing new bootblocks"
     62 	-rm -f ${MOUNT_POINT}/boot
     63 	${MDEC}/binstall -m ${MDEC} -v ffs ${MOUNT_POINT}
     64 	umount ${MOUNT_POINT}
     65 	vnconfig -u ${VND_CDEV}
     66 
     67 unconfig:
     68 	-umount -f ${MOUNT_POINT}
     69 	-vnconfig -u ${VND_DEV}
     70 
     71 netbsd.ram: ${KERN} ${RAMDISK}
     72 	cp ${KERN} netbsd.tmp
     73 	mdsetimage -v netbsd.tmp ${RAMDISK}
     74 	strip netbsd.tmp
     75 	mv netbsd.tmp ${.TARGET}
     76 
     77 
     78 # conjure up a magic header that is accepted by all Sun PROMS;
     79 # see sys/arch/sparc/stand/installboot/installboot.c for details.
     80 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'
     81 
     82 netbsd.ram.aout: netbsd.ram
     83 	objcopy -O binary ${.ALLSRC} netbsd.ram.raw
     84 	(printf ${SUN_MAGIC_HEADER}; cat netbsd.ram.raw)  > ${.TARGET}
     85 	rm -f netbsd.ram.raw
     86 
     87 clean cleandir distclean:
     88 	/bin/rm -f *.core ${IMAGE} ${CLEANFILES}
     89 
     90 depend install:
     91 
     92 real-floppy:
     93 	dd if=${IMAGE} of=${FD_RDEV} bs=32k
     94 
     95 .ifndef RELEASEDIR
     96 release:
     97 	@echo setenv RELEASEDIR first
     98 	@false
     99 .else
    100 release: $(IMAGE)
    101 	gzip -c -9 < $(.OBJDIR)/boot.fs \
    102 		> $(RELEASEDIR)/installation/bootfs/boot.fs.gz
    103 	gzip -c -9 < $(.OBJDIR)/netbsd.ram.aout \
    104 		> $(RELEASEDIR)/installation/bootfs/netbsd.ram.aout.gz
    105 .endif	# RELEASEDIR check
    106 
    107 .include <bsd.obj.mk>
    108