diff options
Diffstat (limited to 'distrib/sun3/ramdisk/Makefile')
-rw-r--r-- | distrib/sun3/ramdisk/Makefile | 112 |
1 files changed, 57 insertions, 55 deletions
diff --git a/distrib/sun3/ramdisk/Makefile b/distrib/sun3/ramdisk/Makefile index 278e1c30042..c98c1bfd343 100644 --- a/distrib/sun3/ramdisk/Makefile +++ b/distrib/sun3/ramdisk/Makefile @@ -1,70 +1,72 @@ -# $NetBSD: Makefile,v 1.3 1995/11/21 21:19:14 gwr Exp $ +# $OpenBSD: Makefile,v 1.5 1998/08/23 18:09:02 kstailey Exp $ +# $NetBSD: Makefile,v 1.1 1995/07/18 04:13:06 briggs Exp $ TOP= ${.CURDIR}/.. -# This include just sets REV=XX .include "${TOP}/Makefile.inc" +IMAGE= ramdisk-${REV}.fs +CRUNCHCONF?= ${.CURDIR}/${CBIN}.conf +BASE= ramdisk -IMAGE= ramdisk -CBIN= rd_bin +MOUNT_POINT= /mnt -TREE= ${TOP}/common/${IMAGE}.tree +VND?= svnd0 +VND_DEV= /dev/${VND}a +VND_RDEV= /dev/r${VND}a +VND_CRDEV= /dev/r${VND}c +PID!= echo $$$$ +REALIMAGE!= echo /var/tmp/image.${PID} -LISTS= ${TOP}/common/${CBIN}.list \ - ${TOP}/common/${IMAGE}.list +GZIP?= gzip +GZIPFLAGS?= -9f -KERNEL=${SRCSYSDIR}/arch/sun3/compile/RAMDISK/netbsd +all: ${CBIN} ${IMAGE} bsd.rd + @echo "all done" -MOUNT_POINT= /mnt -BDEV= /dev/rd0 -CDEV= /dev/rd0 - -# These are all the parameters for the root fs: (256K) -DISKTYPE= rdroot -NBLKS= 512 -# old format, minfree, opt, b/i trks, sects, cpg -NEWFSARGS= -O -m 0 -o space -i 2048 -t 2 -u 16 -c 16 - -CLEANFILES= netbsd-rd rdsetroot ${IMAGE}.fs - -netbsd-rd : rdsetroot ${IMAGE}.fs - cp ${KERNEL} netbsd-tmp - ./rdsetroot netbsd-tmp < ${IMAGE}.fs - -mv -f netbsd-tmp $@ - -rdsetroot: ${TOP}/common/rdsetroot.c - $(CC) -o $@ -DDEBUG ${TOP}/common/rdsetroot.c - -${IMAGE}.fs: ${TREE} ${LISTS} ${CBIN} - -newfs ${NEWFSARGS} -s ${NBLKS} ${CDEV} ${DISKTYPE} - mount ${BDEV} ${MOUNT_POINT} - mtree -def ${TREE} -p ${MOUNT_POINT}/ -u - TOPDIR=${TOP} CURDIR=${.CURDIR} \ - OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \ - sh ${TOP}/common/RunList.sh ${LISTS} - sync - @echo "" - @df -i ${MOUNT_POINT} - @echo "" - -umount ${MOUNT_POINT} - dd if=${CDEV} of=$@ count=${NBLKS} +install: bsd.rd + cp bsd.rd ${DESTDIR}/snapshot/bsd.rd + cp ${.CURDIR}/../HP-IB.geometry ${DESTDIR}/snapshot + +.include "Makefile.inc" -# Do not delete this if I change my mind and kill make... -.PRECIOUS: ${IMAGE}.fs +DISKTYPE= rdroot +NBLKS= 4096 +NEWFSARGS= -m 0 -o space -c 16 -i 3072 -# Rules for making ${CBIN} ... -.include "${TOP}/common/Make.crunch" +bsd.rd: ${IMAGE} bsd rdsetroot + ${.OBJDIR}/rdsetroot bsd < ${IMAGE} + ${GZIP} -c ${GZIPFLAGS} bsd > bsd.rd + rm bsd -# This is listed in rd_bin.conf but is built here. -${CBIN} : libhack.o +bsd: + cd ${.CURDIR}/../../../sys/arch/hp300/conf && config RAMDISK + cd ${.CURDIR}/../../../sys/arch/hp300/compile/RAMDISK && \ + make clean && make depend && make + cp ${.CURDIR}/../../../sys/arch/hp300/compile/RAMDISK/bsd bsd + +${IMAGE}: ${CBIN} rd_setup do_files rd_teardown + +rd_setup: ${CBIN} + dd if=/dev/zero of=${REALIMAGE} bs=512 count=${NBLKS} + vnconfig -v -c ${VND} ${REALIMAGE} + disklabel -w ${VND} ${DISKTYPE} + newfs ${NEWFSARGS} ${VND_RDEV} + fsck ${VND_RDEV} + mount ${VND_DEV} ${MOUNT_POINT} + +rd_teardown: + @df -i ${MOUNT_POINT} + -umount ${MOUNT_POINT} + -vnconfig -u ${VND} + cp ${REALIMAGE} ${IMAGE} + rm ${REALIMAGE} -# Use stubs to eliminate some large stuff from libc -HACKSRC=${TOP}/../utils/libhack -.include "${HACKSRC}/Makefile.inc" +rdsetroot: ${TOP}/../common/rdsetroot.c + ${HOSTCC} -DDEBUG -o rdsetroot ${TOP}/../common/rdsetroot.c -clean cleandir: - -rm -f a.out core *.core *.o - -rm -f ${CLEANFILES} +unconfig: + -umount -f ${MOUNT_POINT} + -vnconfig -u ${VND} + -/bin/rm -f ${IMAGE} -# Standard rules needed by the above... -.include <bsd.obj.mk> +.PRECIOUS: ${IMAGE} |