summaryrefslogtreecommitdiff
path: root/distrib/sparc64/ramdiskB
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-10-10 04:21:03 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-10-10 04:21:03 +0000
commit01d90c47df19e3d4e5c7ea1c351ebbe4613fdf1c (patch)
treea8c394b878dcf5820278a4b402febf6787f9856e /distrib/sparc64/ramdiskB
parentca0009c553ea95636ab09286930c3451deffed07 (diff)
does this work? I do not know yet
Diffstat (limited to 'distrib/sparc64/ramdiskB')
-rw-r--r--distrib/sparc64/ramdiskB/Makefile136
-rw-r--r--distrib/sparc64/ramdiskB/instbin.conf32
-rw-r--r--distrib/sparc64/ramdiskB/list84
-rw-r--r--distrib/sparc64/ramdiskB/mtree.conf90
4 files changed, 342 insertions, 0 deletions
diff --git a/distrib/sparc64/ramdiskB/Makefile b/distrib/sparc64/ramdiskB/Makefile
new file mode 100644
index 00000000000..1f3a6e30ea2
--- /dev/null
+++ b/distrib/sparc64/ramdiskB/Makefile
@@ -0,0 +1,136 @@
+# $OpenBSD: Makefile,v 1.1 2001/10/10 04:21:02 deraadt Exp $
+
+TOP= ${.CURDIR}/..
+
+.include "${TOP}/Makefile.inc"
+BSD_RD= bsd.rd
+IMAGE= mr.fs
+CBIN?= instbin
+LISTS= ${.CURDIR}/list
+UTILS?= ${.CURDIR}/../../miniroot
+
+MOUNT_POINT= /mnt
+MTREE= ${.CURDIR}/mtree.conf
+
+FLOPPY= floppyB${REV}.fs
+FLOPPYSIZE?= 2880
+FLOPPYTYPE?= floppy
+INSTALLBOOT?= /usr/mdec/installboot
+
+VND?= svnd0
+VND_DEV= /dev/${VND}a
+VND_RDEV= /dev/r${VND}a
+VND_CRDEV= /dev/r${VND}c
+PID!= echo $$$$
+
+GZIP?= gzip
+GZIPFLAGS?= -9v
+GZIPEXT?= .gz
+
+MOUNT_POINT?= /mnt
+DISKTYPE= rdroot
+PID!= echo $$$$
+REALIMAGE!= echo /tmp/image.${PID}
+IMAGE?= ramdisk${REV}.fs
+IMAGESIZE?= 8192 # 4MB in 512 byte blocks
+NEWFS_WILL_FAIL?=false
+CRUNCHGENOPTS?=
+KERNEL?= RAMDISKU5
+UTILS?= ${.CURDIR}/../miniroot
+STRIP?= strip
+
+DISKTYPE= rdroot
+NBLKS= 6144
+# minfree, opt, b/i trks, sects, cpg
+NEWFSARGS= -m 0 -o space -c 16 -i 8192
+
+.ifndef DESTDIR
+all ${IMAGE}:
+ @echo setenv DESTDIR before making a ramdisk!
+ @false
+.else
+
+# mix config is not needed.
+all: ${FLOPPY} ${BSD_RD}
+
+bsd.gz: bsd.rd
+ ${GZIP} ${GZIPFLAGS} < bsd.rd > bsd.gz
+
+${FLOPPY}: bsd.gz ${BOOT} /usr/
+ dd if=/dev/zero of=${REALIMAGE} count=${FLOPPYSIZE}
+ vnconfig -v -c ${VND} ${REALIMAGE}
+ disklabel -w ${RAWLABEL} ${VND} ${FLOPPYTYPE}
+ newfs ${NEWFSOPTS_FD} ${VND_RDEV}
+ mount ${VND_DEV} ${MOUNT_POINT}
+ cp ${DESTDIR}/usr/mdec/ofwboot ${MOUNT_POINT}$/
+ cp bsd.gz ${MOUNT_POINT}/bsd
+ ${INSTALLBOOT} -v ${DESTDIR}/usr/mdec/bootblk \
+ `echo ${VND_RDEV} | sed -e 's/a$$/c/'`
+ @echo ""
+ @df -i ${MOUNT_POINT}
+ @echo ""
+ umount ${MOUNT_POINT}
+ vnconfig -u ${VND}
+ dd if=${REALIMAGE} of=${FLOPPY} count=${FLOPPYSIZE}
+ rm -f ${REALIMAGE}
+
+${BSD_RD}: ${CBIN} ${IMAGE} bsd elfrdsetroot
+ cp bsd ${BSD_RD}
+ ${.OBJDIR}/elfrdsetroot ${BSD_RD} < ${IMAGE}
+
+${IMAGE}: rd_setup do_files rd_teardown
+
+.endif
+
+bsd:
+ cd ${TOP}/../../sys/arch/sparc64/conf && config ${KERNEL}
+ cd ${TOP}/../../sys/arch/sparc64/compile/${KERNEL} && \
+ make clean && make depend && COPTS=-Os make
+ cp ${TOP}/../../sys/arch/sparc64/compile/${KERNEL}/bsd bsd
+
+rd_setup:
+ dd if=/dev/zero of=${IMAGE} bs=512 count=${NBLKS}
+ vnconfig -v -c ${VND} ${IMAGE}
+ disklabel -w -r ${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}
+
+elfrdsetroot: ${TOP}/../common/elfrdsetroot.c
+ ${HOSTCC} -DDEBUG -o elfrdsetroot ${TOP}/../common/elfrdsetroot.c
+
+unconfig:
+ -umount -f ${MOUNT_POINT}
+ -vnconfig -u ${VND}
+
+.PRECIOUS: ${IMAGE}
+
+install:
+ cp ${FLOPPY} ${DESTDIR}/snapshot/
+
+${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CBIN}.conf
+ crunchgen -E -D ${.CURDIR}/../../.. -L ${DESTDIR}/usr/lib ${.ALLSRC}
+
+${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
+ make -f ${CBIN}.mk all
+
+do_files:
+ mtree -def ${MTREE} -p ${MOUNT_POINT}/ -u
+ TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \
+ REV=${REV} ARCHDIR=${.CURDIR}/.. TARGDIR=${MOUNT_POINT} \
+ sh ${TOP}/common/runlist.sh ${LISTS}
+
+clean cleandir:
+ /bin/rm -f core ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache \
+ *.o *.lo *.c bsd ${BSD_RD} bsd.gz ${FLOPPY} elfrdsetroot
+
+beforeinstall:
+ cp ${BSD.RD} ${DESTDIR}/snapshot
+
+.include <bsd.obj.mk>
+.include <bsd.subdir.mk>
diff --git a/distrib/sparc64/ramdiskB/instbin.conf b/distrib/sparc64/ramdiskB/instbin.conf
new file mode 100644
index 00000000000..52cb5f54b5f
--- /dev/null
+++ b/distrib/sparc64/ramdiskB/instbin.conf
@@ -0,0 +1,32 @@
+# $OpenBSD: instbin.conf,v 1.1 2001/10/10 04:21:02 deraadt Exp $
+#
+# instbin.conf - unified binary for the inst/upgr floppies
+#
+
+srcdirs distrib/special
+srcdirs gnu/usr.bin usr.bin bin sbin usr.sbin
+
+progs dd df mount sync restore
+progs stty ln disklabel pax ping cat ifconfig dmesg ls
+progs less grep umount fsck
+progs mknod route ftp mount_ffs reboot ed
+progs cp gzip chmod fsck_ffs init newfs
+progs rm mt mkdir sed ksh sleep
+progs mv expr test hostname
+
+ln mt eject
+ln chmod chgrp
+ln chmod chown
+ln pax tar
+ln pax cpio
+ln less more
+ln grep fgrep
+ln grep egrep
+ln reboot halt
+ln gzip gunzip
+ln gzip gzcat
+ln ksh sh
+ln ksh -sh
+ln test [
+
+libs -ledit -lutil -lcurses -ll -lm -lkvm -lz -lkrb -ldes
diff --git a/distrib/sparc64/ramdiskB/list b/distrib/sparc64/ramdiskB/list
new file mode 100644
index 00000000000..e32b5f89fae
--- /dev/null
+++ b/distrib/sparc64/ramdiskB/list
@@ -0,0 +1,84 @@
+# $OpenBSD: list,v 1.1 2001/10/10 04:21:02 deraadt 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 bin/eject
+LINK instbin bin/mv
+LINK instbin bin/pax bin/tar bin/cpio
+LINK instbin bin/rm
+LINK instbin bin/ksh bin/sh
+ARGVLINK ksh -sh
+LINK instbin bin/sleep
+LINK instbin bin/stty
+LINK instbin bin/sync
+LINK instbin bin/test bin/[
+LINK instbin sbin/disklabel
+LINK instbin sbin/fsck
+LINK instbin sbin/fsck_ffs
+LINK instbin sbin/reboot sbin/halt
+LINK instbin sbin/ifconfig
+LINK instbin sbin/init
+LINK instbin sbin/dmesg
+LINK instbin sbin/mknod
+LINK instbin sbin/mount
+#LINK instbin sbin/mount_cd9660
+LINK instbin sbin/mount_ffs
+LINK instbin sbin/newfs
+LINK instbin sbin/ping
+LINK instbin sbin/restore
+LINK instbin sbin/route
+LINK instbin sbin/scsi
+LINK instbin sbin/umount
+LINK instbin usr/bin/grep usr/bin/fgrep usr/bin/egrep
+#LINK instbin usr/bin/mg
+LINK instbin usr/bin/ftp
+LINK instbin usr/bin/gzip usr/bin/gunzip usr/bin/gzcat
+LINK instbin usr/bin/less usr/bin/more
+#LINK instbin usr/bin/rsh
+LINK instbin usr/bin/sed
+LINK instbin usr/bin/sort
+
+# copy the MAKEDEV script and make some devices
+COPY ${DESTDIR}/dev/MAKEDEV dev/MAKEDEV
+SPECIAL echo "cd dev; sh MAKEDEV ramdisk; rm MAKEDEV"
+SPECIAL cd dev; sh MAKEDEV ramdisk; rm MAKEDEV
+
+# we need the contents of /usr/mdec
+#COPY ${DESTDIR}/usr/mdec/installboot usr/mdec/installboot
+#COPY ${DESTDIR}/usr/mdec/ofwboot usr/mdec/ofwboot
+#COPY ${DESTDIR}/usr/mdec/bootblk usr/mdec/bootblk
+
+# various files that we need in /etc for the install
+COPY ${DESTDIR}/etc/group etc/group
+COPY ${DESTDIR}/etc/protocols etc/protocols
+COPY ${DESTDIR}/etc/services etc/services
+COPY ${DESTDIR}/etc/spwd.db etc/spwd.db
+COPY ${DESTDIR}/etc/disktab etc/disktab
+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
+
+# and the common installation tools
+COPY ${TOPDIR}/common/termcap.vt usr/share/misc/termcap
+
+# and the installation tools
+SPECIAL sed -e '/^[ ]*#[ ].*$/d' -e '/^[ ]*#$/d' < ${CURDIR}/../common/dot.profile > .profile
+SPECIAL sed -e '/^[ ]*#[ ].*$/d' -e '/^[ ]*#$/d' -e "s/^ARCH=ARCH$/ARCH=`arch -s`/" < ${CURDIR}/../common/install.md > install.md
+SPECIAL sed -e '/^[ ]*#[ ].*$/d' -e '/^[ ]*#$/d' < ${CURDIR}/../../miniroot/install.sh > install
+SPECIAL sed -e '/^[ ]*#[ ].*$/d' -e '/^[ ]*#$/d' -e "/^VERSION=/s/=.*/=${REV}/" < ${CURDIR}/../../miniroot/install.sub > install.sub
+SPECIAL chmod 755 install
diff --git a/distrib/sparc64/ramdiskB/mtree.conf b/distrib/sparc64/ramdiskB/mtree.conf
new file mode 100644
index 00000000000..c619ef1e898
--- /dev/null
+++ b/distrib/sparc64/ramdiskB/mtree.conf
@@ -0,0 +1,90 @@
+# $OpenBSD: mtree.conf,v 1.1 2001/10/10 04:21:02 deraadt Exp $
+
+/set type=dir uname=root gname=wheel mode=0755
+# .
+.
+
+# ./bin
+bin
+# ./bin
+..
+
+# ./dev
+dev
+# ./dev
+..
+
+# ./etc
+etc
+
+# ./etc
+..
+
+# ./mnt
+mnt
+# ./mnt
+..
+
+# ./mnt2
+mnt2
+# ./mnt2
+..
+
+# ./sbin
+sbin
+# ./sbin
+..
+
+# ./tmp
+tmp mode=01777
+# ./tmp
+..
+
+# ./usr
+usr
+
+# ./usr/bin
+bin
+# ./usr/bin
+..
+
+# ./usr/mdec
+mdec
+# ./usr/mdec
+..
+
+# ./usr/sbin
+sbin
+# ./usr/sbin
+..
+
+# ./usr/share
+share
+
+# ./usr/share/misc
+misc
+# ./usr/share/misc
+..
+
+# ./usr/share
+..
+
+# ./usr
+..
+
+# ./var
+var
+
+# ./var/tmp
+tmp mode=0177
+
+# ./var/tmp
+..
+
+# ./var/db
+db
+# ./var/db
+..
+
+# ./var
+..