head	3.6;
access;
symbols
	fsadapt2_1:2.1;
locks; strict;
comment	@# @;


3.6
date	98.11.13.11.23.23;	author amn;	state Exp;
branches;
next	3.5;

3.5
date	98.11.12.09.15.26;	author amn;	state Exp;
branches;
next	3.4;

3.4
date	98.11.11.12.33.07;	author amn;	state Exp;
branches;
next	3.3;

3.3
date	98.10.30.20.00.31;	author amn;	state Exp;
branches;
next	3.2;

3.2
date	98.10.29.10.32.32;	author amn;	state Exp;
branches;
next	3.1;

3.1
date	98.10.27.14.45.11;	author amn;	state Exp;
branches;
next	2.5;

2.5
date	98.02.10.15.02.27;	author amn;	state Exp;
branches;
next	2.4;

2.4
date	98.02.09.15.04.53;	author amn;	state Exp;
branches;
next	2.2;

2.2
date	98.02.05.13.30.42;	author amn;	state Exp;
branches;
next	2.1;

2.1
date	97.10.22.18.01.50;	author root;	state Exp;
branches;
next	2.0;

2.0
date	97.10.22.12.56.53;	author root;	state Exp;
branches;
next	1.14;

1.14
date	96.03.05.12.14.28;	author root;	state Exp;
branches;
next	1.13;

1.13
date	95.12.01.20.27.37;	author root;	state Exp;
branches;
next	1.12;

1.12
date	95.12.01.19.59.48;	author root;	state Exp;
branches;
next	1.11;

1.11
date	95.09.05.12.44.05;	author root;	state Exp;
branches;
next	1.10;

1.10
date	95.08.29.13.51.29;	author root;	state Exp;
branches;
next	1.9;

1.9
date	95.08.29.10.11.43;	author root;	state Exp;
branches;
next	1.8;

1.8
date	95.08.22.16.18.52;	author root;	state Exp;
branches;
next	1.7;

1.7
date	95.08.04.17.32.47;	author root;	state Exp;
branches;
next	1.6;

1.6
date	95.08.04.14.54.19;	author root;	state Exp;
branches;
next	1.5;

1.5
date	95.08.02.16.34.00;	author root;	state Exp;
branches;
next	1.4;

1.4
date	95.06.12.15.45.03;	author root;	state Exp;
branches;
next	1.3;

1.3
date	95.06.12.15.13.15;	author root;	state Exp;
branches;
next	1.2;

1.2
date	95.06.12.15.07.28;	author root;	state Exp;
branches;
next	1.1;

1.1
date	95.06.12.07.49.58;	author root;	state Exp;
branches;
next	;


desc
@@


3.6
log
@Corrected gpib patch contents, added after-login govt warnings.
@
text
@#!/bin/sh
# fsadapt  -- adapt a Debian 2.0 r2 installation for FS
# $Id: fsadapt,v 3.5 1998/11/12 09:15:26 amn Exp amn $

# What          When                  Who
# $Log: fsadapt,v $
# Revision 3.5  1998/11/12 09:15:26  amn
# Updated Linux-gpib from 2.03 to 2.04 ("SLOW_DOWN_IO()").
#
# Revision 3.4  1998/11/11 12:33:07  amn
# Added command line parameters and numerous corrections.
#
# Revision 3.3  1998/10/30 20:00:31  amn
# X-basckspace-delete, net services off, smailconfig, and many others.
#
# Revision 3.2  1998/10/29 10:32:32  amn
# Changed magicfilter file location, X-sed, and mke2fs-/usr2-detection.
#
# Revision 3.1  1998/10/27 14:45:11  amn
# For Debian 2.0 r2: changed all 'patch' usages et al.
#
# Revision 2.5  1998/02/10 15:02:27  amn
# Updated version number in backdrop, added /dev/tape.
#
# Revision 2.4  1998/02/09 15:04:53  amn
# Updating backdrop version number, syncing RCS version number.
#
# Revision 2.2  1998/02/05 13:30:42  amn
# fort77, ibProto.h, Vikom Pro, blank passwd of user1, config kernel 2.0.30
# only, no networking clears netconfig-generated /etc/resolv.conf, updated
# backdrop version number.
#
# Revision 2.1  1997/10/22 18:01:50  root
# Testing for existence of /etc/printcap before moving it to .orig.
#
# Revision 2.0  1997/10/22 12:56:53  root
# Completely revised for Debian 1.3.1.r3.
#
# Revision 1.14  1996/03/05  12:14:28  root
# For fsadapt-1.12, provide an XF86Config alternative for 21" Nokia.
#
# Revision 1.13  1995/12/01  20:27:37  root
# For fsadapt-1.11, enable copying updatred X servers from fsadapt directory.
#
# Revision 1.12  1995/12/01  19:59:48  root
# As released on 5-Sep-95.
#
# Revision 1.11  1995/09/05  12:44:05  root
# Final Setp 5 release changes.
#
# Revision 1.10  1995/08/29  13:51:29  root
# Name change from fsup to fsadapt.
#
# Revision 1.9  1995/08/29  10:11:43  root
# Blank password check at the beginning, /da, /db, 3c59x, corrected
# rc.serial (in phase 2 instead of 1), prepackaged root/oper/prog/powerdown.
#
# Revision 1.8  1995/08/22  16:18:52  root
# I.e., powerdown script copying, CD-ROM in fstab, passwd escape hatch etc.
#
# Revision 1.7  1995/08/04  17:32:47  root
# Oper, prog, powerdown defaults were always off.
#
# Revision 1.6  1995/08/04  14:54:19  root
# 'Click' to 'select', 'rc.serial', 'powerdown', XF86Config_S3,
# cancel from phase 1, etc.
#
# Revision 1.5  1995/08/02  16:34:00  root
# Name changed from 'update-sw230-to-fs' int 'fsadapt',
# standard /etc/gpib.conf, Linux kernel version 1.2.12 etc.
#
# Revision 1.4  1995/06/12  15:45:03  root
# Bash 1.14.4(1) is still broken for 'f77' use, returns 'Error 4' in make.
#
# Revision 1.3  1995/06/12  15:13:15  root
# Must delete a directory before copying over with 'cp -a'.
#
# Revision 1.2  1995/06/12  15:07:28  root
# Added Linux 1.2.9 support.
#
# Revision 1.1  1995/06/12  07:49:58  root
# Initial revision
#
# 1995-06-07  amn  Selecting target dir/dev, X setup.
# 1995-06-06  amn  Original version.

readonly DIALOG="dialog --backtitle FS/Debian/Linux-fsadapt-3.6"
readonly PATCHOPTS="-s -p1 --set-utc"
readonly MFLOC="/etc/magicfilter"

# Process command line arguments.
NODIALOGS=""
PHASE1=""
PHASE2=""
PHASE3=""
SHOWPHASE1=""
SHOWPHASE2=""
SHOWPHASE3=""
while [ "$1" != "" ]; do
  case $1 in
    "-n")
      NODIALOGS=1
      shift
      ;;
    "-1")
      SHOWPHASE1=1
      shift
      while [ "$1" != "" ]; do
        case $1 in
          -*)
            break;
            ;;
          *)
            PHASE1="${PHASE1} $1"
            ;;
        esac
        shift
      done
      ;;
    "-2")
      SHOWPHASE2=1
      shift
      while [ "$1" != "" ]; do
        case $1 in
          -*)
            break;
            ;;
          *)
            PHASE2="${PHASE2} $1"
            ;;
        esac
        shift
      done
      ;;
    "-3")
      SHOWPHASE3=1
      shift
      while [ "$1" != "" ]; do
        case $1 in
          -*)
            break;
            ;;
          *)
            PHASE3="${PHASE3} $1"
            ;;
        esac
        shift
      done
      ;;
    *)
      echo "fsadapt: usage: fsadapt [-n] [-1 opt1...] [-2 opt2...] [-3 opt3...]" >&2
      exit
      ;;
  esac
done

# If no dialog requested in command line, show all.
if [ ! "$SHOWPHASE1" -a ! "$SHOWPHASE2" -a ! "$SHOWPHASE3" ]; then
  SHOWPHASE1=1
  SHOWPHASE2=1
  SHOWPHASE3=1
fi

# Check for blank root password and refuse to continue unless set.
blank_root=`grep '^root::' /etc/passwd`
blank_oper=`grep '^oper::' /etc/passwd`
unset_oper=`grep '^oper:\*:' /etc/passwd`
blank_prog=`grep '^prog::' /etc/passwd`
unset_prog=`grep '^prog:\*:' /etc/passwd`
has_user1=`grep '^user1:' /etc/passwd`
if [ "$has_user1" ]; then
  user1_text=", 'user1'"
else
  user1_text=""
fi
blank_user1=`grep '^user1::' /etc/passwd`
unset_user1=`grep '^user1:\*:' /etc/passwd`
##if [ "$blank_root" -o "$blank_oper" -o "$blank_prog" -o "$blank_user1" -o "$unset_oper" -o "$unset_prog" -o "$unset_user1" ]; then
if [ "$blank_root" -o "$blank_oper" -o "$blank_prog" -o "$blank_user1" ]; then
  if [ "$NODIALOGS" ]; then
    echo "fsadapt: must set passwords for ('root', 'oper', 'prog'${user1_text}) first" >&2
    exit
  else
    ${DIALOG} --title "Check user accounts and passwords" \
      --msgbox \
"\nYou _must_ set passwords for all default user accounts\n\
('root', 'oper', 'prog'${user1_text})\n\
before continuing the update process.\n\n\
Invoke the command 'passwd' for each of them.\n" \
      17 74
    if [ $? = 255 ]; then
      : # Undocumented skip-over by pressing a certain key in dialog...
    else
      exit
    fi
  fi
fi

# Determine the absolute path to the directory name where this script resides.
SRCS=${0%fsadapt}
if [ x$SRCS = x ]; then
  SRCS="./"
fi
if [ ${SRCS#/} = $SRCS ]; then  # it doesn't start with a '/'
  SRCS=`pwd`/$SRCS
fi

# Establish default update target (a future (or current) FS root file system).
if [ x$1 = x ]; then
  if [ `hostname` = bigbang ]; then
    # amn's special setup, since I usually run this
    # to update Westerbork SCSI disk mounted at /s1...
    NEW_ROOT=/s1/
  else
    NEW_ROOT=/
  fi 
else
  NEW_ROOT=$1
fi

# Again, amn's special case: if updating the third ("larger root")
# partition on my 1GB SCSI disk, default the root device to that...
if [ $NEW_ROOT = /s5/ ]; then
  NEW_ROOT_DEVICE=/dev/sda5
else
  NEW_ROOT_DEVICE=/dev/sda1
fi
NEW_SWAP_DEVICE=/dev/sda2
NEW_USR2_DEVICE=/dev/sda3

# Try to get the "true and right" device names from 'mount' output
# if we are running $NEW_ROOT = /, i.e. a "living" system.
# (xxx: Doesn't support multiple swap partitions yet...)
if [ $NEW_ROOT = / ]; then
  NEW_ROOT_DEVICE="`mount | fgrep "on / " | cut -d' ' -f1`"
  if fgrep "swap" /etc/fstab >/dev/null; then
    NEW_SWAP_DEVICE="`fgrep "swap" /etc/fstab | cut -d' ' -f1`"
  fi
  # Must be a local real Ext2 file system.
  if mount | fgrep "/usr2" | fgrep "ext2" | grep '^/dev' >/dev/null; then
    NEW_USR2_DEVICE="`mount | fgrep "/usr2" | cut -d' ' -f1`"
  fi
fi

# There must be a Debian-specific '/var/lib/dpkg'
# on the new target root file system.
if [ ! -d ${NEW_ROOT}var/lib/dpkg ]; then
  if [ "$NODIALOGS" ]; then
    echo "fsadapt: target new root directory ($NEW_ROOT) not valid" >&2
    exit
  else
    ${DIALOG} --title "Target root file system problem" \
      --msgbox \
"\nThe target directory for the new root file system ($NEW_ROOT)\n\
either doesn't exist\n\
or it doesn't contain Debian 2.0 r2 installed on it.\n\
\n\
Please check the target directory (note the need for trailing '/')\n\
and possibly supply the correct directory name as the first\n\
parameter to this script ($0).\n\
\n\
Select 'OK' to exit and retry." \
      17 74
    exit
  fi
fi

# Now show the root, swap, usr2 settings and provide a way to back out.
if [ "$NODIALOGS" ]; then
  :
else
  ${DIALOG} --title "fsadapt: current root / swap / usr2 settings" \
    --yesno \
"\nWe are about to update a Debian 2.0 r2 + Linux 2.0.34\n\
installation to support running FS9.\
\n\
Target directory\n\
i.e. where the new root file system is mounted now:  $NEW_ROOT\n\
\n\
Target root file system device:    $NEW_ROOT_DEVICE\n\
Swap partition that will be used:  $NEW_SWAP_DEVICE\n\
Partition for '/usr2':             $NEW_USR2_DEVICE\n\
\n\
If these are correct, select 'Yes'.
Select 'No' to cancel this script ($0)." \
      17 74
  if [ $? != 0 ]; then
    exit
  fi
fi


# Ensure that mount points are created.
mkdir -p ${NEW_ROOT}da ${NEW_ROOT}db ${NEW_ROOT}dosa ${NEW_ROOT}cdrom


# Determine if the various kernel and conf file patches have been applied.

# Default verbosity (none).
VERBO=''
VERBOQ='--quiet'

# Debian 2.0 prefers to keep /usr/include/linux|asm in synch with glibc,
# and drivers must -I/usr/src/linux/include to get access to kernel stuff.
## Fix /usr/include/linux symlink.
## xxx: maybe later perform like fsadapt-1.14 kernel-1.2.8.patch 
##      alias mount root readonly/rtx 990/latency enabler.
##      (fgrep 990 ${NEW_ROOT}usr/src/linux/kernel/sys.c >/dev/null)
#if [ -L ${NEW_ROOT}usr/include/linux -a -L ${NEW_ROOT}usr/include/asm ]; then
#  kernelinc_def="off"
#else
#  kernelinc_def="on"
#fi

# Linux-gpib-2.04 driver for NI ATGPIB.
if [ ! -d ${NEW_ROOT}usr/src/linux-gpib-2.04 ]; then
  atgpib_def="on"
else
  atgpib_def="off"
fi

# Add 'rtx' / 990 group into '/etc/group'.
if (grep 'rtx:.:990' ${NEW_ROOT}etc/group >/dev/null); then
  rtxgroup_def="off"
else
  rtxgroup_def="on"
fi
# Add std accounts.
is_root=`grep '^root:' ${NEW_ROOT}etc/passwd`
is_oper=`grep '^oper:' ${NEW_ROOT}etc/passwd`
is_prog=`grep '^prog:' ${NEW_ROOT}etc/passwd`
if [ "$is_root" -a "$is_oper" -a "$is_prog" ]; then
  stdaccts_def="off"
else
  stdaccts_def="on"
fi

# Create '/etc/lilo.conf'.
liloconf_def="on"
if [ -r ${NEW_ROOT}etc/lilo.conf ]; then
  if (fgrep 'digi=' ${NEW_ROOT}etc/lilo.conf >/dev/null); then
    liloconf_def="off"
  fi
fi

## If only libproc.so.1.12 exists and not 1.11, make a quick fix
## for Debian 1.3.1.r3 to enable xload and others to work.
#libproc_def="off"
#if [ -r ${NEW_ROOT}lib/libproc.so.1.12 ]; then
#  if [ ! -e ${NEW_ROOT}lib/libproc.so.1.11 ]; then
#    libproc_def="on"
#  fi
#fi

# If fort77 is of version 1.15 and doesn't have 'gcc -E -' fix, fix it.
fort77_def="off"
if (fgrep '$version = "1.15"' ${NEW_ROOT}usr/bin/fort77 >/dev/null); then
  if (fgrep 'gcc -E - -trad' ${NEW_ROOT}usr/bin/fort77 >/dev/null); then
    :
  else
    fort77_def="on"
  fi
fi

# Has telnet '-h'?
noident_def="off"
if (fgrep '/usr/sbin/in.telnetd -h' ${NEW_ROOT}etc/inetd.conf >/dev/null); then
  noident_def="off"
fi

# Has wu-ftpd '-l'?
ftpdlog_def="off"
if (fgrep '/usr/sbin/ftpd -l' ${NEW_ROOT}etc/inetd.conf >/dev/null); then
  ftpdlog_def="off"
fi

# Do we have 'GOVERNMENT' prompts?
govt_def="off"

# Present a checklist of the patches to do.
if [ "$NODIALOGS" ]; then
  :  # Use PHASE1 params from command line.
elif [ "$SHOWPHASE1" ]; then
  ${DIALOG} --title "FS Adaptation: Modifications" \
    --checklist \
"An 'X' indicates that this action can safely be performed now.
(You may choose to uncheck a given action for specific reasons.)
\n\
Missing 'X' indicates that this action has already been performed.\n\
Most of these can only be done _once_, so please don't put an 'X' on\n\
unless you are certain that you want and can to do that item again." \
22 76 10 \
  skip      "Skip all steps below (regardless of [X] marks)" off \
  verbose   "Show names of files being processed in 'fsadapt'" off \
  atgpib    "Install NI AT-GPIB driver and library" $atgpib_def \
  rcboot    "Adjust 'rc.boot' to run FS-specific programs in boot" "on" \
  rtxgroup  "Add 'rtx' group to '/etc/group'" $rtxgroup_def \
  stdaccts  "Add 'oper' and 'prog' to '/etc/passwd'" $stdaccts_def \
  liloconf  "Put a simple LILO configuration into '/etc/lilo.conf'" $liloconf_def \
  fstab     "Make sure that '/etc/fstab' includes '/usr2' etc" "on" \
  fort77    "Patch version 1.15 of fort77 command" $fort77_def \
  noident   "Remove host and op.sys info from login prompts" $noident_def \
  ftpdlog   "Enable additional logging of FTP sessions served" $ftpdlog_def \
  govt      "Add 'U.S. Government' warnings to login prompts" $govt_def \
  2>/tmp/reply
  # Cancel?
  if [ $? != 0 ]; then
    rm -f /tmp/reply
    exit
  fi
  PHASE1=`cat /tmp/reply | sed 's!\"!!g' `
else
  PHASE1="skip"
fi
#--
  PATCH_ERRS=${SRCS}patch-results-`date +'%Y%m%d%H%M%S'`
  echo -e "Output of patch commands during the FS updating process\\n`date`\\n" > $PATCH_ERRS
  for i in $PHASE1; do
    case $i in
      skip)
break
;;
      verbose)
