summaryrefslogtreecommitdiff
path: root/distrib/i386/floppies/ramdisk/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'distrib/i386/floppies/ramdisk/Makefile')
-rw-r--r--distrib/i386/floppies/ramdisk/Makefile77
1 files changed, 77 insertions, 0 deletions
diff --git a/distrib/i386/floppies/ramdisk/Makefile b/distrib/i386/floppies/ramdisk/Makefile
new file mode 100644
index 00000000000..053c46cda79
--- /dev/null
+++ b/distrib/i386/floppies/ramdisk/Makefile
@@ -0,0 +1,77 @@
+# $OpenBSD: Makefile,v 1.1 1997/04/13 17:17:52 mickey Exp $
+# $NetBSD: Makefile,v 1.1 1995/07/18 04:13:06 briggs Exp $
+
+TOP= ${.CURDIR}/..
+
+.include "${TOP}/Makefile.inc"
+IMAGE= miniroot-${REV}.fs
+CRUNCHCONF?= ${.CURDIR}/${CBIN}.conf
+BASE=miniroot
+
+MOUNT_POINT= /mnt1
+BDEV= /dev/rd0a
+CDEV= /dev/rrd0a
+RDEV= /dev/rd0c
+
+KERNEL= /sys/arch/i386/compile/RAMDISK/bsd
+
+all: ${CBIN} ${IMAGE}
+ @echo "all done"
+
+.include "Makefile.inc"
+
+DISKTYPE= rdroot
+NBLKS= 4046
+# old format, minfree, opt, b/i trks, sects, cpg
+NEWFSARGS= -t ffs -m 0 -o space -c 16 -i 4096
+
+${IMAGE}: do_prep do_mount do_files do_umount_copy do_unconfig
+ mv -f ${IMAGE}.tmp ${IMAGE}
+ -if [ -e ${.CURDIR}/${__objdir}/rd.pid ] ; then \
+ kill `cat ${.CURDIR}/${__objdir}/rd.pid`; \
+ rm ${.CURDIR}/${__objdir}/rd.pid;\
+ fi
+
+rdsetroot: ${TOP}/common/rdsetroot.c
+ ${HOSTCC} -DDEBUG -o rdsetroot ${TOP}/common/rdsetroot.c
+
+setroot: ${IMAGE} bsd
+ ${.CURDIR}/${__objdir}/rdsetroot bsd < ${IMAGE}
+
+bsd: ${KERNEL}
+ cp ${KERNEL} bsd
+
+writetape:
+ echo rewinding tape < /dev/rst0
+ buffer -i /usr/mdec/stboot -o /dev/nrst0
+ buffer -i /usr/mdec/bootst -o /dev/nrst0
+ buffer -B -p75 -i bsd -o /dev/nrst0
+ echo rewinding tape < /dev/rst0
+
+
+do_prep: ${CBIN} do_unconfig
+ sh ${.CURDIR}/start_rdconfig.sh ${RDEV} ${NBLKS}
+ disklabel -w -r ${RDEV} ${DISKTYPE}
+
+do_mount:
+ -newfs ${NEWFSARGS} -s ${NBLKS} ${CDEV} ${DISKTYPE}
+ mount ${BDEV} ${MOUNT_POINT}
+
+do_umount_copy:
+ @echo ""
+ @df -i ${MOUNT_POINT}
+ @echo ""
+ -umount ${MOUNT_POINT}
+ dd if=${CDEV} of=${IMAGE}.tmp bs=4b count=`expr ${NBLKS} / 4 `
+
+do_unconfig:
+ -umount ${MOUNT_POINT}
+ -if [ -e ${.CURDIR}/${__objdir}/rd.pid ] ; then \
+ kill `cat ${.CURDIR}/${__objdir}/rd.pid`; \
+ rm ${.CURDIR}/${__objdir}/rd.pid; \
+ fi
+
+
+.PRECIOUS: ${IMAGE}
+
+