convert to NDWO, a la sun2.

XXX:	untested.
	also needs sun3 converted to sun68k/stand/bootxx so that
	the ${INSTALLBOOT} in miniroot can be enabled.

XXX^2:	sun2 & sun3 should share distrib dirs since they're extremely similar...
This commit is contained in:
lukem 2002-05-17 17:52:29 +00:00
parent b4c170fd08
commit 91db817d71
41 changed files with 386 additions and 1253 deletions

View File

@ -1,16 +1,22 @@
# $NetBSD: Makefile,v 1.6 2002/05/02 18:02:58 lukem Exp $
# $NetBSD: Makefile,v 1.7 2002/05/17 17:52:29 lukem Exp $
SUBDIR= ramdisk miniroot
TARGETS+= release
.include <bsd.own.mk>
.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
release: check_RELEASEDIR .WAIT \
${DESTDIR}/usr/mdec/netboot ${DESTDIR}/usr/mdec/tapeboot \
MakeBootTape MakeInstTape
${RELEASE_INSTALL} ${DESTDIR}/usr/mdec/netboot \
${RELEASE_INSTALL} \
${DESTDIR}/usr/mdec/netboot \
${RELEASEDIR}/installation/netboot
${RELEASE_INSTALL} ${DESTDIR}/usr/mdec/tapeboot \
${RELEASE_INSTALL} \
${DESTDIR}/usr/mdec/tapeboot \
${RELEASEDIR}/installation/tapeimage
${RELEASE_INSTALL} ${.CURDIR}/MakeBootTape ${.CURDIR}/MakeInstTape \
${RELEASE_INSTALL} \
${.CURDIR}/MakeBootTape ${.CURDIR}/MakeInstTape \
${RELEASEDIR}/installation/tapeimage
.include <bsd.subdir.mk>

View File

@ -1,9 +0,0 @@
# $NetBSD: Makefile.inc,v 1.11 2002/04/26 15:50:48 lukem Exp $
.include "../../Makefile.inc"
LDSTATIC= -static # only static compilation makes sense here
# Where to find kernel images...
.include <bsd.kernobj.mk>
SRCSYSDIR?= ${NETBSDSRCDIR}/sys

View File

@ -1,23 +0,0 @@
# $NetBSD: Make.crunch,v 1.7 2002/04/26 15:50:48 lukem Exp $
#
# This is included by subdirectories building a crunched binary.
# Assume the following are already defined: TOP, CBIN
CBIN?= xxx-crunched
CRUNCHCONF= ${TOP}/common/${CBIN}.conf
CRUNCHGEN?= crunchgen
STRIP?= strip
CLEANFILES+= ${CBIN} ${CBIN}.c ${CBIN}.cache ${CBIN}.mk ${CBIN}.syms
CLEANFILES+= *.lo *_stub.o *_stub.c
# Keep a copy that is not stripped so I can debug...
${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
-rm -f ${CBIN}
${MAKE} -f ${CBIN}.mk all STRIP=true
cp -p ${CBIN} ${CBIN}.syms
${STRIP} ${CBIN}
${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
${CRUNCHGEN} -D ${NETBSDSRCDIR} -L ${DESTDIR}/usr/lib ${CRUNCHCONF}

View File

@ -1,42 +0,0 @@
#
# $NetBSD: Make.fsimage,v 1.6 2002/03/06 12:15:19 lukem Exp $
#
# TOP is assumed to be defined by Makefile including this one.
# These will be defined by it too:
IMAGE?= xxx-${DISTRIBREV}
CBIN?= xxx-crunched
TREE?= ${.CURDIR}/${CBIN}.tree
LISTS?= ${.CURDIR}/${CBIN}.list
MOUNT_POINT?= /mnt
DISKTYPE?= xxx-disktype
BDEV?= /dev/md0a
CDEV?= /dev/md0a
IMAGE_DEPS?= ${CBIN}
CLEANFILES+= ${IMAGE}.fs
# These are all the parameters for the root fs:
NBLKS?= 512
# args: old fmt, minfree, opt, ...
NEWFSARGS?= -O -m 0 -o space
do_mount:
-newfs -B be ${NEWFSARGS} -s ${NBLKS} ${CDEV} ${DISKTYPE}
mount ${BDEV} ${MOUNT_POINT}
do_files:
mtree -def ${TREE} -p ${MOUNT_POINT}/ -u
TOPDIR=${TOP} CURDIR=${.CURDIR} \
OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \
sh ${TOP}/common/RunList.sh ${LISTS}
do_umount:
@echo ""
@df -i ${MOUNT_POINT}
@echo ""
-umount ${MOUNT_POINT}

View File

@ -1,11 +0,0 @@
#
# $NetBSD: Make.static,v 1.1 1995/11/21 21:18:51 gwr Exp $
#
# This is logically appended to some other makefile, i.e.
# using: make -f Makefile -f $(OUTDIR)/Make.static ...
STRIP_CMD=strip
${OUTDIR}/${PROG} : ${OBJS} ${LIBC} ${DPADD}
${CC} -static ${LDFLAGS} -o ${OUTDIR}/${PROG} ${OBJS} ${LDADD}
${STRIP_CMD} ${OUTDIR}/${PROG}

View File

@ -1,44 +0,0 @@
# $NetBSD: RunList.awk,v 1.2 1996/10/09 00:13:36 jtc Exp $
BEGIN {
printf("cd ${CURDIR}\n");
printf("\n");
}
/^$/ || /^#/ {
print $0;
next;
}
$1 == "COPY" {
printf("echo '%s'\n", $0);
printf("cp %s ${TARGDIR}/%s\n", $2, $3);
next;
}
$1 == "LINK" {
printf("echo '%s'\n", $0);
printf("(cd ${TARGDIR}; ln %s %s)\n", $2, $3);
next;
}
$1 == "SYMLINK" {
printf("echo '%s'\n", $0);
printf("(cd ${TARGDIR}; rm -f %s; ln -s %s %s)\n", $3, $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;
}

View File

@ -1,14 +0,0 @@
#!/bin/sh
# $NetBSD: RunList.sh,v 1.1.1.1 1995/10/08 23:07:47 gwr Exp $
if [ "X$1" = "X-d" ]; then
SHELLCMD=cat
shift
else
SHELLCMD="sh -e"
fi
cat "$@" |
awk -f ${TOPDIR}/common/RunList.awk |
${SHELLCMD}

View File

@ -1,38 +0,0 @@
#
# $NetBSD: mini_bin.list,v 1.5 1999/05/16 08:21:53 gwr Exp $
#
# miniroot files from /bin:
# Extras not in ../../miniroot/list:
# date ps rmdir
COPY ${DESTDIR}/bin/cat bin
COPY ${DESTDIR}/bin/chmod bin
COPY ${DESTDIR}/bin/cp bin
COPY ${DESTDIR}/bin/date bin
COPY ${DESTDIR}/bin/dd bin
COPY ${DESTDIR}/bin/df bin
COPY ${DESTDIR}/bin/ed bin
COPY ${DESTDIR}/bin/expr bin
COPY ${DESTDIR}/bin/hostname bin
COPY ${DESTDIR}/bin/kill bin
COPY ${DESTDIR}/bin/ln bin
COPY ${DESTDIR}/bin/ls bin
COPY ${DESTDIR}/bin/mkdir bin
COPY ${DESTDIR}/bin/mt bin
COPY ${DESTDIR}/bin/mv bin
COPY ${DESTDIR}/bin/pax bin
COPY ${DESTDIR}/bin/ps bin
COPY ${DESTDIR}/bin/pwd bin
COPY ${DESTDIR}/bin/rm bin
COPY ${DESTDIR}/bin/rmdir bin
COPY ${DESTDIR}/bin/sh bin
COPY ${DESTDIR}/bin/sleep bin
COPY ${DESTDIR}/bin/stty bin
COPY ${DESTDIR}/bin/sync bin
COPY ${DESTDIR}/bin/test bin
LINK bin/test bin/[
# new, combined pax,tar,cpio
LINK bin/pax usr/bin/tar

View File

@ -1,38 +0,0 @@
#
# $NetBSD: mini_sbin.list,v 1.5 2000/06/10 02:57:25 tsutsui Exp $
#
# miniroot files from /sbin:
# Extras not in ../../miniroot/list:
# disklabel dmesg edlabel mount_kernfs restore
COPY ${DESTDIR}/sbin/dmesg sbin
COPY ${DESTDIR}/sbin/edlabel sbin
COPY ${DESTDIR}/sbin/fsck sbin
COPY ${DESTDIR}/sbin/fsck_ffs sbin
COPY ${DESTDIR}/sbin/ifconfig sbin
COPY ${DESTDIR}/sbin/init sbin
COPY ${DESTDIR}/sbin/mknod sbin
COPY ${DESTDIR}/sbin/mount sbin
COPY ${DESTDIR}/sbin/mount_cd9660 sbin
COPY ${DESTDIR}/sbin/mount_ffs sbin
COPY ${DESTDIR}/sbin/mount_kernfs sbin
COPY ${DESTDIR}/sbin/mount_nfs sbin
COPY ${DESTDIR}/sbin/newfs sbin
COPY ${DESTDIR}/sbin/ping sbin
COPY ${DESTDIR}/sbin/reboot sbin
LINK sbin/reboot sbin/halt
COPY ${DESTDIR}/sbin/restore sbin
LINK sbin/restore sbin/rrestore
COPY ${DESTDIR}/sbin/route sbin
COPY ${DESTDIR}/sbin/shutdown sbin
COPY ${DESTDIR}/sbin/slattach sbin
COPY ${DESTDIR}/sbin/swapctl sbin
COPY ${DESTDIR}/sbin/sysctl sbin
COPY ${DESTDIR}/sbin/umount sbin

View File

@ -1,51 +0,0 @@
#
# $NetBSD: mini_usr.list,v 1.14 2001/10/02 06:43:15 chs Exp $
#
# miniroot files from /usr:
# Shared library stuff...
# libcurses: vi
# libedit: ftp
# libtermcap: ftp, less, vi
# libutil: rdate
SPECIAL cd usr; ln -s lib libexec
COPY ${DESTDIR}/usr/libexec/ld.elf_so usr/lib
COPY ${DESTDIR}/usr/lib/libc.so usr/lib
LINK usr/lib/libc.so usr/lib/libc.so.12
COPY ${DESTDIR}/usr/lib/libcurses.so usr/lib
LINK usr/lib/libcurses.so usr/lib/libcurses.so.4
COPY ${DESTDIR}/usr/lib/libedit.so usr/lib
LINK usr/lib/libedit.so usr/lib/libedit.so.2
COPY ${DESTDIR}/usr/lib/libtermcap.so usr/lib
LINK usr/lib/libtermcap.so usr/lib/libtermcap.so.0
COPY ${DESTDIR}/usr/lib/libutil.so usr/lib
LINK usr/lib/libutil.so usr/lib/libutil.so.6
# usr.sbin:
COPY ${DESTDIR}/usr/sbin/chown usr/sbin
COPY ${DESTDIR}/usr/sbin/eeprom usr/sbin
COPY ${DESTDIR}/usr/sbin/rdate usr/sbin
# usr.bin:
LINK usr/sbin/chown usr/bin/chgrp
COPY ${DESTDIR}/usr/bin/chflags usr/bin
COPY ${DESTDIR}/usr/bin/cksum usr/bin
COPY ${DESTDIR}/usr/bin/cmp usr/bin
COPY ${DESTDIR}/usr/bin/ftp usr/bin
COPY ${DESTDIR}/usr/bin/less usr/bin
LINK usr/bin/less usr/bin/more
COPY ${DESTDIR}/usr/bin/rsh usr/bin
COPY ${DESTDIR}/usr/bin/sed usr/bin
COPY ${DESTDIR}/usr/bin/tip usr/bin
COPY ${DESTDIR}/usr/bin/vi usr/bin
# gnu/usr.bin:
COPY ${DESTDIR}/usr/bin/gzip usr/bin
LINK usr/bin/gzip usr/bin/gunzip
LINK usr/bin/gzip usr/bin/gzcat
# install.md still uses sort
COPY ${DESTDIR}/usr/bin/sort usr/bin

View File

@ -1,51 +0,0 @@
#
# $NetBSD: miniroot.list,v 1.6 2000/06/19 14:55:20 tsutsui Exp $
#
# These are scripts:
COPY ${DESTDIR}/usr/bin/false bin
COPY ${DESTDIR}/usr/bin/true bin
# From usr/mdec:
COPY ${DESTDIR}/usr/mdec/bootxx usr/mdec
COPY ${DESTDIR}/usr/mdec/installboot usr/mdec
COPY ${DESTDIR}/usr/mdec/netboot usr/mdec
COPY ${DESTDIR}/usr/mdec/tapeboot usr/mdec
COPY ${DESTDIR}/usr/mdec/ufsboot usr/mdec
LINK usr/mdec/ufsboot ufsboot
# various files that we need in /etc for the install
COPY ${DESTDIR}/etc/group etc
COPY ${DESTDIR}/etc/master.passwd etc
COPY ${DESTDIR}/etc/netconfig etc
COPY ${DESTDIR}/etc/passwd etc
COPY ${DESTDIR}/etc/protocols etc
COPY ${DESTDIR}/etc/pwd.db etc
COPY ${DESTDIR}/etc/services etc
COPY ${DESTDIR}/etc/spwd.db etc
# some /etc files get special handling (for MFS /tmp yuck)
COPY ${DESTDIR}/etc/disktab etc/disktab.shadow
SYMLINK /tmp/disktab.shadow etc/disktab
COPY ${TOPDIR}/common/mr.fstab tmp/fstab.shadow
SYMLINK /tmp/fstab.shadow etc/fstab
SYMLINK /tmp/resolv.conf.shadow etc/resolv.conf
SYMLINK /tmp/hosts etc/hosts
# copy the MAKEDEV script and make some devices
COPY ${DESTDIR}/dev/MAKEDEV dev
COPY ${DESTDIR}/dev/MAKEDEV.local dev
SPECIAL cd dev; sh MAKEDEV std md0 cd0 st0 st1 sd0 sd1 sd2 xd0 xy0 fd0
# copy the miniroot installation tools
COPY ${TOPDIR}/common/mr.profile .profile
COPY ${TOPDIR}/common/mr.termcap usr/share/misc/termcap
COPY ${TOPDIR}/common/install.md install.md
COPY ${OBJDIR}/install.sub install.sub
SPECIAL chmod 644 install.md install.sub
COPY ${TOPDIR}/../miniroot/install.sh install
COPY ${TOPDIR}/../miniroot/upgrade.sh upgrade
SPECIAL chmod 755 install upgrade

View File

@ -1,106 +0,0 @@
#
# $NetBSD: miniroot.tree,v 1.4 1997/12/12 22:39:08 gwr Exp $
#
/set type=dir uname=root gname=wheel mode=0755
# .
.
# ./bin
bin
# ./bin
..
# ./dev
dev
# ./dev
..
# ./etc
etc
# ./etc
..
# ./kern
kern
# ./kern
..
# ./mnt
mnt
# ./mnt
..
# ./mnt2
mnt2
# ./mnt2
..
# ./proc
proc
# ./proc
..
# ./sbin
sbin
# ./sbin
..
# ./tmp
tmp
# ./tmp
..
# ./usr
usr
# ./usr/bin
bin
# ./usr/bin
..
# ./usr/lib
lib
# ./usr/lib
..
# ./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=01777
# ./var/tmp/vi.recover
vi.recover mode=01777
# ./var/tmp/vi.recover
..
# ./var/tmp
..
# ./var
..

View File

@ -1,5 +0,0 @@
#
# $NetBSD: mr.disktab,v 1.2 1999/05/18 07:40:51 gwr Exp $
#
# Disk geometry and partition layout tables.
# (empty on the miniroot)

View File

@ -1,9 +0,0 @@
#!/bin/sh
# $NetBSD: mr.etc.rc,v 1.2 1995/10/13 16:38:27 gwr Exp $
# This is run by /sbin/init as:
# /bin/sh /etc/rc
# Just force init to go single-user...
echo "/etc/rc: miniroot forces single-user mode..."
exit 1

View File

@ -1,26 +0,0 @@
# $NetBSD: ramdisk.list,v 1.7 2000/06/19 14:55:20 tsutsui Exp $
# various files that we need in /etc for the install
COPY ${TOPDIR}/common/rd.disktab etc/disktab
COPY ${TOPDIR}/common/rd.fstab etc/fstab
COPY ${TOPDIR}/common/rd.protocols etc/protocols
COPY ${TOPDIR}/common/rd.services etc/services
COPY ${TOPDIR}/common/rd.passwd etc/passwd
COPY ${TOPDIR}/common/rd.sshrc .sshrc
COPY ${TOPDIR}/common/rd.welcome .welcome
COPY ${DESTDIR}/etc/netconfig etc/netconfig
# Fake /usr
SPECIAL ln -s . usr
# Shell lacks pipe support, so use this.
SPECIAL mkfifo dev/pipe
# copy the MAKEDEV script and make some devices
# Using a hacked MAKEDEV to conserve inodes...
# No block devices, and only partitions a-d.
COPY ${TOPDIR}/common/rd.MAKEDEV dev/MAKEDEV
SPECIAL cd dev; sh MAKEDEV std md0 cd0 st0 st1 sd0 sd1 sd2 xd0 xy0 fd0
SPECIAL /bin/rm dev/MAKEDEV

View File

@ -1,39 +0,0 @@
#
# $NetBSD: ramdisk.tree,v 1.1.1.1 1995/10/08 23:07:48 gwr Exp $
#
/set type=dir uname=root gname=wheel mode=0755
# .
.
# ./bin
bin
# ./bin
..
# ./dev
dev
# ./dev
..
# ./etc
etc
# ./etc
..
# ./mnt
mnt
# ./mnt
..
# ./sbin
sbin
# ./sbin
..
# ./tmp
tmp
# ./tmp
..
# ./usr will be a link to root

View File

@ -1,267 +0,0 @@
#!/bin/sh -
#
# $NetBSD: rd.MAKEDEV,v 1.3 2000/06/10 04:04:45 tsutsui Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
# 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 the University of
# California, Berkeley and its contributors.
# 4. Neither the name of the University nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
#
# @(#)MAKEDEV 5.5 (Berkeley) 5/28/91
#
# Device "make" file. Valid arguments:
# std standard devices
# local configuration specific devices
# Tapes:
# st* SCSI tape
# Disks:
# sd* Sun SCSI disks
# fd* Floppies
# vnd* "file" pseudo-disks
# ccd* concatenated disk driver
# raid* RAIDframe disk driver
# md* memory pseudo-disk devices
# Pseudo terminals:
# pty* set of 16 master and slave pseudo terminals
# Special purpose devices:
# bwtwo* monochromatic frame buffer
# cgtwo* 8-bit VME bus color frame buffer
# cgfour* 8-bit color frame buffer
# bpf* packet filter
# lkm loadable kernel modules interface
# tun* network tunnel driver
# random Random number generator
# scsibus* SCSI busses, see scsictl(8), scsi(4)
# XXX - Keep /usr/etc so SunOS can find chown
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/etc
umask 77
# set this to echo for Echo-Only debugging
eo=
# mk name b/c major minor [mode] [group]
mk() {
$eo rm -f $1
$eo mknod $1 $2 $3 $4
$eo chmod ${5-666} $1
test -n "$6" && $eo chgrp $6 $1
return 0
}
for arg
do
unit=`expr $arg : '[a-z][a-z]*\([0-9][0-9]*\)'`
[ "$unit" ] || unit=0
case $arg in
all)
sh $0 std fd pty0
sh $0 bwtwo0 cgtwo0 cgfour0
sh $0 raid0 raid1 raid2 raid3
sh $0 sd0 sd1 sd2 sd3 sd4 sd5 sd6
sh $0 cd0 cd1 st0 st1 st2 fd0
sh $0 xd0 xd1 xd2 xd3
sh $0 xy0 xy1 xy2 xy3
sh $0 bpf0 bpf1 bpf2 bpf3 bpf4 bpf5 bpf6 bpf7
sh $0 tun0 tun1
sh $0 lkm random
sh $0 scsibus0 scsibus1 scsibus2 scsibus3
sh $0 local
;;
std)
mk console c 0 0 622
mk kd c 1 0 622
mk tty c 2 0
mk mem c 3 0 640 kmem
mk kmem c 3 1 640 kmem
mk null c 3 2
mk eeprom c 3 11 640 kmem
mk zero c 3 12
mk leds c 3 13
mk drum c 7 0 640 kmem
mk ttya c 12 0
mk ttyb c 12 1
mk mouse c 13 0
mk klog c 16 0 600
mk fb c 22 0
mk kbd c 29 0
mk stdin c 23 0
mk stdout c 23 1
mk stderr c 23 2
;;
fd)
rm -f fd/*
mkdir fd > /dev/null 2>&1
n=0
while [ $n -lt 64 ]; do
mk fd/$n c 23 $n 666
n=$(($n + 1))
done
chown -R root.wheel fd
chmod 755 fd
;;
bpf*)
mk bpf$unit c 36 $unit 600
;;
tun*)
mk tun$unit c 24 $unit 600
;;
pty*)
class=${arg#pty}
case $unit in
0) name=p;;
1) name=q;;
2) name=r;;
3) name=s;;
4) name=t;;
5) name=u;;
6) name=v;;
7) name=w;;
8) name=x;;
9) name=y;;
10) name=z;;
11) name=P;;
12) name=Q;;
13) name=R;;
14) name=S;;
15) name=T;;
*) echo "$0: $i: pty unit must be between 0 and 15"
continue ;;
esac
rm -f tty$name[0-9a-f] pty$name[0-9a-f]
for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f
do
case $j in
[0-9]) jn=$j ;;
a) jn=10 ;;
b) jn=11 ;;
c) jn=12 ;;
d) jn=13 ;;
e) jn=14 ;;
f) jn=15 ;;
esac
unit=$(($class * 16 + $jn))
mknod tty$name$j c 20 $unit
mknod pty$name$j c 21 $unit
done
chgrp wheel tty$name? pty$name?
chmod 666 tty$name? pty$name?
;;
ccd*|cd*|fd*|sd*|xd*|xy*|vnd*|raid*)
case $arg in
ccd*) name=ccd; blk=9; chr=33;;
cd*) name=cd; blk=18; chr=58;;
fd*) name=fd; blk=16; chr=54;;
raid*) name=raid; blk=25; chr=82;;
sd*) name=sd; blk=7; chr=17;;
xd*) name=xd; blk=10; chr=42;;
xy*) name=xy; blk=3; chr=9 ;;
vnd*) name=vnd; blk=5; chr=19;;
esac
case $unit in
[0-7]) offset=$(($unit * 8));;
*) echo bad unit for $name in: $arg;;
esac
for part in a.0 b.1 c.2 d.3 # e.4 f.5 g.6 h.7
do
(
tmp="$IFS" ; IFS="$IFS."
set -- $part
IFS="$tmp" ; unset tmp
minor=$(($offset + $2))
# mk $name$unit$1 b $blk $minor 640 operator
mk r$name$unit$1 c $chr $minor 640 operator
)
done
;;
st*)
name=st; blk=11; chr=18;
mk r$name$unit c $chr $(($unit * 16 + 0)) 660 operator
mk nr$name$unit c $chr $(($unit * 16 + 1)) 660 operator
mk er$name$unit c $chr $(($unit * 16 + 2)) 660 operator
mk enr$name$unit c $chr $(($unit * 16 + 3)) 660 operator
;;
bwtwo*)
mk bwtwo$unit c 27 $unit
;;
cgtwo*)
mk cgtwo$unit c 31 $unit
;;
cgfour*)
mk cgfour$unit c 39 $unit
;;
md*)
name=md; blk=13; chr=52;
mk md${unit}a b $blk $(($unit * 8 + 0)) 640 operator
mk md${unit}c b $blk $(($unit * 8 + 2)) 640 operator
# mk rmd${unit}a c $chr $(($unit * 8 + 0)) 640 operator
# mk rmd${unit}c c $chr $(($unit * 8 + 2)) 640 operator
;;
lkm)
mk lkm c 72 0 640 kmem
;;
random)
mk random c 80 0 444
mk urandom c 80 1
;;
scsibus*)
mk scsibus${unit} c 81 $unit 644 wheel
;;
local)
umask 0
sh $0.local all
umask 77
;;
*)
echo $arg: unknown device
;;
esac
done

View File

@ -1,2 +0,0 @@
# $NetBSD: rd.disktab,v 1.2 1995/10/13 16:38:29 gwr Exp $
# The ramdisk has no need for disktab (yet)

View File

@ -1,2 +0,0 @@
# $NetBSD: rd.fstab,v 1.4 2000/01/21 12:32:57 tsutsui Exp $
/dev/md0a / ufs rw 1 1

View File

@ -1,6 +0,0 @@
#
# etc/protocols (ramdisk version)
# $NetBSD: rd.protocols,v 1.1.1.1 1995/10/08 23:07:49 gwr Exp $
#
ip 0 IP
icmp 1 ICMP

View File

@ -1,4 +0,0 @@
# .sshrc
# $NetBSD: rd.sshrc,v 1.2 1995/10/13 16:38:34 gwr Exp $
path /sbin:/bin
run cat /.welcome

View File

@ -1,47 +0,0 @@
#
# $NetBSD: rd_bin.list,v 1.5 2001/09/21 06:12:52 mrg Exp $
#
# copy the crunched binary, link to it, and kill it
COPY ${OBJDIR}/rd_bin rd_bin
# From /usr/src/distrib/utils:
LINK rd_bin sbin/init
LINK rd_bin sbin/ifconfig
LINK rd_bin sbin/edlabel
LINK rd_bin sbin/route
LINK rd_bin bin/dd
LINK rd_bin bin/ls
LINK rd_bin bin/rsh
LINK rd_bin bin/sh
LINK rd_bin bin/ssh
# LINK rd_bin bin/tftp
# From /usr/src/sbin:
LINK rd_bin sbin/halt
LINK rd_bin sbin/mknod
LINK rd_bin sbin/mount
LINK rd_bin sbin/mount_cd9660
LINK rd_bin sbin/mount_ffs
LINK rd_bin sbin/mount_nfs
LINK rd_bin sbin/mount_ufs
LINK rd_bin sbin/reboot
LINK rd_bin sbin/umount
# From /usr/src/bin:
LINK rd_bin bin/cat
# LINK rd_bin bin/chmod
# LINK rd_bin bin/cp
LINK rd_bin bin/echo
LINK rd_bin bin/ln
LINK rd_bin bin/mkdir
LINK rd_bin bin/mt
LINK rd_bin bin/mv
LINK rd_bin bin/pwd
# LINK rd_bin bin/rm
LINK rd_bin bin/sync
LINK rd_bin bin/zcat
LINK rd_bin bin/rcmd
SPECIAL rm rd_bin

View File

@ -1,226 +0,0 @@
/* $NetBSD: rdsetroot.c,v 1.6 1998/02/20 09:27:18 mycroft Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
* 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. 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.
*
* $NetBSD: rdsetroot.c,v 1.6 1998/02/20 09:27:18 mycroft Exp $
*/
/*
* Copy a ramdisk image into the space reserved for it.
* Kernel variables: md_root_size, md_root_image
*/
#include <sys/types.h>
#include <sys/file.h>
#include <sys/mman.h>
#include <stdio.h>
#include <a.out.h>
extern off_t lseek();
struct exec head;
char *file;
/* Virtual addresses of the symbols we frob. */
long rd_root_image_va, rd_root_size_va;
/* Offsets relative to start of data segment. */
long rd_root_image_off, rd_root_size_off;
/* value in the location at rd_root_size_off */
int rd_root_size_val;
/* pointers to pieces of mapped file */
char *dataseg;
/* and lengths */
int data_len;
int data_off;
int data_pgoff;
main(argc,argv)
char **argv;
{
int fd, n;
int *ip;
char *cp;
if (argc < 2) {
printf("%s: missing file name\n", argv[0]);
exit(1);
}
file = argv[1];
fd = open(file, O_RDWR);
if (fd < 0) {
perror(file);
exit(1);
}
n = read(fd, &head, sizeof(head));
if (n < sizeof(head)) {
printf("%s: reading header\n", file);
exit(1);
}
if (N_BADMAG(head)) {
printf("%s: bad magic number\n");
exit(1);
}
#ifdef DEBUG
printf(" text: %9d\n", head.a_text);
printf(" data: %9d\n", head.a_data);
printf(" bss: %9d\n", head.a_bss);
printf(" syms: %9d\n", head.a_syms);
printf("entry: 0x%08X\n", head.a_entry);
printf("trsiz: %9d\n", head.a_trsize);
printf("drsiz: %9d\n", head.a_drsize);
#endif
if (head.a_syms <= 0) {
printf("%s: no symbols\n", file);
exit(1);
}
if (head.a_trsize ||
head.a_drsize)
{
printf("%s: has relocations\n");
exit(1);
}
find_rd_root_image(file);
/*
* Map in the whole data segment.
* The file offset needs to be page aligned.
*/
data_off = N_DATOFF(head);
data_len = head.a_data;
/* align... */
data_pgoff = N_PAGSIZ(head) - 1;
data_pgoff &= data_off;
data_off -= data_pgoff;
data_len += data_pgoff;
/* map in in... */
dataseg = mmap(NULL, /* any address is ok */
data_len, /* length */
PROT_READ | PROT_WRITE,
MAP_FILE | MAP_SHARED,
fd, data_off);
if ((long)dataseg == -1) {
printf("%s: can not map data seg\n", file);
perror(file);
exit(1);
}
dataseg += data_pgoff;
/*
* Find value in the location: rd_root_size
*/
ip = (int*) (dataseg + rd_root_size_off);
rd_root_size_val = *ip;
#ifdef DEBUG
printf("md_root_size val: 0x%08X (%d blocks)\n",
rd_root_size_val, (rd_root_size_val >> 9));
#endif
/*
* Copy the symbol table and string table.
*/
#ifdef DEBUG
printf("copying root image...\n");
#endif
n = read(0, dataseg + rd_root_image_off,
rd_root_size_val);
if (n < 0) {
perror("read");
exit(1);
}
msync(dataseg - data_pgoff, data_len, 0);
#ifdef DEBUG
printf("...copied %d bytes\n", n);
#endif
close(fd);
exit(0);
}
/*
* Find locations of the symbols to patch.
*/
struct nlist wantsyms[] = {
{ "_md_root_size", 0 },
{ "_md_root_image", 0 },
{ NULL, 0 },
};
find_rd_root_image(file)
char *file;
{
int data_va;
int std_entry;
if (nlist(file, wantsyms)) {
printf("%s: no md_root_image symbols?\n", file);
exit(1);
}
std_entry = N_TXTADDR(head) +
(head.a_entry & (N_PAGSIZ(head)-1));
data_va = N_DATADDR(head);
if (head.a_entry != std_entry) {
printf("%s: warning: non-standard entry point: 0x%08x\n",
file, head.a_entry);
printf("\texpecting entry=0x%X\n", std_entry);
data_va += (head.a_entry - std_entry);
}
rd_root_size_off = wantsyms[0].n_value - data_va;
rd_root_image_off = wantsyms[1].n_value - data_va;
#ifdef DEBUG
printf(".data segment va: 0x%08X\n", data_va);
printf("md_root_size va: 0x%08X\n", wantsyms[0].n_value);
printf("md_root_image va: 0x%08X\n", wantsyms[1].n_value);
printf("md_root_size off: 0x%08X\n", rd_root_size_off);
printf("md_root_image off: 0x%08X\n", rd_root_image_off);
#endif
/*
* Sanity check locations of db_* symbols
*/
if (rd_root_image_off < 0 || rd_root_image_off >= head.a_data) {
printf("%s: md_root_image not in data segment?\n", file);
exit(1);
}
if (rd_root_size_off < 0 || rd_root_size_off >= head.a_data) {
printf("%s: md_root_size not in data segment?\n", file);
exit(1);
}
}