VERBO='-v'
VERBOQ=''
;;
#      kernelinc)
### kernel-1.2.8.patch alias mount root readonly/rtx 990/latency enabler.
##(cd ${NEW_ROOT}usr/src/linux; patch ${PATCHOPTS} <${SRCS}kernel-1.2.8.patch) 2>> $PATCH_ERRS
## After new kernel stuff is in place, adjust /usr/include/linux symlink.
#for SUBD in linux asm; do
#  if [ -L ${NEW_ROOT}usr/include/${SUBD} ]; then
#    rm -f ${NEW_ROOT}usr/include/${SUBD}
#  else
#    mv ${VERBO} -f ${NEW_ROOT}usr/include/${SUBD} ${NEW_ROOT}usr/include/${SUBD}.orig
#  fi
#  ln ${VERBO} -s ../src/linux/include/${SUBD} ${NEW_ROOT}usr/include/${SUBD}
#done
### And then we do a cruel thing, namely zap (possible) previous
### configuration choices and replace the default main configurator
### with choices of our own.
##rm -f ${NEW_ROOT}usr/src/linux/.config
##if [ ! -e ${NEW_ROOT}usr/src/linux/arch/i386/config.in.replaced ]; then
##  mv ${VERBO} ${NEW_ROOT}usr/src/linux/arch/i386/config.in ${NEW_ROOT}usr/src/linux/arch/i386/config.in.replaced
##fi
### (this is Linux kernel version specific, so use direct version number
###  to deliberately break this on new versions...)
##cp ${VERBO} -p ${SRCS}replacement-config-in ${NEW_ROOT}usr/src/linux-1.2.12/arch/i386/config.in
#;;
      atgpib)
# Linux-gpib-2.04 driver for NI ATGPIB.
pushd ${NEW_ROOT}usr/src >/dev/null
rm -rf linux-gpib* \
  ${NEW_ROOT}usr/include/gpib ${NEW_ROOT}usr/lib/libgpib.a
tar ${VERBO} -xzf ${SRCS}linux-gpib-2.04a.base.tar.gz 
mv ${VERBO} linux-gpib linux-gpib-2.04
ln ${VERBO} -s linux-gpib-2.04 linux-gpib
ln ${VERBO} -s ../src/linux-gpib/include ${NEW_ROOT}usr/include/gpib
ln ${VERBO} -s ../src/linux-gpib/lib/libgpib.a ${NEW_ROOT}usr/lib/libgpib.a
# Make GPIB driver use MODEVERSION kernel symbols.
(cd linux-gpib; patch ${PATCHOPTS} <${SRCS}linux-gpib-2.04a-base.patch) 2>> $PATCH_ERRS
### Make /usr/bin/dialog available as /bin/dialog for gpib configurator.
##if [ ! -e ${NEW_ROOT}bin/dialog ]; then
##  ln ${VERBO} -s ../usr/bin/dialog ${NEW_ROOT}bin/dialog
##fi
# Replace the default '/etc/gpib.conf' with our version with 32 devices.
if [ ! -e linux-gpib/util/templates/gpib.conf.dist ]; then
  mv ${VERBO} -f linux-gpib/util/templates/gpib.conf linux-gpib/util/templates/gpib.conf.dist
fi
cp ${VERBO} -a ${SRCS}replacement-gpib-conf-template linux-gpib/util/templates/gpib.conf
popd >/dev/null
# Copy the precompiled 'gpib0.o' into the system.
cp ${VERBO} -p ${SRCS}gpib0.o /lib/modules/`uname -r`/misc
depmod ${VERBO} -a -e
rmmod gpib0 >/dev/null 2>&1
insmod ${VERBO} gpib0
# Patch for incorrectly tar-expanded /etc/gpib.conf files:
if [ -e ${NEW_ROOT}etc/gpib.conf ]; then
  chown ${VERBO} root.990 ${NEW_ROOT}etc/gpib.conf
  chmod ${VERBO} 664 ${NEW_ROOT}etc/gpib.conf
fi
;;
      rcboot)
# This used to have a bootup/time disabling of powerdown sudo passwd query:
##mkdir -p -m 700 /tmp/.odus /var/run/sudo
##touch -t 123123592037 /tmp/.odus/powerdow /var/run/sudo/powerdow[n]
# Add establishing FS shared memory to '/etc/rc.boot/' directory.
# Make a link to FS-specific rc script executed during boot.
rm ${VERBO} -f ${NEW_ROOT}etc/rc.boot/fs
ln ${VERBO} -s /usr2/fs/misc/rc.fs ${NEW_ROOT}etc/rc.boot/fs
;;
      rtxgroup)
# Add 'rtx' / 990 group into '/etc/group'.
if (grep 'rtx:.:990' ${NEW_ROOT}etc/group >/dev/null); then
  :
else
  addgroup --gid 990 rtx
fi
;;
      stdaccts)
# Add std accounts into '/etc/passwd'.
if [ ! "$is_oper" ]; then
  echo 'oper:*:501:990:VLBI Operator:/home/oper:/usr/bin/tcsh' >> ${NEW_ROOT}etc/passwd
fi
mkdir -p ${NEW_ROOT}home/oper
chown ${VERBO} 501.990 ${NEW_ROOT}home/oper
if [ ! "$is_prog" ]; then
  echo 'prog:*:502:990:FS Programmer:/home/prog:/usr/bin/tcsh' >> ${NEW_ROOT}etc/passwd
fi
mkdir -p ${NEW_ROOT}home/prog
chown ${VERBO} 502.990 ${NEW_ROOT}home/prog
;;
      liloconf)
# Now we create the most simplistic '/etc/lilo.conf'.
cat >${NEW_ROOT}etc/lilo.conf <<EOF-marker-with-no-quoted-chars-to-get-var-expansion
# LILO configuration produced by $0
# on `date`
boot=${NEW_ROOT_DEVICE%[0-9]}  # the whole disk, i.e. use MBR of that disk
root=${NEW_ROOT_DEVICE}
#compact
linear        # enables LILO boot regardless of BIOS LBA translations on/off
install=/boot/boot.b
map=/boot/map
vga=normal
delay=20      # a short 2-second delay
append="digi=E,PC/Xi,D,8,120,D0000"
image=/vmlinuz
  label=Linux
  read-only  # The root filesystem should be mounted read-only for checking
EOF-marker-with-no-quoted-chars-to-get-var-expansion
;;
      fstab)
# Add swap, '/usr2', '/dosa', '/proc' into '/etc/fstab'.
if (fgrep 'swap' ${NEW_ROOT}etc/fstab >/dev/null); then
  :
else
  echo $NEW_SWAP_DEVICE '  swap   swap  defaults  1  1' >> ${NEW_ROOT}etc/fstab
fi

# Dialog about running 'mkswap' on this partition.
# (No point showing the dialog if we know we are running with
#  that swap partition enabled.)
if [ $NEW_SWAP_DEVICE != `fgrep "swap" ${NEW_ROOT}etc/fstab | cut -d' ' -f1` ]; then
  ${DIALOG} --title "Prepare this swap partition with 'mkswap'?" \
    --yesno \
"You need to run 'mkswap' on any new swap partition at least once.\n\
\n\
However, you _cannot_ run 'mkswap' on a partition
that is currently in use.  (This would crash the system.)\n\
\n\
If you want to run 'mkswap' on $NEW_SWAP_DEVICE, please select 'Yes'.
\n\
If $NEW_SWAP_DEVICE is currently in use for swapping,
please select 'No'." \
    17 74
  if [ $? = 0 ]; then
    mkswap $NEW_SWAP_DEVICE
  fi
fi

if (fgrep '/usr2' ${NEW_ROOT}etc/fstab >/dev/null); then
  :
else
  mkdir -p ${NEW_ROOT}usr2
  echo $NEW_USR2_DEVICE '  /usr2  ext2  defaults  1  1' >> ${NEW_ROOT}etc/fstab
fi
# Try to ensure that the partition is formatted.
# (Mounting an unformatted partition can cause horrid things
#  actually only if it has "old" ext2 file system after resizing a partition.)
if (mount | fgrep $NEW_USR2_DEVICE >/dev/null); then
  :
else
  ${DIALOG} --title "Prepare this '/usr2' partition with 'mke2fs'?" \
    --yesno \
"You need to run 'mke2fs' on any new Linux partition at least once.\n\
\n\
However, you _cannot_ run 'mke2fs' on a partition
that is currently in use.  (This would crash the system.)\n\
\n\
If you think it is safe to run 'mke2fs' on $NEW_USR2_DEVICE,\n\
(and it is OK to _wipe out_ the current contents of that partition)\n\
please select 'Yes'.\n\
\n\
If $NEW_USR2_DEVICE is currently in use (mounted),\n\
please select 'No'." \
    17 74
  if [ $? = 0 ]; then
    /sbin/mke2fs $NEW_USR2_DEVICE
  fi
fi  # if the /usr2 device is not currently mounted

if (fgrep '/cdrom' ${NEW_ROOT}etc/fstab >/dev/null); then
  :
else
  mkdir -p ${NEW_ROOT}cdrom
  echo '/dev/cdrom  /cdrom iso9660 ro,noauto,user  0 0' >> ${NEW_ROOT}etc/fstab
fi

if (fgrep '/dosa' ${NEW_ROOT}etc/fstab >/dev/null); then
  :
else
  mkdir -p ${NEW_ROOT}dosa
  echo '/dev/fd0    /dosa  vfat    noauto,user  0 0' >> ${NEW_ROOT}etc/fstab
fi

if (fgrep '/proc' ${NEW_ROOT}etc/fstab >/dev/null); then
  :
else
  mkdir -p ${NEW_ROOT}proc
  echo 'none        /proc  proc  defaults  1  1' >> ${NEW_ROOT}etc/fstab
fi
;;
#      libproc)
#if [ -r ${NEW_ROOT}lib/libproc.so.1.12 ]; then
#  if [ ! -e ${NEW_ROOT}lib/libproc.so.1.11 ]; then
#    ln ${VERBO} -s libproc.so.1.12 ${NEW_ROOT}lib/libproc.so.1.11
#    # Doesn't seem to need ldconfig, maybe 'xload' et al reference
#    # the library with an explicit version number.
#  fi
#fi
#;;
      fort77)
if (fgrep '$version = "1.15"' ${NEW_ROOT}usr/bin/fort77 >/dev/null); then
  if (fgrep 'gcc -E - -trad' ${NEW_ROOT}usr/bin/fort77 >/dev/null); then
    :
  else
    (cd ${NEW_ROOT}usr/bin; patch ${PATCHOPTS} <${SRCS}patch-fort77-1.15) 2>> $PATCH_ERRS
  fi
fi
;;
      noident)
if (fgrep '/usr/sbin/in.telnetd -h' ${NEW_ROOT}etc/inetd.conf >/dev/null); then
  :
else
  sed -e "s,/usr/sbin/in.telnetd,/usr/sbin/in.telnetd -h," ${NEW_ROOT}etc/inetd.conf >${NEW_ROOT}etc/inetd.conf.new
  mv ${VERBO} -f ${NEW_ROOT}etc/inetd.conf.new ${NEW_ROOT}etc/inetd.conf
fi
cat >${NEW_ROOT}etc/issue <<EOF-marker-with-no-quoted-chars-to-get-var-expansion
Welcome to FS9 Kernel 3 on \l.

EOF-marker-with-no-quoted-chars-to-get-var-expansion
cat >${NEW_ROOT}etc/issue.net <<EOF-marker-with-no-quoted-chars-to-get-var-expansion
Welcome to FS9 Kernel 3 on %t.

EOF-marker-with-no-quoted-chars-to-get-var-expansion
;;
      ftpdlog)
if (fgrep '/usr/sbin/ftpd -l' ${NEW_ROOT}etc/inetd.conf >/dev/null); then
  :
else
  sed -e "s,/usr/sbin/ftpd,/usr/sbin/ftpd -l," ${NEW_ROOT}etc/inetd.conf >${NEW_ROOT}etc/inetd.conf.new
  mv ${VERBO} -f ${NEW_ROOT}etc/inetd.conf.new ${NEW_ROOT}etc/inetd.conf
fi
;;
      powerdown)
cp ${VERBO} -a ${SRCS}powerdown ${NEW_ROOT}bin/powerdown
#xxx: must change to auto-edit /etc/sudoers
cp ${VERBO} -a ${SRCS}sudoers ${NEW_ROOT}etc/sudoers
;;
      govt)
cat >/tmp/govt.$$ <<EOF-marker-with-no-quoted-chars-to-get-var-expansion
------------------------------------------------------------------------------

                           U.S. GOVERNMENT COMPUTER
            If not authorized to access this system, disconnect now.

                   YOU SHOULD HAVE NO EXPECTATION OF PRIVACY
By continuing, you consent to your keystrokes and data content being monitored.

------------------------------------------------------------------------------
EOF-marker-with-no-quoted-chars-to-get-var-expansion
# Login prompt:
if (fgrep 'GOVERNMENT' ${NEW_ROOT}etc/issue >/dev/null); then
  :
else
  cat /tmp/govt.$$ >>${NEW_ROOT}etc/issue
fi
# Network login prompt:
if (fgrep 'GOVERNMENT' ${NEW_ROOT}etc/issue.net >/dev/null); then
  :
else
  cat /tmp/govt.$$ >>${NEW_ROOT}etc/issue.net
fi
# FTP server:
if (fgrep 'GOVERNMENT' ${NEW_ROOT}etc/wu-ftpd-academ/welcome.msg >/dev/null); then
  :
else
  cat /tmp/govt.$$ >>${NEW_ROOT}etc/wu-ftpd-academ/welcome.msg
fi
# Normal login screens after login (incl. xterm).
if (fgrep 'GOVERNMENT' ${NEW_ROOT}etc/govtwarn.txt >/dev/null); then
  :
else
  cat /tmp/govt.$$ >>${NEW_ROOT}etc/govtwarn.txt
fi
if (fgrep 'etc/govtwarn.txt' ${NEW_ROOT}etc/profile >/dev/null); then
  :
else
  echo 'cat /etc/govtwarn.txt' >>${NEW_ROOT}etc/profile
fi
if (fgrep 'etc/govtwarn.txt' ${NEW_ROOT}etc/csh.login >/dev/null); then
  :
else
  echo 'cat /etc/govtwarn.txt' >>${NEW_ROOT}etc/csh.login
fi
rm -f /tmp/govt.$$
;;
      *)
        echo "fsadapt: unknown phase 1 operation ($i)" >&2
        exit
;;
    esac
  done
#--

# Wait for return if in verbose mode (to see the messages before
# 'dialog' is fired up again).
if [ $VERBO ]; then
  echo -n "Please press RETURN to continue. "; read $ans
fi


# Next: things that cannot be done before we have booted 
# with our NEW_ROOT / phase 2.

# Check that we are running off the "real" future '/' root,
# with correct '/etc/lilo.conf' (to safely install recompiled kernel.)
# (We built '/etc/lilo.conf' in the first phase, so it should be ok.)
if [ $NEW_ROOT != / ]; then
  ${DIALOG} --title "Need to reboot to continue installation" \
    --msgbox \
"\nPlease reboot the machine\n\
with a FS9 Linux boot floppy with 'rescue root=$NEW_ROOT_DEVICE' boot option\n\
to run with the new root file system on $NEW_ROOT_DEVICE.
\n\
After the reboot, continue the update process\n\
by rerunning this script ($0)." \
    17 74

  # Check for blank root password and show a reminder.
  if (grep '^root::' ${NEW_ROOT}etc/passwd >/dev/null); then
    ${DIALOG} --title "Check user accounts and passwords" \
      --msgbox \
"\nPlease remember to set a password for 'root'\n\
_immediately_ after the reboot and when you have logged in\n\
as 'root' the first time\n\
by invoking the command 'passwd'.\n"\
      15 74
  fi

  # Rest of this script _must not_ be run if not on the new root.
  rm -f /tmp/reply
  exit
fi

# Finally, back to the "running with the real root on" business...

# xxx: Hmm, we could try to set up default stuff/confs
# in '~oper/' and '~/prog', including
# - 'setenv EDITOR' to a favorite choice + putting in 'edit'/'e'
#    aliases to invoke this "pre-selected" editor,
# - FS-specific login settings, PATH?
# But note that '~oper/' and '~/prog' might actually be on '/usr2'
# and thus come with FS package...

# Selecting defaults for phase 2 of updating.

# Check network service status:
if (grep '^discard' /etc/inetd.conf >/dev/null); then
  netdiscard_def="off"
else
  netdiscard_def="off"
fi
if (grep '^daytime' /etc/inetd.conf >/dev/null); then
  netdaytime_def="off"
else
  netdaytime_def="off"
fi
if (grep '^time' /etc/inetd.conf >/dev/null); then
  nettime_def="off"
else
  nettime_def="off"
fi
if (grep '^talk' /etc/inetd.conf >/dev/null); then
  nettalk_def="off"
else
  nettalk_def="off"
fi
if (grep '^ntalk' /etc/inetd.conf >/dev/null); then
  netntalk_def="off"
else
  netntalk_def="off"
fi
if (grep '^finger' /etc/inetd.conf >/dev/null); then
  netfinger_def="off"
else
  netfinger_def="off"
fi
# Check for 'oper':
if (grep '^oper:' /etc/passwd >/dev/null); then
  oper_account_def="off"
else
  oper_account_def="on"
fi
# Check for 'prog':
if (grep '^prog:' /etc/passwd >/dev/null); then
  prog_account_def="off"
