1 # $NetBSD: Makefile,v 1.31 2001/11/21 01:45:21 jmc 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 MTREECONF= mtree.conf 28 29 CRUNCHGEN?= crunchgen 30 MTREE?= mtree 31 32 # image size in 512-byte blocks 33 SIZE= 1360 34 #DISKTYPE= instfs 35 GEOM= 512/1/${SIZE}/1 36 INO_BYTES= 2752 37 38 all: ${CBIN} 39 dd if=/dev/zero of=${IMAGE} bs=${SIZE}b count=1 40 #vnconfig -t ${DISKTYPE} -v -c ${VND} ${IMAGE} 41 vnconfig -v -c ${VND} ${IMAGE} ${GEOM} 42 #disklabel -rw ${VND_CDEV} ${DISKTYPE} 43 #disklabel -W ${VND_CDEV} 44 newfs -B be -m 0 -o space -i ${INO_BYTES} ${VND_RDEV} 45 mount ${VND_DEV} ${MOUNT_POINT} 46 ${MTREE} -def ${.CURDIR}/${MTREECONF} -p ${MOUNT_POINT}/ -u 47 TOPDIR=${TOP} CURDIR=${MINIROOT} REALCURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \ 48 KERNOBJDIR=${KERNOBJDIR} \ 49 TARGDIR=${MOUNT_POINT} sh ${MINIROOT}/runlist.sh ${.CURDIR}/${LISTS} 50 @echo "" 51 @df -i ${MOUNT_POINT} 52 @echo "" 53 umount ${MOUNT_POINT} 54 vnconfig -u ${VND} 55 56 unconfig: 57 -umount -f ${MOUNT_POINT} 58 -vnconfig -u ${VND} 59 -/bin/rm -f ${IMAGE} 60 61 ${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CBIN}.conf 62 ${CRUNCHGEN} -D ${TOP}/../.. -L ${DESTDIR}/usr/lib ${.ALLSRC} 63 64 ${CBIN}.conf: ${LISTS} 65 awk -f ${MINIROOT}/makeconf.awk CBIN=${CBIN} ${.CURDIR}/${LISTS} > ${CBIN}.conf 66 67 ${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c 68 ${MAKE} -f ${CBIN}.mk all 69 70 # This is listed in ramdiskbin.conf but is built here. 71 ${CBIN}: libhack.o 72 73 # Use stubs to eliminate some large stuff from libc 74 NOLIBHACKOPENDIR=1 75 HACKSRC=${TOP}/../utils/libhack 76 .include "${HACKSRC}/Makefile.inc" 77 78 clean cleandir distclean: 79 /bin/rm -f *.core ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache \ 80 ${CBIN}.conf *.o *.cro *.c 81 82 .include <bsd.obj.mk> 83 .include <bsd.sys.mk> 84 .include <bsd.subdir.mk> 85 .include <bsd.prog.mk> 86