📄 linuxrc.s390
字号:
if [ $ret -eq 1 ]; then echo -n "Invalid network address format. " unset NETWORK fidoneif [ "$NETTYPE" = "qeth" ] || [ "$NETTYPE" = "lcs" ]; then while [ -z "$NETMASK" ]; do echo $"Enter the netmask for the new Linux guest (e.g. 255.255.255.0):" read NETMASK checkip $NETMASK ret=$? if [ $ret -eq 1 ]; then echo -n "Invalid netmask format. " unset NETMASK fi done while [ -z "$BROADCAST" ]; do echo $"Enter the broadcast address for the new Linux guest:" read BROADCAST checkip $BROADCAST ret=$? if [ $ret -eq 1 ]; then echo -n "Invalid broadcast address format. " unset BROADCAST fi done while [ -z "$GATEWAY" ]; do echo $"Enter your default gateway:" read GATEWAY checkip $GATEWAY ret=$? if [ $ret -eq 1 ]; then echo -n "Invalid gateway address format. " unset GATEWAY fi done if [ ":$NETTYPE" = ":lcs" ]; then if [ -n "$RUNKS" -a -z "$PORTNAME" ]; then PORTNAME=0 fi while [ -z "$PORTNAME" ]; do echo $"Enter the relative port number of your LCS device" echo $"(required for OSA-Express ATM cards only):" read PORTNAME done fielse # ctc0, iucv0 if [ -z "$NETMASK" ]; then # If the user did not supply netmask, we add the right one. # Netmask MUST be present, or pumpSetupInterface() blows routes. NETMASK="255.255.255.255" fi while [ -z "$GATEWAY" ]; do echo $"Enter the IP of your CTC / ESCON / IUCV point-to-point partner:" read GATEWAY done if [ "$NETTYPE" = "ctc" ]; then if [ -z "$MTU" ]; then MTU="1500" fi if [ -z "$RUNKS" ]; then if [ -n "$CTCPROT" ]; then validprot=1 else validprot=0 fi while [ "$validprot" = "0" ]; do echo $"Select which protocol should be used for the CTC interface" echo $"0 for compatibility with p.e. VM TCP service machine (default)" echo $"1 for enhanced package checking for Linux peers" echo $"3 for compatibility with OS/390 or z/OS peers" read CTCPROT case "x$CTCPROT" in x|x0) validprot=1 unset CTCPROT ;; x1|x3) validprot=1 ;; x2) echo $"CTC tty's are not usable for this installation" ;; *) echo $"Invalid selection" ;; esac done fi fi if [ ":$NETTYPE" = ":iucv" ]; then while [ -z "$PEERID" ]; do echo $"Enter the peer id of the VM guest you want to" echo $"connect to (in capital letters)." read PEERID done fifi# don't ask for MTU, but use it if it has been set in the .parm file# don't overwrite MMTU if it has been set for CTCif [ -n "$MTU" -a -z "$MMTU" ]; then MMTU="mtu $MTU"fi# configure network-interfaceif [ ":$NETTYPE" = ":ctc" ]; then insmod ccwgroup$LO insmod cu3088$LO insmod fsm$LO insmod ctc$LO setupdevice DEVICE=${NETTYPE}0 ifconfig $DEVICE $IPADDR $MMTU pointopoint $GATEWAY echo "alias $DEVICE ctc" >> /tmp/modprobe.confelif [ ":$NETTYPE" = ":iucv" ]; then insmod fsm$LO insmod iucv$LO insmod netiucv$LO sysecho /sys/bus/iucv/drivers/netiucv/connection $PEERID DEVICE=${NETTYPE}0 ifconfig $DEVICE $IPADDR $MMTU pointopoint $GATEWAY echo "alias $DEVICE netiucv" >> /tmp/modprobe.confelif [ "$NETTYPE" = "lcs" ]; then insmod ccwgroup$LO insmod cu3088$LO insmod lcs$LO setupdevice# KH FIXME: Workaround for missing sysfs interface# DEVICE=`cat /sys/devices/lcs/${SUBCHANNELS//,*/}/if_name` getlcsifname ${SUBCHANNELS//,*/} ifconfig $DEVICE $IPADDR $MMTU netmask $NETMASK broadcast $BROADCAST route add -net $NETWORK netmask $NETMASK dev $DEVICE 2>/dev/null echo "alias $DEVICE lcs" >> /tmp/modprobe.confelif [ "$NETTYPE" = "qeth" ]; then insmod ccwgroup$LO insmod qdio$LO insmod ipv6$LO insmod qeth$LO setupdevice DEVICE=`cat /sys/devices/qeth/${SUBCHANNELS//,*/}/if_name` ifconfig $DEVICE $IPADDR $MMTU netmask $NETMASK broadcast $BROADCAST route add -net $NETWORK netmask $NETMASK dev $DEVICE 2>/dev/null echo "alias $DEVICE qeth" >> /tmp/modprobe.confelse echo $"Unknown network device, aborting installation" exit 1firoute add default gw $GATEWAY dev $DEVICE 2>/dev/nullif [ -z "$DNS" ]; then echo $"Enter your DNS server(s), separated by colons (:):" read DNSfiif [ -z "$DNS" ]; then echo $"You might encounter problems without a nameserver, especially" echo $"with FTP installs"fiif [ -n "$DNS" -a -z "$SEARCHDNS" ]; then echo $"Enter your DNS search domain(s) (if any), separated by colons (:):" read SEARCHDNSfi[ -n "$HOSTNAME" ] && hostname $HOSTNAME# show interfaces and routing tableifconfig -aroute -n#echo $"Starting portmap."#portmap# convert to space-separated listsif [ -n "$SEARCHDNS" ]; then SEARCHDNS=`echo $SEARCHDNS |sed -e 's/:/ /g'` for i in "$SEARCHDNS"; do echo "search $i"; done >> /etc/resolv.conffiif [ -n "$DNS" ]; then DNS=`echo $DNS |sed -e 's/:/ /g'` for i in "$DNS"; do echo "nameserver $i"; done >> /etc/resolv.conffiif [ -z "$DASD" ]; then echo echo $"Enter DASD range (e.g. 200-203 or 200,201,202,203)" echo $"Press <Enter> for autoprobing (not recommended):" echo read DASDfiif [ -n "$DASD" ]; then echo "DASD=$DASD" > /tmp/dasd_portsfifor i in ${!FCP_*}; do echo "${!i}" >> /tmp/fcpconfigdonegrep -q ext3 /proc/filesystemsif [ "$?" != "0" ]; then insmod jbd$LO insmod ext3$LOfi# transfer options into install environmentcat > /tmp/install.cfg << EOFLANG="$LANG"S390ARCH="$S390ARCH"TEXTDOMAIN="$TEXTDOMAIN"TEXTDOMAINDIR="$TEXTDOMAINDIR"PORTNAME="$PORTNAME"HOSTNAME="$HOSTNAME"DEVICE="$DEVICE"NETTYPE="$NETTYPE"IPADDR="$IPADDR"GATEWAY="$GATEWAY"MTU="$MTU"NETWORK="$NETWORK"NETMASK="$NETMASK"BROADCAST="$BROADCAST"DNS="$DNS"SEARCHDNS="$SEARCHDNS"PEERID="$PEERID"SUBCHANNELS="$SUBCHANNELS"ONBOOT="yes"CTCPROT="$CTCPROT"export LANG PORTNAME S390ARCH TEXTDOMAIN TEXTDOMAINDIRexport HOSTNAME DEVICE NETTYPE IPADDR GATEWAY MTUexport NETWORK NETMASK BROADCAST DNS SEARCHDNSexport PEERID ONBOOT SUBCHANNELS CTCPROTEOF# immediately read it in again to export these into the shell below. /tmp/install.cfgcat /tmp/install.cfg >> /etc/profilecat > /tmp/netinfo << EOFDEVICE=$DEVICEONBOOT=yesBOOTPROTO=staticIPADDR=$IPADDRNETMASK=$NETMASKGATEWAY=$GATEWAYBROADCAST=$BROADCASTHOSTNAME=$HOSTNAMEMTU=$MTUSUBCHANNELS=$SUBCHANNELSEOF[ "$NETTYPE" != "" ] && echo "NETTYPE=$NETTYPE" >> /tmp/netinfo[ "$PEERID" != "" ] && echo "PEERID=$PEERID" >> /tmp/netinfo[ "$PORTNAME" != "" ] && echo "PORTNAME=$PORTNAME" >> /tmp/netinfo[ "$CTCPROT" != "" ] && echo "CTCPROT=$CTCPROT" >> /tmp/netinfo# so that the vars get propagated into the sshd shellsmkdir /.sshcat >> /.ssh/environment <<EOFLD_LIBRARY_PATH=$LD_LIBRARY_PATHPATH=$PATHHOME=$HOMEPYTHONPATH=$PYTHONPATHEOFcat >> /etc/profile <<EOFLD_LIBRARY_PATH=$LD_LIBRARY_PATHPATH=$PATHHOME=$HOMEPYTHONPATH=$PYTHONPATHexport LD_LIBRARY_PATH PATH HOME PYTHONPATHEOFif [ -n "$DISPLAY" ]; then echo "export DISPLAY=$DISPLAY" >> /etc/profilefi# I'm tired of typing this out...echo "loader" >> /.bash_historyecho -n $$ > /var/run/init.pid# shutdown (halt) on SIGUSR1trap doshutdown SIGUSR1# reboot on SIGUSR2trap doreboot SIGUSR2startinetdif [ -n "$RUNKS" ]; then /sbin/loaderfidoshutdown# ;;; Local Variables: ***# ;;; mode: sh ***# ;;; tab-width:3 ***# ;;; end: ***# vim:ts=3:sw=3
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -