Sync with MI-miniroot code.

This commit is contained in:
leo 1996-05-27 12:49:49 +00:00
parent 05574183dd
commit bacafe6a9f
11 changed files with 31 additions and 2406 deletions

View File

@ -1,55 +0,0 @@
# $NetBSD: Makefile,v 1.1.1.1 1996/05/19 19:43:39 leo Exp $
# Revision is 1.1B
REV= 11B
CBIN= instbin
ARCHDIR= ${.CURDIR}/../${MACHINE}/miniroot
MOUNT_POINT?= /mnt
VND?= vnd0
VND_DEV= /dev/${VND}c
VND_RDEV= /dev/r${VND}c
IMAGE?= inst-${REV}.fs
MDEC= ${DESTDIR}/usr/mdec
#LISTS= ${ARCHDIR}/list ${.CURDIR}/list
LISTS= ${.CURDIR}/list ${.CURDIR}/list.md
CRUNCHCONF= ${CBIN}.conf
MTREE= ${.CURDIR}/mtree.conf
all: ${CBIN}
dd if=/dev/zero of=${IMAGE} bs=18k count=60
vnconfig -v -c ${VND_DEV} ${IMAGE}
newfs -m 0 -o space -i 3052 -c 60 ${VND_RDEV} floppybt
mount ${VND_DEV} ${MOUNT_POINT}
mtree -def ${MTREE} -p ${MOUNT_POINT}/ -u
CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} ARCHDIR=${ARCHDIR} \
TARGDIR=${MOUNT_POINT} sh ${.CURDIR}/runlist.sh ${LISTS}
@echo ""
@df -i ${MOUNT_POINT}
@echo ""
umount ${MOUNT_POINT}
vnconfig -u ${VND_DEV}
cat /*bin/* > /dev/null
unconfig:
-umount -f ${MOUNT_POINT}
-vnconfig -u ${VND_DEV}
-/bin/rm -f ${IMAGE}
${CBIN}.conf: ${LISTS}
awk -f ${.CURDIR}/makeconf.awk CBIN=${CBIN} ${LISTS} > ${CBIN}.conf
${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
crunchgen -D ${.CURDIR}/../../.. -L ${DESTDIR}/usr/lib ${CRUNCHCONF}
${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
.include <bsd.obj.mk>
.include <bsd.subdir.mk>

View File

@ -0,0 +1,5 @@
# $NetBSD: Makefile.inc,v 1.1 1996/05/27 12:49:53 leo Exp $
VND= vnd0c
IMAGESIZE?= 2160 # 512 byte blocks
NEWFSOPTS?= -i 3052 -c 60

View File

@ -1,447 +0,0 @@
#!/bin/sh
# $NetBSD: install.sh,v 1.2 1996/05/25 22:13:08 leo Exp $
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
# by Jason R. Thorpe.
#
# 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 NetBSD
# Foundation, Inc. and its contributors.
# 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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.
#
# NetBSD installation script.
# In a perfect world, this would be a nice C program, with a reasonable
# user interface.
FILESYSTEMS="/tmp/filesystems" # used thoughout
FQDN="" # domain name
trap "umount /tmp > /dev/null 2>&1" 0
MODE="install"
# include machine-dependent functions
# The following functions must be provided:
# md_copy_kernel() - copy a kernel to the installed disk
# md_get_diskdevs() - return available disk devices
# md_get_cddevs() - return available CD-ROM devices
# md_get_ifdevs() - return available network interfaces
# md_installboot() - install boot-blocks on disk
# md_checkfordisklabel() - check for valid disklabel
# md_labeldisk() - put label on a disk
# md_prep_disklabel() - label the root disk
# md_welcome_banner() - display friendly message
# md_not_going_to_install() - display friendly message
# md_congrats() - display friendly message
# md_native_fstype() - native filesystem type for disk installs
# md_native_fsopts() - native filesystem options for disk installs
. install.md
# include common subroutines
. install.sub
# decide upon an editor
if [ X$EDITOR = X ]; then
if [ -x /usr/bin/vi ]; then
EDITOR=vi
else
EDITOR=ed
fi
fi
# Good {morning,afternoon,evening,night}.
md_welcome_banner
echo -n "Proceed with installation? [n] "
getresp "n"
case "$resp" in
y*|Y*)
echo "Cool! Let's get to it..."
;;
*)
md_not_going_to_install
exit
;;
esac
# XXX Work around vnode aliasing bug (thanks for the tip, Chris...)
ls -l /dev > /dev/null 2>&1
# Deal with terminal issues
md_set_term
# Get timezone info
get_timezone
# We don't like it, but it sure makes a few things a lot easier.
do_mfs_mount "/tmp" "2048"
# Install the shadowed disktab file; lets us write to it for temporary
# purposes without mounting the miniroot read-write.
cp /etc/disktab.shadow /tmp/disktab.shadow
while [ "X${ROOTDISK}" = "X" ]; do
getrootdisk
done
# Make sure there's a disklabel there. If there isn't, puke after
# disklabel prints the error message.
md_checkfordisklabel ${ROOTDISK}
case "$resp" in
1)
cat << \__disklabel_not_present_1
FATAL ERROR: There is no disklabel present on the root disk! You must
label the disk with SYS_INST before continuing.
__disklabel_not_present_1
exit
;;
2)
cat << \__disklabel_corrupted_1
FATAL ERROR: The disklabel on the root disk is corrupted! You must
re-label the disk with SYS_INST before continuing.
__disklabel_corrupted_1
exit
;;
*)
;;
esac
# Give the user the opportinuty to edit the root disklabel.
cat << \__disklabel_notice_1
You have already placed a disklabel onto the target root disk.
However, due to the limitations of the standalone program used
you may want to edit that label to change partition type information.
You will be given the opporunity to do that now. Note that you may
not change the size or location of any presently open partition.
__disklabel_notice_1
echo -n "Do you wish to edit the root disklabel? [y] "
getresp "y"
case "$resp" in
y*|Y*)
md_prep_disklabel ${ROOTDISK}
;;
*)
;;
esac
cat << \__disklabel_notice_2
You will now be given the opportunity to place disklabels on any additional
disks on your system.
__disklabel_notice_2
_DKDEVS=`rmel ${ROOTDISK} ${_DKDEVS}`
resp="X" # force at least one iteration
while [ "X$resp" != X"done" ]; do
labelmoredisks
done
# Assume partition 'a' of $ROOTDISK is for the root filesystem. Loop and
# get the rest.
# XXX ASSUMES THAT THE USER DOESN'T PROVIDE BOGUS INPUT.
cat << \__get_filesystems_1
You will now have the opportunity to enter filesystem information.
You will be prompted for device name and mount point (full path,
including the prepending '/' character).
Note that these do not have to be in any particular order. You will
be given the opportunity to edit the resulting 'fstab' file before
any of the filesystems are mounted. At that time you will be able
to resolve any filesystem order dependencies.
__get_filesystems_1
echo "The following will be used for the root filesystem:"
echo " ${ROOTDISK}a /"
echo "${ROOTDISK}a /" > ${FILESYSTEMS}
resp="X" # force at least one iteration
while [ "X$resp" != X"done" ]; do
echo ""
echo -n "Device name? [done] "
getresp "done"
case "$resp" in
done)
;;
*)
_device_name=`basename $resp`
# force at least one iteration
_first_char="X"
while [ "X${_first_char}" != X"/" ]; do
echo -n "Mount point? "
getresp ""
_mount_point=$resp
if [ "X${_mount_point}" = X"/" ]; then
# Invalid response; no multiple roots
_first_char="X"
else
_first_char=`firstchar ${_mount_point}`
fi
done
echo "${_device_name} ${_mount_point}" >> ${FILESYSTEMS}
resp="X" # force loop to repeat
;;
esac
done
echo ""
echo "You have configured the following devices and mount points:"
echo ""
cat ${FILESYSTEMS}
echo ""
echo "Filesystems will now be created on these devices. If you made any"
echo -n "mistakes, you may edit this now. Edit? [n] "
getresp "n"
case "$resp" in
y*|Y*)
${EDITOR} ${FILESYSTEMS}
;;
*)
;;
esac
# Loop though the file, place filesystems on each device.
echo "Creating filesystems..."
(
while read _device_name _junk; do
newfs /dev/r${_device_name}
echo ""
done
) < ${FILESYSTEMS}
# Get network configuration information, and store it for placement in the
# root filesystem later.
cat << \__network_config_1
You will now be given the opportunity to configure the network. This will
be useful if you need to transfer the installation sets via FTP or NFS.
Even if you choose not to transfer installation sets that way, this
information will be preserved and copied into the new root filesystem.
Note, enter all symbolic host names WITHOUT the domain name appended.
I.e. use 'hostname' NOT 'hostname.domain.name'.
__network_config_1
echo -n "Configure the network? [y] "
getresp "y"
case "$resp" in
y*|Y*)
echo -n "Enter system hostname: "
resp="" # force at least one iteration
while [ "X${resp}" = X"" ]; do
getresp ""
done
hostname $resp
echo $resp > /tmp/myname
echo -n "Enter DNS domain name: "
resp="" # force at least one iteration
while [ "X${resp}" = X"" ]; do
getresp ""
done
FQDN=$resp
configurenetwork
echo -n "Enter IP address of default route: [none] "
getresp "none"
if [ "X${resp}" != X"none" ]; then
route delete default > /dev/null 2>&1
if route add default $resp > /dev/null ; then
echo $resp > /tmp/mygate
fi
fi
echo -n "Enter IP address of primary nameserver: [none] "
getresp "none"
if [ "X${resp}" != X"none" ]; then
echo "domain $FQDN" > /tmp/resolv.conf
echo "nameserver $resp" >> /tmp/resolv.conf
echo "search $FQDN" >> /tmp/resolv.conf
echo -n "Would you like to use the nameserver now? [y] "
getresp "y"
case "$resp" in
y*|Y*)
cp /tmp/resolv.conf \
/tmp/resolv.conf.shadow
;;
*)
;;
esac
fi
echo ""
echo "The host table is as follows:"
echo ""
cat /tmp/hosts
echo ""
echo "You may want to edit the host table in the event that"
echo "you need to mount an NFS server."
echo -n "Would you like to edit the host table? [n] "
getresp "n"
case "$resp" in
y*|Y*)
${EDITOR} /tmp/hosts
;;
*)
;;
esac
cat << \__network_config_2
You will now be given the opportunity to escape to the command shell to
do any additional network configuration you may need. This may include
adding additional routes, if needed. In addition, you might take this
opportunity to redo the default route in the event that it failed above.
If you do change the default route, and wish for that change to carry over
to the installed system, execute the following command at the shell
prompt:
echo <ip_address_of_gateway> > /tmp/mygate
where <ip_address_of_gateway> is the IP address of the default router.
__network_config_2
echo -n "Escape to shell? [n] "
getresp "n"
case "$resp" in
y*|Y*)
echo "Type 'exit' to return to install."
sh
;;
*)
;;
esac
;;
*)
;;
esac
# Now that the network has been configured, it is safe to configure the
# fstab.
(
while read _dev _mp; do
if [ "$mp" = "/" ]; then
echo /dev/$_dev $_mp ffs rw 1 1
else
echo /dev/$_dev $_mp ffs rw 1 2
fi
done
) < ${FILESYSTEMS} > /tmp/fstab
echo "The fstab is configured as follows:"
echo ""
cat /tmp/fstab
cat << \__fstab_config_1
You may wish to edit the fstab. For example, you may need to resolve
dependencies in the order which the filesystems are mounted. You may
also wish to take this opportunity to place NFS mounts in the fstab.
This would be especially useful if you plan to keep '/usr' on an NFS
server.
__fstab_config_1
echo -n "Edit the fstab? [n] "
getresp "n"
case "$resp" in
y*|Y*)
${EDITOR} /tmp/fstab
;;
*)
;;
esac
echo ""
munge_fstab /tmp/fstab /tmp/fstab.shadow
mount_fs /tmp/fstab.shadow
install_sets $ALLSETS
# Copy in configuration information and make devices in target root.
(
cd /tmp
for file in fstab hostname.* hosts myname mygate resolv.conf; do
if [ -f $file ]; then
echo -n "Copying $file..."
cp $file /mnt/etc/$file
echo "done."
fi
done
# If no zoneinfo on the installfs, give them a second chance
if [ ! -e /usr/share/zoneinfo ]; then
get_timezone
fi
if [ ! -e /mnt/usr/share/zoneinfo ]; then
echo "Cannot install timezone link..."
else
echo -n "Installing timezone link..."
rm -f /mnt/etc/localtime
ln -s /usr/share/zoneinfo/$TZ /mnt/etc/localtime
echo "done."
fi
if [ ! -x /mnt/dev/MAKEDEV ]; then
echo "No /dev/MAKEDEV installed, something is wrong here..."
else
echo -n "Making devices..."
pid=`twiddle`
cd /mnt/dev
sh MAKEDEV all
kill $pid
echo "done."
fi
md_copy_kernel
md_installboot ${ROOTDISK}
)
unmount_fs /tmp/fstab.shadow
# Pat on the back.
md_congrats
# ALL DONE!
exit 0

File diff suppressed because it is too large Load Diff

View File

@ -1,84 +1,35 @@
# $NetBSD: list,v 1.1.1.1 1996/05/19 19:43:37 leo Exp $
# $NetBSD: list,v 1.2 1996/05/27 12:50:08 leo Exp $
SRCDIRS usr.bin bin sbin usr.sbin gnu/usr.bin
# copy the crunched binary, link to it, and kill it
COPY ${OBJDIR}/instbin instbin
LINK instbin bin/cat
LINK instbin bin/chmod
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/kill
LINK instbin bin/mkdir
LINK instbin bin/mt
LINK instbin bin/mv
LINK instbin bin/pwd
LINK instbin bin/rm
LINK instbin bin/sh
LINK instbin bin/stty
LINK instbin bin/sleep
LINK instbin bin/sync
LINK instbin bin/test bin/[
LINK instbin sbin/fsck_ffs sbin/fsck
LINK instbin sbin/reboot sbin/halt
LINK instbin sbin/ifconfig
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/shutdown
LINK instbin sbin/slattach
LINK instbin sbin/umount
SYMLINK ../../instbin usr/bin/chflags
SYMLINK ../../instbin usr/sbin/chown usr/bin/chgrp
SYMLINK ../../instbin usr/sbin/chroot
SYMLINK ../../instbin usr/bin/ftp
SYMLINK ../../instbin usr/bin/gzip usr/bin/gunzip usr/bin/gzcat
SYMLINK ../../instbin usr/bin/less usr/bin/more
SYMLINK ../../instbin usr/bin/printf
SYMLINK ../../instbin usr/bin/sed
SYMLINK ../../instbin usr/bin/sort
SYMLINK ../../instbin usr/bin/tar
SYMLINK ../../instbin usr/bin/tip
SYMLINK ../../instbin usr/sbin/update
# crunchgen source directory specials
CRUNCHSPECIAL less srcdir /usr/src/usr.bin/less/less/
# Atari extra's
LINK instbin sbin/edahdi
LINK instbin sbin/edlabel
LINK instbin sbin/mount_msdos
LINK instbin sbin/mount_kernfs
LINK instbin usr/bin/printf
# `internal' crunchgen links
ARGVLINK mount_ffs ffs
ARGVLINK mount_nfs nfs
ARGVLINK mount_cd9660 cd9660
ARGVLINK sh -sh
ARGVLINK mount_msdos msdos
# Minimize use of MFS
#SYMLINK /tmp var/tmp
# crunchgen source directory specials
CRUNCHSPECIAL edahdi srcdir /usr/src/sys/arch/atari/stand/edahdi/
# copy the MAKEDEV script and make some devices
COPY ${DESTDIR}/dev/MAKEDEV dev/MAKEDEV
COPY ${DESTDIR}/dev/MAKEDEV.local dev/MAKEDEV.local
SPECIAL cd dev; sh MAKEDEV floppy
SPECIAL /bin/rm dev/MAKEDEV
# 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/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
COPY ${CURDIR}/disktab.shadow 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
# the zoneinfo
#COPYDIR ${DESTDIR}/usr/share/zoneinfo usr/share/zoneinfo
# and the termcap file
COPY ${CURDIR}/termcap.vt usr/share/misc/termcap
# and the installation scripts
COPY ${CURDIR}/install.sub install.sub
COPY ${CURDIR}/install.sh install
COPY ${CURDIR}/upgrade.sh upgrade
SPECIAL chmod 755 install upgrade
COPY ${CURDIR}/install.md install.md
COPY ${CURDIR}/dot.profile .profile

View File

@ -1,34 +0,0 @@
# $NetBSD: list.md,v 1.1.1.1 1996/05/19 19:43:37 leo Exp $
# Atari extra's
SYMLINK instbin sbin/edahdi
LINK instbin sbin/edlabel
LINK instbin sbin/mount_msdos
LINK instbin sbin/mount_kernfs
# `internal' crunchgen links
ARGVLINK mount_msdos msdos
# crunchgen source directory specials
CRUNCHSPECIAL edahdi srcdir /usr/src/sys/arch/atari/stand/edahdi/
# copy the MAKEDEV script and make some devices
COPY ${DESTDIR}/dev/MAKEDEV dev/MAKEDEV
COPY ${DESTDIR}/dev/MAKEDEV.local dev/MAKEDEV.local
SPECIAL cd dev; sh MAKEDEV floppy
SPECIAL /bin/rm dev/MAKEDEV
# various files that we need in /etc for the install
COPY ${CURDIR}/disktab.shadow 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
# and the termcap file
COPY ${CURDIR}/termcap.vt usr/share/misc/termcap
# and the installation scripts
COPY ${CURDIR}/install.md install.md
COPY ${CURDIR}/dot.profile .profile

View File

@ -1,70 +0,0 @@
# $NetBSD: list2sh.awk,v 1.1.1.1 1996/05/19 19:43:37 leo Exp $
BEGIN {
printf("cd ${OBJDIR}\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);
for (i = 3; i <= NF; i++) {
printf("rm -f ${TARGDIR}/%s\n", $i);
printf("(cd ${TARGDIR}; ln %s %s)\n", $2, $i);
}
next;
}
$1 == "SYMLINK" {
printf("echo '%s'\n", $0);
for (i = 3; i <= NF; i++) {
printf("rm -f ${TARGDIR}/%s\n", $i);
printf("(cd ${TARGDIR}; ln -s %s %s)\n", $2, $i);
}
next;
}
$1 == "ARGVLINK" {
# crunchgen directive; ignored here
next;
}
$1 == "SRCDIRS" {
# crunchgen directive; ignored here
next;
}
$1 == "CRUNCHSPECIAL" {
# crunchgen directive; ignored here
next;
}
$1 == "COPYDIR" {
printf("echo '%s'\n", $0);
printf("(cd ${TARGDIR}/%s && find . ! -name . | xargs /bin/rm -rf)\n",
$3);
printf("(cd %s && pax -pe -rw . ${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;
}

View File

@ -1,67 +0,0 @@
# $NetBSD: makeconf.awk,v 1.1.1.1 1996/05/19 19:43:37 leo Exp $
#
# generate crunchgen(1) configuration file from `list' spec.
#
BEGIN {
printf("#\n# This file is automatically generated by `makeconf'\n#\n\n");
printf("\nlibs -ledit -lutil -lcurses -ltermcap -lcrypt -ll -lm -lkvm\n");
}
$1 == "SRCDIRS" {
$1 = tolower($1);
print;
}
($1 == "LINK" || $1 == "SYMLINK") && index($2,CBIN) {
# find basenames for inclusion in crunchgen's `prog' and `ln' directives
n = split($3, x, "/");
p = x[n];
progs[p] = NF - 3;
for (i = 4; i <= NF; i++) {
n = split($i, x, "/");
l = x[n];
links[i - 3, p] = l;
}
}
$1 == "ARGVLINK" {
# add extra `ln' entries (these don't appear in the filesystem)
n = progs[$2];
progs[$2] = ++n;
links[n, $2] = $3;
}
$1 == "CRUNCHSPECIAL" {
# collect crunchgen `special' directives
$1 = "";
specials[$0] = 1;
}
END {
# write crunchgen configuration
# `prog' directives; print 8 to a line
column = 0;
for (p in progs) {
if ((column++ % 8) == 0)
printf("\nprogs");
printf(" %s", p);
}
printf("\n\n");
# `ln' directives
for (p in progs) {
n = progs[p];
for (i = 1; i <= n; i++)
printf("ln %s %s\n", p, links[i,p]);
}
printf("\n\n");
# `special' directives
for (s in specials) {
printf("special %s\n", s);
}
}

View File

@ -1,74 +0,0 @@
#
# $NetBSD: mtree.conf,v 1.1.1.1 1996/05/19 19:43:36 leo 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
# ./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
..

View File

@ -1,13 +0,0 @@
# $NetBSD: runlist.sh,v 1.1.1.1 1996/05/19 19:43:36 leo 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 ${CURDIR}/list2sh.awk | ${SHELLCMD}

View File

@ -1,366 +0,0 @@
#!/bin/sh
# $NetBSD: upgrade.sh,v 1.2 1996/05/25 22:13:11 leo Exp $
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
# by Jason R. Thorpe.
#
# 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 NetBSD
# Foundation, Inc. and its contributors.
# 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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.
#
# NetBSD installation script.
# In a perfect world, this would be a nice C program, with a reasonable
# user interface.
VERSION=1.1
export VERSION # XXX needed in subshell
ROOTDISK="" # filled in below
RELDIR="" # Path searched for sets by install_sets
export RELDIR # on the local filesystems
trap "umount -a > /dev/null 2>&1" 0
MODE="upgrade"
# include machine-dependent functions
# The following functions must be provided:
# md_copy_kernel() - copy a kernel to the installed disk
# md_get_diskdevs() - return available disk devices
# md_get_cddevs() - return available CD-ROM devices
# md_get_ifdevs() - return available network interfaces
# md_installboot() - install boot-blocks on disk
# md_checkfordisklabel() - check for valid disklabel
# md_labeldisk() - put label on a disk
# md_welcome_banner() - display friendly message
# md_not_going_to_install() - display friendly message
# md_congrats() - display friendly message
. install.md
# include common subroutines
. install.sub
get_reldir() {
while : ; do
echo -n "Enter the pathname where the sets are stored [$RELDIR] "
getresp "$RELDIR"
RELDIR=$resp
# Allow break-out with empty response
if [ -z "$RELDIR" ]; then
echo -n "Are you sure you don't want to set the pathname? [n] "
getresp "n"
case "$resp" in
y*|Y*)
break
;;
*)
continue
;;
esac
fi
if [ -f "/mnt/$RELDIR/base.tar.gz" ]; then
break
else
echo -n "The directory $RELDIR does not exist, retry? [y] "
getresp "y"
case "$resp" in
y*|Y*)
;;
*)
break
;;
esac
fi
done
}
# Good {morning,afternoon,evening,night}.
md_welcome_banner
echo -n "Proceed with upgrade? [n] "
getresp "n"
case "$resp" in
y*|Y*)
echo "Cool! Let's get to it..."
;;
*)
md_not_going_to_install
exit
;;
esac
# Deal with terminal issues
md_set_term
# XXX Work around vnode aliasing bug (thanks for the tip, Chris...)
ls -l /dev > /dev/null 2>&1
# We don't like it, but it sure makes a few things a lot easier.
do_mfs_mount "/tmp" "2048"
while [ "X${ROOTDISK}" = "X" ]; do
getrootdisk
done
# Make sure there's a disklabel there. If there isn't, puke after
# disklabel prints the error message.
md_checkfordisklabel ${ROOTDISK}
case $rval in
1)
cat << \__disklabel_not_present_1
FATAL ERROR: There is no disklabel present on the root disk! You must
label the disk with SYS_INST before continuing.
__disklabel_not_present_1
exit
;;
2)
cat << \__disklabel_corrupted_1
FATAL ERROR: The disklabel on the root disk is corrupted! You must
re-label the disk with SYS_INST before continuing.
__disklabel_corrupted_1
exit
;;
*)
;;
esac
# Assume partition 'a' of $ROOTDISK is for the root filesystem. Confirm
# this with the user. Check and mount the root filesystem.
resp="" # force one iteration
while [ "X${resp}" = "X" ]; do
echo -n "Root filesystem? [${ROOTDISK}a] "
getresp "${ROOTDISK}a"
_root_filesystem="/dev/`basename $resp`"
if [ ! -b ${_root_filesystem} ]; then
echo "Sorry, ${resp} is not a block device."
resp="" # force loop to repeat
fi
done
echo "Checking root filesystem..."
if ! fsck -pf ${_root_filesystem}; then
echo "ERROR: can't check root filesystem!"
exit 1
fi
echo "Mounting root filesystem..."
if ! mount -o ro ${_root_filesystem} /mnt; then
echo "ERROR: can't mount root filesystem!"
exit 1
fi
# Grab the fstab so we can munge it for our own use.
if [ ! -f /mnt/etc/fstab ]; then
echo "ERROR: no /etc/fstab!"
exit 1
fi
cp /mnt/etc/fstab /tmp/fstab
# Grab the hosts table so we can use it.
if [ ! -f /mnt/etc/hosts ]; then
echo "ERROR: no /etc/hosts!"
exit 1
fi
cp /mnt/etc/hosts /tmp/hosts
# Start up the network in same/similar configuration as the installed system
# uses.
cat << \__network_config_1
The upgrade program would now like to enable the network. It will use the
configuration already stored on the root filesystem. This is required
if you wish to use the network installation capabilities of this program.
__network_config_1
echo -n "Enable network? [y] "
getresp "y"
case "$resp" in
y*|Y*)
if ! enable_network; then
echo "ERROR: can't enable network!"
exit 1
fi
cat << \__network_config_2
You will now be given the opportunity to escape to the command shell to
do any additional network configuration you may need. This may include
adding additional routes, if needed. In addition, you might take this
opportunity to redo the default route in the event that it failed above.
__network_config_2
echo -n "Escape to shell? [n] "
getresp "n"
case "$resp" in
y*|Y*)
echo "Type 'exit' to return to upgrade."
sh
;;
*)
;;
esac
;;
*)
;;
esac
# Now that the network has been configured, it is safe to configure the
# fstab. We remove all but ufs/ffs/nfs.
(
rm -f /tmp/fstab.new
while read line; do
_fstype=`echo $line | cutword 3`
if [ "X${_fstype}" = X"ufs" -o \
"X${_fstype}" = X"ffs" -o \
"X${_fstype}" = X"nfs" ]; then
echo $line >> /tmp/fstab.new
fi
done
) < /tmp/fstab
if [ ! -f /tmp/fstab.new ]; then
echo "ERROR: strange fstab!"
exit 1
fi
# Convert ufs to ffs.
sed -e 's/ufs/ffs/' < /tmp/fstab.new > /tmp/fstab
rm -f /tmp/fstab.new
echo "The fstab is configured as follows:"
echo ""
cat /tmp/fstab
cat << \__fstab_config_1
You may wish to edit the fstab. For example, you may need to resolve
dependencies in the order which the filesystems are mounted. Note that
this fstab is only for installation purposes, and will not be copied into
the root filesystem.
__fstab_config_1
echo -n "Edit the fstab? [n] "
getresp "n"
case "$resp" in
y*|Y*)
${EDITOR} /tmp/fstab
;;
*)
;;
esac
echo ""
munge_fstab /tmp/fstab /tmp/fstab.shadow
if ! umount /mnt; then
echo "ERROR: can't unmount previously mounted root!"
exit 1
fi
# Check all of the filesystems.
check_fs /tmp/fstab.shadow
# Mount filesystems.
mount_fs /tmp/fstab.shadow
echo -n "Are the upgrade sets on one of your normally mounted filesystems? [y] "
getresp "y"
case "$resp" in
y*|Y*)
get_reldir
;;
*)
;;
esac
# Install sets.
install_sets $UPGRSETS
# Get timezone info
get_timezone
# Fix up the fstab.
echo -n "Converting ufs to ffs in /etc/fstab..."
sed -e 's/ufs/ffs/' < /mnt/etc/fstab > /tmp/fstab
echo "done."
echo -n "Would you like to edit the resulting fstab? [y] "
getresp "y"
case "$resp" in
y*|Y*)
${EDITOR} /tmp/fstab
;;
*)
;;
esac
# Copy in configuration information and make devices in target root.
(
cd /tmp
for file in fstab; do
if [ -f $file ]; then
echo -n "Copying $file..."
cp $file /mnt/etc/$file
echo "done."
fi
done
echo -n "Installing timezone link..."
rm -f /mnt/etc/localtime
ln -s /usr/share/zoneinfo/$TZ /mnt/etc/localtime
echo "done."
echo -n "Making devices..."
pid=`twiddle`
cd /mnt/dev
sh MAKEDEV all
kill $pid
echo "done."
md_copy_kernel
md_installboot ${ROOTDISK}
)
unmount_fs /tmp/fstab.shadow
# Pat on the back.
md_congrats
# ALL DONE!
exit 0