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