prepare and installation floppies

This commit is contained in:
leo 2002-04-12 21:11:46 +00:00
parent 3d6043053d
commit 64fdec5519
12 changed files with 754 additions and 0 deletions

View File

@ -0,0 +1,8 @@
# $NetBSD: Makefile,v 1.1.1.1 2002/04/12 21:11:46 leo Exp $
SUBDIR= install
SUBDIR+= prepare
TARGETS+=release
.include <bsd.subdir.mk>

View File

@ -0,0 +1,3 @@
# $NetBSD: Makefile.inc,v 1.1.1.1 2002/04/12 21:11:46 leo Exp $
.include "${.CURDIR}/../../../Makefile.inc"

View File

@ -0,0 +1,56 @@
# $NetBSD: Makefile.images,v 1.1.1.1 2002/04/12 21:11:47 leo Exp $
.include <bsd.own.mk>
.include "${_SRC_TOP_}/distrib/Makefile.inc"
.include <bsd.kernobj.mk>
CRUNCHBIN= instbin
LISTS= ${.CURDIR}/list ${.CURDIR}/../common/list.images
MTREECONF= ${DISTRIBDIR}/common/mtree.common
IMAGEDEPENDS+= ${CRUNCHBIN} ${KERNSRCDIR}/conf/osrelease.sh \
${_SRC_TOP_}/etc/group ${_SRC_TOP_}/etc/master.passwd
PARSELISTENV= ARCHDIR=${ARCHDIR:Q} \
DISTRIBREV=${DISTRIBREV:Q} \
DISTRIBVER=${DISTRIBVER:Q} \
KERNOBJDIR=${KERNOBJDIR:Q}
MAKESUMS= CKSUM=${CKSUM:Q} sh ${DISTRIBDIR}/sets/makesums
.if defined(USE_SYSINST)
LISTS+= ${DISTRIBDIR}/common/list.sysinst
.endif
realall: check_DESTDIR .WAIT image
@true
release: check_RELEASEDIR .WAIT image
mkdir -p ${RELEASEDIR}/installation/miniroot
gzip -c -9 < ${.OBJDIR}/${IMAGE} \
> ${RELEASEDIR}/installation/miniroot/${IMAGE}.gz
${MAKESUMS} -t ${RELEASEDIR}/installation/miniroot ${IMAGE}.gz
image: ${IMAGE} image_md_post
image_md_post:
# nothing here; refer to machine-dependant ${ARCHDIR}/Makefile.inc
#
# Using libhack:opendir() causes linking errors
#
NOLIBHACKOPENDIR=1
# Use stubs to eliminate some large stuff from libc
HACKSRC=${_SRC_TOP_}/distrib/utils/libhack
.include "${HACKSRC}/Makefile.inc"
# This is listed in instbin.conf but is built here.
${CRUNCHBIN}: libhack.o
.include "${DISTRIBDIR}/common/Makefile.crunch"
.if defined(MAKEDEVTARGETS)
.include "${DISTRIBDIR}/common/Makefile.makedev"
.endif
.include "${DISTRIBDIR}/common/Makefile.image"
.include <bsd.prog.mk>

View File