View File

@ -1,76 +1,80 @@
# $NetBSD: Makefile,v 1.27 2002/05/02 18:02:58 lukem Exp $
# $NetBSD: Makefile,v 1.28 2002/05/17 17:52:35 lukem Exp $
.include <bsd.own.mk>
.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
TOP= ${.CURDIR}/..
.include <bsd.kernobj.mk>
.include "${TOP}/Makefile.inc"
IMAGE= miniroot.fs
IMAGESIZE= 12m
MAKEFS_FLAGS= -o minfree=0,optimization=space,density=8k,cpg=16
IMAGE= miniroot
KERNEL3= ${KERNOBJDIR}/INSTALL/netbsd
KERNEL3X= ${KERNOBJDIR}/INSTALL3X/netbsd
TREE= ${TOP}/common/${IMAGE}.tree
WARNS= 1
DBG= -Os
LISTS= ${TOP}/common/${IMAGE}.list \
${TOP}/common/mini_sbin.list \
${TOP}/common/mini_bin.list \
${TOP}/common/mini_usr.list
LISTS= ${.CURDIR}/list
MTREECONF= ${.CURDIR}/mtree.conf
IMAGEENDIAN= be
PARSELISTENV= KERNEL3=${KERNEL3} KERNEL3X=${KERNEL3X}
MAKEDEVTARGETS= std md0 cd0 st0 st1 sd0 sd1 sd2 xd0 xy0 fd0
IMAGEDEPENDS= ${KERNEL3} ${KERNEL3X} \
fstab install.md profile termcap \
${DESTDIR}/bin/cat ${DESTDIR}/bin/chmod ${DESTDIR}/bin/cp \
${DESTDIR}/bin/date ${DESTDIR}/bin/dd ${DESTDIR}/bin/df \
${DESTDIR}/bin/ed ${DESTDIR}/bin/expr ${DESTDIR}/bin/hostname \
${DESTDIR}/bin/kill ${DESTDIR}/bin/ln ${DESTDIR}/bin/ls \
${DESTDIR}/bin/mkdir ${DESTDIR}/bin/mt ${DESTDIR}/bin/mv \
${DESTDIR}/bin/pax ${DESTDIR}/bin/ps ${DESTDIR}/bin/pwd \
${DESTDIR}/bin/rm ${DESTDIR}/bin/rmdir ${DESTDIR}/bin/sh \
${DESTDIR}/bin/sleep ${DESTDIR}/bin/stty ${DESTDIR}/bin/sync \
${DESTDIR}/bin/test \
${DESTDIR}/dev/MAKEDEV ${DESTDIR}/dev/MAKEDEV.local \
${DESTDIR}/etc/disktab ${DESTDIR}/etc/group \
${DESTDIR}/etc/master.passwd ${DESTDIR}/etc/netconfig \
${DESTDIR}/etc/passwd ${DESTDIR}/etc/protocols \
${DESTDIR}/etc/pwd.db ${DESTDIR}/etc/services \
${DESTDIR}/etc/spwd.db \
${DESTDIR}/sbin/dmesg ${DESTDIR}/sbin/edlabel \
${DESTDIR}/sbin/fsck ${DESTDIR}/sbin/fsck_ffs \
${DESTDIR}/sbin/ifconfig ${DESTDIR}/sbin/init \
${DESTDIR}/sbin/mknod ${DESTDIR}/sbin/mount \
${DESTDIR}/sbin/mount_cd9660 ${DESTDIR}/sbin/mount_ffs \
${DESTDIR}/sbin/mount_kernfs ${DESTDIR}/sbin/mount_nfs \
${DESTDIR}/sbin/newfs ${DESTDIR}/sbin/ping \
${DESTDIR}/sbin/reboot ${DESTDIR}/sbin/restore \
${DESTDIR}/sbin/route ${DESTDIR}/sbin/shutdown \
${DESTDIR}/sbin/slattach ${DESTDIR}/sbin/swapctl \
${DESTDIR}/sbin/sysctl ${DESTDIR}/sbin/umount \
${DESTDIR}/usr/bin/chflags ${DESTDIR}/usr/bin/cksum \
${DESTDIR}/usr/bin/cmp ${DESTDIR}/usr/bin/false \
${DESTDIR}/usr/bin/ftp ${DESTDIR}/usr/bin/gzip \
${DESTDIR}/usr/bin/less ${DESTDIR}/usr/bin/rsh \
${DESTDIR}/usr/bin/sed ${DESTDIR}/usr/bin/sort \
${DESTDIR}/usr/bin/tip ${DESTDIR}/usr/bin/true \
${DESTDIR}/usr/bin/vi \
${DESTDIR}/usr/mdec/bootxx ${DESTDIR}/usr/mdec/bootyy \
${DESTDIR}/usr/mdec/netboot ${DESTDIR}/usr/mdec/tapeboot \
${DESTDIR}/usr/mdec/ufsboot \
${DESTDIR}/usr/sbin/chown ${DESTDIR}/usr/sbin/installboot \
${DESTDIR}/usr/sbin/rdate \
${DISTRIBDIR}/miniroot/install.sh \
${DISTRIBDIR}/miniroot/upgrade.sh \
install.sub
KERNEL3 = ${KERNOBJDIR}/INSTALL/netbsd
KERNEL3X = ${KERNOBJDIR}/INSTALL3X/netbsd
# XXXDISTRIB: need to cut sun3 over to sun68k/bootxx first...
#IMAGEPOSTBUILD= ${INSTALLBOOT} -v -m ${MACHINE} ${IMAGE} \
# ${DESTDIR}/usr/mdec/bootxx /ufsboot
IMAGE_RELEASEDIR= installation/miniroot
MOUNT_POINT?= /mnt
VND?= vnd1
VND_DEV?= /dev/${VND}a
VND_RDEV?= /dev/r${VND}a
VND_CRDEV?= /dev/r${VND}c
# These are all the parameters for the miniroot: (12MB)
DISKTYPE= miniroot
SIZE= 12
# bigendian, old format, minfree, opt, b/i, cpg
NEWFSARGS= -B be -O -m 0 -o space -i 8192 -c 16
MTREE?= mtree
CLEANFILES= ${IMAGE}.gz ${IMAGE} ${IMAGE}.tmp install.sub
all: ${IMAGE}.gz
${IMAGE}.gz: ${TREE} ${LISTS} install.sub
dd if=/dev/zero of=${IMAGE} bs=1024k count=${SIZE}
vnconfig -t ${DISKTYPE} -v -c ${VND} ${IMAGE}
disklabel -f ${.CURDIR}/disktab -rw ${VND} ${DISKTYPE}
newfs ${NEWFSARGS} ${VND_RDEV}
mount ${VND_DEV} ${MOUNT_POINT}
${MTREE} -def ${TREE} -p ${MOUNT_POINT}/ -u
cp ${KERNEL3} ${MOUNT_POINT}/netbsd.sun3
cp ${KERNEL3X} ${MOUNT_POINT}/netbsd.sun3x
TOPDIR=${TOP} CURDIR=${.CURDIR} DESTDIR=${DESTDIR} \
OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \
sh ${TOP}/common/RunList.sh ${LISTS}
sync ; sleep 1 ; sync
cd ${MOUNT_POINT} ;\
usr/mdec/installboot -v ufsboot usr/mdec/bootxx ${VND_CRDEV}
sync
@echo ""
@df -i ${MOUNT_POINT}
@echo ""
-umount ${MOUNT_POINT}
vnconfig -u ${VND}
gzip -9f ${IMAGE}
unconfig:
-umount -f ${MOUNT_POINT}
-vnconfig -u ${VND}
-/bin/rm -f ${IMAGE} ${IMAGE}.tmp
# Do not delete this if I change my mind and kill make...
.PRECIOUS: ${IMAGE}.gz
install.sub : ${TOP}/../miniroot/install.sub
install.sub: ${DISTRIBDIR}/miniroot/install.sub
sed -e "/^VERSION=/s/=.*/=${DISTRIBREV}/" < $? > $@
release: check_RELEASEDIR .WAIT ${IMAGE}.gz
${RELEASE_INSTALL} ${IMAGE}.gz ${RELEASEDIR}/installation/miniroot
CLEANFILES+= install.sub
.include "${DISTRIBDIR}/common/Makefile.makedev"
.include "${DISTRIBDIR}/common/Makefile.image"
.include <bsd.prog.mk>