else
  prog_account_def="on"
fi
# Try to figure out recommendations if these need to be done.
if [ -r /usr/src/linux-gpib/.config.stat ]; then
  config_gpib_def="off"
else
  config_gpib_def="on"
fi
if [ -r /usr/src/linux/.config -a -r /usr/src/linux/fs3.cfg -a -r /usr/src/linux/include/linux/modversions.h ]; then
  config_kernel_def="off"
else
  config_kernel_def="on"
fi
# Has ibProto.h been generated?
if [ -r /usr/include/gpib/ibProto.h ]; then
  comp_gpib_def="off"
else
  comp_gpib_def="on"
fi
# Enable '/etc/rc.boot/0setserial' for Boca BB2016 / Vikom Pro.
if [ -r /etc/rc.boot/0setserial -o -e /etc/rc.boot/0setserial.not-needed ]; then
  rcserial_def="off"
else
  rcserial_def="on"
fi

# Present a checklist which of the following to do.
if [ "$NODIALOGS" ]; then
  :  # Use PHASE2 params from command line.
elif [ "$SHOWPHASE2" ]; then
  ${DIALOG} --title "FS Adaptation: Setup" \
    --checklist \
"Which of the following you would like to do?\n\
\n\
(Recommended options are shown with 'X';\n\
all of these can be safely attempted again and again.)" \
20 76 10 \
  skip          "Skip all steps below (regardless of [X] marks)" off \
  oper_account  "Create user account 'oper'" $oper_account_def \
  prog_account  "Create user account 'prog'" $prog_account_def \
  config_gpib   "Configure 'linux-gpib' driver and library" $config_gpib_def \
  set_perms     "Set device permissions (serial, digi, gpib)" "on" \
  config_kernel "Configure Linux kernel (make config/dep/clean)" $config_kernel_def \
  comp_kernel   "Recompile Linux kernel (make-kpkg)" "off" \
  comp_gpib     "Recompile 'linux-gpib' driver and library" $comp_gpib_def \
  disk_space    "Clean up '.o' files created by 'comp_*' above" off \
  rcserial      "Enable 'rc.serial' to be run for Boca/Vikom" $rcserial_def \
  netdiscard    "Disable internal 'discard' net service" $netdiscard_def \
  netdaytime    "Disable internal 'daytime' net service" $netdaytime_def \
  nettime       "Disable internal 'time' net service " $nettime_def \
  nettalk       "Disable 'talk' net service" $nettalk_def \
  netntalk      "Disable 'ntalk' net service" $netntalk_def \
  netfinger     "Disable 'fingerd' net service" $netfinger_def \
  2>/tmp/reply
  # Cancel?
  if [ $? != 0 ]; then
    rm -f /tmp/reply
    exit
  fi
  PHASE2=`cat /tmp/reply | sed 's!\"!!g' `
else
  PHASE2="skip"
fi
#--
  for i in $PHASE2; do
    case $i in
      skip)
break
;;
      oper_account)
# Add user 'oper'.
${DIALOG} --title "Please add 'oper' account" \
  --msgbox \
"\nYou need to set up a user account 'oper'\n\
for normal FS operations.\n\
\n\
An interactive command 'adduser' will be invoked\n\
after you select 'Ok'."\
  15 74
adduser --uid 501 --gid 990 --gecos 'VLBI Operator' oper
chsh -s /usr/bin/tcsh oper
;;
      prog_account)
# Add user 'prog'.
${DIALOG} --title "Please add 'prog' account" \
  --msgbox \
"\nYou need to set up a user account 'prog'\n\
for FS programming work.\n\
\n\
An interactive command 'adduser' will be invoked\n\
after you select 'Ok'."\
  15 74
adduser --uid 502 --gid 990 --gecos 'FS Programmer' prog
chsh -s /usr/bin/tcsh prog
;;
      config_gpib)
# Configure linux-gpib.
rm -f /etc/gpib.conf
(cd /usr/src/linux-gpib; make clean; make config)
chown ${VERBO} root.990 /etc/gpib.conf
chmod ${VERBO} 664 /etc/gpib.conf
# Wait for return if in verbose mode (to see the messages before
# 'dialog' is fired up again).
if [ $VERBO ]; then
  echo -n "Please press RETURN to continue. "; read $ans
fi
;;
      set_perms)
