* Edit VERSION into install.sub while copying instead of using a

VERSION file.
* Set the EDITOR variable in install.sub, so it will be set in both
  upgrade & install.
* Make the checks on  the presence of installation sets on the local
  disks on upgrade more precise.
* Remove more&less from the list of standard binaries (I need more space!)
* When building an fstab from the users' fstab, drop lines starting with
  a '#' and lines with an fstype that is not supported on the miniroot.
This commit is contained in:
leo 1996-05-30 06:57:12 +00:00
parent 956fd533da
commit 76285e652b
5 changed files with 53 additions and 30 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.5 1996/05/27 15:46:41 leo Exp $
# $NetBSD: Makefile,v 1.6 1996/05/30 06:57:12 leo Exp $
# Revision is 1.1B
REV= 11B
@ -28,8 +28,7 @@ all: ${CBIN}
newfs -m 0 -o space ${NEWFSOPTS} ${VND_RDEV} miniroot
mount ${VND_DEV} ${MOUNT_POINT}
mtree -def ${MTREE} -p ${MOUNT_POINT}/ -u
echo "VERSION=${REV}; export VERSION" > ${MOUNT_POINT}/VERSION
CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} ARCHDIR=${ARCHDIR} \
REV=${REV} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} ARCHDIR=${ARCHDIR} \
TARGDIR=${MOUNT_POINT} sh ${.CURDIR}/runlist.sh ${LISTS}
@echo ""
@df -i ${MOUNT_POINT}

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $NetBSD: install.sh,v 1.6 1996/05/27 12:39:02 leo Exp $
# $NetBSD: install.sh,v 1.7 1996/05/30 06:57:13 leo Exp $
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
@ -70,18 +70,6 @@ MODE="install"
# include common subroutines
. install.sub
# include version number
. VERSION
# 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] "

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $NetBSD: install.sub,v 1.6 1996/05/27 12:39:04 leo Exp $
# $NetBSD: install.sub,v 1.7 1996/05/30 06:57:14 leo Exp $
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
@ -39,10 +39,21 @@
# NetBSD installation/upgrade script - common subroutines.
ROOTDISK="" # filled in below
VERSION= # filled in automatically (see list)
export VERSION
ALLSETS="base comp etc games man misc text" # default install sets
UPGRSETS="base comp games man misc text" # default upgrade sets
# decide upon an editor
if [ X$EDITOR = X ]; then
if [ -x /usr/bin/vi ]; then
EDITOR=vi
else
EDITOR=ed
fi
fi
getresp() {
read resp
if [ "X$resp" = "X" ]; then
@ -131,6 +142,21 @@ basename () {
eval echo \$$#
}
dir_has_sets() {
# return true when the directory $1 contains a set for $2...$n
local _dir
local _file
_dir=$1; shift
for _file in $*
do
if [ -f $_dir/${_file}.tar.gz ]; then
return 0
fi
done
return 1
}
twiddle() {
# spin the propeller so we don't get bored
while : ; do
@ -991,7 +1017,7 @@ Make sure The sets are either on a local device (i.e. tape, CD-ROM) or on a
network server.
__install_sets_1
if [ -f /mnt/$RELDIR/$1.tar.gz ]; then
if dir_has_sets "/mnt/$RELDIR" $* ; then
echo -n "Are you sure to install sets from $RELDIR ? [y] "
getresp "y"
case "$resp" in
@ -1084,6 +1110,7 @@ munge_fstab()
local _fstab_shadow
local _dev
local _mp
local _fstype
local _rest
# Now that the 'real' fstab is configured, we munge it into a 'shadow'
@ -1091,7 +1118,17 @@ munge_fstab()
# filesystems relative to /mnt. Mount all filesystems.
_fstab=$1
_fstab_shadow=$2
( while read _dev _mp _rest; do
( while read _dev _mp _fstype _rest; do
# Skip comment lines
case "$_dev" in
\#*) continue;;
*) ;;
esac
# and some filesystem types (like there are swap,kernfs,...)
case "$_fstype" in
ffs|ufs|nfs) ;;
*) continue;;
esac
if [ "$_mp" = "/" ]; then
echo $_dev /mnt $_rest
else

View File

@ -1,4 +1,4 @@
# $NetBSD: list,v 1.6 1996/05/27 15:50:53 leo Exp $
# $NetBSD: list,v 1.7 1996/05/30 06:57:16 leo Exp $
SRCDIRS usr.bin bin sbin usr.sbin gnu/usr.bin
@ -45,16 +45,12 @@ 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/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
# `internal' crunchgen links
ARGVLINK mount_ffs ffs
ARGVLINK mount_nfs nfs
@ -74,4 +70,5 @@ COPY ${DESTDIR}/etc/spwd.db etc/spwd.db
COPY ${CURDIR}/install.sub install.sub
COPY ${CURDIR}/install.sh install
COPY ${CURDIR}/upgrade.sh upgrade
SPECIAL sed "/^VERSION=/s/=.*/=${REV}/" < ${CURDIR}/install.sub > install.sub
SPECIAL chmod 755 install upgrade

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $NetBSD: upgrade.sh,v 1.4 1996/05/27 13:32:01 pk Exp $
# $NetBSD: upgrade.sh,v 1.5 1996/05/30 06:57:17 leo Exp $
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
# All rights reserved.
@ -68,9 +68,6 @@ MODE="upgrade"
# include common subroutines
. install.sub
# include version number
. VERSION
get_reldir() {
while : ; do
echo -n "Enter the pathname where the sets are stored [$RELDIR] "
@ -90,10 +87,15 @@ get_reldir() {
;;
esac
fi
if [ -f "/mnt/$RELDIR/base.tar.gz" ]; then
if dir_has_sets "/mnt/$RELDIR" $UPGRSETS
then
break
else
echo -n "The directory $RELDIR does not exist, retry? [y] "
cat << \__get_reldir_1
The directory $RELDIR does not exist, or does not hold any of the
upgrade sets."
__get_reldir_1
echo -n "Re-enter pathname? [y] "
getresp "y"
case "$resp" in
y*|Y*)