View File

@ -1,4 +0,0 @@
miniroot|Installation root-on-swap FS image:\
:ty=simulated:se#512:ns#32:nt#8:nc#96:\
:ta=4.4BSD:oa#0:pa#24576:\
:ob#0:pb#0:oc#0:pc#24576:

View File

@ -1,4 +1,4 @@
# $NetBSD: mr.fstab,v 1.2 1998/01/09 18:56:53 perry Exp $
# $NetBSD: fstab,v 1.1 2002/05/17 17:52:35 lukem Exp $
#
/kern /kern kernfs ro 0 0
/kern/rootdev / ffs rw 1 1

View File

@ -1,4 +1,4 @@
# $NetBSD: install.md,v 1.8 1999/04/22 04:29:49 gwr Exp $
# $NetBSD: install.md,v 1.1 2002/05/17 17:52:35 lukem Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -108,7 +108,7 @@ md_installboot() {
( cd /usr/mdec ;\
cp -p ./ufsboot /mnt/ufsboot ;\
sync ; sleep 1 ; sync ;\
./installboot -v /mnt/ufsboot bootxx /dev/r${1}a )
/usr/sbin/installboot -v /dev/r${1}a bootxx ufsboot )
echo "done."
}

169
distrib/sun3/miniroot/list Normal file
View File