@ -0,0 +1,137 @@
# $NetBSD: dot.profile,v 1.1.1.1 2002/04/12 21:11:47 leo Exp $
#
# Copyright (c) 1995 Jason R. Thorpe
# 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 for the
# NetBSD Project. See http://www.netbsd.org/ for
# information about NetBSD.
# 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.
#
# <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
export PATH
TERM=vt220
export TERM
HOME=/
export HOME
OBLOCKSIZE=1k
export BLOCKSIZE
EDITOR=ed
export EDITOR
umask 022
makerootwritable() {
if [ ! -e /tmp/.root_writable ]; then
if [ ! -e /kern/msgbuf ]; then
mount -t kernfs /kern /kern
fi
mount -t ffs -u /kern/rootdev /
cp /dev/null /tmp/.root_writable
fi
}
if [ "X${DONEPROFILE}" = "X" ]; then
DONEPROFILE=YES
export DONEPROFILE
# set up some sane defaults
echo 'erase ^H, werase ^W, kill ^U, intr ^C'
stty newcrt werase ^W intr ^C kill ^U erase ^H 9600
# mount root read write
makerootwritable
# If supported: Select a keyboard map
/usr/sbin/loadkmap > /dev/null 2>&1
if [ $? -eq 0 ]; then
_maps=`ls /usr/share/keymaps/atari | sed 's/\.map//g'`
fi
while [ ! -z "$_maps" ]; do
echo "The available keyboard maps are:"
_num=0
for i in $_maps; do
echo " $_num $i"
_num=`expr $_num + 1`
done
echo
echo -n "Select the number of the map you want to activate: "
read _ans
# Delete all non-nummeric characters from the users answer
if [ ! -z "$_ans" ]; then
_ans=`echo $_ans | sed 's/[^0-9]//g`
fi
# Check if the answer is valid (in range). Note that an answer
# < 0 cannot happen because the sed(1) above also removes the
# sign.
if [ -z "$_ans" -o "$_ans" -ge $_num ]; then
echo "You entered an invalid response, please try again."
continue
fi
# Got a valid answer, activate the map...
set -- $_maps
shift $_ans
/usr/sbin/loadkmap -f /usr/share/keymaps/atari/$1.map
break
done
if [ -x /sysinst ]; then
sysinst
else
if [ -x /upgrade ]; then
#
# Original installation script.
# Installing or upgrading?
_forceloop=""
while [ "X${_forceloop}" = X"" ]; do
echo -n '(I)nstall or (U)pgrade? '
read _forceloop
case "$_forceloop" in
i*|I*)
/install
;;
u*|U*)
/upgrade
;;
*)
_forceloop=""
;;
esac
done
else
#
# Stripped down preparation version
/install
fi
fi
fi

View File

@ -0,0 +1,20 @@
# $NetBSD: list.images,v 1.1.1.1 2002/04/12 21:11:47 leo Exp $
SRCDIRS bin sbin usr.bin usr.sbin gnu/usr.bin sys/arch/atari/stand
LIBS libhack.o -lrmt -ledit -lbz2 -lutil -lcurses -ltermcap -lcrypt -lkvm -ll -lm
# init invokes the shell as -sh
ARGVLN sh -sh
# files that we need in /etc for the install
COPY ${_SRC_TOP_}/etc/group etc/group
COPY ${_SRC_TOP_}/etc/master.passwd etc/master.passwd
# the termcap file
COPY ${CURDIR}/../common/termcap.mini usr/share/misc/termcap
COPY ${CURDIR}/../common/dot.profile .profile
# and the keyboard maps
MTREE ./usr/share/keymaps type=dir uname=root gname=wheel mode=0755
COPYDIR ${DESTDIR}/usr/share/keymaps/atari usr/share/keymaps/atari

View File

@ -0,0 +1,3 @@
# $NetBSD: mtree.conf,v 1.1.1.1 2002/04/12 21:11:47 leo Exp $
./.profile type=file uname=root gname=wheel mode=0644

View File

