summaryrefslogtreecommitdiff
path: root/distrib
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
parent8cd7b8389cd3d6d42d230c30048e1735d86bba53 (diff)
this allows to build a ramdiskNN.lif
Diffstat (limited to 'distrib')
-rw-r--r--distrib/hppa/Makefile5
-rw-r--r--distrib/hppa/Makefile.inc3
-rw-r--r--distrib/hppa/install.md74
-rw-r--r--distrib/hppa/list62
-rw-r--r--distrib/hppa/ramdisk/Makefile107
-rw-r--r--distrib/hppa/ramdisk/list31
6 files changed, 282 insertions, 0 deletions
diff --git a/distrib/hppa/Makefile b/distrib/hppa/Makefile
new file mode 100644
index 00000000000..07d3fbfcde4
--- /dev/null
+++ b/distrib/hppa/Makefile
@@ -0,0 +1,5 @@
+# $OpenBSD: Makefile,v 1.1 2003/01/30 21:05:00 mickey Exp $
+
+SUBDIR=ramdisk
+
+.include <bsd.subdir.mk>
diff --git a/distrib/hppa/Makefile.inc b/distrib/hppa/Makefile.inc
new file mode 100644
index 00000000000..9aec5f464d0
--- /dev/null
+++ b/distrib/hppa/Makefile.inc
@@ -0,0 +1,3 @@
+# $OpenBSD: Makefile.inc,v 1.1 2003/01/30 21:05:00 mickey Exp $
+
+REV=${OSrev}
diff --git a/distrib/hppa/install.md b/distrib/hppa/install.md
new file mode 100644
index 00000000000..fe775a8db41
--- /dev/null
+++ b/distrib/hppa/install.md
@@ -0,0 +1,74 @@
+# $OpenBSD: install.md,v 1.1 2003/01/30 21:05:00 mickey Exp $
+#
+# machine dependent section of installation/upgrade script.
+#
+
+MDTERM=vt100
+MDDISKDEVS='/^sd[0-9] /s/ .*//p'
+MDCDDEVS='/^cd[0-9] /s/ .*//p'
+ARCH=ARCH
+
+md_set_term() {
+}
+
+md_installboot() {
+ local _rawdev _prefix
+
+ if [ -z "$1" ]; then
+ echo No disk device specified, you must run installboot manually.
+ return
+ fi
+ _rawdev=/dev/r${1}c
+
+ # use extracted mdec if it exists (may be newer)
+ if [ -e /mnt/usr/mdec/boot ]; then
+ _prefix=/mnt/usr/mdec
+ elif [ -e /usr/mdec/boot ]; then
+ _prefix=/usr/mdec
+ else
+ echo No boot block prototypes found, you must run installboot manually.
+ return
+ fi
+
+ echo Installing boot block...
+ /sbin/disklabel -B $1
+}
+
+md_checkfordisklabel() {
+ # $1 is the disk to check
+ local rval
+
+ disklabel $1 > /dev/null 2> /tmp/checkfordisklabel
+ if grep "no disk label" /tmp/checkfordisklabel; then
+ rval=1
+ elif grep "disk label corrupted" /tmp/checkfordisklabel; then
+ rval=2
+ else
+ rval=0
+ fi
+
+ rm -f /tmp/checkfordisklabel
+ return $rval
+}
+
+md_prep_disklabel()
+{
+ local _disk=$1
+
+ md_checkfordisklabel $_disk
+ case $? in
+ 0) ;;
+ 1) echo WARNING: Disk $_disk has no label. You will be creating a new one.
+ echo
+ ;;
+ 2) echo WARNING: Label on disk $_disk is corrupted. You will be repairing.
+ echo
+ ;;
+ esac
+
+ disklabel -W ${_disk}
+ disklabel -f /tmp/fstab.${_disk} -E ${_disk}
+}
+
+md_congrats() {
+}
diff --git a/distrib/hppa/list b/distrib/hppa/list
new file mode 100644
index 00000000000..ed91673c41d
--- /dev/null
+++ b/distrib/hppa/list
@@ -0,0 +1,62 @@
+# $OpenBSD: list,v 1.1 2003/01/30 21:05:00 mickey Exp $
+
+SRCDIRS distrib/special
+SRCDIRS gnu/usr.bin usr.bin bin sbin usr.sbin
+
+# copy the crunched binary, link to it, and kill it
+COPY ${OBJDIR}/instbin instbin
+LINK instbin bin/cat
+LINK instbin bin/chmod bin/chgrp sbin/chown
+LINK instbin bin/cp
+LINK instbin bin/dd
+LINK instbin bin/df
+LINK instbin bin/ed
+LINK instbin bin/expr
+LINK instbin bin/hostname
+LINK instbin bin/ln
+LINK instbin bin/ls
+LINK instbin bin/mkdir
+LINK instbin bin/mt
+LINK instbin bin/mv
+LINK instbin bin/pax bin/tar bin/cpio
+LINK instbin bin/rm
+LINK instbin bin/ksh bin/sh
+LINK instbin bin/stty
+LINK instbin bin/sleep
+LINK instbin bin/sync
+LINK instbin sbin/dmesg
+LINK instbin sbin/fsck_ffs sbin/fsck
+LINK instbin sbin/reboot sbin/halt
+LINK instbin sbin/ifconfig
+LINK instbin sbin/dhclient
+LINK instbin sbin/init
+LINK instbin sbin/mknod
+LINK instbin sbin/mount
+LINK instbin sbin/mount_cd9660
+LINK instbin sbin/mount_ffs
+LINK instbin sbin/mount_nfs
+LINK instbin sbin/newfs sbin/mount_mfs
+LINK instbin sbin/ping
+LINK instbin sbin/route
+LINK instbin sbin/umount
+LINK instbin usr/bin/ftp
+LINK instbin usr/bin/gzip usr/bin/gunzip usr/bin/gzcat
+LINK instbin usr/bin/sed
+
+ARGVLINK ksh -sh
+
+# various files that we need in /etc for the install
+COPY ${DESTDIR}/etc/group etc/group
+COPY ${DESTDIR}/etc/spwd.db etc/spwd.db
+COPY ${CURDIR}/../../miniroot/protocols etc/protocols
+COPY ${CURDIR}/../../miniroot/services etc/services
+
+# dhcp things
+SCRIPT ${DESTDIR}/sbin/dhclient-script sbin/dhclient-script
+
+# and the installation scripts
+SCRIPT ${CURDIR}/../../miniroot/dot.profile .profile
+SCRIPT ${CURDIR}/../../miniroot/upgrade.sh upgrade
+SCRIPT ${CURDIR}/../../miniroot/install.sh install
+SCRIPT ${CURDIR}/../../miniroot/install.sub install.sub
+SPECIAL chmod 755 install upgrade sbin/dhclient-script
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