diff --git a/distrib/pmax/ramdisk/Makefile b/distrib/pmax/ramdisk/Makefile new file mode 100644 index 000000000000..29389dd62ac8 --- /dev/null +++ b/distrib/pmax/ramdisk/Makefile @@ -0,0 +1,58 @@ +# $NetBSD: Makefile,v 1.1 1998/11/27 23:10:28 jonathan Exp $ + +TOP?= ${.CURDIR}/.. +ARCHDIR?= ${.CURDIR}/../../${MACHINE}/miniroot + +.include "${TOP}/Makefile.inc" +IMAGE= ramdisk.fs + +CBIN= ramdiskbin +#CSIZE?= 6144 +CSIZE?= 4096 +MOUNT_POINT?= /mnt +# DEV/RDEV file system device, CDEV/RDEV vnconfig device +VND?= vnd0 +VND_DEV= /dev/${VND}a +VND_RDEV= /dev/r${VND}a +VND_CDEV= /dev/${VND}c +VND_CRDEV= /dev/r${VND}c +IMAGE?= xxx.fs +MDEC= ${DESTDIR}/usr/mdec + +LISTS= list +CRUNCHCONF= ${CBIN}.conf +MTREE= mtree.conf + +all: ${CBIN} + dd if=/dev/zero of=${IMAGE} count=${CSIZE} + vnconfig -v -c ${VND_CDEV} ${IMAGE} +# disklabel -rw ${VND_CDEV} ${DISKTYPE} + -(disklabel ${VND_CDEV} > /tmp/proto; disklabel -R -r ${VND_CDEV} /tmp/proto) + -newfs -m 0 -o space -i 5120 ${VND_RDEV} + mount ${VND_DEV} ${MOUNT_POINT} + mtree -def ${.CURDIR}/${MTREE} -p ${MOUNT_POINT}/ -u + TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} ARCHDIR=${ARCHDIR} \ + TARGDIR=${MOUNT_POINT} sh ${TOP}/src/runlist.sh ${.CURDIR}/${LISTS} + @echo "" + @df -i ${MOUNT_POINT} + @echo "" + umount ${MOUNT_POINT} + vnconfig -u ${VND_CDEV} + +unconfig: + -umount -f ${MOUNT_POINT} + -vnconfig -u ${VND_DEV} + -/bin/rm -f ${IMAGE} + +${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF} + crunchgen -D ${TOP}/../.. -L ${DESTDIR}/usr/lib ${.ALLSRC} + +${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c + make -f ${CBIN}.mk all + +clean cleandir distclean: + /bin/rm -f *.core ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache *.o *.lo *.c + +.include +.include +.include diff --git a/distrib/pmax/ramdisk/disktab.preinstall b/distrib/pmax/ramdisk/disktab.preinstall new file mode 100644 index 000000000000..5ae2558f632e --- /dev/null +++ b/distrib/pmax/ramdisk/disktab.preinstall @@ -0,0 +1,31 @@ +# $NetBSD: disktab.preinstall,v 1.1 1998/11/27 23:10:28 jonathan Exp $ +# +# Disk geometry and partition layout tables. +# Key: +# dt controller type +# ty type of disk (fixed, removeable, simulated) +# d[0-4] drive-type-dependent parameters +# ns #sectors/track +# nt #tracks/cylinder +# nc #cylinders/disk +# sc #sectors/cylinder, nc*nt default +# su #sectors/unit, sc*nc default +# se sector size, DEV_BSIZE default +# rm rpm, 3600 default +# sf supports bad144-style bad sector forwarding +# sk sector skew per track, default 0 +# cs sector skew per cylinder, default 0 +# hs headswitch time, default 0 +# ts one-cylinder seek time, default 0 +# il sector interleave (n:1), 1 default +# bs boot block size, default BBSIZE +# sb superblock size, default SBSIZE +# o[a-h] partition offsets in sectors +# p[a-h] partition sizes in sectors +# b[a-h] partition block sizes in bytes +# f[a-h] partition fragment sizes in bytes +# t[a-h] partition types (filesystem, swap, etc) +# +# All partition sizes reserve space for bad sector tables. +# (5 cylinders needed for maintenance + replacement sectors) +# diff --git a/distrib/pmax/ramdisk/dot.hdprofile b/distrib/pmax/ramdisk/dot.hdprofile new file mode 100644 index 000000000000..67b9888cfd14 --- /dev/null +++ b/distrib/pmax/ramdisk/dot.hdprofile @@ -0,0 +1,58 @@ +# $NetBSD: dot.hdprofile,v 1.1 1998/11/27 23:10:28 jonathan Exp $ +# +# Copyright (c) 1994 Christopher G. Demetriou +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by Christopher G. Demetriou. +# 4. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +PATH=/sbin:/bin:/usr/bin:/usr/sbin:/ +export PATH +TERM=pc3 +export TERM +HOME=/ +export HOME + +umask 022 + +if [ "X${DONEPROFILE}" = "X" ]; then + DONEPROFILE=YES + + echo "Checking filesystems..." + fsck -y + + echo "Mounting root..." + mount -u / + + # set up some sane defaults + echo 'erase ^?, werase ^W, kill ^U, intr ^C' + stty newcrt werase ^W intr ^C kill ^U erase ^? 9600 + echo '' + + TERMCAP=/.termcap ; export TERMCAP + + [ -x /sysinst ] && /sysinst +fi diff --git a/distrib/pmax/ramdisk/dot.profile b/distrib/pmax/ramdisk/dot.profile new file mode 100644 index 000000000000..c6d34eafcb20 --- /dev/null +++ b/distrib/pmax/ramdisk/dot.profile @@ -0,0 +1,66 @@ +# $NetBSD: dot.profile,v 1.1 1998/11/27 23:10:28 jonathan Exp $ +# +# Copyright (c) 1994 Christopher G. Demetriou +# Copyright (c) 1997 Perry E. Metzger +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by Christopher G. Demetriou. +# 4. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +PATH=/sbin:/bin:/usr/bin:/usr/sbin:/ +export PATH +TERM=sun +export TERM +HOME=/ +export HOME + +umask 022 + +ROOTDEV=/dev/md0a + +if [ "X${DONEPROFILE}" = "X" ]; then + DONEPROFILE=YES + + # get the terminal type + eval `tset -s -m ":?$TERM"` + + # set up some sane defaults + echo 'erase ^?, werase ^W, kill ^U, intr ^C' + stty newcrt werase ^W intr ^C kill ^U erase ^? 9600 + echo '' + + # run update, so that installed software is written as it goes. + update + + # mount the ramdisk read write + mount -u $ROOTDEV / + + # mount the kern_fs so that we can examine the dmesg state + mount -t kernfs /kern /kern + + # run the installation program + sysinst +fi diff --git a/distrib/pmax/ramdisk/list b/distrib/pmax/ramdisk/list new file mode 100644 index 000000000000..ac8ae21e4fab --- /dev/null +++ b/distrib/pmax/ramdisk/list @@ -0,0 +1,94 @@ +# $NetBSD: list,v 1.1 1998/11/27 23:10:29 jonathan Exp $ + +# copy the crunched binary, link to it, and kill it +COPY ${OBJDIR}/ramdiskbin ramdiskbin +LINK ramdiskbin sysinst +LINK ramdiskbin bin/cat +LINK ramdiskbin bin/chmod +LINK ramdiskbin bin/cp +LINK ramdiskbin bin/dd +LINK ramdiskbin bin/df +LINK ramdiskbin bin/ed +LINK ramdiskbin bin/ln +LINK ramdiskbin bin/ls +LINK ramdiskbin bin/mkdir +LINK ramdiskbin bin/mt +LINK ramdiskbin bin/mv +LINK ramdiskbin bin/pwd +LINK ramdiskbin bin/rm +LINK ramdiskbin bin/sh +LINK ramdiskbin bin/stty +LINK ramdiskbin bin/sync +LINK ramdiskbin bin/test +LINK ramdiskbin bin/[ +LINK ramdiskbin sbin/disklabel +LINK ramdiskbin sbin/fsck +LINK ramdiskbin sbin/fsck_ffs +LINK ramdiskbin sbin/halt +LINK ramdiskbin sbin/ifconfig +LINK ramdiskbin sbin/init +LINK ramdiskbin sbin/mknod +LINK ramdiskbin sbin/mount +LINK ramdiskbin sbin/mount_cd9660 +LINK ramdiskbin sbin/mount_ffs +LINK ramdiskbin sbin/mount_msdos +LINK ramdiskbin sbin/mount_nfs +LINK ramdiskbin sbin/mount_kernfs +LINK ramdiskbin sbin/newfs +LINK ramdiskbin sbin/ping +LINK ramdiskbin sbin/reboot +LINK ramdiskbin sbin/restore +LINK ramdiskbin sbin/route +LINK ramdiskbin sbin/rrestore +LINK ramdiskbin sbin/shutdown +LINK ramdiskbin sbin/slattach +LINK ramdiskbin sbin/umount +SYMLINK /bin/cat usr/bin/chgrp +SYMLINK /bin/cat usr/bin/ftp +SYMLINK /bin/cat usr/bin/gunzip +SYMLINK /bin/cat usr/bin/gzcat +SYMLINK /bin/cat usr/bin/gzip +SYMLINK /bin/cat usr/bin/more +SYMLINK /bin/cat usr/bin/sed +SYMLINK /bin/cat usr/bin/strings +SYMLINK /bin/cat usr/bin/tar +SYMLINK /bin/cat usr/bin/tip +SYMLINK /bin/cat usr/bin/tset +SYMLINK /bin/cat usr/mdec/installboot +SYMLINK /bin/cat usr/sbin/bad144 +SYMLINK /bin/cat usr/sbin/chown +SYMLINK /bin/cat usr/sbin/chroot +SYMLINK /bin/cat usr/sbin/update +SPECIAL /bin/rm ramdiskbin + +# copy the MAKEDEV script and make some devices +COPY ${CURDIR}/../../../etc/etc.pmax/MAKEDEV dev/MAKEDEV +#SPECIAL cd dev; sh MAKEDEV minimal +SPECIAL cd dev; sh MAKEDEV minimal +SPECIAL /bin/rm dev/MAKEDEV + +# we need the boot blocks /usr/mdec +COPY ${DESTDIR}/usr/mdec/rzboot usr/mdec/rzboot +COPY ${DESTDIR}/usr/mdec/bootrz usr/mdec/bootrz + +# various files that we need in /etc for the install +COPY ${CURDIR}/../../../etc/group etc/group +COPY ${CURDIR}/../../../etc/master.passwd etc/master.passwd +COPY ${CURDIR}/../../../etc/protocols etc/protocols +COPY ${CURDIR}/../../../etc/services etc/services +SPECIAL pwd_mkdb -p -d ./ etc/master.passwd + +# and the common installation tools +COPY ${ARCHDIR}/termcap.rcons usr/share/misc/termcap + +# the disktab explanation file +COPY disktab.preinstall etc/disktab.preinstall + +# and the installation tools +COPY dot.profile .profile +COPY dot.hdprofile tmp/.hdprofile + + +# someday put in the release notes too +# +#COPY ${CURDIR}/../../notes/pmax/INSTALL.txt INSTALL.txt diff --git a/distrib/pmax/ramdisk/mtree.conf b/distrib/pmax/ramdisk/mtree.conf new file mode 100644 index 000000000000..182c5d9b4998 --- /dev/null +++ b/distrib/pmax/ramdisk/mtree.conf @@ -0,0 +1,77 @@ +# $NetBSD: mtree.conf,v 1.1 1998/11/27 23:10:29 jonathan 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 +.. + +# ./kern +kern +# ./kern +.. + +# ./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 +.. diff --git a/distrib/pmax/ramdisk/ramdiskbin.conf b/distrib/pmax/ramdisk/ramdiskbin.conf new file mode 100644 index 000000000000..16d91e32c988 --- /dev/null +++ b/distrib/pmax/ramdisk/ramdiskbin.conf @@ -0,0 +1,32 @@ +# $NetBSD: ramdiskbin.conf,v 1.1 1998/11/27 23:10:29 jonathan Exp $ +# +# ramdiskbin.conf - unified binary for the install ramdisk +# + +srcdirs bin sbin usr.bin usr.sbin gnu/usr.bin sys/arch/pmax/stand +#srcdirs usr.bin/less + +progs cat chmod chown chroot cp dd df disklabel ed +progs fsck fsck_ffs ftp gzip ifconfig init #less +progs ln ls mkdir mknod mount mount_cd9660 mount_ffs mount_msdos +progs mount_nfs mount_kernfs mt mv newfs ping pwd reboot rm +progs route sed sh shutdown slattach stty sync tar test +progs tip tset umount update +progs sysinst + +special sysinst srcdir distrib/utils/sysinst/arch/pmax +special init srcdir distrib/utils/init_s + +ln chown chgrp +ln gzip gzcat gunzip +#ln less more +ln sh -sh # init invokes the shell this way +ln test [ +ln mount_cd9660 cd9660 +ln mount_ffs ffs +ln mount_msdos msdos +ln mount_nfs nfs +ln mount_kernfs kernfs +ln reboot halt + +libs -ledit -lutil -lcurses -ltermcap -lrmt -lcrypt -ll -lm diff --git a/distrib/pmax/src/list2sh.awk b/distrib/pmax/src/list2sh.awk new file mode 100644 index 000000000000..d85eb54b6172 --- /dev/null +++ b/distrib/pmax/src/list2sh.awk @@ -0,0 +1,55 @@ +# $NetBSD: list2sh.awk,v 1.1 1998/11/27 23:10:29 jonathan Exp $ + +BEGIN { + printf("cd ${CURDIR}\n"); + printf("\n"); +} +/^$/ || /^#/ { + print $0; + next; +} +$1 == "COPY" { + printf("echo '%s'\n", $0); + printf("rm -f ${TARGDIR}/%s\n", $3); + printf("cp %s ${TARGDIR}/%s\n", $2, $3); + next; +} +$1 == "LINK" { + printf("echo '%s'\n", $0); + printf("rm -f ${TARGDIR}/%s\n", $3); + printf("(cd ${TARGDIR}; ln %s %s)\n", $2, $3); + next; +} +$1 == "SYMLINK" { + printf("echo '%s'\n", $0); + printf("rm -f ${TARGDIR}/%s\n", $3); + printf("(cd ${TARGDIR}; ln -s %s %s)\n", $2, $3); + next; +} +$1 == "COPYDIR" { + printf("echo '%s'\n", $0); + printf("(cd ${TARGDIR}/%s && find . ! -name . | xargs /bin/rm -rf)\n", + $3); + printf("(cd %s && find . ! -name . | cpio -pdamu ${TARGDIR}/%s)\n", $2, + $3); + next; +} +$1 == "SPECIAL" { + printf("echo '%s'\n", $0); + printf("(cd ${TARGDIR};"); + for (i = 2; i <= NF; i++) + printf(" %s", $i); + printf(")\n"); + next; +} +{ + printf("echo '%s'\n", $0); + printf("echo 'Unknown keyword \"%s\" at line %d of input.'\n", $1, NR); + printf("exit 1\n"); + exit 1; +} +END { + printf("\n"); + printf("exit 0\n"); + exit 0; +} diff --git a/distrib/pmax/src/runlist.sh b/distrib/pmax/src/runlist.sh new file mode 100644 index 000000000000..d20a4c339707 --- /dev/null +++ b/distrib/pmax/src/runlist.sh @@ -0,0 +1,13 @@ +# $NetBSD: runlist.sh,v 1.1 1998/11/27 23:10:29 jonathan Exp $ + +if [ "X$1" = "X-d" ]; then + SHELLCMD=cat + shift +else + SHELLCMD="sh -e" +fi + +( while [ "X$1" != "X" ]; do + cat $1 + shift +done ) | awk -f ${TOPDIR}/src/list2sh.awk | ${SHELLCMD}