@ -0,0 +1,67 @@
#
# $NetBSD: termcap.mini,v 1.1.1.1 2002/04/12 21:11:47 leo Exp $
#
# Copyright (c) 1980, 1985, 1989 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.
#
# @(#)termcap.src 5.109 (Berkeley) 3/8/93
#
vt200|vt220|dec-vt220|vt200-js|vt220-js|dec vt200 series with jump scroll:\
:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:LE=\E[%dD:\
:RI=\E[%dC:UP=\E[%dA:ae=^O:al=\E[L:as=^N:ct=\E[3g:dc=\E[P:dl=\E[M:\
:ei=\E[4l:im=\E[4h:k1=\E[17~:k2=\E[18~:k3=\E[19~:k4=\E[20~:\
:k5=\E[21~:k6=\E[23~:k7=\E[24~:k8=\E[25~:kD=\E[3~:kH=\E[4~:\
:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kh=\E[1~:km:mi:ms:\
:if=/usr/share/tabset/vt100:se=\E[27m:st=\EH:ue=\E[24m:\
:tc=vt100:
vt100|dec-vt100|vt100-am|vt100am|dec vt100:\
:bl=^G:cr=^M:it#8:\
:do=^J:co#80:li#24:cl=50\E[;H\E[2J:sf=2*\ED:\
:le=^H:bs:am:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:cb=3\E[1K:\
:ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\
:md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:is=\E[1;24r\E[24;1H:\
:if=/usr/share/tabset/vt100:\
:rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\
:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\
:ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=2*\EM:vt#3:xn:\
:sc=\E7:rc=\E8:cs=\E[%i%d;%dr:
vt300|vt320|vt300-80|VT 300 with 80 columns, on VMS:\
:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
:LE=\E[%dD:RI=\E[%dC:SR=1*\E[%dM:UP=\E[%dA:al=\E[L:\
:am:bl=^G:bs:cd=2*\E[J:ce=2*\E[K:cl=45\E[H\E[2J:\
:cm=%i\E[%d;%dH:co#80:cr=\r:cs=\E[%i%d;%dr:ct=\E[3g:\
:dc=\E[P:dl=\E[M:dm=:do=\ED:ec=\E[%dX:ed=:ei=\E[4l:\
:ho=\E[H:ic:im=\E[4h:it#8:k1=\EOP:k2=\EOQ:k3=\EOR:\
:k4=\EOS:kd=\E[B:ke=\E[?1l\E>:kl=\E[D:kn#4:kr=\E[C:ks=\E[?1h\E=:\
:ku=\E[A:le=^H:li#24:mb=\E[5m:md=\E[1m:me=\E[0m:mi:\
:mr=\E[7m:ms:nd=\E[C:nl=\ED:nw=\EE:pf=\E[?4i:po=\E[?5i:\
:ps=\E[i:rc=\E8:sc=\E7:se=\E[27m:sf=1*\ED:so=\E[7m:\
:sr=1*\EM:st=\EH:ue=\E[24m:up=\EM:us=\E[4m:xn:

View File

@ -0,0 +1,14 @@
# $NetBSD: Makefile,v 1.1.1.1 2002/04/12 21:11:47 leo Exp $
IMAGESIZE?= 1440k
IMAGEENDIAN= be
MAKEDEVTARGETS= floppy
ARCHDIR= ${.CURDIR}/.
IMAGE= sysinst.fs
USE_SYSINST= yes
MAKEFS_FLAGS= -f 10
.include "../common/Makefile.images"
#.include <bsd.prog.mk>

View File

@ -0,0 +1,67 @@
# $NetBSD: list,v 1.1.1.1 2002/04/12 21:11:47 leo Exp $
PROG bin/cat
PROG bin/chmod
PROG bin/cp
PROG bin/expr
PROG bin/ln
PROG bin/ls
PROG bin/mkdir
PROG bin/mv
PROG bin/pax usr/bin/tar
PROG bin/pwd
PROG bin/rm
PROG bin/sh
PROG bin/stty
PROG sbin/disklabel
PROG sbin/fsck
PROG sbin/fsck_ffs
PROG sbin/ifconfig
PROG sbin/init
PROG sbin/mknod
PROG sbin/mount
PROG sbin/mount_cd9660
PROG sbin/mount_ffs
PROG sbin/mount_kernfs
PROG sbin/mount_msdos
PROG sbin/mount_nfs
PROG sbin/newfs sbin/mount_mfs
PROG sbin/ping
PROG sbin/reboot sbin/halt
PROG sbin/route
PROG sbin/swapctl
PROG sbin/umount
PROG usr/bin/ftp
PROG usr/bin/gzip usr/bin/gzcat usr/bin/gunzip
PROG usr/bin/sed
PROG usr/mdec/installboot
PROG usr/sbin/chown usr/bin/chgrp
PROG usr/sbin/chroot
PROG sbin/ahdilabel
PROG usr/sbin/loadkmap
SPECIAL ftp srcdir distrib/utils/x_ftp
SPECIAL ifconfig srcdir distrib/utils/x_ifconfig
SPECIAL mount srcdir distrib/utils/x_mount
SPECIAL ping srcdir distrib/utils/x_ping
SPECIAL route srcdir distrib/utils/x_route
SPECIAL umount srcdir distrib/utils/x_umount
# various files that we need in /etc for the install
COPY ${_SRC_TOP_}/etc/netconfig etc/netconfig
COPY ${_SRC_TOP_}/etc/protocols etc/protocols
COPY ${_SRC_TOP_}/etc/services etc/services
# we need the boot block code in /usr/mdec
COPY ${DESTDIR}/usr/mdec/fdboot usr/mdec/fdboot
COPY ${DESTDIR}/usr/mdec/sdb00t.ahdi usr/mdec/sdb00t.ahdi
COPY ${DESTDIR}/usr/mdec/wdb00t.ahdi usr/mdec/wdb00t.ahdi
COPY ${DESTDIR}/usr/mdec/xxboot.ahdi usr/mdec/xxboot.ahdi
COPY ${DESTDIR}/usr/mdec/sdboot usr/mdec/sdboot
COPY ${DESTDIR}/usr/mdec/wdboot usr/mdec/wdboot
COPY ${DESTDIR}/usr/mdec/bootxx usr/mdec/bootxx

View File

@ -0,0 +1,14 @@
# $NetBSD: Makefile,v 1.1.1.1 2002/04/12 21:11:46 leo Exp $
IMAGESIZE?= 1080k
IMAGEENDIAN= be
#DISKTYPE?= floppybt
MAKEDEVTARGETS= floppy
ARCHDIR= ${.CURDIR}/.
IMAGE= prepare.fs
IMAGEDEPENDS+= install.sh install.md
.include "../common/Makefile.images"
#.include <bsd.prog.mk>

View File

@ -0,0 +1,195 @@
# $NetBSD: install.md,v 1.1.1.1 2002/04/12 21:11:46 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 FOUNDATION 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.
#
#
# machine dependent section of installation/upgrade script.
#
VERSION= # filled in automatically (see list)
export VERSION
md_set_term() {
if [ ! -z "$TERM" ]; then
return
fi
echo -n "Specify terminal type [vt220]: "
getresp "vt220"
TERM="$resp"
export TERM
}
__mount_kernfs() {
#
# Force kern_fs to be mounted
#
if [ ! -d /kern -o ! -e /kern/msgbuf ]; then
mkdir /kern > /dev/null 2>&1
/sbin/mount_kernfs /kern /kern >/dev/null 2>&1
fi
}
md_makerootwritable() {
# Mount root rw for convenience of the tester ;-)
if [ ! -e /tmp/.root_writable ]; then
__mount_kernfs
mount -t ffs -u /kern/rootdev / > /dev/null 2>&1
cp /dev/null /tmp/.root_writable
fi
}
md_get_diskdevs() {
# return available disk devices
__mount_kernfs
sed -n -e '/^[sw]d[0-9] /s/ .*//p' \
< /kern/msgbuf | sort -u
}
md_prep_disklabel()
{
# $1 is the root disk
# Note that the first part of this function is just a *very* verbose
# version of md_label_disk().
cat << \__md_prep_disklabel_1
You now have to prepare your root disk for the installation of NetBSD. This
is further referred to as 'labeling' a disk.
First you get the chance to edit or create an AHDI compatible partitioning on
the installation disk. Note that NetBSD can do without AHDI partitions,
check the documentation.
If you want to use an AHDI compatible partitioning, you have to assign some
partitions to NetBSD before NetBSD is able to use the disk. Change the 'id'
of all partitions you want to use for NetBSD filesystems to 'NBD'. Change
the 'id' of the partition you wish to use for swap to 'SWP'.
Hit the <return> key when you have read this...
__md_prep_disklabel_1
getresp ""
ahdilabel /dev/r${1}c
# display example
cat << \__md_prep_disklabel_3
Here is an example of what the partition information will look like once
you have entered the disklabel editor. Disk partition sizes and offsets
are in sector (most likely 512 bytes) units.
[Example]
partition start (c/t/s) nblks (c/t/s) type
a (root) 0 (0/00/00) 31392 (109/00/00) 4.2BSD
b (swap) 31392 (109/00/00) 73440 (255/00/00) swap
c (disk) 0 (0/00/00) 1070496 (3717/00/00) unused
d (user) 104832 (364/00/00) 30528 (106/00/00) 4.2BSD
e (user) 135360 (470/00/00) 40896 (142/00/00) 4.2BSD
f (user) 176256 (612/00/00) 92160 (320/00/00) 4.2BSD
g (user) 268416 (932/00/00) 802080 (2785/00/00) 4.2BSD
[End of example]
Hit the <return> key when you have read this...
__md_prep_disklabel_3
getresp ""
edlabel /dev/r${1}c
cat << \__md_prep_disklabel_4
You will now be given the opportunity to place disklabels on any additional
disks on your system.
__md_prep_disklabel_4
_DKDEVS=`rmel ${1} ${_DKDEVS}`
resp="X" # force at least one iteration
while [ "X$resp" != X"done" ]; do
labelmoredisks
done
}
md_labeldisk() {
edahdi /dev/r${1}c < /dev/null > /dev/null 2>&1
[ $? -eq 0 ] && edahdi /dev/r${1}c
edlabel /dev/r${1}c
}
md_welcome_banner() {
echo ""
echo "Welcome to the NetBSD/atari ${VERSION} preparation program."
cat << \__welcome_banner_1
This program is designed to partition your disk in preparation of the
NetBSD installation. At this stage, the only thing you _must_ setup
is a swap partition. If you wish, the remaining partitioning work might
be delayed until the actual installation.
As with anything which modifies your disk's contents, this
program can cause SIGNIFICANT data loss, and you are advised
to make sure your data is backed up before beginning the
preparation process.
Default answers are displayed in brackets after the questions.
You can hit Control-C at any time to quit, but if you do so at a
prompt, you may have to hit return.
__welcome_banner_1
}
md_not_going_to_install() {
cat << \__not_going_to_install_1
OK, then. Enter `halt' at the prompt to halt the machine. Once the
machine has halted, power-cycle the system to load new boot code.
Note: If you wish to have another try. Just type '^D' at the prompt. After
a moment, the program will restart itself.
__not_going_to_install_1
}
md_congrats() {
cat << __congratulations_1
CONGRATULATIONS! You have successfully partitioned your disks!
Now you can use file2swap.ttp to transfer the install.fs to your
swap partition and continue the installation.
Enter halt at the command prompt. Once the system has halted, reset the
machine and re-boot it.
Note: If you wish to have another try. Just type '^D' at the prompt. After
a moment, the installer will restart itself.
__congratulations_1
}

View File

@ -0,0 +1,170 @@
#!/bin/sh
# $NetBSD: install.sh,v 1.1.1.1 2002/04/12 21:11:46 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 FOUNDATION 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
MODE="install"
# include machine-dependent functions
# The following functions must be provided:
# md_prep_disklabel() - label the root disk
# md_welcome_banner() - display friendly message
# md_congrats() - display friendly message
# md_makerootwritable() - make root writable (at least /tmp)
# we need to make sure .'s below work if this directory is not in $PATH
# dirname may not be available but expr is
Mydir=`expr $0 : '^\(.*\)/[^/]*$'`
Mydir=`cd ${Mydir:-.}; pwd`
#
# Sub-parts
#
getresp() {
read resp
if [ "X$resp" = "X" ]; then
resp=$1
fi
}
isin() {
# test the first argument against the remaining ones, return succes on a match
_a=$1; shift
while [ $# != 0 ]; do
if [ "$_a" = "$1" ]; then return 0; fi
shift
done
return 1
}
getrootdisk() {
cat << \__getrootdisk_1
The installation program needs to know which disk to consider
the root disk. Note the unit number may be different than
the unit number you used in the standalone installation
program.
Available disks are:
__getrootdisk_1
_DKDEVS=`md_get_diskdevs`
echo "$_DKDEVS"
echo ""
echo -n "Which disk is the root disk? "
getresp ""
if isin $resp $_DKDEVS ; then
ROOTDISK="$resp"
else
echo ""
echo "The disk $resp does not exist."
ROOTDISK=""
fi
}
labelmoredisks() {
cat << \__labelmoredisks_1
You may label the following disks:
__labelmoredisks_1
echo "$_DKDEVS"
echo ""
echo -n "Label which disk? [done] "
getresp "done"
case "$resp" in
"done")
;;
*)
if isin $resp $_DKDEVS ; then
md_labeldisk $resp
else
echo ""
echo "The disk $resp does not exist."
fi
;;
esac
}
#
# include machine dependent subroutines
. $Mydir/install.md
# Good {morning,afternoon,evening,night}.
md_welcome_banner
echo -n "Proceed? [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
# Make sure we can write files (at least in /tmp)
# This might make an MFS mount on /tmp, or it may
# just re-mount the root with read-write enabled.
md_makerootwritable
while [ "X${ROOTDISK}" = "X" ]; do
getrootdisk
done
# Deal with disklabels, including editing the root disklabel
# and labeling additional disks. This is machine-dependent since
# some platforms may not be able to provide this functionality.
md_prep_disklabel ${ROOTDISK}
# Pat on the back.
md_congrats
# ALL DONE!
exit 0