# Give world r/w access to SCSI tape drives.
# (Debian /dev/*st* devices are owned by root.disk,
#  so putting oper,prog into 'tape' group wouldn't suffice.)
chmod ${VERBO} a+rw /dev/*st[0-7]*
if [ ! -e /etc/rmt ]; then
  ln ${VERBO} -s ../usr/sbin/rmt /etc/rmt
fi
# Make /dev/tape by default a symlink to the first SCSI tape.
if [ ! -e /dev/tape ]; then
  ln ${VERBO} -s nst0 /dev/tape
fi
# Enable 'oper', 'prog' access to floppy, serial, and other devices.
#for GRP in dialout cdrom floppy tape audio backup dos; do  # no dos in Hamm
for GRP in dialout cdrom floppy tape audio backup; do
  adduser ${VERBOQ} oper $GRP
  adduser ${VERBOQ} prog $GRP
done
# Permissions of /dev/ttyS*, /dev/ttyD* (Digi), /dev/gpib*.
# (This can be run only after configuring linux-gpib
#  which creates these device special files.)
## Old: chmod ${VERBO} a=rw /dev/cua* /dev/tty[dD]* /dev/gpib*
## New: we create new copies of device special files.
(cd /dev; ./MAKEDEV ${VERBO} serial; ./MAKEDEV ${VERBO} digiboard)
(cd /dev; chown ${VERBO} root.rtx gpib0/master; chmod ${VERBO} ug=rw gpib0/master)
# Wait for return if in verbose mode (to see the messages before
# 'dialog' is fired up again).
if [ $VERBO ]; then
  echo -n "Please press RETURN to continue. "; read $ans
fi
;;
      config_kernel)
# Configure kernel.
cp ${VERBO} -a ${SRCS}fs3.cfg /usr/src/linux/fs3.cfg
# xxx: any new kernel source package will contain '.config'...
if [ ! -e /usr/src/kernel-source-2.0.34/.config ]; then
  cp ${VERBO} -a ${SRCS}fs3.cfg /usr/src/kernel-source-2.0.34/.config
fi
(cd /usr/src/linux; make menuconfig; make clean; make dep; make clean)
;;
      comp_kernel)
# Recompile kernel.
# "traditional": (cd /usr/src/linux; make zImage)
(cd /usr/src/linux; rm -f stamp-configure; rm-f stamp-image; make-kpkg --revision fslcl1 binary-arch)
# xxx: (cd /usr/src; dpkg --install kernel-package*fslcl1.deb)
;;
      comp_gpib)
# Recompile linux-gpib.
# This requires that kernel has been re-configured (modversions.h available).
(cd /usr/src/linux-gpib; make; cp ${VERBO} -p driver/gpib0.o /lib/modules/`uname -r`/misc)
depmod ${VERBO} -a -e
# xxx: modconf?
# Wait for return if in verbose mode (to see the messages before
# 'dialog' is fired up again).
if [ $VERBO ]; then
  echo -n "Please press RETURN to continue. "; read $ans
fi
;;
      disk_space)
pushd /usr/src >/dev/null
pushd linux >/dev/null
# This will leave the much needed (gpib recompilation) modversions.h
# stuff around:
make clean
popd >/dev/null
pushd linux-gpib >/dev/null
# And this will effectively zap gpib configuration...:
make clean
popd >/dev/null
popd >/dev/null
;;
      rcserial)
# Enable '/etc/rc.boot/0setserial' for Boca BB2016 or Vikom Pro
# to be run in boot.
${DIALOG} --title "Really enable Boca BB2016 / Vikom Pro?" \
  --menu \
"\nAlthough this script offers installing '/etc/rc.boot/0setserial'\n\
to recognize Boca BB2016 or Vikom Pro multiport RS232 cards,\n\
you should do this _only_ if you really have such a card\n\
in your PC (or are planning to edit the installed file manually).
\n\
If you have a Boca BB2016 or Vikom Pro, please select 'Yes'.
\n\
If you don't have a Boca BB2016 nor Vikom Pro, please select 'No'.\n" \
      19 74 3 \
  Yes   "Yes, I want '/etc/rc.boot/0setserial' to run for Boca BB2016" \
  No    "No, I don't need it" \
  Defer "I'm not sure yet, ask again in a later run of 'fsadapt'" \
2>/tmp/reply
if [ $? = 0 ]; then
  pushd /etc/rc.boot >/dev/null
  if [ `cat /tmp/reply` = Yes ]; then
    cp ${VERBO} -a ${SRCS}replacement-0setserial 0setserial
  elif [ `cat /tmp/reply` = No ]; then
    if [ -r 0setserial ]; then
      mv ${VERBO} -f 0setserial 0setserial.not-needed
    else
      # To signify the default [ ] off:
      touch 0setserial.not-needed
    fi
  elif [ `cat /tmp/reply` = Defer ]; then
    if [ -r 0setserial ]; then
      mv ${VERBO} -f 0setserial 0setserial.defer
    fi
  fi
  popd >/dev/null
fi
;;
      netdiscard)
update-inetd --disable discard --multi
;;
      netdaytime)
update-inetd --disable daytime --multi
;;
      nettime)
update-inetd --disable time --multi
;;
      nettalk)
update-inetd --disable talk
;;
      netntalk)
update-inetd --disable ntalk
;;
      netfinger)
update-inetd --disable finger
;;
      *)
        echo "fsadapt: unknown phase 2 operation ($i)" >&2
        exit
;;
    esac
  done
#--


# Next: phase 3, things that may be done later again.

# Selecting defaults for phase 3 of updating.

# Check if our network settings are right.
if [ -e /etc/hostname-assumed-correct ]; then
  netconfig_def="off"
else
  netconfig_def="on"
fi
# LILO conffile available?
if [ -r /etc/lilo.conf ]; then
  lilo_def="on"
else
  lilo_def="off"
fi
# X config already done?
if [ -e /etc/X11/config.no-x-yet ]; then
  setup_x_def="on"
else
  setup_x_def="off"
fi
# CD-ROM type selected?
if [ -e /dev/cdrom.selected ]; then
  set_cdrom_def="off"
else
  set_cdrom_def="on"
fi
# /etc/printcap already there
if [ -e /etc/printcap ]; then
  printer_def="off"
else
  printer_def="on"
fi

# Present a checklist which of the following to do.
if [ "$NODIALOGS" ]; then
  :  # Use PHASE3 params from command line.
elif [ "$SHOWPHASE3" ]; then
  ${DIALOG} --title "FS Adaptation: Settings" \
    --checklist \
"Which of the following you would like to do?\n\
\n\
(Recommended options are shown with 'X';\n\
all of these can be safely attempted again and again.)" \
20 76 10 \
  drivers       "Select loadable drivers (incl. network)" "on" \
  netconfig     "Alter TCP/IP configuration (IP numbers)" $netconfig_def \
  lilo          "Make sure LILO is properly installed" $lilo_def \
  gpmconfig     "Select virtual console gpm mouse type" on \
  setup_x       "Select X Window System server/configuration" $setup_x_def \
  printer       "Setup your printer for 'lpr' use" $printer_def \
  set_cdrom     "Select your CD-ROM type" $set_cdrom_def \
  smailconfig   "Change configuration of 'smail' email system" off \
  2>/tmp/reply
  # Cancel?
  if [ $? != 0 ]; then
    rm -f /tmp/reply
    exit
  fi
  PHASE3=`cat /tmp/reply | sed 's!\"!!g' `
else
  PHASE3="skip"
fi
#--
  for i in $PHASE3; do
    case $i in
      skip)
break
;;
      drivers)
# Copy the precompiled 'gpib0.o' if a newly compiled one is not already there.
if [ ! -e /lib/modules/`uname -r`/misc/gpib0.o ]; then
  cp ${VERBO} -p ${SRCS}gpib0.o /lib/modules/`uname -r`/misc
fi
depmod ${VERBO} -a -e
${DIALOG} --title "Selecting loadable device drivers" \
  --msgbox \
"\nYou should ensure that a network device driver\n\
which corresponds to your network interface card is loaded\n\
and that the 'gpib0.o' NI ATGPIB driver is loaded\n\
(if you have a NI ATGPIB board installed).\n\
\n\
An interactive command 'modconf' will be invoked\n\
after you select 'Ok'.  It updates the module list\n\
of modules to load during boot in '/etc/modules' for you."\
  15 74
modconf
;;
      netconfig)
${DIALOG} --title "Check the TCP/IP network settings" \
  --menu \
"\nThe current TCP/IP networking settings are for the machine:\n\n\
    `cat /etc/hostname`\n\n\
If this is correct, select 'Correct'.\n\n\
If this is _not_ correct, disconnect the Ethernet cable and\n\
select 'Netconfig' to invoke the 'netconfig' script.\n\
(You can also defer setting up IP numbers to a later 'fsadapt' run.)\n" \
    19 74 3 \
  Correct     "Yes, the settings are correct for this machine" \
  Netconfig   "No, I want to run 'netconfig' now to set up IP addresses" \
  Defer       "No, but I don't know the IP numbers yet, defer to later" \
2>/tmp/reply
if [ $? = 0 ]; then
  if [ `cat /tmp/reply` = Defer ]; then
    : # Nothing
  else
    if [ `cat /tmp/reply` = Netconfig ]; then
      ${SRCS}netconfig
    fi
    touch /etc/hostname-assumed-correct
  fi
fi
;;
      lilo)
# Install LILO.
/sbin/lilo
# Wait for return if in verbose mode (to see the messages before
# 'dialog' is fired up again).
if [ $VERBO ]; then
  echo -n "Please press RETURN to continue. "; read $ans
fi
;;
      gpmconfig)
# Try to stop, make sure by killing,...
/etc/init.d/gpm stop >/dev/null 2>&1
gpm -k >/dev/null 2>&1
# ...configure...
gpmconfig
# ...try to stop, make sure by killing,...
/etc/init.d/gpm stop >/dev/null 2>&1
gpm -k >/dev/null 2>&1
# ...and finally start with new parameters.
/etc/init.d/gpm start
;;
      setup_x)
# Present a menu of X Window System servers and config files.
xconfigok=0
while [ $xconfigok = 0 ]; do

${DIALOG} --title "Setup X Window System" --menu "Select your SVGA card / monitor type:" 17 76 10 \
  No_X         "Leave X setup undetermined, will choose later" \
  xf86config   "Run 'xf86config' to build the conf" \
`(cd ${SRCS}xf86configs; ls -1 */*) | sed -e 's!^\(.*\)$!\1 \1!'` \
2>/tmp/reply
if [ $? = 0 ]; then
  SEL=`cat /tmp/reply`
  if [ $SEL = "No_X" ]; then
    if [ -e /etc/X11/config ]; then
      mv ${VERBO} -f /etc/X11/config /etc/X11/config.no-x-yet
      mv ${VERBO} -f /etc/X11/XF86Config /etc/X11/XF86Config.no-x-yet
    fi
    xconfigok=1
    break
  fi
  # Put xdm-capable basic X config back in before configuration attempts.
  if [ -e /etc/X11/config.no-x-yet ]; then
    mv ${VERBO} -f /etc/X11/config.no-x-yet /etc/X11/config
  else
    cp ${VERBO} -p ${SRCS}backup-x-config /etc/X11/config
  fi
  # Get rid of renamed wrong/old XF86Config.
  rm ${VERBO} -f /etc/X11/XF86Config.no-x-yet
  # Configure using xf86config or prepackaged conf files.
  if [ $SEL = "xf86config" ]; then
    xf86config
  else
    if [ -e ${SRCS}xf86configs/${SEL} ]; then
      if [ -e /etc/X11/XF86Config ]; then
        mv ${VERBO} -f /etc/X11/XF86Config /etc/X11/XF86Config.old
      fi
      # Get mouse type from gpm:
      if [ -r /etc/gpm.conf ]; then
        source /etc/gpm.conf
        case $type in
          ms)   MTYPE="Microsoft" ;;
          bare) MTYPE="Microsoft" ;;
          msc)  MTYPE="MouseSystems" ;;
          mman) MTYPE="MouseMan" ;;
          logi) MTYPE="Logitech" ;;
          ps2)  MTYPE="PS/2" ;;
          mm)   MTYPE="MMSeries" ;;
          *)    MTYPE="MouseMan" ;;
        esac
      else
        MTYPE="MouseMan"
      fi
      sed -e "s,MouseMan,${MTYPE}," ${SRCS}xf86configs/${SEL} > /etc/X11/XF86Config
      # Making the selected server the new default server.
      cat >/tmp/Xserver.$$ <<EOF
/usr/bin/X11/XF86_NONE
EOF
      tail +2 /etc/X11/Xserver >>/tmp/Xserver.$$
      mv ${VERBO} -f /tmp/Xserver.$$ /etc/X11/Xserver
      CARD=${SEL%/*}
      /var/lib/dpkg/info/xserver-${CARD}.postinst
    fi
  fi
else
  # Cancel selected, get out of loop:
  xconfigok=1
fi

# Test the new config:
if [ $xconfigok = 0 ]; then
		echo -n 'Do you want to test the configuration? (y/n) [y] '
		read input
		if [ "$input" = "n" ]
		then
		    testconfig=0
		else
		    testconfig=1
		fi
		
		if [ $testconfig = 1 ]
		then
		    echo
		    echo 'The X server will start in 10 seconds. If the configuration'
		    echo 'file is correct, you should see a grey patterned screen'
		    echo 'with an X shaped cursor in the middle. The mouse should'
		    echo 'move the cursor.'
		    echo
		    echo 'If the virtual screen resolution is higher than the default'
		    echo 'one, you may not be able to see the cursor immediately.'
		    echo 'It should become visible when you move the mouse.'
		    echo
		    echo 'This display should disappear after another 10 seconds; you'
		    echo 'will then be asked whether the test worked.'
		    echo
		    echo 'Waiting 10 seconds before starting X server...'
		    sleep 10
		    echo 'Starting X server...'
		    /usr/X11R6/bin/X :9 &
		    xserverpid=$!
		    sleep 11
		    set +e
		    kill $!
		    set -e
		    sleep 3
		    echo -n 'Did the X server work properly? (y/n) [n] '
		    read input
		    if [ "$input" = "y" ]
		    then
			xconfigok=1
		    else
			xconfigok=0
			rm -f /etc/X11/XF86Config
			mv ${VERBO} -f /etc/X11/config /etc/X11/config.no-x-yet
		    fi
		else
		    # Assume the file is ok without testing
		    xconfigok=1
		fi
fi

done
cp ${VERBO} -a ${SRCS}replacement-Xresources /etc/X11/Xresources
;;
      printer)
if [ ! -e /etc/printcap.orig ]; then
  if [ -e /etc/printcap ]; then
    mv ${VERBO} -f /etc/printcap /etc/printcap.orig
  fi
fi
rm -f /etc/printcap

${DIALOG} --title "Printer Configuration Overview" --msgbox \
"Configuring printers includes the following three steps:\n\
\n\
1) Selecting the default paper size (a4, letter)\n\
   with 'paperconfig'.\n\
2) Creating local printer queues with 'magicifilterconfig'.\n\
   You should create local queues for remote printers, too,\n\
   but use '/dev/null' as printer port (instead of '/dev/lp1').\n\
3) Creating remote \"feeder\" queues for local '/dev/null'\n\
   printers created in step 2 above.\n\
\n\
These steps will now be invoked automatically in a row." 16 70

paperconfig --force

magicfilterconfig

while true; do

${DIALOG} --title "Local name for a remote printer" --inputbox \
"Please enter a local name of a remote printer\n\
(a printer you just configured to use /dev/null\n\
as its printing port device) for which you will want to\n\
supply remote host and printer queue information now.\n\n\
Just press Enter if you have no remote printers." 13 60 \
2> /tmp/reply
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/reply
  exit
fi
MYPR="`cat /tmp/reply`"
rm -f /tmp/reply

if [ x$MYPR = x ]; then
  break
fi

${DIALOG} --title "Filter name" --inputbox \
"Please enter the name of the filter program you selected\n\
when you configured this printer ('$MYPR')\n\
to use '/dev/null' in 'magicfilterconfig'.\n\n\
(Use the short name without trailing '-filter'.)" 13 60 \
2> /tmp/reply
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/reply
  exit
fi
MYFILT="`cat /tmp/reply`-filter"
rm -f /tmp/reply

${DIALOG} --title "Remote computer name" --inputbox \
"Please enter the TCP/IP name of the computer \
to which the remote printer is connected." 12 60 \
2> /tmp/reply
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/reply
  exit
fi
RMHOST="`cat /tmp/reply`"
rm -f /tmp/reply

${DIALOG} --title "Remote printer name" --inputbox \
"Please enter the printer queue name on $RMHOST \
you wish to use as $MYPR on this computer.  \
(This printer must accept binary/'raw' data.)  \
Please remember to enable remote access in $RMHOST's '/etc/hosts.lpd' \
(or equivalent)." 12 60 \
2> /tmp/reply
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/reply
  exit
fi
RMPR="`cat /tmp/reply`"
rm -f /tmp/reply

cat >> /etc/printcap <<EOF-marker-with-no-quoted-chars-to-get-var-expansion
${MYPR}queue:\\
        :lp=:mx#0:rm=$RMHOST:rp=$RMPR:\\
        :sd=/var/spool/lpd/${MYPR}queue:\\
        :lf=/var/log/lpd/lp-errs:
EOF-marker-with-no-quoted-chars-to-get-var-expansion
mkdir -p /var/spool/lpd/${MYPR}queue
chown root.lp /var/spool/lpd/${MYPR}queue
chmod ug=rwx,o=rx /var/spool/lpd/${MYPR}queue
cat > ${MFLOC}/${MYFILT}-to-${MYPR}queue <<EOF-marker-with-no-quoted-chars-to-get-var-expansion
#!/bin/sh
# ${MYFILT}-to-${MYPR}queue -- an 'if=' script for a local printer ${MYPR}.
# ${MYPR} sends bytestreams to a remote printer ${MYPR}queue with lpr.
#
# This lpd 'if=' input filter script gets the following arguments:
# args: [-c] -wwidth -llength -iindent -n login -h host acct-file
#
# It would be nice to convey lpr user account onto the second lpr:
###${MFLOC}/${MYFILT} \$\@@ | su login -c \'lpr -P${MYPR}queue\'

${MFLOC}/${MYFILT} \$\@@ | lpr -P${MYPR}queue
EOF-marker-with-no-quoted-chars-to-get-var-expansion
chmod a+x ${MFLOC}/${MYFILT}-to-${MYPR}queue

${DIALOG} --title "Need to manually edit /etc/printcap" --msgbox \
"You still need to manually edit your '/etc/printcap' file\n\
to enable the remote printer '${MYPR}'.\n\
\n\
Locate the 'if=${MFLOC}/${MYFILT}' entry that corresponds\n\
to printer '${MYPR}' and change it to read:\n\
'if=${MFLOC}/${MYFILT}-to-${MYPR}queue'.\n\
\n\
(You can do this now in another virtual console,\n\
 use 'Alt-Fn' keys to switch consoles.)" 15 70

done

lpc restart all
;;
      set_cdrom)
${DIALOG} --title "Configuring CD-ROM link (/dev/cdrom)" \
--menu "\nWhat type of CD-ROM drive do you have?\n" 15 71 6 \
"none" "No CD-ROM drive installed" \
"scd0" "Any SCSI CD-ROM drive" \
"hda"  "IDE, as master on primary interface (SWT default)" \
"hdb"  "IDE, as slave on primary interface" \
"hdc"  "IDE, as master on secondary interface" \
"hdd"  "IDE, as slave on secondary interface" \
 2> /tmp/cdtype
if [ $? = 1 -o $? = 255 ]; then
 rm -f /tmp/cdtype
else
 CD_ROM_TYPE="`cat /tmp/cdtype`"
 rm -f /tmp/cdtype
 if [ -b /dev/$CD_ROM_TYPE ]; then
  (cd /dev; chown ${VERBO} root.cdrom $CD_ROM_TYPE; ln ${VERBO} -sf $CD_ROM_TYPE cdrom)
  touch /dev/cdrom.selected
 fi
fi
;;
      smailconfig)
smailconfig --force
;;
      disk_space)
pushd /usr/src >/dev/null
pushd linux >/dev/null
# This will leave the much needed (gpib recompilation) modversions.h
# stuff around:
make clean
popd >/dev/null
pushd linux-gpib >/dev/null
# And this will effectively zap gpib configuration...:
make clean
popd >/dev/null
popd >/dev/null
;;
      *)
        echo "fsadapt: unknown phase 3 operation ($i)" >&2
        exit
;;
    esac
  done
#--

# xxx: (perhaps remove /usr-'.orig' files)
rm -f /tmp/reply
@


3.5
log
@Updated Linux-gpib from 2.03 to 2.04 ("SLOW_DOWN_IO()").
@
text
@d3 1
a3 1
# $Id: fsadapt,v 3.4 1998/11/11 12:33:07 amn Exp amn $
d7 3
d87 1
a87 1
readonly DIALOG="dialog --backtitle FS/Debian/Linux-fsadapt-3.5"
d178 2
a179 1
if [ "$blank_root" -o "$blank_oper" -o "$blank_prog" -o "$blank_user1" -o "$unset_oper" -o "$unset_prog" -o "$unset_user1" ]; then
d472 5
d639 1
a639 1
Welcome to FS9 Kernel 3 on \l!
d643 1
a643 1
Welcome to FS9 Kernel 3 on %t!
d672 1
d678 1
d684 1
d690 16
a1119 114
;;
      netdiscard)
update-inetd --multi --disable discard
;;
      netdaytime)
update-inetd --multi --disable daytime
;;
      nettime)
update-inetd --multi --disable time
;;
      nettalk)
update-inetd --disable talk
;;
      netntalk)
update-inetd --disable ntalk
;;
      netfinger)
update-inetd --disable finger
;;
      oper_account)
# Add user 'oper'.
${DIALOG} --title "Please add 'oper' account" \
  --msgbox \
"\nYou need to set up a user account 'oper'\n\
for normal FS operations.\n\
\n\
An interactive command 'adduser' will be invoked\n\
after you select 'Ok'."\
  15 74
adduser --uid 501 --gid 990 --gecos 'VLBI Operator' oper
chsh -s /usr/bin/tcsh oper
;;
      prog_account)
# Add user 'prog'.
${DIALOG} --title "Please add 'prog' account" \
  --msgbox \
"\nYou need to set up a user account 'prog'\n\
for FS programming work.\n\
\n\
An interactive command 'adduser' will be invoked\n\
after you select 'Ok'."\
  15 74
adduser --uid 502 --gid 990 --gecos 'FS Programmer' prog
chsh -s /usr/bin/tcsh prog
;;
      config_gpib)
# Configure linux-gpib.
rm -f /etc/gpib.conf
(cd /usr/src/linux-gpib; make clean; make config)
chown ${VERBO} root.990 /etc/gpib.conf
chmod ${VERBO} 664 /etc/gpib.conf
# Wait for return if in verbose mode (to see the messages before
# 'dialog' is fired up again).
if [ $VERBO ]; then
  echo -n "Please press RETURN to continue. "; read $ans
fi
;;
      set_perms)
# Give world r/w access to SCSI tape drives.
# (Debian /dev/*st* devices are owned by root.disk,
#  so putting oper,prog into 'tape' group wouldn't suffice.)
chmod ${VERBO} a+rw /dev/*st[0-7]*
if [ ! -e /etc/rmt ]; then
  ln ${VERBO} -s ../usr/sbin/rmt /etc/rmt
fi
# Make /dev/tape by default a symlink to the first SCSI tape.
if [ ! -e /dev/tape ]; then
  ln ${VERBO} -s nst0 /dev/tape
fi
# Enable 'oper', 'prog' access to floppy, serial, and other devices.
#for GRP in dialout cdrom floppy tape audio backup dos; do  # no dos in Hamm
for GRP in dialout cdrom floppy tape audio backup; do
  adduser ${VERBOQ} oper $GRP
  adduser ${VERBOQ} prog $GRP
done
# Permissions of /dev/ttyS*, /dev/ttyD* (Digi), /dev/gpib*.
# (This can be run only after configuring linux-gpib
#  which creates these device special files.)
## Old: chmod ${VERBO} a=rw /dev/cua* /dev/tty[dD]* /dev/gpib*
## New: we create new copies of device special files.
(cd /dev; ./MAKEDEV ${VERBO} serial; ./MAKEDEV ${VERBO} digiboard)
(cd /dev; chown ${VERBO} root.rtx gpib0/master; chmod ${VERBO} ug=rw gpib0/master)
# Wait for return if in verbose mode (to see the messages before
# 'dialog' is fired up again).
if [ $VERBO ]; then
  echo -n "Please press RETURN to continue. "; read $ans
fi
;;
      config_kernel)
# Configure kernel.
cp ${VERBO} -a ${SRCS}fs3.cfg /usr/src/linux/fs3.cfg
# xxx: any new kernel source package will contain '.config'...
if [ ! -e /usr/src/kernel-source-2.0.34/.config ]; then
  cp ${VERBO} -a ${SRCS}fs3.cfg /usr/src/kernel-source-2.0.34/.config
fi
(cd /usr/src/linux; make menuconfig; make clean; make dep; make clean)
;;
      comp_kernel)
# Recompile kernel.
# "traditional": (cd /usr/src/linux; make zImage)
(cd /usr/src/linux; rm -f stamp-configure; rm-f stamp-image; make-kpkg --revision fslcl1 binary-arch)
# xxx: (cd /usr/src; dpkg --install kernel-package*fslcl1.deb)
;;
      comp_gpib)
# Recompile linux-gpib.
# This requires that kernel has been re-configured (modversions.h available).
(cd /usr/src/linux-gpib; make; cp ${VERBO} -p driver/gpib0.o /lib/modules/`uname -r`/misc)
depmod ${VERBO} -a -e
# xxx: modconf?
# Wait for return if in verbose mode (to see the messages before
# 'dialog' is fired up again).
if [ $VERBO ]; then
  echo -n "Please press RETURN to continue. "; read $ans
fi
@


3.4
log
@Added command line parameters and numerous corrections.
@
text
@d3 1
a3 1
# $Id: fsadapt,v 3.3 1998/10/30 20:00:31 amn Exp amn $
d7 3
d84 1
a84 1
readonly DIALOG="dialog --backtitle FS/Debian/Linux-fsadapt-3.4"
d311 2
a312 2
# Linux-gpib-2.03 driver for NI ATGPIB.
if [ ! -d ${NEW_ROOT}usr/src/linux-gpib-2.03 ]; then
d447 1
a447 1
# Linux-gpib-2.03 driver for NI ATGPIB.
d451 3
a453 3
tar ${VERBO} -xzf ${SRCS}linux-gpib-2.03.base.tar.gz 
mv ${VERBO} linux-gpib linux-gpib-2.03
ln ${VERBO} -s linux-gpib-2.03 linux-gpib
d456 6
a461 6
# Withdraw tcl stuff from Makefile and eliminate a couple of 'printk()'s.
(cd linux-gpib; patch ${PATCHOPTS} <${SRCS}linux-gpib-2.03-base.patch) 2>> $PATCH_ERRS
# Make /usr/bin/dialog available as /bin/dialog for gpib configurator.
if [ ! -e ${NEW_ROOT}bin/dialog ]; then
  ln ${VERBO} -s ../usr/bin/dialog ${NEW_ROOT}bin/dialog
fi
d680 4
d1014 4
d1553 4
@


3.3
log
@X-basckspace-delete, net services off, smailconfig, and many others.
@
text
@d3 1
a3 1
# $Id: fsadapt,v 3.2 1998/10/29 10:32:32 amn Exp amn $
d7 3
d81 1
a81 1
readonly DIALOG="dialog --backtitle FS/Debian/Linux-fsadapt-3.2"
d85 73
a158 1

d164 6
d173 6
a178 2
  ${DIALOG} --title "Check user accounts and passwords" \
    --msgbox \
d180 1
a180 1
('root', 'oper', 'prog', 'user1')\n\
d183 6
a188 5
    17 74
  if [ $? = 255 ]; then
    : # Undocumented skip-over by pressing a certain key in dialog...
  else
    exit
d241 6
a246 2
  ${DIALOG} --title "Target root file system problem" \
    --msgbox \
d256 3
a258 2
    17 74
  exit
d262 5
a266 2
${DIALOG} --title "fsadapt: current root / swap / usr2 settings" \
  --yesno \
d279 4
a282 3
    17 74
if [ $? != 0 ]; then
  exit
d359 1
a359 1
noident_def="on"
d365 1
a365 1
ftpdlog_def="on"
d370 3
d374 5
a378 2
${DIALOG} --title "FS Adaptation: Modifications" \
  --checklist \
d397 12
a408 2
2>/tmp/reply
if [ $? = 0 ]; then
d411 1
a411 1
  for i in `cat /tmp/reply | sed 's!\"!!g' `; do
d517 1
a517 1
  read-only  # Non-UMSDOS filesystems should be mounted read-only for checking
d627 6
a632 1
Welcome to FS9 Kernel 3!
a633 1
cp ${VERBO} -a ${NEW_ROOT}etc/issue ${NEW_ROOT}etc/issue.net
d648 29
d679 2
a680 5
else
# Cancel was selected in main phase 1 dialog:
  rm -f /tmp/reply
  exit
fi
d689 1
a689 1
# with our NEW_ROOT.
a732 6
# Check if our network settings are right.
if [ -e /etc/hostname-assumed-correct ]; then
  netconfig_def="off"
else
  netconfig_def="on"
fi
d735 1
a735 1
  netdiscard_def="on"
d740 1
a740 1
  netdaytime_def="on"
d745 1
a745 1
  nettime_def="on"
d750 1
a750 1
  nettalk_def="on"
d755 1
a755 1
  netntalk_def="on"
d760 1
a760 1
  netfinger_def="on"
a786 6
# LILO conffile available?
if [ -r /etc/lilo.conf ]; then
  lilo_def="on"
else
  lilo_def="off"
fi
d799 229
d1048 5
a1052 2
${DIALOG} --title "FS Adaptation: Settings" \
  --checklist \
a1057 8
  oper_account  "Create user account 'oper'" $oper_account_def \
  prog_account  "Create user account 'prog'" $prog_account_def \
  config_gpib   "Configure 'linux-gpib' driver and library" $config_gpib_def \
  set_perms     "Set device permissions (serial, digi, gpib)" "on" \
  config_kernel "Configure Linux kernel (make config/dep/clean)" $config_kernel_def \
  comp_kernel   "Recompile Linux kernel (make-kpkg)" "off" \
  lilo          "Make sure LILO is properly installed" $lilo_def \
  comp_gpib     "Recompile 'linux-gpib' driver and library" $comp_gpib_def \
d1060 1
a1060 7
  netdiscard    "Disable internal 'discard' net service" $netdiscard_def \
  netdaytime    "Disable internal 'daytime' net service" $netdaytime_def \
  nettime       "Disable internal 'time' net service " $nettime_def \
  nettalk       "Disable 'talk' net service" $nettalk_def \
  netntalk      "Disable 'ntalk' net service" $netntalk_def \
  netfinger     "Disable 'fingerd' net service" $netfinger_def \
  rcserial      "Enable 'rc.serial' to be run for Boca/Vikom" $rcserial_def \
a1061 1
  smailconfig   "Change configuration of 'smail' email system" off \
d1063 1
d1065 6
a1070 28
  printer       "Setup your printer for 'lpr' use" $printer_def \
  disk_space    "Clean up '.o' files created by 'comp_*' above" off \
2>/tmp/reply
if [ $? = 0 ]; then
  for i in `cat /tmp/reply | sed 's!\"!!g' `; do
    case $i in
      netconfig)
${DIALOG} --title "Check the TCP/IP network settings" \
  --menu \
"\nThe current TCP/IP networking settings are for the machine:\n\n\
    `cat /etc/hostname`\n\n\
If this is correct, select 'Correct'.\n\n\
If this is _not_ correct, disconnect the Ethernet cable and\n\
select 'Netconfig' to invoke the 'netconfig' script.\n\
(You can also defer setting up IP numbers to a later 'fsadapt' run.)\n" \
    19 74 3 \
  Correct     "Yes, the settings are correct for this machine" \
  Netconfig   "No, I want to run 'netconfig' now to set up IP addresses" \
  Defer       "No, but I don't know the IP numbers yet, defer to later" \
2>/tmp/reply
if [ $? = 0 ]; then
  if [ `cat /tmp/reply` = Defer ]; then
    : # Nothing
  else
    if [ `cat /tmp/reply` = Netconfig ]; then
      ${SRCS}netconfig
    fi
    touch /etc/hostname-assumed-correct
d1072 3
d1076 5
d1083 1
a1083 1
update-inetd --disable discard
d1086 1
a1086 1
update-inetd --disable daytime
d1089 1
a1089 1
update-inetd --disable time
a1183 9
      lilo)
# Install LILO.
/sbin/lilo
# Wait for return if in verbose mode (to see the messages before
# 'dialog' is fired up again).
if [ $VERBO ]; then
  echo -n "Please press RETURN to continue. "; read $ans
fi
;;
d1215 2
a1216 4
      rcserial)
# Enable '/etc/rc.boot/0setserial' for Boca BB2016 or Vikom Pro
# to be run in boot.
${DIALOG} --title "Really enable Boca BB2016 / Vikom Pro?" \
d1218 10
a1227 12
"\nAlthough this script offers installing '/etc/rc.boot/0setserial'\n\
to recognize Boca BB2016 or Vikom Pro multiport RS232 cards,\n\
you should do this _only_ if you really have such a card\n\
in your PC (or are planning to edit the installed file manually).
\n\
If you have a Boca BB2016 or Vikom Pro, please select 'Yes'.
\n\
If you don't have a Boca BB2016 nor Vikom Pro, please select 'No'.\n" \
      19 74 3 \
  Yes   "Yes, I want '/etc/rc.boot/0setserial' to run for Boca BB2016" \
  No    "No, I don't need it" \
  Defer "I'm not sure yet, ask again in a later run of 'fsadapt'" \
d1230 5
a1234 13
  pushd /etc/rc.boot >/dev/null
  if [ `cat /tmp/reply` = Yes ]; then
    cp ${VERBO} -a ${SRCS}replacement-0setserial 0setserial
  elif [ `cat /tmp/reply` = No ]; then
    if [ -r 0setserial ]; then
      mv ${VERBO} -f 0setserial 0setserial.not-needed
    else
      # To signify the default [ ] off:
      touch 0setserial.not-needed
    fi
  elif [ `cat /tmp/reply` = Defer ]; then
    if [ -r 0setserial ]; then
      mv ${VERBO} -f 0setserial 0setserial.defer
d1236 1
d1238 9
a1246 1
  popd >/dev/null
d1251 2
a1252 2
/etc/init.d/gpm stop
gpm -k
d1256 2
a1257 2
/etc/init.d/gpm stop
gpm -k
a1260 3
      smailconfig)
smailconfig --force
;;
d1315 5
a1383 21
      set_cdrom)
${DIALOG} --title "Configuring CD-ROM link (/dev/cdrom)" \
--menu "\nWhat type of CD-ROM drive do you have?\n" 15 71 6 \
"none" "No CD-ROM drive installed" \
"scd0" "Any SCSI CD-ROM drive" \
"hda"  "IDE, as master on primary interface (SWT default)" \
"hdb"  "IDE, as slave on primary interface" \
"hdc"  "IDE, as master on secondary interface" \
"hdd"  "IDE, as slave on secondary interface" \
 2> /tmp/cdtype
if [ $? = 1 -o $? = 255 ]; then
 rm -f /tmp/cdtype
else
 CD_ROM_TYPE="`cat /tmp/cdtype`"
 rm -f /tmp/cdtype
 if [ -b /dev/$CD_ROM_TYPE ]; then
  (cd /dev; chown ${VERBO} root.cdrom $CD_ROM_TYPE; ln ${VERBO} -sf $CD_ROM_TYPE cdrom)
  touch /dev/cdrom.selected
 fi
fi
;;
d1506 24
d1545 1
a1545 3
else
  :  # Cancel selected in phase 2 dialog.
fi
@


3.2
log
@Changed magicfilter file location, X-sed, and mke2fs-/usr2-detection.
@
text
@d3 1
a3 1
# $Id: fsadapt,v 3.1 1998/10/27 14:45:11 amn Exp amn $
d7 3
d86 1
d88 1
d90 2
a91 1
if [ "$blank_root" -o "$blank_oper" -o "$blank_prog" -o "$blank_user1" ]; then
d263 12
d294 2
d380 1
a380 1
  echo 'oper::501:990:VLBI Operator:/home/oper:/usr/bin/tcsh' >> ${NEW_ROOT}etc/passwd
d385 1
a385 1
  echo 'prog::502:990:FS Programmer:/home/prog:/usr/bin/tcsh' >> ${NEW_ROOT}etc/passwd
d508 20
d598 31
d707 6
d715 1
d749 18
d929 2
d932 1
d934 8
d1059 1
d1154 1
@


3.1
log
@For Debian 2.0 r2: changed all 'patch' usages et al.
@
text
@d3 1
a3 1
# $Id: fsadapt,v 2.5 1998/02/10 15:02:27 amn Exp amn $
d7 3
d75 1
a75 1
readonly DIALOG="dialog --backtitle FS/Debian/Linux-fsadapt-3.0"
d77 1
d140 2
a141 1
  if mount | fgrep "/usr2" >/dev/null; then
d426 1
a426 1
#  on the health of a Linux system...)
d888 1
a888 1
      sed -e "s/MouseMan/${MTYPE}/" ${SRCS}xf86configs/${SEL} > /etc/X11/XF86Config
d1065 1
a1065 1
cat > /usr/sbin/${MYFILT}-to-${MYPR}queue <<EOF-marker-with-no-quoted-chars-to-get-var-expansion
d1074 1
a1074 1
###/usr/sbin/${MYFILT} \$\@@ | su login -c \'lpr -P${MYPR}queue\'
d1076 1
a1076 1
/usr/sbin/${MYFILT} \$\@@ | lpr -P${MYPR}queue
d1078 1
a1078 1
chmod a+x /usr/sbin/${MYFILT}-to-${MYPR}queue
d1084 1
a1084 1
Locate the 'if=/usr/sbin/${MYFILT}' entry that corresponds\n\
d1086 1
a1086 1
'if=/usr/sbin/${MYFILT}-to-${MYPR}queue'.\n\
@


2.5
log
@Updated version number in backdrop, added /dev/tape.
@
text
@d2 2
a3 2
# fsadapt  -- adapt a Debian 1.3.1.r3 installation for FS
# $Id: fsadapt,v 2.4 1998/02/09 15:04:53 amn Exp amn $
d7 3
d72 2
a73 1
readonly DIALOG="dialog --backtitle FS/Debian/Linux-fsadapt-2.5"
d148 1
a148 1
or it doesn't contain Debian 1.3.1.r3 installed on it.\n\
d162 1
a162 1
"\nWe are about to update a Debian 1.3.1.r3 + Linux 2.0.30\n\
d190 12
a201 9
# Fix /usr/include/linux symlink.
# xxx: maybe later perform like fsadapt-1.14 kernel-1.2.8.patch 
#      alias mount root readonly/rtx 990/latency enabler.
#      (fgrep 990 ${NEW_ROOT}usr/src/linux/kernel/sys.c >/dev/null)
if [ -L ${NEW_ROOT}usr/include/linux -a -L ${NEW_ROOT}usr/include/asm ]; then
  kernelinc_def="off"
else
  kernelinc_def="on"
fi
d208 1
d224 1
d232 11
a242 10
# If only libproc.so.1.12 exists and not 1.11, make a quick fix
# for Debian 1.3.1.r3 to enable xload and others to work.
libproc_def="off"
if [ -r ${NEW_ROOT}lib/libproc.so.1.12 ]; then
  if [ ! -e ${NEW_ROOT}lib/libproc.so.1.11 ]; then
    libproc_def="on"
  fi
fi
# If fort77 is of version 1.13 and doesn't have debugcmd fix, fix it.
# for Debian 1.3.1.r3 to enable xload and others to work.
d244 2
a245 2
if (fgrep '$version = "1.13"' ${NEW_ROOT}usr/bin/fort77 >/dev/null); then
  if (fgrep '$debugcmd = ""' ${NEW_ROOT}usr/bin/fort77 >/dev/null); then
a263 1
  kernelinc "Make kernel include files available" $kernelinc_def \
d270 1
a270 3
  libproc   "Make libproc.so.1.11 available" $libproc_def \
  fort77    "Patch version 1.13 of fort77 command" $fort77_def \
  powerdown "Copy '/bin/powerdown' and edit '/etc/sudoers'" "on" \
d273 1
a273 1
  PATCH_ERRS=${SRCS}patch-results-`date +'%Y%m%d%H%S'`
d284 23
a306 23
      kernelinc)
## kernel-1.2.8.patch alias mount root readonly/rtx 990/latency enabler.
#(cd ${NEW_ROOT}usr/src/linux; patch <${SRCS}kernel-1.2.8.patch) 2>> $PATCH_ERRS
# After new kernel stuff is in place, adjust /usr/include/linux symlink.
for SUBD in linux asm; do
  if [ -L ${NEW_ROOT}usr/include/${SUBD} ]; then
    rm -f ${NEW_ROOT}usr/include/${SUBD}
  else
    mv ${VERBO} -f ${NEW_ROOT}usr/include/${SUBD} ${NEW_ROOT}usr/include/${SUBD}.orig
  fi
  ln ${VERBO} -s ../src/linux/include/${SUBD} ${NEW_ROOT}usr/include/${SUBD}
done
## And then we do a cruel thing, namely zap (possible) previous
## configuration choices and replace the default main configurator
## with choices of our own.
#rm -f ${NEW_ROOT}usr/src/linux/.config
#if [ ! -e ${NEW_ROOT}usr/src/linux/arch/i386/config.in.replaced ]; then
#  mv ${VERBO} ${NEW_ROOT}usr/src/linux/arch/i386/config.in ${NEW_ROOT}usr/src/linux/arch/i386/config.in.replaced
#fi
## (this is Linux kernel version specific, so use direct version number
##  to deliberately break this on new versions...)
#cp ${VERBO} -p ${SRCS}replacement-config-in ${NEW_ROOT}usr/src/linux-1.2.12/arch/i386/config.in
;;
d318 1
a318 1
(cd linux-gpib; patch <${SRCS}linux-gpib-2.03-base.patch) 2>> $PATCH_ERRS
d465 9
a473 9
      libproc)
if [ -r ${NEW_ROOT}lib/libproc.so.1.12 ]; then
  if [ ! -e ${NEW_ROOT}lib/libproc.so.1.11 ]; then
    ln ${VERBO} -s libproc.so.1.12 ${NEW_ROOT}lib/libproc.so.1.11
    # Doesn't seem to need ldconfig, maybe 'xload' et al reference
    # the library with an explicit version number.
  fi
fi
;;
d475 2
a476 2
if (fgrep '$version = "1.13"' ${NEW_ROOT}usr/bin/fort77 >/dev/null); then
  if (fgrep '$debugcmd = ""' ${NEW_ROOT}usr/bin/fort77 >/dev/null); then
d479 1
a479 1
    (cd ${NEW_ROOT}usr/bin; patch <${SRCS}patch-fort77-1.13) 2>> $PATCH_ERRS
d571 1
a571 1
if [ -r /usr/src/linux/.config ]; then
a620 1
  netconfig     "Alter TCP/IP configuration (IP numbers)" $netconfig_def \
d630 1
d698 5
d717 2
a718 1
for GRP in dialout cdrom floppy tape audio backup dos; do
d729 5
d737 1
a737 1
cp ${VERBO} -a ${SRCS}fs2.cfg /usr/src/linux/fs2.cfg
d739 2
a740 2
if [ ! -e /usr/src/kernel-source-2.0.30/.config ]; then
  cp ${VERBO} -a ${SRCS}fs2.cfg /usr/src/kernel-source-2.0.30/.config
d753 5
d761 1
a761 1
# xxx: does this require that kernel has been recompiled (ksyms avail?) ?
d765 5
@


2.4
log
@Updating backdrop version number, syncing RCS version number.
@
text
@d3 1
a3 1
# $Id: fsadapt,v 2.2 1998/02/05 13:30:42 amn Exp amn $
d7 3
d69 1
a69 1
readonly DIALOG="dialog --backtitle FS/Debian/Linux-fsadapt-2.4"
d699 4
@


2.2
log
@fort77, ibProto.h, Vikom Pro, blank passwd of user1, config kernel 2.0.30
only, no networking clears netconfig-generated /etc/resolv.conf, updated
backdrop version number.
@
text
@d3 1
a3 1
# $Id: fsadapt,v 2.1 1997/10/22 18:01:50 root Exp amn $
d7 5
d66 1
a66 1
readonly DIALOG="dialog --backtitle FS/Debian/Linux-fsadapt-2.3"
@


2.1
log
@Testing for existence of /etc/printcap before moving it to .orig.
@
text
@d3 1
a3 1
# $Id: fsadapt,v 2.0 1997/10/22 12:56:53 root Exp root $
d7 3
d61 1
a61 1
readonly DIALOG="dialog --backtitle FS/Debian/Linux-fsadapt-2.0"
d68 2
a69 1
if [ "$blank_root" -o "$blank_oper" -o "$blank_prog" ]; then
d73 1
a73 1
('root', 'oper', 'prog')\n\
d223 10
d252 3
a254 2
  fstab     "Make sure that '/etc/fstab' includes '/usr2' etc." "on" \
  libproc   "Make libproc.so.1.11 available." $libproc_def \
d459 9
d505 1
a505 1
  if (fgrep 'root::' ${NEW_ROOT}etc/passwd >/dev/null); then
d511 1
a511 1
by invoking the command 'passwd'."\n\
d561 1
d567 7
a573 1
# Enable '/etc/rc.boot/0setserial' for Boca BB2016.
d614 1
a614 1
  comp_gpib     "Recompile 'linux-gpib' driver and library" "off" \
d616 1
a616 1
  rcserial      "Enable 'rc.serial' to be run for Boca BB2016" $rcserial_def \
d709 2
a710 2
if [ ! -e /usr/src/linux/.config ]; then
  cp ${VERBO} -a ${SRCS}fs2.cfg /usr/src/linux/.config
d717 1
a717 1
(cd /usr/src/linux; make-kpkg --revision fslcl1 binary-arch)
d751 3
a753 2
# Enable '/etc/rc.boot/0setserial' for Boca BB2016 to be run in boot.
${DIALOG} --title "Really enable Boca BB2016?" \
d756 1
a756 1
to recognize Boca BB2016 multiport RS232 cards,\n\
d760 1
a760 1
If you have a Boca BB2016, please select 'Yes'.
d762 1
a762 1
If you don't have a Boca BB2016, please select 'No'.\n" \
d806 1
d817 2
@


2.0
log
@Completely revised for Debian 1.3.1.r3.
@
text
@d3 1
a3 1
# $Id: fsadapt,v 1.14 1996/03/05 12:14:28 root Exp root $
d7 3
d896 3
a898 1
  mv ${VERBO} -f /etc/printcap /etc/printcap.orig
@


1.14
log
@For fsadapt-1.12, provide an XF86Config alternative for 21" Nokia.
@
text
@d2 2
a3 2
# fsadapt  -- adapt a Slackware 2.3.0 installation for FS
# $Id: fsadapt,v 1.13 1995/12/01 20:27:37 root Exp root $
d7 3
d55 2
d62 2
a63 3
blank_powerdown=`grep '^powerdown::' /etc/passwd`
if [ "$blank_root" -o "$blank_oper" -o "$blank_prog" -o "$blank_powerdown" ]; then
  dialog --title "Check user accounts and passwords" \
d66 1
a66 1
('root', 'oper', 'prog', 'powerdown')\n\
d109 1
a109 1
# Try to get "true and right" device names from 'mount' output
d122 1
a122 1
# There must be Slackware-specific '/var/adm/packages'
d124 2
a125 2
if [ ! -d ${NEW_ROOT}var/adm/packages ]; then
  dialog --title "New root file system target directory problem" \
d129 1
a129 1
or it doesn't contain Slackware 2.3.0 installed on it.\n\
d141 1
a141 1
dialog --title "Current root / swap / usr2 settings" \
d143 2
a144 2
"\nWe are about to update a Slackware 2.3.0 + Linux 1.2.8\n\
installation with Linux 1.2.12 to support running FS9.\
a159 13
# Finalize SW installation if not installed via boot/root floppies.
# (Can be detected because no '/etc/fstab' is built then.)
# (Let 'SeTconfig.color144' build a LILO slow boot floppy
#  and do config, but install LILO on hard disk MBR only later...)
if [ ! -r ${NEW_ROOT}etc/fstab ]; then
  cp ${VERBO} -p /vmlinuz ${NEW_ROOT}vmlinuz
  echo $NEW_ROOT >/tmp/SeTT_PX
  echo $NEW_ROOT_DEVICE >/tmp/SeTrootdev
  touch /tmp/SeTcolor
  ${SRCS}SeTconfig.color144
  echo $NEW_ROOT_DEVICE '  /      ext2  defaults  1  1' >${NEW_ROOT}etc/fstab
  rm -f /tmp/SeT*
fi
d162 1
a162 1
mkdir -p ${NEW_ROOT}da ${NEW_ROOT}db
d169 1
d171 6
a176 27
# Test for Linux 1.2.12.
if [ ! -d ${NEW_ROOT}usr/src/linux-1.2.12 ]; then
  linux1212_def="on"
else
  linux1212_def="off"
fi
# Make aic7xxx alias Adaptec 294x PCI an accepted SCSI controller.
if [ ! -r ${NEW_ROOT}usr/src/linux/drivers/scsi/aic7xxx.c ]; then
  aic7xxx_def="on"
else
  aic7xxx_def="off"
fi
# Make 3c59x PCI Ethernet card an accepted SCSI controller.
if [ ! -r ${NEW_ROOT}usr/src/linux/drivers/net/3c59x.c ]; then
  e3c59x_def="on"
else
  e3c59x_def="off"
fi
# kernel-1.2.8.patch alias mount root readonly/rtx 990/latency enabler.
if (fgrep 990 ${NEW_ROOT}usr/src/linux/kernel/sys.c >/dev/null); then
  kernel128_def="off"
else
  kernel128_def="on"
fi
# Digiboard PC/Xx driver.
if [ ! -r ${NEW_ROOT}usr/src/linux/drivers/char/pcxe.c ]; then
  digiboard_def="on"
d178 1
a178 1
  digiboard_def="off"
d180 2
a181 2
# Linux-gpib-1.0 driver for NI ATGPIB.
if [ ! -d ${NEW_ROOT}usr/src/linux-gpib-1.0 ]; then
a185 87
if (fgrep high_memory ${NEW_ROOT}usr/src/linux/kernel/ksyms.c >/dev/null); then
  atgpibkr_def="off"
else
  atgpibkr_def="on"
fi
# Add 3c5x9 setup program.
if [ ! -x ${NEW_ROOT}sbin/3c5x9 ]; then
  a3c5x9_def="on"
else
  a3c5x9_def="off"
fi
# Add 'm1' Mosaic, 'co1' conversions.
if [ ! -x ${NEW_ROOT}usr/X11R6/bin/Mosaic ]; then
  mosaic_def="on"
else
  mosaic_def="off"
fi
if [ ! -x ${NEW_ROOT}usr/bin/recode ]; then
  conv_def="on"
else
###  conv_def="off"  For fsadapt-1.9 "on" all the time:
  conv_def="on"
fi
# Add 'kermit'.
if [ ! -r ${NEW_ROOT}usr/bin/kermit ]; then
  kermit_def="on"
else
  kermit_def="off"
fi
# Add corrected Linuxdoc-sgml, comes from its own package:
if [ ! -d ${NEW_ROOT}usr/src/linuxdoc-sgml-1.1 -a -r ${NEW_ROOT}usr/bin/latex ]; then
  ldsgml_def="on"
else
  ldsgml_def="off"
fi
# Correct '/bin/bash', as 1.14.3-4(1) break 'f77' to always return
# 'Error 4' in make...  (Get older 1.14.2(1).)
if (fgrep 'version 1.14.2(1)' ${NEW_ROOT}bin/bash >/dev/null); then
  bashdwng_def="off"
else
  bashdwng_def="on"
fi
# Correct 'updatedb' not to search files in '/proc'.
if (fgrep /proc ${NEW_ROOT}var/spool/cron/crontabs/root >/dev/null); then
  updatedb_def="off"
else
  updatedb_def="on"
fi
# Correct '/var/X11R6/lib/xdm/xdm-config' to supply the same
# initial PATH setting for logged-in users as what 'login' provides.
if (fgrep userPath ${NEW_ROOT}var/X11R6/lib/xdm/xdm-config >/dev/null); then
  xdmpath_def="off"
else
  xdmpath_def="on"
fi
# Correct '/etc/inetd.conf' _not_ to try start up Samba
# Lan Manager servers if the executables are missing.
if (grep '^netbios' ${NEW_ROOT}etc/inetd.conf >/dev/null); then
  if [ -x ${NEW_ROOT}usr/sbin/smbd -a -x ${NEW_ROOT}usr/sbin/nmbd ]; then
    nosamba_def="off"
  else
    nosamba_def="on"
  fi
else
  nosamba_def="off"
fi
# Adjust '/etc/rc.d/rc.S' to set Linux clock assuming
# PC hardware clock is kept in GMT/UTC time.
# (The default is to assume PC hw clock keeps local time.)
if (fgrep 'clock -u -s' ${NEW_ROOT}etc/rc.d/rc.S >/dev/null); then
  hwutclock_def="off"
else
  hwutclock_def="on"
fi
# Adjust '/etc/rc.d/rc.S' to run 'rc.serial', if it exists.
if (fgrep -e '-r /etc/rc.d/rc.serial' ${NEW_ROOT}etc/rc.d/rc.S >/dev/null); then
  rcsrcser_def="off"
else
  rcsrcser_def="on"
fi
# Add loading of GPIB, FS shared memory, redirection of home/mail
# directories, and starting 'xdm' to '/etc/rc.d/rc.local'.
if (fgrep gpib0 ${NEW_ROOT}etc/rc.d/rc.local >/dev/null); then
  rclocal_def="off"
else
  rclocal_def="on"
fi
d187 1
a187 1
if (fgrep 'rtx:*:990' ${NEW_ROOT}etc/group >/dev/null); then
d196 1
a196 2
is_powerdown=`grep '^powerdown:' ${NEW_ROOT}etc/passwd`
if [ "$is_root" -a "$is_oper" -a "$is_prog" -a "$is_powerdown" ]; then
a200 6
# Make editor 'joe' to use WordStar-style key bindings.
if [ -e ${NEW_ROOT}usr/lib/joe/jstarrc -a ! -e ${NEW_ROOT}usr/lib/joe/plain-joerc ]; then
  joews_def="on"
else
  joews_def="off"
fi
d202 1
d204 3
a206 3
  liloconf_def="off"
else
  liloconf_def="on"
d208 7
a214 4
if [ -x ${NEW_ROOT}root/fsadapt/fsadapt ]; then
  cpfsadapt_def="off"
else
  cpfsadapt_def="on"
d218 1
a218 1
dialog --title "FS Adaptation: Modifications" \
d227 1
d229 1
a229 5
  linux1212 "Install Linux kernel 1.2.12 in '/usr/src/linux'" $linux1212_def \
  aic7xxx   "Enable support for Adaptec 294X PCI SCSI card" $aic7xxx_def \
  kernel128 "General kernel enhancements" $kernel128_def \
  e3c59x    "Enable support for 3Com 3C590 PCI Ethernet card" $e3c59x_def \
  digiboard "Add DigiBoard PC/Xx driver to the kernel" $digiboard_def \
d231 1
a231 13
  atgpibkr  "Add kernel symbols required by 'atgpib'" $atgpibkr_def \
  a3c5x9    "Add a setup program for 3Com 3C5x9 Ethercards" $a3c5x9_def \
  mosaic    "Add NCSA Mosaic 2.4 WWW/html browser" $mosaic_def \
  conv      "Add GNU recode and lpr printing templates" $conv_def \
  kermit    "Add Kermit serial comms program" $kermit_def \
  ldsgml    "Add Linuxdoc-sgml documenting system" $ldsgml_def \
  bashdwng  "Correct '/bin/bash' to 1.14.2(1)" $bashdwng_def \
  updatedb  "Correct 'updatedb' to exclude '/proc'" $updatedb_def \
  xdmpath   "Correct 'xdm' to supply correct PATH settings" $xdmpath_def \
  nosamba   "Disable 'Samba' startup in '/etc/inetd.conf'" $nosamba_def \
  hwutclock "Correct 'rc.S' to support PC hardware clock set in UTC" $hwutclock_def \
  rcsrcser  "Correct 'rc.S' to support 'rc.serial'" $rcsrcser_def \
  rclocal   "Adjust 'rc.local' to run FS-specific programs in boot" $rclocal_def \
d233 1
a233 2
  stdaccts  "Add 'oper', 'prog' and 'powerdown' to '/etc/passwd'" $stdaccts_def \
  joews     "Change 'joe' editor to use WordStar-style keys" $joews_def \
d236 2
a237 4
  remtar    "Enable remote 'tar' and '/dev/*st[0-9]' permissions" "on" \
  floppy    "Enable floppy access to 'oper'/'prog'" "on" \
  powerdown "Copy '/bin/powerdown' and '/etc/sudoers'" "on" \
  cpfsadapt "Copy this 'fsadapt' system to new '/root/fsadapt'" "off" \
d244 3
d249 1
d251 22
a272 45
      linux1212)
# Install Linux 1.2.12 to be visible at '/usr/src/linux'.
pushd ${NEW_ROOT}usr/src >/dev/null
rm ${VERBO} -rf linux
###rm ${VERBO} -rf linux-1.*
tar ${VERBO} -xzf ${SRCS}linux-1.2.12.tar.gz
mv ${VERBO} linux linux-1.2.12
ln ${VERBO} -s linux-1.2.12 linux
rm ${VERBO} -rf linux-1.2.8
popd >/dev/null
;;
      aic7xxx)
# Make aic7xxx alias Adaptec 294x PCI an accepted SCSI controller.
(cd ${NEW_ROOT}usr/src/linux; zcat ${SRCS}aic7xxx.patch.gz | patch) 2>> $PATCH_ERRS
;;
      kernel128)
# kernel-1.2.8.patch alias mount root readonly/rtx 990/latency enabler.
(cd ${NEW_ROOT}usr/src/linux; patch <${SRCS}kernel-1.2.8.patch) 2>> $PATCH_ERRS
# And then we do a cruel thing, namely zap (possible) previous
# configuration choices and replace the default main configurator
# with choices of our own.
rm -f ${NEW_ROOT}usr/src/linux/.config
if [ ! -e ${NEW_ROOT}usr/src/linux/arch/i386/config.in.replaced ]; then
  mv ${VERBO} ${NEW_ROOT}usr/src/linux/arch/i386/config.in ${NEW_ROOT}usr/src/linux/arch/i386/config.in.replaced
fi
# (this is Linux kernel version specific, so use direct version number
#  to deliberately break this on new versions...)
cp ${VERBO} -p ${SRCS}replacement-config-in ${NEW_ROOT}usr/src/linux-1.2.12/arch/i386/config.in
;;
      e3c59x)
# Make 3c59x (PCI) an accepted Ethernet card.
cp ${VERBO} -p ${SRCS}3c59x.c ${NEW_ROOT}usr/src/linux/drivers/net/3c59x.c
(cd ${NEW_ROOT}usr/src; patch -p0 < ${SRCS}vortex.patch ) 2>> $PATCH_ERRS
;;
      digiboard)
# Digiboard PC/Xx driver.
(cd ${NEW_ROOT}usr/src/linux/drivers/char; tar ${VERBO} -xzf ${SRCS}digipcxx-1.3.tgz) 2>> $PATCH_ERRS
(cd ${NEW_ROOT}usr/src/linux; patch <${SRCS}digipcxx-1.3.patch) 2>> $PATCH_ERRS
# The problem with v1.3 release is that it comes with two cards
# preconfigured but not with the corresponding /dev/tty[dD]*
# special device files; after the cards are deleted, 'digisetup'
# is unable to create '/dev/tty[dD]*'s...
# We just replace with a config with _no_ cards, then
# 'digisetup' can cope with adding a card and the corr. '/dev/tty[dD]*'s.
cp ${VERBO} -p ${SRCS}replacement-pcxxconfig-h ${NEW_ROOT}usr/src/linux/drivers/char/pcxxconfig.h
d275 1
a275 1
# Linux-gpib-1.0 driver for NI ATGPIB.
d277 1
a277 1
rm -rf linux-gpib linux-gpib-1.0 \
d279 3
a281 3
tar ${VERBO} -xzf ${SRCS}linux-gpib-1.0.tgz
mv ${VERBO} linux-gpib linux-gpib-1.0
ln ${VERBO} -s linux-gpib-1.0 linux-gpib
d284 6
a289 3
# Withdraw 'ibsh' from Makefile, correct generation of lib/ibProto.h.
(cd linux-gpib; patch <${SRCS}linux-gpib-1.0-lib.patch) 2>> $PATCH_ERRS
rm ${VERBO} -rf linux-gpib/ibsh
d296 4
a299 34
;;
      atgpibkr)
# Add required 'ksyms'.
(cd ${NEW_ROOT}usr/src/linux; patch <${SRCS}linux-gpib-1.0.patch) 2>> $PATCH_ERRS
;;
      a3c5x9)
# Add 3c5x9 Ethercard setup program.
cp ${VERBO} -a ${SRCS}3c5x9 ${NEW_ROOT}sbin/3c5x9
;;
      mosaic)
# Add 'm1' Mosaic, 'co1' conversions.
echo ".fs" >/tmp/SeTtagext
/sbin/pkgtool -sets \#m\# -source_mounted -source_dir ${SRCS%/} -target_dir $NEW_ROOT
rm -f /tmp/SeTtagext
;;
      conv)
echo ".fs" >/tmp/SeTtagext
/sbin/pkgtool -sets \#co\# -source_mounted -source_dir ${SRCS%/} -target_dir $NEW_ROOT
rm -f /tmp/SeTtagext
;;
      kermit)
(cd $NEW_ROOT; tar ${VERBO} -xzf ${SRCS}kermit-189.tgz)
;;
      ldsgml)
# Add corrected Linuxdoc-sgml, comes from its own package:
(cd $NEW_ROOT; tar ${VERBO} -xzf ${SRCS}lds-11c.tgz)
(cd ${NEW_ROOT}usr/lib/texmf; patch <${SRCS}dvips-config.patch) 2>> $PATCH_ERRS
;;
      bashdwng)
# Correct '/bin/bash' to older version (from SW 2.1.0) to keep 'f77' happy.
if [ -r ${NEW_ROOT}bin/bash.orig ]; then
  :
else
  mv ${VERBO} ${NEW_ROOT}bin/bash ${NEW_ROOT}bin/bash.orig
a300 1
cp ${VERBO} -p ${SRCS}bash-1.14.2.1 ${NEW_ROOT}bin/bash
d302 5
a306 30
      updatedb)
# Correct 'updatedb' not to search files in '/proc'.
(cd ${NEW_ROOT}var/spool/cron; patch <${SRCS}crontabs-root.patch) 2>> $PATCH_ERRS
;;
      xdmpath)
# Correct '/var/X11R6/lib/xdm/xdm-config' to supply the same
# initial PATH setting for logged-in users as what 'login' provides.
(cd ${NEW_ROOT}var/X11R6/lib/xdm; patch <${SRCS}xdm-path.patch) 2>> $PATCH_ERRS
;;
      nosamba)
# Correct '/etc/inetd.conf' _not_ to try start up Samba
# Lan Manager servers if the executables are missing.
(cd ${NEW_ROOT}etc; patch <${SRCS}no-samba.patch) 2>> $PATCH_ERRS
;;
      hwutclock)
# Adjust '/etc/rc.d/rc.S' to set Linux clock assuming
# PC hardware clock is kept in GMT/UTC time.
# (The default is to assume PC hw clock keeps local time.)
(cd ${NEW_ROOT}etc/rc.d; patch <${SRCS}rc-S-gmt-clock.patch) 2>> $PATCH_ERRS
;;
      rcsrcser)
# Adjust '/etc/rc.d/rc.S' to conditionally call rc.serial.
(cd ${NEW_ROOT}etc/rc.d; patch <${SRCS}rc-S-rc-serial.patch) 2>> $PATCH_ERRS
# rc.S was "clean", we assume that there is rc.serial is also from SW:
(cd ${NEW_ROOT}etc/rc.d; mv ${VERBO} -f rc.serial rc.serial.defer)
;;
      rclocal)
# Add loading of GPIB, FS shared memory, redirection of home/mail
# directories, and starting 'xdm' to '/etc/rc.d/rc.local'.
(cd ${NEW_ROOT}etc/rc.d; cat ${SRCS}rc-local-addition >>rc.local)
d308 2
a309 2
rm ${VERBO} -f ${NEW_ROOT}etc/rc.d/rc.fs
ln ${VERBO} -s /usr2/fs/misc/rc.fs ${NEW_ROOT}etc/rc.d/rc.fs
d313 5
a317 1
echo 'rtx:*:990:' >> ${NEW_ROOT}etc/group
d322 1
a322 1
  echo 'oper::501:990:VLBI Operator:/home/oper:/bin/tcsh' >> ${NEW_ROOT}etc/passwd
d327 1
a327 1
  echo 'prog::502:990:FS Programmer:/home/prog:/bin/tcsh' >> ${NEW_ROOT}etc/passwd
a330 11
if [ ! "$is_powerdown" ]; then
  echo 'powerdown::503:990:Powerdown by login:/home/powerdown:/bin/powerdown' >> ${NEW_ROOT}etc/passwd
fi
mkdir -p ${NEW_ROOT}home/powerdown
chown ${VERBO} 503.990 ${NEW_ROOT}home/powerdown
;;
      joews)
if [ ! -e ${NEW_ROOT}usr/lib/joe/plain-joerc ]; then
  mv ${VERBO} ${NEW_ROOT}usr/lib/joe/joerc ${NEW_ROOT}usr/lib/joe/plain-joerc
fi
cp ${VERBO} -p ${NEW_ROOT}usr/lib/joe/jstarrc ${NEW_ROOT}usr/lib/joe/joerc
d337 3
a339 1
#append = ..., if you need permanent kernel parameters
d341 7
a347 7
boot = ${NEW_ROOT_DEVICE%[0-9]}  # the whole disk, i.e. use MBR of that disk
delay = 0     # no LILO prompt wait delay
vga = normal  # force sane state
ramdisk = 0   # paranoia setting
image = /vmlinuz
  root = ${NEW_ROOT_DEVICE}
  label = Linux
d362 2
a363 2
if [ $NEW_SWAP_DEVICE != `fgrep "swap" ${NEW_ROOT}/etc/fstab | cut -d' ' -f1` ]; then
  dialog --title "Prepare this swap partition with 'mkswap'?" \
d392 1
a392 1
  dialog --title "Prepare this '/usr2' partition with 'mke2fs'?" \
d415 1
a415 1
  echo '/dev/cdrom  /cdrom iso9660 ro,noauto,user 1 1' >> ${NEW_ROOT}etc/fstab
d422 1
a422 1
  echo '/dev/fd0    /dosa  msdos  noauto,user  1  1' >> ${NEW_ROOT}etc/fstab
d432 8
a439 16
      remtar)
# SW 2.3.0 '/bin/tar' refers to '/etc/rmt' (not '/sbin/rmt'),
# for remote tar operations, so '/bin/tar' doesn't need to be patched.
# But we need to make sure other machines see our 'rmt'
# at '/etc/rmt', too.
# (Don't be too paranoid about ordinary users executing 'rmt'
#  and everybody accessing SCSI tape drives...)
chmod ${VERBO} a+x ${NEW_ROOT}sbin/rmt
chmod ${VERBO} a+rw ${NEW_ROOT}dev/*st[0-9]
if [ ! -e ${NEW_ROOT}etc/rmt ]; then
  ln ${VERBO} -s /sbin/rmt ${NEW_ROOT}/etc/rmt
fi
;;
      floppy)
# Enable world access to floppy devices.
chmod ${VERBO} a+rw ${NEW_ROOT}dev/fd*
d443 1
a445 7
      cpfsadapt)
# Copy the setup system anew.
if [ ${NEW_ROOT} != / ]; then
  rm -rf ${NEW_ROOT}root/fsadapt
  cp ${VERBO} -a /root/fsadapt ${NEW_ROOT}root/fsadapt
fi
;;
d453 4
a456 40

# (xxx: Could these be useful in other development machines than bigbang?)
if [ `hostname` = bigbang -a $NEW_ROOT != / ]; then
  CURRENT_ROOT_DEVICE="`mount | fgrep "on / " | cut -d' ' -f1`"

  dialog --title "Development machine dual-boot setup" \
    --yesno \
"\nDo you wish to enable the future FS root file system to:\n\
1) access '/home' and '/var/spool/mail' directories\n\
   on your current root ($CURRENT_ROOT_DEVICE) via '/u1' and symlinks and\n\
2) use a copy of your current '/etc/passwd'?" \
      12 74
  if [ $? = 0 ]; then

#----> indent 4 start
# To enable the previous automatic redirection (in rc.local), 
# move local (= on root file system)
# '/home' and '/var/spool/mail' -> '.local' names.
if [ -d ${NEW_ROOT}home.local ]; then
  :
else
  mv ${VERBO} ${NEW_ROOT}home ${NEW_ROOT}home.local
fi
if [ -d ${NEW_ROOT}var/spool/mail.local ]; then
  :
else
  mv ${VERBO} ${NEW_ROOT}var/spool/mail ${NEW_ROOT}var/spool/mail.local
fi

# While currently running off "the regular root" of this machine,
# make that mounted as as '/u1' with future root.
# (This allows sharing the same home and mail spool directories
#  while this machine is booted with FS root file system.)
if mount | fgrep "on / " | fgrep /dev/hda >/dev/null; then
  if (fgrep '/u1' ${NEW_ROOT}etc/fstab >/dev/null); then
    :
  else
    mkdir -p ${NEW_ROOT}u1
    echo $CURRENT_ROOT_DEVICE '  /u1  ext2  defaults  1  1' >> ${NEW_ROOT}etc/fstab
  fi
a458 11
# Finally, make a copy of current '/etc/passwd'.
cp ${VERBO} -p /etc/passwd ${NEW_ROOT}etc/passwd
#----> indent 4 end

  unset CURRENT_ROOT_DEVICE
  fi  # if development dual-boot dialog 'yes'
fi  # if bigbang and we are not copying to '/'


# xxx: What to export via NFS in '/etc/exports'?

d467 1
a467 1
  dialog --title "Need to reboot to continue installation" \
d470 1
a470 2
with a Slackware 'slow LILO' boot floppy\n\
or a FS9 Linux boot floppy with 'mount root=$NEW_ROOT_DEVICE' boot option\n\
d479 1
a479 1
    dialog --title "Check user accounts and passwords" \
d484 2
a485 5
by invoking the command 'passwd'.\n\
\n\
You should also add the user accounts 'prog' and 'oper'\n\
by using the interactive command 'adduser'." \
      17 74
a502 8

# Patch for incorrectly expanded /etc/gpib.confs:
if [ -e /etc/gpib.conf ]; then
  chown ${VERBO} root.990 /etc/gpib.conf
  chmod ${VERBO} 664 /etc/gpib.conf
fi


d506 1
a506 1
if [ -e /etc/HOSTNAME-assumed-correct ]; then
d512 1
a512 1
if (grep '^oper:' ${NEW_ROOT}etc/passwd >/dev/null); then
d518 1
a518 1
if (grep '^prog:' ${NEW_ROOT}etc/passwd >/dev/null); then
a522 6
# Check for 'powerdown':
if (grep '^powerdown:' ${NEW_ROOT}etc/passwd >/dev/null); then
  powerdown_def="off"
else
  powerdown_def="on"
fi
a528 7
# (Very feeble try of detecting that "one card seems to be configured"...
#  the driver ships with 2 or 0 cards configured in.)
if (fgrep 'NUMCARDS 1' /usr/src/linux/drivers/char/pcxxconfig.h >/dev/null); then
  config_digi_def="off"
else
  config_digi_def="on"
fi
d539 2
a540 2
# Enable '/etc/rc.d/rc.serial' for Boca BB2016.
if [ -r /etc/rc.d/rc.serial -o -e /etc/rc.d/rc.serial.not-needed ]; then
d546 3
a548 1
if [ -r /var/X11R6/lib/XF86Config ]; then
a549 2
else
  setup_x_def="on"
d557 6
d565 1
a565 1
dialog --title "FS Adaptation: Recompilations" \
d570 1
a570 1
all of these can be safely done again and again.)" \
a574 1
  powerdown     "Create user account 'powerdown'" $powerdown_def \
a575 1
  config_digi   "Configure DigiBoard PC/Xx device driver" $config_digi_def \
d578 1
a578 1
  comp_kernel   "Recompile Linux kernel (make zlilo)" "off" \
d581 1
a581 1
  makewhatis    "Rebuild 'apropos'/'make -k' database" "off" \
d583 1
d586 1
a586 2
  printer       "Setup your printer for 'lpr' use" on \
  bootfloppies  "Make additional stand-alone boot floppies" off \
d593 1
a593 1
dialog --title "Check the TCP/IP network settings" \
d596 1
a596 1
    `cat /etc/HOSTNAME`\n\n\
d611 1
a611 1
      /sbin/netconfig
d613 1
a613 1
    touch /etc/HOSTNAME-assumed-correct
d619 1
a619 1
dialog --title "Please add 'oper' account" \
d625 4
a628 5
after you select 'Ok'.\n\
\n\
(Please use GID of 'rtx'/990 and shell '/bin/tcsh'.)"\
  17 74
adduser
d632 1
a632 1
dialog --title "Please add 'prog' account" \
d638 4
a641 21
after you select 'Ok'.\n\
\n\
(Please use GID of 'rtx'/990 and shell '/bin/tcsh'.)"\
  17 74
adduser
;;
      powerdown)
# Add user 'powerdown'.
dialog --title "Please add 'powerdown' account" \
  --msgbox \
"\nYou need to set up a user account 'powerdown'\n\
for shutting the FS computer down properly.\n\
\n\
An interactive command 'adduser' will be invoked\n\
after you select 'Ok'.\n\
\n\
(Please use GID of 'users'/100,\n\
home directory of '/home/powerdown',\n\
and shell '/bin/powerdown'.)"\
  17 74
adduser
d648 1
a648 5
chmod ${VERBO} 660 /etc/gpib.conf
;;
      config_digi)
# Configure Digiboard (compiled together with the kernel.)
(cd /usr/src/linux/drivers/char; digisetup; make ditty)
d651 19
a669 4
# Permissions of /dev/cua*, /dev/ttyS*, /dev/digiboard, /dev/gpib*.
# (This can be run only after configuring linux-gpib and Digiboard
#  which create these device special files.)
chmod ${VERBO} a=rw /dev/cua* /dev/tty[dD]* /dev/gpib*
d673 6
a678 1
(cd /usr/src/linux; make config; make dep; make clean)
d682 3
a684 1
(cd /usr/src/linux; make zlilo)
d692 23
a714 5
(cd /usr/src/linux-gpib; make; cp ${VERBO} -p driver/gpib0.o /boot)
;;
      makewhatis)
# Rebuild 'apropos'/'whatis'/'man -k' database.
(cd /usr/man; /usr/lib/makewhatis -v -w -c)
a715 1

d717 2
a718 2
# Enable '/etc/rc.d/rc.serial' for Boca BB2016 to be run in boot.
dialog --title "Really enable Boca BB2016?" \
d720 1
a720 1
"\nAlthough this script offers installing '/etc/rc.d/rc.serial'\n\
d723 1
a723 1
in your PC (or are planning to edit that file manually).
d729 1
a729 1
  Yes   "Yes, I want '/etc/rc.d/rc.serial' to run for Boca BB2016" \
d734 1
d736 1
a736 3
    pushd /etc/rc.d >/dev/null
    cp ${VERBO} -a ${SRCS}replacement-rc-serial rc.serial
    popd >/dev/null
d738 2
a739 2
    if [ -r /etc/rc.d/rc.serial ]; then
      mv ${VERBO} -f /etc/rc.d/rc.serial /etc/rc.d/rc.serial.not-needed
d742 1
a742 1
      touch /etc/rc.d/rc.serial.not-needed
d745 2
a746 2
    if [ -r /etc/rc.d/rc.serial ]; then
      mv ${VERBO} -f /etc/rc.d/rc.serial /etc/rc.d/rc.serial.defer
d749 1
d752 4
d758 4
a761 1
dialog --title "Setup X Window System" --menu "Select your SVGA card type:" 17 76 10 \
d763 2
a764 6
  XF86_S3_1024 "Diamond Stealth SE or 64 (used in 'SWT' systems)" \
  XF86_S3_1600 "Stealth 64 with a 21\" monitor (1600x1280)" \
  XF86_Mach8   "ATI Mach8 (used in 'TAG' systems)" \
  XF86_Mach32  "ATI Mach32" \
  XF86_Mach64  "ATI Mach64" \
  XF86_SVGA    "Genoa 8900VLB (need to edit for other Cirrus chips)" \
d768 10
a777 2
  if [ $SEL = "No_X" -a -f /var/X11R6/lib/XF86Config ]; then
    mv ${VERBO} -f /var/X11R6/lib/XF86Config /var/X11R6/lib/XF86Config.no-X
d779 30
a808 12
    if [ $SEL = "XF86_S3_1024" -o $SEL = "XF86_S3_1600" ]; then
      SSEL="XF86_S3"
    else
      SSEL=${SEL}
    fi
    ln ${VERBO} -sf /usr/X11R6/bin/${SSEL} /var/X11R6/bin/X
    mv ${VERBO} -f /var/X11R6/lib/XF86Config /var/X11R6/lib/XF86Config.old
    cp ${VERBO} -p ${SRCS}XF86Config.${SEL} /var/X11R6/lib/XF86Config
    # If we have an updated executable (== X server), copy it.
    if [ -x ${SRCS}${SSEL} ]; then
      mv ${VERBO} -f /usr/X11R6/bin/${SSEL} /usr/X11R6/bin/${SSEL}.old
      cp ${VERBO} -p ${SRCS}${SSEL} /usr/X11R6/bin/${SSEL}
d811 3
d815 54
d871 2
a872 2
dialog --title "Configuring CD-ROM link (/dev/cdrom)" \
--menu "\nWhat type of CD-ROM drive do you have?\n" 15 71 7 \
a878 5
"sbpcd" "Sound Blaster Pro/Panasonic/Matsushita" \
"sonycd" "Sony CDU31A" \
"cdu535" "Sony 531/535" \
"mcd"  "Mitsumi" \
"aztcd" "Aztech/Orchid/Okano/Wearnes with interface card" \
d886 1
a886 1
  (cd /dev; ln ${VERBO} -sf $CD_ROM_TYPE cdrom)
d892 117
a1008 4
${SRCS}printconfig
;;
      bootfloppies)
${SRCS}make-bootdisks $NEW_ROOT $NEW_ROOT_DEVICE
d1013 2
d1018 1
@


1.13
log
@For fsadapt-1.11, enable copying updatred X servers from fsadapt directory.
@
text
@d3 1
a3 1
# $Id: fsadapt,v 1.12 1995/12/01 19:59:48 root Exp root $
d7 3
d1035 2
a1036 1
  XF86_S3      "Diamond Stealth SE or 64 (used in 'SWT' systems)" \
d1047 7
a1053 1
    ln ${VERBO} -sf /usr/X11R6/bin/${SEL} /var/X11R6/bin/X
d1056 3
a1058 3
    if [ -x ${SRCS}${SEL} ]; then
      mv ${VERBO} -f /usr/X11R6/bin/${SEL} /usr/X11R6/bin/${SEL}.old
      cp ${VERBO} -p ${SRCS}${SEL} /usr/X11R6/bin/${SEL}
@


1.12
log
@As released on 5-Sep-95.
@
text
@d3 1
a3 1
# $Id: fsadapt,v 1.11 1995/09/05 12:44:05 root Exp root $
d7 3
d1032 1
a1032 1
  XF86_S3      "Diamond Stealth SE (used in 'SWT' systems)" \
d1035 1
d1043 7
a1049 2
    ln ${VERBO} -sf /usr/X11R6/bin/`cat /tmp/reply` /var/X11R6/bin/X
    cp ${VERBO} -p ${SRCS}XF86Config.`cat /tmp/reply` /var/X11R6/lib/XF86Config
@


1.11
log
@Final Setp 5 release changes.
@
text
@d3 1
a3 1
# $Id: fsadapt,v 1.10 1995/08/29 13:51:29 root Exp root $
d7 3
d229 2
a230 1
  conv_def="off"
d780 1
a780 1
  chmod ${VERBO} 660 /etc/gpib.conf
d875 1
d1069 3
@


1.10
log
@Name change from fsup to fsadapt.
@
text
@d3 1
a3 1
# $Id: fsadapt,v 1.9 1995/08/29 10:11:43 root Exp root $
d7 3
d773 7
d841 6
d870 1
d885 1
a885 1
(You can also defer setting up IP numbers to a later 'fsadapt' session.)\n" \
d1037 26
@


1.9
log
@Blank password check at the beginning, /da, /db, 3c59x, corrected
rc.serial (in phase 2 instead of 1), prepackaged root/oper/prog/powerdown.
@
text
@d2 2
a3 2
# fsup  -- adapt a Slackware 2.3.0 installation for FS
# $Id: fsup,v 1.8 1995/08/22 16:18:52 root Exp root $
d6 5
a10 1
# $Log: fsup,v $
d22 1
a22 1
# Name changed from 'update-sw230-to-fs' int 'fsup',
d62 1
a62 1
SRCS=${0%fsup}
d317 2
a318 3
# Disable sudo asking powerdown's password multiple times.
if [ -x ${NEW_ROOT}root/fsup/fsup ]; then
  cpfsup_def="off"
d320 1
a320 1
  cpfsup_def="on"
d333 1
a333 1
  verbose   "Show names of files being processed in 'fsup'" off \
d361 1
a361 1
  cpfsup    "Copy this 'fsup' system to new '/root/fsup'" "off" \
d654 1
a654 1
      cpfsup)
d657 2
a658 2
  rm -rf ${NEW_ROOT}root/fsup
  cp ${VERBO} -a /root/fsup ${NEW_ROOT}root/fsup
d868 1
a868 1
(You can also defer setting up IP numbers to a later 'fsup' session.)\n" \
d982 1
a982 1
  Defer "I'm not sure yet, ask again in a later run of 'fsup'" \
@


1.8
log
@I.e., powerdown script copying, CD-ROM in fstab, passwd escape hatch etc.
@
text
@d3 1
a3 1
# $Id: fsup,v 1.7 1995/08/04 17:32:47 root Exp root $
d7 3
d36 21
d154 4
d175 6
d272 3
a274 3
# Enable '/etc/rc.d/rc.serial' for Boca BB2016.
if [ -e ${NEW_ROOT}etc/rc.d/rc-serial-is-not-required ]; then
  rcserial_def="off"
d276 1
a276 5
  if (grep '^\. /etc/rc\.d/rc\.serial' ${NEW_ROOT}etc/rc.d/rc.S >/dev/null); then
    rcserial_def="off"
  else
    rcserial_def="on"
  fi
d291 10
a318 6
# Copy this 'fsup' system
if [ -x ${NEW_ROOT}root/fsup/fsup ]; then
  cpfsup_def="off"
else
  cpfsup_def="on"
fi
d334 1
d338 1
a338 1
  3c5x9     "Add a setup program for 3Com 3C5x9 Ethercards" $a3c5x9_def \
d348 1
a348 1
  rcserial  "Enable '/etc/rc.d/rc.serial' to be run for Boca BB2016" $rcserial_def \
d351 1
d358 1
a358 1
  cpfsup    "Copy this 'fsup' system to new '/root/fsup'" $cpfsup_def \
d397 5
d429 1
a429 1
  mv ${VERBO} linux-gpib/util/templates/gpib.conf linux-gpib/util/templates/gpib.conf.dist
d438 1
a438 1
      3c5x9)
d490 5
a494 38
      rcserial)
# Enable '/etc/rc.d/rc.serial' for Boca BB2016 to be run in boot.
dialog --title "Really enable Boca BB2016?" \
  --menu \
"\nAlthough this script offers installing '/etc/rc.d/rc.serial'\n\
to recognize Boca BB2016 multiport RS232 cards,\n\
you should do this _only_ if you really have such a card\n\
in your PC (or are planning to edit that file manually).
\n\
If you have a Boca BB2016, please select 'Yes'.
\n\
If you don't have a Boca BB2016, please select 'No'.\n" \
      19 74 3 \
  Yes   "Yes, I want '/etc/rc.d/rc.serial' to run for Boca BB2016" \
  No    "No, I don't need it" \
  Defer "I'm not sure yet, ask again in a later run of 'fsup'" \
2>/tmp/reply
if [ $? = 0 ]; then
  if [ `cat /tmp/reply` = Yes ]; then
    pushd ${NEW_ROOT}etc/rc.d >/dev/null
    if [ ! -e rc.serial.orig ]; then
      mv ${VERBO} rc.serial rc.serial.orig
    fi
    cp ${VERBO} -a ${SRCS}replacement-rc-serial rc.serial
    patch <${SRCS}rc-S-rc-serial.patch 2>> $PATCH_ERRS
    touch ${NEW_ROOT}etc/rc.d/rc-serial-is-for-Boca-BB2016
    popd >/dev/null
  else
    if [ `cat /tmp/reply` = No ]; then
      rm -f ${NEW_ROOT}etc/rc.d/rc-serial-is-for-Boca-BB2016
      if [ -r ${NEW_ROOT}etc/rc.d/rc.serial ]; then
        mv ${VERBO} -f ${NEW_ROOT}etc/rc.d/rc.serial ${NEW_ROOT}etc/rc.d/rc-serial-is-not-required
      else
        touch ${NEW_ROOT}etc/rc.d/rc-serial-is-not-required
      fi
    fi
  fi
fi
d508 18
a757 16
# Check for blank root password and refuse to continue unless set.
if (fgrep 'root::' ${NEW_ROOT}etc/passwd >/dev/null); then
  dialog --title "Check user accounts and passwords" \
    --msgbox \
"\nYou _must_ set a password for 'root'\n\
before continuing the update process\n\
by invoking the command 'passwd'.\n" \
    17 74
  rm -f /tmp/reply
  if [ $? = 255 ]; then
    : # Undocumented skip-over by pressing a certain key in dialog...
  else
    exit
  fi
fi

d811 12
d846 1
d849 1
d928 1
d930 2
d951 4
d964 36
d1023 1
a1023 1
pushd ${NEW_ROOT}usr/src >/dev/null
@


1.7
log
@Oper, prog, powerdown defaults were always off.
@
text
@d3 1
a3 1
# $Id: fsup,v 1.6 1995/08/04 14:54:19 root Exp root $
d7 3
d66 1
a66 1
# if we are running $NEW_ROOT = /, ie. a "living" system.
d103 1
a103 1
ie. where the new root file system is mounted now:  $NEW_ROOT\n\
d170 6
d177 1
a177 1
if [ ! -r ${NEW_ROOT}usr/X11R6/bin/Mosaic ]; then
d182 1
a182 1
if [ ! -r ${NEW_ROOT}usr/bin/recode ]; then
d273 6
d303 1
d321 1
d397 4
d403 1
d405 1
d408 1
d410 1
d456 1
a456 1
in your PC (or are planning to edit that file manually.)
d474 1
a474 1
    touch rc-serial-is-for-Boca-BB2016
d478 6
a483 1
      touch ${NEW_ROOT}etc/rc.d/rc-serial-is-not-required
d513 1
a513 1
boot = ${NEW_ROOT_DEVICE%[0-9]}  # the whole disk, ie. use MBR of that disk
d583 7
d621 4
d636 1
d726 1
d740 6
a745 1
  exit
d818 1
a818 1
  powerdown     "Add user account and command 'powerdown'" $powerdown_def \
d823 2
a824 2
  comp_kernel   "Recompile Linux kernel (make zlilo)" "on" \
  comp_gpib     "Recompile 'linux-gpib' driver and library" "on" \
d828 1
a828 1
  disk_space    "Clean up .o files created by 'comp_*' above" off \
d887 1
a887 1
# Add user 'prog'.
d896 2
a897 1
(Please use GID of 'rtx'/990, home directory of '/',\n\
a900 2
cp ${VERBO} -a ${SRCS}powerdown /bin/powerdown
cp ${VERBO} -a ${SRCS}sudoers /etc/sudoers
d936 2
a938 1
  XF86_S3      "Diamond Stealth SE (used in 'SWT' systems)" \
d943 7
a949 2
  ln ${VERBO} -sf /usr/X11R6/bin/`cat /tmp/reply` /var/X11R6/bin/X
  cp ${VERBO} -p ${SRCS}XF86Config.`cat /tmp/reply` /var/X11R6/lib/XF86Config
d972 1
@


1.6
log
@'Click' to 'select', 'rc.serial', 'powerdown', XF86Config_S3,
cancel from phase 1, etc.
@
text
@d3 1
a3 1
# $Id: fsup,v 1.5 1995/08/02 16:34:00 root Exp root $
d7 4
d721 1
a721 1
  oper_account_def="off"
d727 1
a727 1
  prog_account_def="off"
d733 1
a733 1
  powerdown_def="off"
d914 2
@


1.5
log
@Name changed from 'update-sw230-to-fs' int 'fsup',
standard /etc/gpib.conf, Linux kernel version 1.2.12 etc.
@
text
@d3 1
a3 1
# $Id: update-sw230-to-fs,v 1.4 1995/06/12 15:45:03 root Exp root $
d6 5
a10 1
# $Log: update-sw230-to-fs,v $
d84 1
a84 1
Click 'OK' to exit and retry." \
d92 1
a92 1
"We are about to update a Slackware 2.3.0 + Linux 1.2.8\n\
d102 2
a103 2
If these are correct, click 'Yes'.
Click 'No' to cancel this script ($0)." \
d225 10
d293 1
d420 34
d508 1
a508 1
If you want to run 'mkswap' on $NEW_SWAP_DEVICE, please click 'Yes'.
d511 1
a511 1
please click 'No'." \
d539 1
a539 1
please click 'Yes'.\n\
d542 1
a542 1
please click 'No'." \
d589 3
a593 1

d640 1
a640 1
  fi  # if dialog 'yes'
a643 2
# xxx: /etc/rc.d/rc.serial for 16550A multi-UART cards?

a695 60
# Then check if our network settings are right, according to the user.
if [ ! -e /etc/HOSTNAME-assumed-correct ]; then
  dialog --title "Check the TCP/IP network settings" \
    --menu \
"\nThe current TCP/IP networking settings are for the machine:\n\n\
    `cat /etc/HOSTNAME`\n\n\
If this is correct, select 'Correct'.\n\n\
If this is _not_ correct, disconnect the Ethernet cable and\n\
select 'Netconfig' to invoke the 'netconfig' script.\n\
(You can also defer setting up IP numbers to a later 'fsup' session.)\n" \
      19 74 3 \
  Correct     "Yes, the settings are correct for this machine" \
  Netconfig   "No, I want to run 'netconfig' now to set up IP addresses" \
  Defer       "No, but I don't know the IP numbers yet, defer to later" \
2>/tmp/reply
  if [ $? = 0 ]; then
    if [ `cat /tmp/reply` = Defer ]; then
      : # Nothing
    else
      if [ `cat /tmp/reply` = Netconfig ]; then
        /sbin/netconfig
      fi
      touch /etc/HOSTNAME-assumed-correct
    fi
  fi
fi

# Add user 'oper'.
if (fgrep 'oper:' ${NEW_ROOT}etc/passwd >/dev/null); then
  :
else
  dialog --title "Please add 'oper' account" \
    --msgbox \
"\nYou need to set up a user account 'oper'\n\
for normal FS operations.\n\
\n\
An interactive command 'adduser' will be invoked\n\
after you click 'Ok'.\n\
\n\
(Please use GID of 'rtx'/990 and shell '/bin/tcsh'.)"\
    17 74
  adduser
fi
# Add user 'prog'.
if (fgrep 'prog:' ${NEW_ROOT}etc/passwd >/dev/null); then
  :
else
  dialog --title "Please add 'prog' account" \
    --msgbox \
"\nYou need to set up a user account 'prog'\n\
for FS programming work.\n\
\n\
An interactive command 'adduser' will be invoked\n\
after you click 'Ok'.\n\
\n\
(Please use GID of 'rtx'/990 and shell '/bin/tcsh'.)"\
    17 74
  adduser
fi

d704 27
d733 1
a733 1
  CONFIG_GPIB_def="off"
d735 1
a735 1
  CONFIG_GPIB_def="on"
d740 1
a740 1
  CONFIG_DIGI_def="off"
d742 1
a742 1
  CONFIG_DIGI_def="on"
d745 1
a745 1
  CONFIG_KERNEL_def="off"
d747 1
a747 1
  CONFIG_KERNEL_def="on"
d750 1
a750 1
  SETUP_X_def="off"
d752 1
a752 1
  SETUP_X_def="on"
d763 14
a776 10
  CONFIG_GPIB   "Configure 'linux-gpib' driver and library" $CONFIG_GPIB_def \
  CONFIG_DIGI   "Configure DigiBoard PC/Xx device driver" $CONFIG_DIGI_def \
  SET_PERMS     "Set device permissions (serial, digi, gpib)" "on" \
  CONFIG_KERNEL "Configure Linux kernel (make config/dep/clean)" $CONFIG_KERNEL_def \
  COMP_KERNEL   "Recompile Linux kernel (make zlilo)" "on" \
  COMP_GPIB     "Recompile 'linux-gpib' driver and library" "on" \
  MAKEWHATIS    "Rebuild 'apropos'/'make -k' database" "off" \
  SETUP_X       "Select X Window System server/configuration" $SETUP_X_def \
  BOOTFLOPPIES  "Make additional stand-alone boot floppies" on \
  DISK_SPACE    "Clean up .o files created by COMP_* above" off \
d781 71
a851 1
      CONFIG_GPIB)
d855 1
a855 1
      CONFIG_DIGI)
d859 1
a859 1
      SET_PERMS)
d865 1
a865 1
      CONFIG_KERNEL)
d869 1
a869 1
      COMP_KERNEL)
d873 1
a873 1
      COMP_GPIB)
d877 1
a877 1
      MAKEWHATIS)
d882 1
a882 1
      SETUP_X)
d888 1
a888 2
  XF86_Mach64  "ATI Mach64" \
  XF86_SVGA    "Cirrus Logic chips" \
d895 1
a895 1
      BOOTFLOPPIES)
d898 1
a898 1
      DISK_SPACE)
@


1.4
log
@Bash 1.14.4(1) is still broken for 'f77' use, returns 'Error 4' in make.
@
text
@d2 2
a3 2
# update-sw230-to-fs  -- adapt a Slackware 2.3.0 installation for FS
# $Id: update-sw230-to-fs,v 1.3 1995/06/12 15:13:15 root Exp root $
d7 3
d23 1
a23 1
SRCS=${0%update-sw230-to-fs}
d89 1
a89 1
installation with Linux 1.2.9 to support running FS8.x.\
d110 1
a110 1
  cp -p /vmlinuz ${NEW_ROOT}vmlinuz
d121 6
a126 3
# Test for Linux 1.2.9.
if [ ! -d ${NEW_ROOT}usr/src/linux-1.2.9 ]; then
  linux129_def="on"
d128 1
a128 1
  linux129_def="off"
d202 11
d246 6
d263 2
a264 1
  linux129  "Install Linux kernel 1.2.9 in '/usr/src/linux'" $linux129_def \
d268 1
a268 1
  atgpib    "Install NI ATGPIB driver and library" $atgpib_def \
d277 1
d285 2
d293 5
a297 2
      linux129)
# Install Linux 1.2.9 to be visible at '/usr/src/linux'.
d299 6
a304 5
rm -rf linux
#rm -rf linux-1.*
tar xvzf ${SRCS}linux-1.2.9.tar.gz
mv linux linux-1.2.9
ln -s linux-1.2.9 linux
d319 1
a319 1
  mv ${NEW_ROOT}usr/src/linux/arch/i386/config.in ${NEW_ROOT}usr/src/linux/arch/i386/config.in.replaced
d323 1
a323 1
cp -p ${SRCS}replacement-config-in ${NEW_ROOT}usr/src/linux-1.2.9/arch/i386/config.in
d327 1
a327 1
(cd ${NEW_ROOT}usr/src/linux/drivers/char; tar xvzf ${SRCS}digipcxx-1.3.tgz) 2>> $PATCH_ERRS
d335 1
a335 1
cp -p ${SRCS}replacement-pcxxconfig-h ${NEW_ROOT}usr/src/linux/drivers/char/pcxxconfig.h
d342 5
a346 5
tar xvzf ${SRCS}linux-gpib-1.0.tgz
mv linux-gpib linux-gpib-1.0
ln -s linux-gpib-1.0 linux-gpib
ln -s ../src/linux-gpib/include ${NEW_ROOT}usr/include/gpib
ln -s ../src/linux-gpib/lib/libgpib.a ${NEW_ROOT}usr/lib/libgpib.a
d349 6
a354 1
rm -rf linux-gpib/ibsh
d363 1
a363 1
pkgtool -sets \#m\# -source_mounted -source_dir ${SRCS%/} -target_dir $NEW_ROOT
d366 1
a366 1
pkgtool -sets \#co\# -source_mounted -source_dir ${SRCS%/} -target_dir $NEW_ROOT
d369 1
a369 1
(cd $NEW_ROOT; tar xvzf ${SRCS}kermit-189.tgz)
d373 1
a373 1
(cd $NEW_ROOT; tar xvzf ${SRCS}lds-11c.tgz)
d381 1
a381 1
  mv ${NEW_ROOT}bin/bash ${NEW_ROOT}bin/bash.orig
d383 1
a383 1
cp -p ${SRCS}bash-1.14.2.1 ${NEW_ROOT}bin/bash
d394 5
d410 2
a411 2
rm -f ${NEW_ROOT}etc/rc.d/rc.fs
ln -s /usr2/fs/misc/rc.fs ${NEW_ROOT}etc/rc.d/rc.fs
d419 1
a419 1
  mv ${NEW_ROOT}usr/lib/joe/joerc ${NEW_ROOT}usr/lib/joe/plain-joerc
d421 1
a421 1
cp -p ${NEW_ROOT}usr/lib/joe/jstarrc ${NEW_ROOT}usr/lib/joe/joerc
d496 1
a496 1
    mke2fs $NEW_USR2_DEVICE
d521 2
a522 2
chmod a+x ${NEW_ROOT}sbin/rmt
chmod a+rw ${NEW_ROOT}dev/*st[0-9]
d524 12
a535 1
  ln -s /sbin/rmt ${NEW_ROOT}/etc/rmt
d551 2
a552 3
   on your current root ($CURRENT_ROOT_DEVICE) via '/u1' and symbolic links,\n\
2) copy this setup system to the future '/root/, and\n\
3) use a copy of your current '/etc/passwd'?" \
d563 1
a563 1
  mv ${NEW_ROOT}home ${NEW_ROOT}home.local
d568 1
a568 1
  mv ${NEW_ROOT}var/spool/mail ${NEW_ROOT}var/spool/mail.local
a583 4
# Copy the setup system anew.
rm -rf ${NEW_ROOT}root/update-sw-to-fs
cp -a /root/update-sw-to-fs ${NEW_ROOT}root/update-sw-to-fs

d585 1
a585 1
cp -p /etc/passwd ${NEW_ROOT}etc/passwd
d602 2
a603 1
# xxx: with correct '/etc/lilo.conf' (to safely install recompiled kernel.)
d605 10
d621 2
a622 1
_immediately_ after you have logged in as 'root' the first time\n\
a628 9
  dialog --title "Need to reboot to continue installation" \
    --msgbox \
"\nPlease reboot the machine\n\
with the Slackware "slow" LILO boot floppy\n\
to run with the new root file system on $NEW_ROOT_DEVICE.
\n\
After the reboot, continue the update process\n\
by rerunning this script ($0)." \
    17 74
d642 1
a642 1
by invoking the command 'passwd'."\n\
d650 1
a650 1
    --yesno \
d653 1
a653 1
If this is correct, click 'Yes'.\n\n\
d655 16
a670 4
click 'No' to invoke the 'netconfig' script." \
      17 74
  if [ $? != 0 ]; then
    netconfig
a671 1
  touch /etc/HOSTNAME-assumed-correct
d756 1
d773 1
a773 1
chmod -v a=rw /dev/cua* /dev/tty[dD]* /dev/gpib*
d785 1
a785 1
(cd /usr/src/linux-gpib; make; cp -p driver/gpib0.o /boot)
d795 2
a796 1
  XF86_Mach8   "ATI Mach8 (used in 'TAG/CDP' systems)" \
a799 1
  XF86_S3      "S3-based cards like Diamond Stealth64 and #9" \
d802 2
a803 2
  ln -sf /usr/X11R6/bin/`cat /tmp/reply` /var/X11R6/bin/X
  cp -p ${SRCS}XF86Config.`cat /tmp/reply` /var/X11R6/lib/XF86Config
d808 10
@


1.3
log
@Must delete a directory before copying over with 'cp -a'.
@
text
@d3 1
a3 1
# $Id: update-sw230-to-fs,v 1.2 1995/06/12 15:07:28 root Exp root $
d7 3
d176 7
d250 1
d339 9
@


1.2
log
@Added Linux 1.2.9 support.
@
text
@d3 1
a3 1
# $Id: update-sw230-to-fs,v 1.1 1995/06/12 07:49:58 root Exp root $
d5 1
a5 1
# When        Who  What
d7 3
d514 1
a514 1
#rm -rf ${NEW_ROOT}root/update-sw-to-fs
d523 1
a523 1
fi  # if bigbang
@


1.1
log
@Initial revision
@
text
@d3 1
a3 1
# $Id$
d6 4
a9 1
# $Log$
d58 3
a60 2
# There must be '/usr/src/linux-1.2.8' on the new target root file system.
if [ ! -d ${NEW_ROOT}usr/src/linux-1.2.8 ]; then
d65 1
a65 1
or it doesn't contain Slackware 2.3.0 + Linux 1.2.8 installed on it.\n\
d80 1
a80 1
installation to support running FS8.x.\
d110 8
a117 1
#
d142 5
d227 1
d232 1
d252 10
d278 1
a278 1
cp -p ${SRCS}replacement-config-in ${NEW_ROOT}usr/src/linux-1.2.8/arch/i386/config.in
d295 2
d305 3
d309 1
a309 2
(cd linux; patch <${SRCS}linux-gpib-1.0.patch) 2>> $PATCH_ERRS
popd >/dev/null
@