@ -0,0 +1,169 @@
#
# $NetBSD: list,v 1.1 2002/05/17 17:52:36 lukem Exp $
#
COPY ${KERNEL3} netbsd.sun3
COPY ${KERNEL3X} netbsd.sun3x
# These are scripts:
COPY ${DESTDIR}/usr/bin/false bin/false
COPY ${DESTDIR}/usr/bin/true bin/true
# From usr/mdec:
COPY ${DESTDIR}/usr/mdec/bootxx usr/mdec/bootxx
COPY ${DESTDIR}/usr/mdec/bootyy usr/mdec/bootyy
SYMLINK /usr/sbin/installboot usr/mdec/installboot
COPY ${DESTDIR}/usr/mdec/netboot usr/mdec/netboot
COPY ${DESTDIR}/usr/mdec/tapeboot usr/mdec/tapeboot
COPY ${DESTDIR}/usr/mdec/ufsboot usr/mdec/ufsboot
LINK usr/mdec/ufsboot ufsboot
# various files that we need in /etc for the install
COPY ${DESTDIR}/etc/group etc/group
COPY ${DESTDIR}/etc/master.passwd etc/master.passwd
COPY ${DESTDIR}/etc/netconfig etc/netconfig
COPY ${DESTDIR}/etc/passwd etc/passwd
COPY ${DESTDIR}/etc/protocols etc/protocols
COPY ${DESTDIR}/etc/pwd.db etc/pwd.db
COPY ${DESTDIR}/etc/services etc/services
COPY ${DESTDIR}/etc/spwd.db etc/spwd.db
# some /etc files get special handling (for MFS /tmp yuck)
COPY ${DESTDIR}/etc/disktab etc/disktab.shadow
SYMLINK /tmp/disktab.shadow etc/disktab
COPY ${CURDIR}/fstab tmp/fstab.shadow
SYMLINK /tmp/fstab.shadow etc/fstab
SYMLINK /tmp/resolv.conf.shadow etc/resolv.conf
SYMLINK /tmp/hosts etc/hosts
# copy the MAKEDEV script and make some devices
COPY ${DESTDIR}/dev/MAKEDEV dev/MAKEDEV
COPY ${DESTDIR}/dev/MAKEDEV.local dev/MAKEDEV.local
# copy the miniroot installation tools
COPY ${CURDIR}/profile .profile
COPY ${CURDIR}/termcap usr/share/misc/termcap
COPY ${CURDIR}/install.md install.md 0644
COPY ${OBJDIR}/install.sub install.sub 0644
COPY ${DISTRIBDIR}/miniroot/install.sh install 0755
COPY ${DISTRIBDIR}/miniroot/upgrade.sh upgrade 0755
# miniroot files from /sbin:
# Extras not in ../../miniroot/list:
# disklabel dmesg edlabel mount_kernfs restore
COPY ${DESTDIR}/sbin/dmesg sbin/dmesg
COPY ${DESTDIR}/sbin/edlabel sbin/edlabel
COPY ${DESTDIR}/sbin/fsck sbin/fsck
COPY ${DESTDIR}/sbin/fsck_ffs sbin/fsck_ffs
COPY ${DESTDIR}/sbin/ifconfig sbin/ifconfig
COPY ${DESTDIR}/sbin/init sbin/init
COPY ${DESTDIR}/sbin/mknod sbin/mknod
COPY ${DESTDIR}/sbin/mount sbin/mount
COPY ${DESTDIR}/sbin/mount_cd9660 sbin/mount_cd9660
COPY ${DESTDIR}/sbin/mount_ffs sbin/mount_ffs
COPY ${DESTDIR}/sbin/mount_kernfs sbin/mount_kernfs
COPY ${DESTDIR}/sbin/mount_nfs sbin/mount_nfs
COPY ${DESTDIR}/sbin/newfs sbin/newfs
COPY ${DESTDIR}/sbin/ping sbin/ping
COPY ${DESTDIR}/sbin/reboot sbin/reboot
LINK sbin/reboot sbin/halt
COPY ${DESTDIR}/sbin/restore sbin/restore
LINK sbin/restore sbin/rrestore
COPY ${DESTDIR}/sbin/route sbin/route
COPY ${DESTDIR}/sbin/shutdown sbin/shutdown
COPY ${DESTDIR}/sbin/slattach sbin/slattach
COPY ${DESTDIR}/sbin/swapctl sbin/swapctl
COPY ${DESTDIR}/sbin/sysctl sbin/sysctl
COPY ${DESTDIR}/sbin/umount sbin/umount
# miniroot files from /bin:
# Extras not in ../../miniroot/list:
# date ps rmdir
COPY ${DESTDIR}/bin/cat bin/cat
COPY ${DESTDIR}/bin/chmod bin/chmod
COPY ${DESTDIR}/bin/cp bin/cp
COPY ${DESTDIR}/bin/date bin/date
COPY ${DESTDIR}/bin/dd bin/dd
COPY ${DESTDIR}/bin/df bin/df
COPY ${DESTDIR}/bin/ed bin/ed
COPY ${DESTDIR}/bin/expr bin/expr
COPY ${DESTDIR}/bin/hostname bin/hostname
COPY ${DESTDIR}/bin/kill bin/kill
COPY ${DESTDIR}/bin/ln bin/ln
COPY ${DESTDIR}/bin/ls bin/ls
COPY ${DESTDIR}/bin/mkdir bin/mkdir
COPY ${DESTDIR}/bin/mt bin/mt
COPY ${DESTDIR}/bin/mv bin/mv
COPY ${DESTDIR}/bin/pax bin/pax
COPY ${DESTDIR}/bin/ps bin/ps
COPY ${DESTDIR}/bin/pwd bin/pwd
COPY ${DESTDIR}/bin/rm bin/rm
COPY ${DESTDIR}/bin/rmdir bin/rmdir
COPY ${DESTDIR}/bin/sh bin/sh
COPY ${DESTDIR}/bin/sleep bin/sleep
COPY ${DESTDIR}/bin/stty bin/stty
COPY ${DESTDIR}/bin/sync bin/sync
COPY ${DESTDIR}/bin/test bin/test
LINK bin/test bin/[
# new, combined pax,tar,cpio
LINK bin/pax usr/bin/tar
SYMLINK /usr/lib usr/libexec
# Shared library stuff...
# libcurses: vi
# libedit: ftp
# libtermcap: ftp, less, vi
# libutil: rdate
COPY ${DESTDIR}/usr/libexec/ld.elf_so usr/lib
COPY ${DESTDIR}/usr/lib/libc.so usr/lib
LINK usr/lib/libc.so usr/lib/libc.so.12
COPY ${DESTDIR}/usr/lib/libcurses.so usr/lib
LINK usr/lib/libcurses.so usr/lib/libcurses.so.4
COPY ${DESTDIR}/usr/lib/libedit.so usr/lib
LINK usr/lib/libedit.so usr/lib/libedit.so.2
COPY ${DESTDIR}/usr/lib/libtermcap.so usr/lib
LINK usr/lib/libtermcap.so usr/lib/libtermcap.so.0
COPY ${DESTDIR}/usr/lib/libutil.so usr/lib
LINK usr/lib/libutil.so usr/lib/libutil.so.6
# usr.sbin:
COPY ${DESTDIR}/usr/sbin/chown usr/sbin/chown
COPY ${DESTDIR}/usr/sbin/eeprom usr/sbin
COPY ${DESTDIR}/usr/sbin/installboot usr/sbin/installboot
COPY ${DESTDIR}/usr/sbin/rdate usr/sbin/rdate
# usr.bin:
LINK usr/sbin/chown usr/bin/chgrp
COPY ${DESTDIR}/usr/bin/chflags usr/bin/chflags
COPY ${DESTDIR}/usr/bin/cksum usr/bin/cksum
COPY ${DESTDIR}/usr/bin/cmp usr/bin/cmp
COPY ${DESTDIR}/usr/bin/ftp usr/bin/ftp
COPY ${DESTDIR}/usr/bin/less usr/bin/less
LINK usr/bin/less usr/bin/more
COPY ${DESTDIR}/usr/bin/rsh usr/bin/rsh
COPY ${DESTDIR}/usr/bin/sed usr/bin/sed
COPY ${DESTDIR}/usr/bin/tip usr/bin/tip
COPY ${DESTDIR}/usr/bin/vi usr/bin/vi
# gnu/usr.bin:
COPY ${DESTDIR}/usr/bin/gzip usr/bin/gzip
LINK usr/bin/gzip usr/bin/gunzip
LINK usr/bin/gzip usr/bin/gzcat
# install.md still uses sort
COPY ${DESTDIR}/usr/bin/sort usr/bin/sort

View File

@ -0,0 +1,25 @@
# $NetBSD: mtree.conf,v 1.1 2002/05/17 17:52:36 lukem Exp $
#
/set type=dir uname=root gname=wheel mode=0755
.
./bin
./dev
./etc
./kern
./mnt
./mnt2
./proc
./sbin
./tmp
./usr
./usr/bin
./usr/lib
./usr/mdec
./usr/sbin
./usr/share
./usr/share/misc
./var
./var/tmp mode=01777
.recover mode=01777

View File

@ -1,4 +1,4 @@
# $NetBSD: mr.profile,v 1.6 2000/06/14 22:52:47 cgd Exp $
# $NetBSD: profile,v 1.1 2002/05/17 17:52:36 lukem Exp $
#
# Copyright (c) 1995 Jason R. Thorpe
# Copyright (c) 1994 Christopher G. Demetriou

View File

@ -1,5 +1,5 @@
#
# $NetBSD: mr.termcap,v 1.1.1.1 1995/10/08 23:07:47 gwr Exp $
# $NetBSD: termcap,v 1.1 2002/05/17 17:52:36 lukem Exp $
#
#

View File

@ -1,92 +1,37 @@
# $NetBSD: Makefile,v 1.29 2002/05/02 18:02:59 lukem Exp $
# $NetBSD: Makefile,v 1.30 2002/05/17 17:52:36 lukem Exp $
.include <bsd.own.mk>
.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
.include <bsd.kernobj.mk>
TOP= ${.CURDIR}/..
IMAGE= ramdisk.fs
IMAGESIZE= 400k
MAKEFS_FLAGS= -f 15 -o minfree=0,optimization=space,density=4096,cpg=20
.include "${TOP}/Makefile.inc"
WARNS= 1
DBG= -Os
DBG= -Os
CRUNCHBIN= rd_bin
LISTS= ${.CURDIR}/list
MTREECONF= ${.CURDIR}/mtree.conf
IMAGEENDIAN= be
MAKEDEVTARGETS= __ramdisk std md0 cd0 st0 st1 sd0 sd1 sd2 xd0 xy0 fd0
IMAGEDEPENDS= ${CRUNCHBIN} \
disktab fstab passwd protocols services sshrc welcome \
${NETBSDSRCDIR}/etc/netconfig
IMAGE= ramdisk
CBIN= rd_bin
TREE= ${TOP}/common/${IMAGE}.tree
LISTS= ${TOP}/common/${CBIN}.list \
${TOP}/common/${IMAGE}.list
KERNEL3 = ${KERNOBJDIR}/RAMDISK/netbsd
KERNEL3X = ${KERNOBJDIR}/RAMDISK3X/netbsd
MOUNT_POINT?= /mnt
VND?= vnd1
VND_DEV?= /dev/${VND}a
VND_RDEV?= /dev/r${VND}a
# These are all the parameters for the root fs:
DISKTYPE= rdroot
SIZE= 400k
# bigendian, minfree, opt, b/i , cpg
NEWFSARGS= -B be -m 0 -o space -i 4096 -c 20
MDSETIMAGE?= mdsetimage
MTREE?= mtree
KERNELS= netbsd.RAMDISK netbsd.RAMDISK3X
CLEANFILES= $(KERNELS) ${IMAGE}.fs netbsd-tmp
all: $(KERNELS)
netbsd.RAMDISK : ${IMAGE}.fs
cp ${KERNEL3} netbsd-tmp
${MDSETIMAGE} -v netbsd-tmp ${IMAGE}.fs
-mv -f netbsd-tmp $@
netbsd.RAMDISK3X : ${IMAGE}.fs
cp ${KERNEL3X} netbsd-tmp
${MDSETIMAGE} -v netbsd-tmp ${IMAGE}.fs
-mv -f netbsd-tmp $@
${IMAGE}.fs: ${TREE} ${LISTS} ${CBIN}
dd if=/dev/zero of=${IMAGE}.fs bs=${SIZE} count=1
vnconfig -t ${DISKTYPE} -v -c ${VND} ${IMAGE}.fs
disklabel -rw ${VND} ${DISKTYPE}
newfs ${NEWFSARGS} ${VND_RDEV}
mount ${VND_DEV} ${MOUNT_POINT}
${MTREE} -def ${TREE} -p ${MOUNT_POINT}/ -u
TOPDIR=${TOP} CURDIR=${.CURDIR} DESTDIR=${DESTDIR} \
OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \
sh ${TOP}/common/RunList.sh ${LISTS}
sync
@echo ""
@df -i ${MOUNT_POINT}
@echo ""
umount ${MOUNT_POINT}
vnconfig -u ${VND}
unconfig:
-umount -f ${MOUNT_POINT}
-vnconfig -u ${VND}
-/bin/rm -f ${IMAGE}.fs
# Do not delete this if I change my mind and kill make...
.PRECIOUS: ${IMAGE}.fs
# Rules for making ${CBIN} ...
.include "${TOP}/common/Make.crunch"
MDSETTARGETS= RAMDISK ramdisk.fs - \
RAMDISK3X ramdisk.fs -
MDSET_RELEASEDIR= binary/kernel
# Use stubs to eliminate some large stuff from libc
HACKSRC= ${DISTRIBDIR}/utils/libhack
.include "${HACKSRC}/Makefile.inc"
${CBIN}: libhack.o
${CRUNCHBIN}: libhack.o
release: check_RELEASEDIR .WAIT $(KERNELS)
.for x in ${KERNELS}
gzip -c -9 < ${x} > \
${RELEASEDIR}/binary/kernel/${x}.gz
.endfor # KERNELS
.INTERRUPT: unconfig
.include "${DISTRIBDIR}/common/Makefile.crunch"
.include "${DISTRIBDIR}/common/Makefile.makedev"
.include "${DISTRIBDIR}/common/Makefile.image"
.include "${DISTRIBDIR}/common/Makefile.mdset"
.include <bsd.prog.mk>

View File

@ -0,0 +1,2 @@
# $NetBSD: disktab,v 1.1 2002/05/17 17:52:36 lukem Exp $
# The ramdisk has no need for disktab (yet)

View File

@ -0,0 +1,2 @@
# $NetBSD: fstab,v 1.1 2002/05/17 17:52:36 lukem Exp $
/dev/md0a / ufs rw 1 1

View File

@ -1,7 +1,7 @@
#
# $NetBSD: rd_bin.conf,v 1.7 2001/09/21 06:12:52 mrg Exp $
# $NetBSD: list,v 1.1 2002/05/17 17:52:36 lukem Exp $
#
# common/rd_bin.conf - unified binary for the ramdisk.
# ramdisk/list - packing list for the ramdisk.
#
# The ramdisk root has to stay small enough so the kernel
# can be loaded in less than one megabyte of ram, including
@ -24,7 +24,7 @@
#
# Include mknod incase I forgot some device nodes...
# Support copying miniroot from NFS, TFTP, or CDROM.
# Need mount_ffs, mount_ufs to remount the ramdisk.
# Need mount_ffs to remount the ramdisk.
#
# Might use cat to look at files (it's small anyway).
# Need for copying miniroot from tape: dd, mt
@ -42,46 +42,66 @@
# No need to extract archives either...
#
#
# Here are all the programs, ordered by source location:
SRCDIRS bin sbin usr.bin distrib/utils
# Special programs used to save space...
srcdirs distrib/utils
progs init ssh ls zcat
special init srcdir distrib/utils/init_s
special ls srcdir distrib/utils/tls
ln init oinit
ln ssh sh
ln ssh -sh # login shell (not actual file name)
# From /usr/src/distrib/utils:
PROG bin/dd
PROG bin/ls
PROG bin/rsh
PROG bin/ssh bin/sh bin/-sh
# PROG bin/tftp
PROG sbin/edlabel
PROG sbin/ifconfig
PROG sbin/init
PROG sbin/route
# From /usr/src/sbin:
PROG sbin/mknod
PROG sbin/mount
PROG sbin/mount_cd9660
PROG sbin/mount_ffs
PROG sbin/mount_nfs
PROG sbin/reboot sbin/halt
PROG sbin/umount
# From /usr/src/bin:
PROG bin/cat
# PROG bin/chmod
# PROG bin/cp
PROG bin/echo
PROG bin/ln
PROG bin/mkdir
PROG bin/mt
PROG bin/mv
PROG bin/pwd
PROG bin/rcmd
# PROG bin/rm
PROG bin/sync
PROG bin/zcat
LIBS libhack.o -lrmt -lutil -lz
# These are built with special flags to save a little space.
progs dd ifconfig mount route umount
special dd srcdir distrib/utils/x_dd
special ifconfig srcdir distrib/utils/x_ifconfig
special mount srcdir distrib/utils/x_mount
special route srcdir distrib/utils/x_route
special umount srcdir distrib/utils/x_umount
SPECIAL ifconfig srcdir distrib/utils/x_ifconfig
SPECIAL ls srcdir distrib/utils/tls
SPECIAL mount srcdir distrib/utils/x_mount
SPECIAL route srcdir distrib/utils/x_route
SPECIAL ssh srcdir distrib/utils/ssh
SPECIAL umount srcdir distrib/utils/x_umount
srcdirs sbin
progs edlabel mknod
progs mount_cd9660 mount_ffs mount_nfs
progs reboot
ln mount_ffs ffs mount_ufs ufs
ln mount_nfs nfs
ln mount_cd9660 cd9660
ln reboot halt
# various files that we need in /etc for the install
COPY ${CURDIR}/disktab etc/disktab
COPY ${CURDIR}/fstab etc/fstab
COPY ${CURDIR}/passwd etc/passwd
COPY ${CURDIR}/protocols etc/protocols
COPY ${CURDIR}/services etc/services
COPY ${CURDIR}/sshrc .sshrc
COPY ${CURDIR}/welcome .welcome
srcdirs bin
progs cat echo ln mkdir mt mv pwd rcmd sync
COPY ${NETBSDSRCDIR}/etc/netconfig etc/netconfig
srcdirs usr.bin
progs rsh
# progs tftp
# Fake /usr
SYMLINK . usr
# srcdirs usr.sbin
# srcdirs gnu/usr.bin
# progs cpio, gzip, tar
# ln gzip gzcat gunzip
libs libhack.o -lrmt -lutil -lz
# Shell lacks pipe support, so use this.
CMD mkfifo dev/pipe

View File

@ -0,0 +1,14 @@
#
# $NetBSD: mtree.conf,v 1.1 2002/05/17 17:52:36 lukem Exp $
#
/set type=dir uname=root gname=wheel mode=0755
.
./bin
./dev
./etc
./mnt
./sbin
./tmp
# (./usr will be a link to root)

View File

@ -0,0 +1,6 @@
#
# etc/protocols (ramdisk version)
# $NetBSD: protocols,v 1.1 2002/05/17 17:52:36 lukem Exp $
#
ip 0 IP
icmp 1 ICMP

View File

@ -1,6 +1,6 @@
#
# etc/services (ramdisk version)
# $NetBSD: rd.services,v 1.2 2001/09/21 05:46:09 mrg Exp $
# $NetBSD: services,v 1.1 2002/05/17 17:52:36 lukem Exp $
#
tcpmux 1/tcp
echo 7/tcp

View File

@ -0,0 +1,4 @@
# .sshrc
# $NetBSD: sshrc,v 1.1 2002/05/17 17:52:37 lukem Exp $
path /sbin:/bin
run cat /.welcome