1 # $NetBSD: Makefile,v 1.21 2000/10/20 11:56:58 pk Exp $ 2 # 3 # ramdisk.fs is the microroot filesystem intended for use with 4 # the INSTALL kernel. It provides just enough tools to extract the 5 # miniroot-based `instfs' filesystem into an MFS mount point 6 # and start the installation scripts from there (see dot.profile). 7 # 8 9 TOP= ${.CURDIR}/.. 10 MINIROOT= ${.CURDIR}/../../miniroot 11 12 .include "${TOP}/Makefile.inc" 13 14 CBIN= ramdiskbin 15 16 MOUNT_POINT?= /mnt 17 # DEV/RDEV file system device, CDEV/RDEV vnconfig device 18 VND?= vnd0 19 VND_DEV= /dev/${VND}a 20 VND_RDEV= /dev/r${VND}a 21 VND_CDEV= /dev/${VND}c 22 VND_CRDEV= /dev/r${VND}c 23 MDEC= ${DESTDIR}/usr/mdec 24 IMAGE?= ramdisk.fs 25 26 LISTS= list 27 MTREE= mtree.conf 28 29 # image size in 512-byte blocks 30 SIZE= 1360 31 #DISKTYPE= instfs 32 GEOM= 512/1/${SIZE}/1 33 INO_BYTES= 2048 34 35 all: ${CBIN} 36 dd if=/dev/zero of=${IMAGE} bs=${SIZE}b count=1 37 #vnconfig -t ${DISKTYPE} -v -c ${VND_CDEV} ${IMAGE} 38 vnconfig -v -c ${VND_CDEV} ${IMAGE} ${GEOM} 39 #disklabel -rw ${VND_CDEV} ${DISKTYPE} 40 #disklabel -W ${VND_CDEV} 41 newfs -B be -m 0 -o space -i ${INO_BYTES} ${VND_RDEV} 42 mount ${VND_DEV} ${MOUNT_POINT} 43 mtree -def ${.CURDIR}/${MTREE} -p ${MOUNT_POINT}/ -u 44 TOPDIR=${TOP} CURDIR=${MINIROOT} REALCURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \ 45 KERNOBJDIR=${KERNOBJDIR} \ 46 TARGDIR=${MOUNT_POINT} sh ${MINIROOT}/runlist.sh ${.CURDIR}/${LISTS} 47 @echo "" 48 @df -i ${MOUNT_POINT} 49 @echo "" 50 umount ${MOUNT_POINT} 51 vnconfig -u ${VND_CDEV} 52 53 unconfig: 54 -umount -f ${MOUNT_POINT} 55 -vnconfig -u ${VND_DEV} 56 -/bin/rm -f ${IMAGE} 57 58 ${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CBIN}.conf 59 crunchgen -D ${TOP}/../.. -L ${DESTDIR}/usr/lib ${.ALLSRC} 60 61 ${CBIN}.conf: ${LISTS} 62 awk -f ${MINIROOT}/makeconf.awk CBIN=${CBIN} ${.CURDIR}/${LISTS} > ${CBIN}.conf 63 64 ${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c 65 make -f ${CBIN}.mk all 66 67 # This is listed in ramdiskbin.conf but is built here. 68 ${CBIN}: libhack.o 69 70 # Use stubs to eliminate some large stuff from libc 71 NOLIBHACKOPENDIR=1 72 HACKSRC=${TOP}/../utils/libhack 73 .include "${HACKSRC}/Makefile.inc" 74 75 clean cleandir distclean: 76 /bin/rm -f *.core ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache \ 77 ${CBIN}.conf *.o *.cro *.c 78 79 .ifndef RELEASEDIR 80 release: 81 @echo setenv RELEASEDIR first 82 @false 83 .else 84 release: $(IMAGE) 85 gzip -c -9 < $(.OBJDIR)/ramdisk.fs \ 86 > $(RELEASEDIR)/installation/bootfs/ramdisk.fs.gz 87 .endif # RELEASEDIR check 88 89 .include <bsd.obj.mk> 90 .include <bsd.subdir.mk> 91