summaryrefslogtreecommitdiffstats
path: root/loader/linuxrc.s390
diff options
context:
space:
mode:
authorharald <harald>2001-08-22 10:56:17 +0000
committerharald <harald>2001-08-22 10:56:17 +0000
commit871c68cb05fa93fd55757248b9bff55e8181ace9 (patch)
treea1821e976b56045a48dd51b30ebab239c745cbd6 /loader/linuxrc.s390
parent29a25bf3882596ca917e6d1c0612cd691e659a55 (diff)
downloadanaconda-871c68cb05fa93fd55757248b9bff55e8181ace9.tar.gz
anaconda-871c68cb05fa93fd55757248b9bff55e8181ace9.tar.xz
anaconda-871c68cb05fa93fd55757248b9bff55e8181ace9.zip
rejoined s390 branch
Diffstat (limited to 'loader/linuxrc.s390')
-rwxr-xr-xloader/linuxrc.s390260
1 files changed, 260 insertions, 0 deletions
diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390
new file mode 100755
index 000000000..291249060
--- /dev/null
+++ b/loader/linuxrc.s390
@@ -0,0 +1,260 @@
+#! /bin/sh
+#
+# Copyright (C) 2000,2001 by
+# Bernhard Rosenkraenzer <bero@redhat.com>
+# Oliver Paukstadt <opaukstadt@millenux.com>
+# Karsten Hopp <karsten@redhat.de>
+# Florian La Roche <laroche@redhat.com>
+# Nils Philippsen <nils@redhat.de>
+# Helge Deller <hdeller@redhat.de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+debugshell()
+{
+ echo "You have defined DEBUG, so here is a shell. You can use 'exit'"
+ echo "to go on with the normal installation process."
+ /bin/sh
+}
+
+startinetd()
+{
+ echo
+ echo "Starting telnetd and sshd to allow login over the network."
+ /sbin/inetd
+ echo "Generating ssh keys, This can take a while..."
+ (cd /etc/ssh
+ echo " Generating host_key"
+ ssh-keygen -q -t rsa1 -f ssh_host_key -C '' -N '' >/dev/null 2>&1
+ echo " Generating rsa_key"
+ ssh-keygen -q -t rsa -f ssh_host_rsa_key -C '' -N '' >/dev/null 2>&1
+ echo " Generating dsa_key"
+ ssh-keygen -q -t dsa -f ssh_host_dsa_key -C '' -N '' >/dev/null 2>&1
+ chmod 600 ssh_host_key ssh_host_rsa_key ssh_host_dsa_key
+ chmod 644 *.pub
+ echo "Done"
+ )
+ /sbin/sshd
+ while : ; do
+ echo
+ echo "Please connect now to $IPADDR and start 'rhsetup' or start"
+ echo "'rhsetup nointeractive' from this shell."
+ /bin/sh -l
+ done
+ # /sbin/mingetty console --noclear
+}
+
+
+echo "Starting the S390 initrd to configure networking. Version is 0.24."
+
+PATH="/bin:/sbin:/usr/bin:/usr/sbin"
+export PATH
+
+#mount -n -o remount,rw /
+mount -t proc none /proc
+mount -t devpts none /dev/pts
+
+ifconfig lo 127.0.0.1 netmask 255.0.0.0
+route add -host 127.0.0.1 dev lo
+
+[ -n "$DEBUG" ] && debugshell
+
+# Parse configuration
+if [ -n "$HOST" ]; then
+ set -- `echo $HOST |sed 's/:/ /g'`
+ HNAME=$1
+ DEVICE=$2
+ NETTYPE=`echo $DEVICE |sed -e 's/[0-9].*//'`
+ IPADDR=$3
+ if [ ":$NETTYPE" = ":iucv" ]; then
+ IUCV="iucv=$4"
+ GATEWAY=$5
+ MTU=$6
+ elif [ ":$NETTYPE" = ":ctc" ]; then
+ GATEWAY=$4
+ MTU=$5
+ else
+ MTU=$4
+ fi
+fi
+if [ -n "$MTU" ]; then
+ MMTU="mtu $MTU"
+fi
+if [ -n "$NETWORK" ]; then
+ set -- `echo $NETWORK | sed 's/:/ /g'`
+ NETWORKIP=$1
+ NETMASK=$2
+ BROADCAST=$3
+ if [ ":$NETTYPE" != ":ctc" ] && [ ":$NETTYPE" != ":iucv" ]; then
+ GATEWAY=$4
+ fi
+fi
+
+# Check for missing parameters, prompt for them if necessary
+while [ -z "$HNAME" ]; do
+ echo "Please enter the FQDN of your new virtual machine (e.g. s390.redhat.com):"
+ read HNAME
+done
+while [ -z "$DEVICE" ]; do
+ echo "Please enter the network device you intend to use (e.g. ctc0, iucv0, eth0, tr0):"
+ read DEVICE
+ NETTYPE=`echo $DEVICE |sed -e 's/[0-9].*//'`
+done
+while [ -z "$IPADDR" ]; do
+ echo "Please enter the IP address of your new virtual machine:"
+ read IPADDR
+done
+if [ ":$NETTYPE" = ":eth" ] || [ ":$NETTYPE" = ":tr" ]; then
+ while [ -z "$NETMASK" ]; do
+ echo "Please enter your netmask (e.g. 255.255.255.0):"
+ read NETMASK
+ done
+ while [ -z "$BROADCAST" ]; do
+ echo "Please enter your broadcast address:"
+ read BROADCAST
+ done
+ while [ -z "$NETWORKIP" ]; do
+ echo "Please enter your network address:"
+ read NETWORKIP
+ done
+ while [ -z "$GATEWAY" ]; do
+ echo "Please enter your default gateway:"
+ read GATEWAY
+ done
+ while [ -z "$LCS" ] && [ -z "$QETH" ]; do
+ echo "(1) for OSA-2 with LCS or (2) for OSA-Express with QDIO/QETH"
+ read INF
+ while [ -z "$LCS" ] && [ ":$INF" = ":1" ]; do
+ echo "OSA Device address (e.g. fc20,1 - or \"auto\" (may not work)):"
+ read LCS
+ done
+ while [ -z "$QETH" ] && [ ":$INF" = ":2" ]; do
+ echo "OSA-Express Device address (e.g. 0xf000,0xf001,0xf002 - or \"auto\" (may not work)):"
+ read QETH
+ done
+ done
+else
+ while [ -z "$GATEWAY" ]; do
+ echo "Enter the IP of your ctc/iucv point-to-point partner:"
+ read GATEWAY
+ done
+ if [ ":$NETTYPE" = ":iucv" ]; then
+ while [ -z "$IUCV" ]; do
+ echo "Enter iucv kernel module options (usually iucv=HOST):"
+ read IUCV
+ done
+ fi
+fi
+
+# configure network-interface
+if [ ":$NETTYPE" = ":ctc" ]; then
+ insmod ctc $CTC
+ ifconfig $DEVICE $IPADDR $MMTU pointopoint $GATEWAY
+ route add -host $IPADDR dev $DEVICE
+elif [ ":$NETTYPE" = ":iucv" ]; then
+ insmod netiucv $IUCV
+ ifconfig $DEVICE $IPADDR $MMTU pointopoint $GATEWAY
+ route add -host $IPADDR dev $DEVICE
+else
+ if [ -z "$QETH" ]; then
+ if [ ":$LCS" = ":auto" ]; then
+ LCS=""
+ else
+ LCS=`echo $LCS | sed -e '/^0x\|^0X/ b; s/^/0x/'`
+ LCS="noauto=1 devno_portno_pairs=$LCS"
+ fi
+ insmod -f /lib/lcs.o $LCS
+ else
+ if [ ":$QETH" = ":auto" ]; then
+ QETH="qeth_options="
+ else
+ QETH="qeth_options=noauto,$QETH"
+ fi
+ insmod -f /lib/qdio.o
+ insmod -f /lib/qeth.o $QETH
+ fi
+ ifconfig $DEVICE $IPADDR $MMTU netmask $NETMASK broadcast $BROADCAST
+ route add -net $NETWORKIP netmask $NETMASK dev $DEVICE
+fi
+route add default gw $GATEWAY dev $DEVICE
+
+[ -n "$HNAME" ] && hostname $HNAME
+
+# show interfaces and routing table
+ifconfig -a
+route -n
+
+[ -n "$DEBUG" ] && debugshell
+
+echo "Starting portmap."
+portmap
+
+# convert to space-separated lists
+DNS=`echo $DNS |sed -e 's/:/ /g'`
+SEARCHDNS=`echo $SEARCHDNS |sed -e 's/:/ /g'`
+
+# transfer options into install environment
+cat > /tmp/install.cfg <<EOF
+HNAME="$HNAME"
+DEVICE="$DEVICE"
+NETTYPE="$NETTYPE"
+IPADDR="$IPADDR"
+GATEWAY="$GATEWAY"
+MTU="$MTU"
+NETWORKIP="$NETWORKIP"
+NETMASK="$NETMASK"
+BROADCAST="$BROADCAST"
+INSTALL="$INSTALL"
+INTERACTIVE="$INTERACTIVE"
+DNS="$DNS"
+SEARCHDNS="$SEARCHDNS"
+RPMSERVER="$RPMSERVER"
+MOUNTS="$MOUNTS"
+FORCEDASDFORMAT="$FORCEDASDFORMAT"
+SWAP="$SWAP"
+DASD="$DASD"
+LCS="$LCS"
+QETH="$QETH"
+IUCV="$IUCV"
+CTC="$CTC"
+DTZ="$DTZ"
+ROOTPW="$ROOTPW"
+CROOTPW="$CROOTPW"
+export HNAME DEVICE NETTYPE IPADDR GATEWAY MTU INTERACTIVE
+export NETWORKIP NETMASK BROADCAST INSTALL DNS SEARCHDNS FORCEDASDFORMAT
+export RPMSERVER MOUNTS SWAP DASD LCS QETH IUCV DTZ ROOTPW CROOTPW
+EOF
+# immediately read it in again to export these into the shell below
+. /tmp/install.cfg
+
+[ -n "$DEBUG" ] && debugshell
+
+if [ ":$INTERACTIVE" = ":0" ]; then
+ rhsetup nointeractive || startinetd
+else
+ startinetd
+fi
+
+umount -a
+umount /proc
+#umount /
+
+exit 0
+# vim:ts=3:sw=3
+# ;;; Local Variables: ***
+# ;;; mode: sh ***
+# ;;; tab-width:3 ***
+# ;;; end: ***