diff options
Diffstat (limited to 'distrib/arm32/floppies/inst-common')
-rw-r--r-- | distrib/arm32/floppies/inst-common/Makefile.inc | 49 | ||||
-rw-r--r-- | distrib/arm32/floppies/inst-common/dot.commonutils | 133 | ||||
-rw-r--r-- | distrib/arm32/floppies/inst-common/inst.sh | 953 | ||||
-rw-r--r-- | distrib/arm32/floppies/inst-common/instbin.conf | 29 | ||||
-rw-r--r-- | distrib/arm32/floppies/inst-common/list | 90 | ||||
-rw-r--r-- | distrib/arm32/floppies/inst-common/mtree.conf | 95 | ||||
-rw-r--r-- | distrib/arm32/floppies/inst-common/termcap.vt100 | 49 |
7 files changed, 1398 insertions, 0 deletions
diff --git a/distrib/arm32/floppies/inst-common/Makefile.inc b/distrib/arm32/floppies/inst-common/Makefile.inc new file mode 100644 index 00000000000..cbde1681f24 --- /dev/null +++ b/distrib/arm32/floppies/inst-common/Makefile.inc @@ -0,0 +1,49 @@ +# $NetBSD: Makefile.inc,v 1.1 1996/05/16 19:59:03 mark Exp $ + +# TOP is assumed to be defined by Makefile including this one. + +CBIN= instbin +COMMONDIR= ${TOP}/inst-common + +MOUNT_POINT?= /mnt +VND?= vnd0 +VND_DEV= /dev/${VND}a +VND_RDEV= /dev/r${VND}a +IMAGE?= xxx-${REV}.fs +MDEC= ${DESTDIR}/usr/mdec + +LISTS= ${COMMONDIR}/list ${.CURDIR}/list +CRUNCHCONF= ${COMMONDIR}/${CBIN}.conf +MTREE= ${COMMONDIR}/mtree.conf + +all: ${CBIN} + dd if=/dev/zero of=${IMAGE} bs=144k count=10 + vnconfig -v -c ${VND_DEV} ${IMAGE} + newfs -O -m 0 -o space -i 5120 -c 80 ${VND_RDEV} floppy + mount ${VND_DEV} ${MOUNT_POINT} + mtree -def ${MTREE} -p ${MOUNT_POINT}/ -u + TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \ + TARGDIR=${MOUNT_POINT} sh ${TOP}/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}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF} + crunchgen -D ${TOP}/../../.. -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 *.o *.lo *.c + +.include <bsd.obj.mk> +.include <bsd.subdir.mk> diff --git a/distrib/arm32/floppies/inst-common/dot.commonutils b/distrib/arm32/floppies/inst-common/dot.commonutils new file mode 100644 index 00000000000..cec4d110b7e --- /dev/null +++ b/distrib/arm32/floppies/inst-common/dot.commonutils @@ -0,0 +1,133 @@ +# $NetBSD: dot.commonutils,v 1.1 1996/05/16 19:59:04 mark Exp $ +# +# Copyright (c) 1994 Christopher G. Demetriou +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by Christopher G. Demetriou. +# 4. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# Installation utilites (functions), to get NetBSD installed on +# the hard disk. These are meant to be invoked from the shell prompt, +# by people installing NetBSD. + +# we know that /etc/fstab is only generated on the hard drive +dest_dir=/ +if [ ! -f /etc/fstab ]; then + dest_dir=/mnt/ +fi + +# counter for possible shared library confusion +TAR=/usr/bin/tar +GUNZIP=/usr/bin/gunzip + +Set_tmp_dir() +{ + def_tmp_dir=`pwd` + if [ "$def_tmp_dir" = "/" -o "$def_tmp_dir" = "/mnt" ]; then + def_tmp_dir="$dest_dir"usr/distrib + fi + + echo -n "What directory should be used to find and/or store " + echo "installtion" + echo -n "files? [$def_tmp_dir] " + read tmp_dir + if [ "$tmp_dir" = "" ]; then + tmp_dir=$def_tmp_dir + fi + if [ ! -d "$tmp_dir" ]; then + /bin/rm -rf $tmp_dir + mkdir -p $tmp_dir + fi +} + +Tmp_dir() +{ + if [ "$tmp_dir" = "" ]; then + Set_tmp_dir + fi + cd $tmp_dir +} + +Load_fd() +{ + Tmp_dir + which= + echo "Don't forget that you can't load from the drive you booted from." + echo "unless you booted with a ramdisk." + echo "" + + while [ "$which" != "0" -a "$which" != "1" ]; do + echo -n "Read from which floppy drive ('0' or '1')? [0] " + read which + if [ "X$which" = "X" ]; then + which=0 + fi + done + echo "" + echo "WARNING: during the floppy loading process, you should only" + echo "use Control-C at the prompt." + echo "" + while echo -n \ + "Insert floppy (hit Control-C to terminate, enter to load): " + do + read foo + mount -t msdos /dev/fd${which}a /mnt2 + cp -rp /mnt2/* . + umount /mnt2 + done +} + +Load_tape() +{ + Tmp_dir + echo -n "Which tape drive will you be using? [rst0] " + read which + if [ "X$which" = "X" ]; then + which=rst0 + fi + echo -n "Insert the tape into the tape drive and hit return to " + echo -n "continue..." + read foo + echo "Extracting files from the tape..." + $TAR xvpf --unlink /dev/$which + echo "Done." +} + +Extract() +{ + Tmp_dir + echo -n "Would you like to list the files as they're extracted? [n] " + read verbose + case $verbose in + y*|Y*) + tarverbose=v + ;; + *) + tarverbose= + ;; + esac + cat "$1"* | $GUNZIP | (cd $dest_dir ; $TAR --unlink -xp"$tarverbose"f - ) +} diff --git a/distrib/arm32/floppies/inst-common/inst.sh b/distrib/arm32/floppies/inst-common/inst.sh new file mode 100644 index 00000000000..619dc4d49f7 --- /dev/null +++ b/distrib/arm32/floppies/inst-common/inst.sh @@ -0,0 +1,953 @@ +#!/bin/sh +# +# $NetBSD: inst.sh,v 1.1 1996/05/16 19:59:05 mark Exp $ +# +# Copyright (c) 1995-1996 Mark Brinicombe +# 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 Mark Brinicombe. +# 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. +# +# from inst,v 1.9 1996/04/18 20:56:14 mark Exp $ +# + +# +# Installation utilites (functions), to get NetBSD installed on +# the hard disk. These are meant to be invoked from the shell prompt, +# by people installing NetBSD. +# + +VERSION=`echo '$Revision: 1.1 $' | cut '-d ' -f2` + +Load_tape() +{ + Tmp_dir + echo -n "Which tape drive will you be using? [rst0] " + read which + if [ "X$which" = "X" ]; then + which=rst0 + fi + echo -n "Insert the tape into the tape drive and hit return to " + echo -n "continue..." + read foo + echo "Extracting files from the tape..." + $TAR xvpf --unlink /dev/$which + echo "Done." +} + + +Get_Dest_Dir() +{ + echo -n "Enter new path to dest directory [$dest_dir] " + read newdir + if [ ! "X$newdir" = "X" ]; then + dest_dir=$newdir + fi +} + + +Get_Distrib_Dir() +{ + echo -n "Enter new path to distrib directory [$distribdir] " + read distribdir + if [ "X$distribdir" = "X" ]; then + distribdir=$destdir/usr/distrib + fi + if [ ! -d $distribdir ]; then + echo -n "$distribdir does not exist, create it [n] " + read yorn + if [ "$yorn" = "y" ]; then + mkdir $distribdir + fi + fi +} + + +Set_Distrib_Dir() +{ + while [ ! -d $distribdir ]; do + echo "Directory $distribdir does not exist" + Get_Distrib_Dir + done + + cd $distribdir +} + + +Load_Msdos_Fd() +{ + echo "Loading sets from msdos floppies" + Set_Distrib_Dir + + which= + while [ "$which" != "0" -a "$which" != "1" ]; do + echo -n "Read from which floppy drive ('0' or '1')? [0] " + read which + if [ "X$which" = "X" ]; then + which=0 + fi + done + + foo= + while [ "X$foo" = "X" ]; do + echo -n "Insert floppy (type s to stop, enter to load): " + read foo + if [ "X$foo" = "X" ]; then + mount -t msdos /dev/fd${which}a /mnt2 + cp -rp /mnt2/* . + umount /mnt2 + fi + done +} + + +Load_Tar_Fd() +{ + echo "Loading sets from tar floppies" + Set_Distrib_Dir + + which= + while [ "$which" != "0" -a "$which" != "1" ]; do + echo -n "Read from which floppy drive ('0' or '1')? [0] " + read which + if [ "X$which" = "X" ]; then + which=0 + fi + done + + foo= + while [ "X$foo" = "X" ]; do + echo -n "Insert floppy (type s to stop, enter to load): " + read foo + if [ "X$foo" = "X" ]; then + tar xf /dev/fd${which}a + fi + done +} + + +Load_Tar_Fd1() +{ + echo "Loading sets from multi-volume tar floppies" + Set_Distrib_Dir + + which= + while [ "$which" != "0" -a "$which" != "1" ]; do + echo -n "Read from which floppy drive ('0' or '1')? [0] " + read which + if [ "X$which" = "X" ]; then + which=0 + fi + done + + foo= + while [ "X$foo" = "X" ]; do + echo -n "Insert floppy (type s to stop, enter to load): " + read foo + if [ "X$foo" = "X" ]; then + tar xfM /dev/fd${which}a + fi + done +} + + +Load_Sets() +{ + res0= + while [ "$res0" != "q" -a "$res0" != "Q" ]; do + echo "" + echo -n "1. Set distrib directory (Currently $distribdir" + if [ ! -d $distribdir ]; then + echo " - non-existant)" + else + echo ")" + fi + echo "2. Load sets from msdos floppies" + echo "3. Load sets from tar floppies" + echo "4. Load sets from multi-volume tar floppies" + echo "Q. Return to previous menu" + echo "" + echo -n "Choice : " + read res0 + case "$res0" in + 1) + Get_Distrib_Dir + ;; + 2) + Load_Msdos_Fd + ;; + 3) + Load_Tar_Fd + ;; + 4) + Load_Tar_Fd1 + ;; + q|Q) +# echo "Returning to previous menu" + ;; + esac + done +} + + +Mount_SCSI_CDROM() +{ + which= + while [ "$which" != "0" -a "$which" != "1" ]; do + echo -n "Mount which CDROM drive ('0' or '1')? [0] " + read which + if [ "X$which" = "X" ]; then + which=0 + fi + done + + mount -r -t cd9660 /dev/cd${which}a /cdrom + if [ ! $? = 0 ]; then + echo "Mount failed" + else + distribdir="/cdrom/usr/distrib" + fi + +} + + +Mount_SCSI_Disc() +{ + echo -n "Mount which SCSI device as CDROM ? [sd0a] " + read which + + mount -r -t cd9660 /dev/${which} /cdrom + if [ ! $? = 0 ]; then + echo "Mount failed" + else + distribdir="/cdrom/usr/distrib" + fi + +} + + +Mount_ATAPI_CDROM() +{ + mount -r -t cd9660 /dev/wcd0a /cdrom + if [ ! $? = 0 ]; then + mount -r -t cd9660 /dev/wcd0a /cdrom + if [ ! $? = 0 ]; then + echo "Mount failed" + else + distribdir="/cdrom/usr/distrib" + fi + else + distribdir="/cdrom/usr/distrib" + fi + +} + + +CDROM_Sets() { + res0= + while [ "$res0" != "q" -a "$res0" != "Q" ]; do + echo "" + echo -n "1. Set distrib directory (Currently $distribdir" + if [ ! -d $distribdir ]; then + echo " - non-existant)" + else + echo ")" + fi + echo -n "2. Mount SCSI CDROM " + if [ ! -b /dev/cd0a ]; then + echo "- Not available" + else + echo "" + fi + echo -n "3. Mount ATAPI CDROM " + if [ ! -b /dev/wcd0a ]; then + echo "- Not available" + else + echo "" + fi + if [ -f /var/inst/developer ]; then + echo "D. Mount SCSI disc as CDROM" + fi + echo "Q. Return to previous menu" + echo "" + echo -n "Choice : " + read res0 + case "$res0" in + 1) + Get_Distrib_Dir + ;; + 2) + Mount_SCSI_CDROM + ;; + 3) + Mount_ATAPI_CDROM + ;; + d|D) + Mount_SCSI_Disc + ;; + q|Q) + ;; + esac + done +} + + +Show_Sets() +{ + Set_Distrib_Dir + sets=`ls *.[sS][eE][tT] 2>/dev/null | sed -e 's/.[sS][eE][tT]//'` + + echo "Loaded sets in $distribdir :" + for set in $sets; do + cat "$set".set 2>/dev/null | grep 'desc:' | cut -f2- + cat "$set".SET 2>/dev/null | grep 'desc:' | cut -f2- + done +} + + +Show_Installed_Sets() +{ + INSTALLDIR=$dest_dir/var/inst/installed + cd $INSTALLDIR + if [ ! $? = 0 ]; then + return + fi + sets=`ls *.[sS][eE][tT] 2>/dev/null | sed -e 's/.[sS][eE][tT]//'` + + echo "Installed sets:" + for set in $sets; do + cat "$set".set 2>/dev/null | grep 'desc:' | cut -f2- + cat "$set".SET 2>/dev/null | grep 'desc:' | cut -f2- + done +} + + +Validate_Sets() +{ + Set_Distrib_Dir + sets=`ls *.[sS][eE][tT] 2>/dev/null | sed -e 's/.[sS][eE][tT]//'` + list="" + + echo "Loaded sets in $distribdir :" + for set in $sets; do + printf "$set\t" + list="$list $set" + done + echo "" + + echo -n "Enter set names or 'all' for all sets : " + read res2 + res2=`echo "$res2" | tr "," " " | tr "[A-Z]" "[a-z]"` + if [ "$res2" = "all" ]; then + res2="$list" + fi + sets="$res2" + + echo "Validating in $distribdir :" + fail="" + for set in $sets; do + setname="set" + if [ ! -f "$set"."$setname" ]; then + setname="SET" + set=`echo $set | tr [a-z] [A-Z]` + fi + p1=`cat $set.$setname 2>/dev/null | grep 'parts:' | cut -f2` + if [ "$p1" = "" ]; then + continue + fi + p2=`ls "$set".[0-9a-z][0-9a-z] 2>/dev/null | wc | awk '{print $1}'` + printf "$set\t:" +# echo "$p1 , $p2" + if [ ! "$p1" = "$p2" ]; then + echo -n " Failed parts check (need $p1, got $p2)" + else + echo -n " Passed parts check" + fi + loop=0 + while [ $loop -lt $p1 ]; do + if [ $loop -lt 10 ]; then + file="0$loop" + else + file=$loop + fi + echo -n " [$file]" + cksum=`cat $set.$setname | grep "cksum.$file:" | cut -f2` + cksum1=`cat "$set".$file 2>&1 | cksum | cut "-d " -f1` + #echo "#$cksum, $cksum1#" + if [ ! "$cksum" = "$cksum1" ]; then + echo -n " part $file failed checksum" + fail="yes" + fi + loop=$(($loop+1)) + done + if [ "$fail" = "" ]; then + echo " Passed checksum" + else + echo "" + fi + done +} + + +Verify_Sets() +{ + Set_Distrib_Dir + sets=`ls *.[sS][eE][tT] 2>/dev/null | sed -e 's/.[sS][eE][tT]//'` + list="" + + echo "Loaded sets in $distribdir :" + for set in $sets; do + printf "$set\t" + list="$list $set" + done + echo "" + + echo -n "Enter set names or 'all' for all sets : " + read res2 + res2=`echo "$res2" | tr "," " " | tr "[A-Z]" "[a-z]"` + if [ "$res2" = "all" ]; then + res2="$list" + fi + sets="$res2" + + echo "Verifing sets in $distribdir :" + for set in $sets; do + setname="set" + if [ ! -f "$set"."$setname" ]; then + setname="SET" + set=`echo $set | tr [a-z] [A-Z]` + fi + printf "$set\t:" + cat "$set".[0-9a-z][0-9a-z] 2>/dev/null | $GUNZIP -t 2>/dev/null 1>/dev/null + if [ ! $? = 0 ]; then + echo " Failed archive integrity" + else + echo " Passed" + fi + done +} + + +Verify_Checksums() +{ + echo -n "Enter name of checksums file : " + read checkfile + if [ "X$checkfile" = "X" ]; then + return + fi + + Set_Distrib_Dir + sets=`ls *.[sS][eE][tT] 2>/dev/null | sed -e 's/.[sS][eE][tT]//'` + list="" + + echo "Available sets in $distribdir :" + for set in $sets; do + printf "$set\t" + list="$list $set" + done + echo "" + + echo -n "Enter set names or 'all' for all sets : " + read res2 + res2=`echo "$res2" | tr "," " " | tr "[A-Z]" "[a-z]"` + if [ "$res2" = "all" ]; then + res2="$list" + fi + sets="$res2" + + TMPFILE1="/tmp/inst.cksum1" + TMPFILE2="/tmp/inst.cksum2" + + echo "Verifing checksums for sets in $distribdir :" + for set in $sets; do + setname="set" + if [ ! -f "$set"."$setname" ]; then + setname="SET" + set=`echo $set | tr [a-z] [A-Z]` + fi + printf "$set\t:" + grep cksum $set.$setname >$TMPFILE1 + egrep -i "`echo ^$set.$setname | sed -e 's/\+/\\\\+/g'`" $checkfile | cut '-d:' -f2- >$TMPFILE2 + cmp -s $TMPFILE1 $TMPFILE2 + if [ $? = 0 ]; then + echo "checksums ok" + else + echo "checksum error" + fi + done + rm -f $TMPFILE1 + rm -f $TMPFILE2 +} + + +Check_Sets() { + res0= + while [ "$res0" != "q" -a "$res0" != "Q" ]; do + echo "" + echo "1. Validate distribution sets (confirm checksums)" + echo "2. Verify distribution sets (integrity check)" + echo "3. Verify checksums (confirm set checksums)" + echo "Q. Return to previous menu" + echo "" + echo -n "Choice : " + read res0 + case "$res0" in + 1) + Validate_Sets + ;; + 2) + Verify_Sets + ;; + 3) + Verify_Checksums + ;; + q|Q) + ;; + esac + done +} + + + + +List_Sets() +{ + Set_Distrib_Dir + sets=`ls *.[sS][eE][tT] 2>/dev/null | sed -e 's/.[sS][eE][tT]//'` + list="" + + echo "Loaded sets in $distribdir :" + for set in $sets; do + printf "$set\t" + list="$list $set" + done + echo "" + + echo -n "Enter set names or 'all' for all sets : " + read res2 + res2=`echo "$res2" | tr "," " " | tr "[A-Z]" "[a-z]"` + if [ "$res2" = "all" ]; then + res2="$list" + fi + sets="$res2" + + echo "Listing contents of sets in $distribdir :" + for set in $sets; do + setname="set" + if [ ! -f "$set"."$setname" ]; then + setname="SET" + set=`echo $set | tr [a-z] [A-Z]` + fi + echo "$set:" + cat "$set".[0-9a-z][0-9a-z] | $GUNZIP | $TAR -tpvf - + done +} + + +Install_Sets() +{ +# Make sure all the directories exist for recording the installation + + INSTALLDIR=$dest_dir/var/inst + if [ ! -d $dest_dir/var ]; then + echo "Creating $dest_dir/var" + mkdir $dest_dir/var + fi + if [ ! -d $INSTALLDIR ]; then + echo "Creating $INSTALLDIR" + mkdir $INSTALLDIR + fi + if [ ! -d $INSTALLDIR/installed ]; then + echo "Creating $INSTALLDIR/installed" + mkdir $INSTALLDIR/installed + fi + if [ ! -d $INSTALLDIR/sets ]; then + echo "Creating $INSTALLDIR/sets" + mkdir $INSTALLDIR/sets + fi + + if [ ! -d $dest_dir/tmp ]; then + echo "Creating $dest_dir/tmp" + mkdir $dest_dir/tmp + chmod 1777 $dest_dir/tmp + fi + +# Set the distribution directory and list all the available sets + + Set_Distrib_Dir + sets=`ls *.[sS][eE][tT] 2>/dev/null | sed -e 's/.[sS][eE][tT]//'` + list="" + + echo "Loaded sets in $distribdir :" + for set in $sets; do + printf "$set\t" + list="$list $set" + done + echo "" + +# Prompt for the sets to install + + echo -n "Enter set names or 'all' for all sets : " + read res2 + res2=`echo "$res2" | tr "," " " | tr "[A-Z]" "[a-z]"` + +# Check for any of the special sets + + if [ "$res2" = "all" ]; then + res2="$list" + fi + + if [ "$res2" = "req" ]; then + res2="base etc misc text kern" + fi + + if [ "$res2" = "std" ]; then + res2="base etc misc text local man kern" + fi + +# Hack to make sure the base set is the first installed + + echo "$res2" | grep base 2>/dev/null >/dev/null + if [ $? = 0 ]; then + res2="base "`echo "$res2" | sed 's/base//'` + fi + + echo "$res2" | grep BASE 2>/dev/null >/dev/null + if [ $? = 0 ]; then + res2="BASE "`echo "$res2" | sed 's/BASE//'` + fi + + echo -n "Would you like to list the files as they're extracted? [n] " + read verbose + case $verbose in + y*|Y*) + tarverbose=v + ;; + *) + tarverbose= + ;; + esac + + for set in $res2; do + setname="set" + if [ ! -f "$set"."$setname" ]; then + setname="SET" + set=`echo $set | tr [a-z] [A-Z]` + fi + +# Test for conflicts + + ok="" + for file in `ls $INSTALLDIR/installed/*.[sS][eE][tT] 2>/dev/null`; do + conflict="`grep conflict: $file | cut -d: -f2- 2>/dev/null`" + echo $conflict | egrep -i "(^|[[:space:]])$set([[:space:]]|$)" 2>/dev/null > /dev/null + if [ $? = 0 ]; then + echo "Set $set conflicts with installed set `basename $file`" + ok="no" + break + fi + done + + if [ ! "$ok" = "" ]; then + continue + fi + + conflicts="`grep conflict: $set.$setname | cut -d: -f2-`" + installed="`(cd $INSTALLDIR/installed ; ls *.[sS][eE][tT]) 2>/dev/null`" + + for conflict in $conflicts ; do + echo $installed | egrep -i "(^|[[:space:]])$conflict.set([[:space:]]|$)" 2>/dev/null > /dev/null + if [ $? = 0 ]; then + echo "Set $set conflicts with installed set $conflict" + ok="no" + break; + fi + done + + if [ ! "$ok" = "" ]; then + continue + fi + + dependancies="`grep depend: $set.$setname | cut -d: -f2-`" + installed="`(cd $INSTALLDIR/installed ; ls *.[sS][eE][tT]) 2>/dev/null`" + + for depend in $dependancies ; do + echo $installed | egrep -i "(^|[[:space:]])$depend\.set([[:space:]]|$)" 2> /dev/null >/dev/null + if [ ! $? = 0 ]; then + echo "Set $depend must be installed before $set" + ok="no" + break; + fi + done + + if [ ! "$ok" = "" ]; then + continue + fi + + if [ -f "$set".00 ]; then + if [ -x "$INSTALLDIR/scripts/$set" ]; then + echo "Running deinstallation script for $set" + (cd $dest_dir ; INSTALLROOT=$dest_dir; export INSTALLROOT ; $INSTALLDIR/scripts/$set deinstall) + fi + + filelist="$dest_dir/tmp/$set.files" + echo "Installing $set" + case $verbose in + y*|Y*) + cat "$set".[0-9a-z][0-9a-z] | $GUNZIP | (cd $dest_dir ; $TAR --unlink -xpvf - | tee $filelist) + ;; + *) + cat "$set".[0-9a-z][0-9a-z] | $GUNZIP | (cd $dest_dir ; $TAR --unlink -xpvf - >$filelist) + ;; + esac + echo "Generating installation information" + cat $filelist | awk '{ print $0 }' > $INSTALLDIR/installed/$set.files +# cat $filelist | awk '{ print $3 $8 }' > $INSTALLDIR/installed/$set.files + rm $filelist + cp $set.$setname $INSTALLDIR/installed/ + +# Run any install script + + if [ -x "$INSTALLDIR/scripts/$set" ]; then + echo "Running installation script for $set" + (cd $dest_dir ; INSTALLROOT=$dest_dir; export INSTALLROOT ; $INSTALLDIR/scripts/$set install) + fi + else + echo "Set $set not available for installation" + fi + sync + done + +# Test for other set requirements + + echo "Checking installed set requirements" + + installed="`(cd $INSTALLDIR/installed ; ls *.[sS][eE][tT]) 2>/dev/null`" + + for set in $installed; do + required="`grep req: $INSTALLDIR/installed/$set | cut -d: -f2- 2>/dev/null`" + for require in $required; do + echo $installed | egrep -i "(^|[[:space:]])$require.set([[:space:]]|$)" 2>/dev/null > /dev/null + if [ ! $? = 0 ]; then + echo "Set $set requires set $require" +# break + fi + done + done +} + + +Deinstall_Sets() +{ +# Make sure all the directories exist for recording the installation + + INSTALLDIR=$dest_dir/var/inst + +# Set the distribution directory and list all the available sets + + cd $INSTALLDIR/installed + sets=`ls *.[sS][eE][tT] 2>/dev/null | sed -e 's/.[sS][eE][tT]//'` + list="" + + echo "Installed sets :" + for set in $sets; do + printf "$set\t" + list="$list $set" + done + echo "" + +# Prompt for the sets to deinstall + + echo -n "Enter set names : " + read res2 + res2=`echo "$res2" | tr "," " " | tr "[A-Z]" "[a-z]"` + + echo -n "Would you like to list the files as they're removed? [n] " + read verbose + + for set in $res2; do + setname="set" + if [ ! -f "$set"."$setname" ]; then + setname="SET" + set=`echo $set | tr [a-z] [A-Z]` + fi + + if [ -f "$set".set ]; then +# Test for dependancies + + ok="" + for file in `ls $INSTALLDIR/installed/*.[sS][eE][tT] 2>/dev/null`; do + depend="`grep depend: $file 2>/dev/null`" + echo $depend | egrep -i "(^|[[:space:]])$set([[:space:]]|$)" 2>/dev/null > /dev/null + if [ $? = 0 ]; then + echo "Installed set $file depends on set $set" + ok="no" + break + fi + done + + if [ ! "$ok" = "" ]; then + continue + fi + + echo "Deinstalling $set" + if [ -x "$INSTALLDIR/scripts/$set" ]; then + echo "Running deinstallation script for $set" + (cd $dest_dir ; INSTALLROOT=$dest_dir; export INSTALLROOT ; $INSTALLDIR/scripts/$set deinstall) + fi + case $verbose in + y*|Y*) + for file in `cat $set.files`; do + echo $file + (cd $dest_dir ; rm $file) 2>/dev/null >/dev/null + done + ;; + *) + cat "$set.files" | (cd $dest_dir ; xargs rm 2>/dev/null >/dev/null ) + ;; + esac + rm "$set.files" + rm "$set.set" + else + echo "Set $set not available for deinstallation" + fi + sync + done + +# Test for other set requirements + + echo "Checking installed set requirements" + + installed="`(cd $INSTALLDIR/installed ; ls *.[sS][eE][tT]) 2>/dev/null`" + + for set in $installed; do + required="`grep req: $INSTALLDIR/installed/$set | cut -d: -f2- 2>/dev/null`" + for require in $required; do + echo $installed | egrep -i "(^|[[:space:]])$require.set([[:space:]]|$)" 2>/dev/null > /dev/null + if [ ! $? = 0 ]; then + echo "Set $set requires set $require" +# break + fi + done + done +} + + +Select_Sets() +{ +} + + +Main_Menu() +{ + res1= + while [ "$res1" != "q" -a "$res1" != "Q" ]; do + echo "" + echo "RiscBSD (NetBSD/arm32) Installer V$VERSION" + echo "" + echo -n "1. Set distrib directory (Currently $distribdir" + if [ ! -d $distribdir ]; then + echo " - non-existant)" + else + echo ")" + fi + echo "2. Load distribution sets onto harddisc" + echo "3. Load distribution sets from CDROM" + echo "4. Show distribution sets" + echo "5. Show installed sets" + echo "6. Check sets (verify/validate)" + echo "7. List contents of distribution sets in $distribdir" + echo "8. Install distribution sets from $distribdir" + echo "D. Deinstall installed sets" + echo "R. Set root directory for install (Currently $dest_dir)" + echo "Q. Quit" + echo "" + echo -n "Choice : " + read res1 + case "$res1" in + 1) + Get_Distrib_Dir + ;; + 2) + Load_Sets + ;; + 3) + CDROM_Sets + ;; + 4) + Show_Sets + ;; + 5) + Show_Installed_Sets + ;; + 6) + Check_Sets + ;; + 7) + List_Sets + ;; + 8) + Install_Sets + ;; + d|D) + Deinstall_Sets + ;; + r|R) + Get_Dest_Dir + ;; + q|Q) +# echo "Quitting" + ;; + esac + done +} + + +# we know that /etc/fstab is only generated on the hard drive +destdir= +dest_dir=/ +if [ ! -f /etc/fstab ]; then + dest_dir=/mnt/ +fi +if [ -f /etc/cdrom ]; then + dest_dir=/mnt/ +fi + +# counter for possible shared library confusion +TAR=/usr/bin/tar +GUNZIP=/usr/bin/gunzip + +distribdir=$destdir/usr/distrib + +#IAM=`whoami` +# +#if [ ! "$IAM" = "root" ]; then +# echo "inst should be run as root" +# exit +#fi + +Main_Menu + +exit diff --git a/distrib/arm32/floppies/inst-common/instbin.conf b/distrib/arm32/floppies/inst-common/instbin.conf new file mode 100644 index 00000000000..dbeac1091bd --- /dev/null +++ b/distrib/arm32/floppies/inst-common/instbin.conf @@ -0,0 +1,29 @@ +# +# $NetBSD: instbin.conf,v 1.1 1996/05/16 19:59:07 mark Exp $ +# + +srcdirs bin sbin usr.bin/less usr.bin usr.sbin gnu/usr.bin + +progs cat chmod chown chroot cp dd df disklabel ed expr fsck_ffs ftp gawk grep +progs gzip ifconfig init less ln ls mkdir mknod mount mount_cd9660 +progs mount_ffs mount_msdos mount_nfs mount_kernfs +progs mv newfs ping printf pwd reboot rm route +progs sed sh shutdown slattach strings stty sync tar test tip umount +progs update cksum wc tee tr cut cmp xargs + +ln chown chgrp +ln fsck_ffs fsck +ln gawk awk +ln grep egrep +ln gzip gzcat gunzip +ln sh -sh # init invokes the shell this way +ln test [ +ln mount_cd9660 cd9660 +ln mount_ffs ffs +ln mount_msdos msdos +ln mount_nfs nfs +ln mount_kernfs kernfs +ln less more +ln reboot halt + +libs -ledit -lutil -ltermcap -lcrypt -ll -lm diff --git a/distrib/arm32/floppies/inst-common/list b/distrib/arm32/floppies/inst-common/list new file mode 100644 index 00000000000..3075cf8e347 --- /dev/null +++ b/distrib/arm32/floppies/inst-common/list @@ -0,0 +1,90 @@ +# $NetBSD: list,v 1.1 1996/05/16 19:59:08 mark Exp $ + +# 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/ln +LINK instbin bin/ls +LINK instbin bin/mkdir +LINK instbin bin/mv +LINK instbin bin/pwd +LINK instbin bin/rm +LINK instbin bin/sh +LINK instbin bin/stty +LINK instbin bin/sync +LINK instbin bin/test +LINK instbin bin/[ +LINK instbin sbin/disklabel +LINK instbin sbin/fsck +LINK instbin sbin/fsck_ffs +LINK instbin 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_msdos +LINK instbin sbin/mount_nfs +LINK instbin sbin/mount_kernfs +LINK instbin sbin/newfs +LINK instbin sbin/ping +LINK instbin sbin/reboot +LINK instbin sbin/route +LINK instbin sbin/shutdown +LINK instbin sbin/slattach +LINK instbin sbin/umount +SYMLINK /bin/cat usr/bin/awk +SYMLINK /bin/cat usr/bin/chgrp +SYMLINK /bin/cat usr/bin/cksum +SYMLINK /bin/cat usr/bin/cmp +SYMLINK /bin/cat usr/bin/cut +SYMLINK /bin/cat usr/bin/ftp +SYMLINK /bin/cat usr/bin/gunzip +SYMLINK /bin/cat usr/bin/gzcat +SYMLINK /bin/cat usr/bin/gzip +SYMLINK /bin/cat usr/bin/grep +SYMLINK /bin/cat usr/bin/more +SYMLINK /bin/cat usr/bin/printf +SYMLINK /bin/cat usr/bin/sed +SYMLINK /bin/cat usr/bin/strings +SYMLINK /bin/cat usr/bin/tar +SYMLINK /bin/cat usr/bin/tee +SYMLINK /bin/cat usr/bin/tip +SYMLINK /bin/cat usr/bin/tr +SYMLINK /bin/cat usr/bin/wc +SYMLINK /bin/cat usr/bin/xargs +SYMLINK /bin/cat usr/sbin/chown +SYMLINK /bin/cat usr/sbin/chroot +SYMLINK /bin/cat usr/sbin/update +SPECIAL /bin/rm instbin + +# copy the MAKEDEV script and make some devices +COPY ${DESTDIR}/dev/MAKEDEV dev/MAKEDEV +SPECIAL cd dev; sh MAKEDEV floppy +SPECIAL /bin/rm dev/MAKEDEV + +# we need the contents of /usr/mdec +#COPYDIR ${DESTDIR}/usr/mdec usr/mdec + +# 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 + +# and the common installation tools +COPY ${TOPDIR}/inst-common/dot.commonutils .commonutils +COPY ${TOPDIR}/inst-common/termcap.vt100 usr/share/misc/termcap + +COPY ${TOPDIR}/inst-common/inst.sh usr/local/sbin/inst +SPECIAL /bin/chmod 755 usr/local/sbin/inst diff --git a/distrib/arm32/floppies/inst-common/mtree.conf b/distrib/arm32/floppies/inst-common/mtree.conf new file mode 100644 index 00000000000..d673b106253 --- /dev/null +++ b/distrib/arm32/floppies/inst-common/mtree.conf @@ -0,0 +1,95 @@ +# $NetBSD: mtree.conf,v 1.1 1996/05/16 19:59:09 mark Exp $ + +/set type=dir uname=root gname=wheel mode=0755 +# . +. + +# ./bin +bin +# ./bin +.. + +# ./dev +dev +# ./dev +.. + +# ./etc +etc +# ./etc +.. + +# ./mnt +mnt +# ./mnt +.. + +# ./mnt2 +mnt2 +# ./mnt2 +.. + +# ./kern +kern +# ./kern +.. + +# ./cdrom +cdrom +# ./cdrom +.. + +# ./sbin +sbin +# ./sbin +.. + +# ./tmp +tmp +# ./tmp +.. + +# ./usr +usr + +# ./usr/bin +bin +# ./usr/bin +.. + +# ./usr/mdec +mdec +# ./usr/mdec +.. + +# ./usr/sbin +sbin +# ./usr/sbin +.. + +# ./usr/local +local + +# ./usr/local/sbin +sbin + +# ./usr/local +.. + +# ./usr +.. + +# ./usr/share +share + +# ./usr/share/misc +misc +# ./usr/share/misc +.. + +# ./usr/share +.. + +# ./usr +.. + diff --git a/distrib/arm32/floppies/inst-common/termcap.vt100 b/distrib/arm32/floppies/inst-common/termcap.vt100 new file mode 100644 index 00000000000..57340c7000a --- /dev/null +++ b/distrib/arm32/floppies/inst-common/termcap.vt100 @@ -0,0 +1,49 @@ +# $NetBSD: termcap.vt100,v 1.1 1996/05/16 19:59:11 mark 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 +# +vt100|vt100-am|dec vt100 (w/advanced video):\ + :am:mi:ms:xn:xo:\ + :co#80:it#8:li#24:vt#3:\ + :DO=\E[%dB:K1=\EOq:K2=\EOr:K3=\EOs:K4=\EOp:K5=\EOn:\ + :LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:ae=^O:as=^N:bl=^G:\ + :cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:\ + :cs=\E[%i%d;%dr:ct=\E[3g:do=^J:ho=\E[H:k0=\EOy:\ + :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\EOt:k6=\EOu:\ + :k7=\EOv:k8=\EOl:k9=\EOw:kb=^H:kd=\EOB:ke=\E[?1l\E>:\ + :kl=\EOD:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:le=^H:mb=\E[5m:\ + :md=\E[1m:me=\E[m\017:mr=\E[7m:nd=\E[C:rc=\E8:\ + :..sa=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;:\ + :sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:st=\EH:ta=^I:\ + :ue=\E[m:up=\E[A:us=\E[4m: |