summaryrefslogtreecommitdiff
path: root/distrib/hppa/ramdisk
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2003-01-30 21:05:02 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2003-01-30 21:05:02 +0000
commit40fa295c7d4b8f2c25a804fbe379c2b34aa6e180 (patch)
treef74afbdf136ea9974dc2509fd2db34622704f518 /distrib/hppa/ramdisk
parent8cd7b8389cd3d6d42d230c30048e1735d86bba53 (diff)
this allows to build a ramdiskNN.lif
Diffstat (limited to 'distrib/hppa/ramdisk')
-rw-r--r--distrib/hppa/ramdisk/Makefile107
-rw-r--r--distrib/hppa/ramdisk/list31
2 files changed, 138 insertions, 0 deletions
diff --git a/distrib/hppa/ramdisk/Makefile b/distrib/hppa/ramdisk/Makefile
new file mode 100644
index 00000000000..08386d93e3f
--- /dev/null
+++ b/distrib/hppa/ramdisk/Makefile
@@ -0,0 +1,107 @@
+# $OpenBSD: Makefile,v 1.1 2003/01/30 21:05:01 mickey Exp $
+
+CBIN= instbin
+ARCHDIR= ${.CURDIR}/..
+SRCDIR= ${.CURDIR}/../../..
+
+.include <bsd.own.mk>
+
+.if exists(${ARCHDIR}/Makefile.inc)
+.include "${ARCHDIR}/Makefile.inc"
+.endif
+
+MOUNT_POINT?= /mnt
+VND?= svnd0
+VND_DEV= /dev/${VND}a
+VND_RDEV= /dev/r${VND}a
+DISKTYPE= rdroot
+PID!= echo $$$$
+REALIMAGE!= echo /tmp/image.${PID}
+IMAGE?= ramdisk${REV}.fs
+IMAGESIZE?= 5120 # 2.5MB in 512 byte blocks
+NEWFS_WILL_FAIL?=false
+RDSETROOT?= elfrdsetroot
+CRUNCHGENOPTS?=-E
+KERNEL?= RAMDISK
+UTILS?= ${.CURDIR}/../../miniroot
+STRIP?= strip
+
+LISTS= ${ARCHDIR}/list ${.CURDIR}/list
+MTREE= ${UTILS}/mtree.conf
+
+FLOPPY?= ramdisk${REV}.lif
+MKBOOT?= ${DESTDIR}/usr/mdec/mkboot
+BOOT?= ${DESTDIR}/usr/mdec/boot
+
+GZIP?= gzip
+GZIPFLAGS?= -9
+
+# old format, minfree, opt, b/i trks, sects, cpg
+NEWFSOPTS= -t ffs -m 0 -o space -f 1024 -b 8192
+NEWFSOPTS_RD?= ${NEWFSOPTS} -i 16384 -c 64 -s ${IMAGESIZE}
+
+all: bsd.rd ${FLOPPY}
+
+${FLOPPY}: bsd ${BOOT} ${BOOTXX}
+ ${MKBOOT} -v ${BOOT} bsd ${FLOPPY}
+
+obsd:
+ cd ${SRCDIR}/sys/arch/${MACHINE}/conf && config ${KERNEL}
+ cd ${SRCDIR}/sys/arch/${MACHINE}/compile/${KERNEL} && \
+ make depend && make clean && make
+ cp ${SRCDIR}/sys/arch/${MACHINE}/compile/${KERNEL}/bsd obsd
+
+bsd.rd: obsd ${IMAGE} ${RDSETROOT}
+ cp obsd bsd.rd
+ ${.OBJDIR}/${RDSETROOT} bsd.rd < ${IMAGE}
+ ${STRIP} bsd.rd
+
+bsd: bsd.rd
+ ${GZIP} ${GZIPFLAGS} < bsd.rd > bsd
+
+${RDSETROOT}: ${.CURDIR}/../../common/${RDSETROOT}.c
+ ${HOSTCC} ${HOSTCCFLAGS} -o ${RDSETROOT} $<
+
+${IMAGE}: ${CBIN}
+ dd if=/dev/zero of=${REALIMAGE} count=${IMAGESIZE}
+ vnconfig -v -c ${VND} ${REALIMAGE}
+ disklabel -w ${RAWLABEL} ${VND} ${DISKTYPE}
+ newfs ${NEWFSOPTS_RD} ${VND_RDEV} || ${NEWFS_WILL_FAIL}
+ mount ${VND_DEV} ${MOUNT_POINT}
+ mtree -def ${MTREE} -p ${MOUNT_POINT}/ -u
+ REV=${REV} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} ARCHDIR=${ARCHDIR} \
+ TARGDIR=${MOUNT_POINT} UTILS=${UTILS} sh ${UTILS}/runlist.sh ${LISTS}
+ rm ${MOUNT_POINT}/${CBIN}
+ @echo ""
+ @df -i ${MOUNT_POINT}
+ @echo ""
+ umount ${MOUNT_POINT}
+ vnconfig -u ${VND_DEV}
+ cp ${REALIMAGE} ${IMAGE}
+ rm ${REALIMAGE}
+
+${CBIN}.conf: ${LISTS}
+ awk -f ${UTILS}/makeconf.awk CBIN=${CBIN} ${LISTS} > ${CBIN}.conf
+
+${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CBIN}.conf
+ crunchgen ${CRUNCHGENOPTS} -D ${SRCDIR} -L ${DESTDIR}/usr/lib \
+ ${CBIN}.conf
+
+${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
+ make -f ${CBIN}.mk all
+
+clean cleandir:
+ /bin/rm -f *.core ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache \
+ ${CBIN}.conf *.o *.lo *.c obsd bsd bsd.*
+
+beforeinstall:
+ cp bsd.rd ${DESTDIR}/snapshot
+ cp ${FLOPPY} ${DESTDIR}/snapshot
+
+unconfig:
+ -umount -f ${MOUNT_POINT}
+ -vnconfig -u ${VND}
+ -/bin/rm -f ${REALIMAGE}
+
+.include <bsd.obj.mk>
+.include <bsd.subdir.mk>
diff --git a/distrib/hppa/ramdisk/list b/distrib/hppa/ramdisk/list
new file mode 100644
index 00000000000..b77518b1a4b
--- /dev/null
+++ b/distrib/hppa/ramdisk/list
@@ -0,0 +1,31 @@
+# $OpenBSD: list,v 1.1 2003/01/30 21:05:01 mickey Exp $
+
+# hppa extra's
+LINK instbin sbin/disklabel
+LINK instbin usr/bin/grep usr/bin/egrep usr/bin/fgrep
+LINK instbin usr/bin/less usr/bin/more
+
+SRCDIRS sys/arch/hppa/stand
+
+# Minimize use of MFS
+SYMLINK /tmp var/tmp
+
+# copy the MAKEDEV script and make some devices
+SCRIPT ${DESTDIR}/dev/MAKEDEV dev/MAKEDEV
+SPECIAL cd dev; sh MAKEDEV ramdisk
+
+# we need the contents of /usr/mdec (but not boot or binstall)
+COPYDIR ${DESTDIR}/usr/mdec usr/mdec
+SPECIAL rm -f usr/mdec/mkboot
+
+# various files that we need in /etc for the install
+SCRIPT ${DESTDIR}/etc/disktab etc/disktab.shadow
+SYMLINK /tmp/disktab.shadow etc/disktab
+SYMLINK /tmp/fstab.shadow etc/fstab
+SYMLINK /tmp/resolv.conf.shadow etc/resolv.conf
+SYMLINK /tmp/hosts etc/hosts
+TERMCAP vt100,vt220,dumb,hp2392,hpansi,hpsub,hpex,hp700-wy,hp70092 usr/share/misc/termcap
+
+# and the installation tools (no upgrade from to 3.3)
+SCRIPT ${ARCHDIR}/install.md install.md
+REMOVE upgrade