summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2008-07-17 14:33:17 -1000
committerDavid Cantrell <dcantrell@redhat.com>2008-07-17 14:33:17 -1000
commitcaff274991609b4e64ed2f0def6cdf5e2ff57aac (patch)
tree30dfd850c92cafff3d74740fd4dd8e4a9625d309
parent4aa9ca1c35b867fa5a4d94c41591700ca7ab5edb (diff)
downloadanaconda-caff274991609b4e64ed2f0def6cdf5e2ff57aac.tar.gz
anaconda-caff274991609b4e64ed2f0def6cdf5e2ff57aac.tar.xz
anaconda-caff274991609b4e64ed2f0def6cdf5e2ff57aac.zip
Support booting from FCP-attached CD/DVD drive on s390 (#184648)
The s390 can boot El Torito CD or DVD images iff they are attached by zFCP, used as the IPL device, and contain a specially formatted boot image on the disc. IBM provided the tool to combobulate the boot image together and a description of the desired execution path. When you boot on s390, the linuxrc.s390 will look to see if you IPL'ed from a CD or DVD. If you did, it will ask if you also want to install from that device. If you answer yes (y, Y, or any case spelling of 'yes'), the script will bring the IPL device online so the kernel assigns it a device name. Then it skips over the network configuration and starts you in to loader. If you tell it no or did not IPL from a CD or DVD, it'll launch the missiles--wait, no, I mean you get the normal network installation questions before loader starts. I have no way to test this as it requires the following changes: (1) Rel-eng needs to build s390x media with -no-emul-boot and specify the new cdboot.img file on that platform. I have already contacted rel-eng about making this change. (2) I don't have a CD-ROM drive in my mainframe. IBM does and testing is all falling on them. IBM knows this...maybe. I explain all of this like anyone else on the team will ever get a chance to experience it. So there you have it. A letter opener.
-rw-r--r--loader2/cdinstall.c2
-rw-r--r--loader2/linuxrc.s390572
-rw-r--r--loader2/loader.c2
-rw-r--r--loader2/method.c2
-rwxr-xr-xscripts/mk-images1
-rw-r--r--scripts/mk-images.s3908
-rw-r--r--utils/Makefile10
-rw-r--r--utils/mk-s390-cdboot.c156
8 files changed, 477 insertions, 276 deletions
diff --git a/loader2/cdinstall.c b/loader2/cdinstall.c
index fe5a42116..90afdfb43 100644
--- a/loader2/cdinstall.c
+++ b/loader2/cdinstall.c
@@ -423,9 +423,7 @@ char * mountCdromImage(struct installMethod * method,
void setKickstartCD(struct loaderData_s * loaderData, int argc, char ** argv) {
logMessage(INFO, "kickstartFromCD");
-#if !defined(__s390__) && !defined(__s390x__)
loaderData->method = METHOD_CDROM;
-#endif
}
int kickstartFromCD(char *kssrc) {
diff --git a/loader2/linuxrc.s390 b/loader2/linuxrc.s390
index 95f0d0228..8e7d6ae7e 100644
--- a/loader2/linuxrc.s390
+++ b/loader2/linuxrc.s390
@@ -241,286 +241,322 @@ mount -t ramfs none /tmp
ifconfig lo 127.0.0.1 netmask 255.0.0.0
route add -host 127.0.0.1 dev lo 2>/dev/null
+echo -e "127.0.0.1\tlocalhost.localdomain localhost" > /etc/hosts
+echo -e "::1\t\tlocalhost6.localdomain6 localhost6" >> /etc/hosts
+
LO=""
[ -L /sbin/insmod ] && LO=".ko"
+# Parse configuration
if [ -n "$CMSDASD" -a -n "$CMSCONFFILE" ]; then
readcmsfile $CMSDASD $CMSCONFFILE
source /tmp/$CMSCONFFILE #2>/dev/null
fi
-# Parse configuration
-# Check for missing parameters, prompt for them if necessary
-while [ -z "$NETTYPE" ]; do
- echo $"Which kind of network device do you intend to use"
- echo $" (e.g. ctc, iucv, qeth, lcs)."
- echo $"Enter 'qeth' for OSA-Express Fast Ethernet, Gigabit Ethernet"
- echo $" (including 1000Base-T), High Speed Token Ring, and ATM "
- echo $" (running Ethernet LAN emulation) features in QDIO mode."
- echo $"Enter 'lcs' for OSA­2 Ethernet/Token Ring, OSA-Express Fast Ethernet in"
- echo $" non-QDIO mode, OSA-Express High Speed Token Ring in non-QDIO mode and"
- echo $" Gigabit Ethernet in non-QDIO mode."
- read NETTYPE
-done
-if [ "$NETTYPE" != "iucv" ]; then # iucv is the only interface without ccw config
- if [ -n "$CHANDEV" ]; then
- echo
- echo $"The CHANDEV variable isn't used anymore, please update your "
- echo $".parm or the .conf file"
- echo
+do_net_install="yes"
+
+if [ -r /sys/firmware/ipl/ipl_type ]; then
+ if [ "`cat /sys/firmware/ipl/ipl_type`" = "fcp" ]; then
+ while [ 1 ]; do
+ echo $"Your IPL device is set to FCP."
+ echo $"Would you like to perform a CD-ROM/DVD-ROM installation? (y/n)"
+ read do_cd_install
+ case $do_cd_install in
+ y|Y|[Yy][Ee][Ss])
+ # set up FCP cdrom here
+ CD_DEVICE="`cat /sys/firmware/ipl/device`"
+ WWPN="`cat /sys/firmware/ipl/wwpn`"
+ LUN="`cat /sys/firmware/ipl/lun`"
+ echo 1 > /sys/bus/ccw/drivers/zfcp/$CD_DEVICE/online
+ echo $WWPN > /sys/bus/ccw/drivers/zfcp/$CD_DEVICE/port_add
+ echo $LUN > /sys/bus/ccw/drivers/zfcp/$CD_DEVICE/$WWPN/unit_add
+ do_net_install="no"
+ break
+ ;;
+ n|N|[Nn][Oo])
+ do_net_install="yes"
+ break
+ ;;
+ *)
+ echo
+ echo $"*** INVALID ANSWER: $do_cd_install"
+ echo
+ unset do_cd_install
+ ;;
+ esac
+ done
fi
- while [ -z "$SUBCHANNELS" ]; do
- echo $"Enter the bus ID and the device number of your CCW devices."
- echo $"CTC/ESCON and LCS need two subchannels:"
- echo $"(e.g. \"0.0.0600,0.0.0601\" will configure the CTC or ESCON interface"
- echo $"with the subchannels 0x600 and 0x601)"
- echo $"QETH needs three subchannels p.e. 0.0.0300,0.0.0301,0.0.0302"
- read SUBCHANNELS
- done
- SUBCHANNELS=`echo $SUBCHANNELS | /sbin/busybox tr ABCDEF abcdef`
- if [ "$NETTYPE" = "qeth" ]; then
- if [ -z "$PORTNAME" ]; then
- echo $"Portname of the OSA-Express feature in QDIO mode and z/VM Guest LAN"
- echo $"This parameter is optional with z/VM 4.4.0 or z/VM 4.3.0 with"
- echo $"APARs VM63308 and PQ73878"
- echo $"Press enter if you don't want to enter a portname"
- read PORTNAME
- fi
- if [ -z "$LAYER2" ]; then
- echo $"Enter the mode of operation for the OSA device"
- echo $"0 for layer 3 mode (default)"
- echo $"1 for layer 2 mode"
- read LAYER2
- fi
- if [ "$LAYER2" == 1 ]; then
- if [ -z "$VSWITCH" -o "$VSWITCH" == 0 ]; then
- if [ -z "$MACADDR" ]; then
- echo $"Enter a unique MAC address (eg. 02:00:00:00:00:00)."
- echo $"Leave this blank and press enter if connecting to a"
- echo $"Layer 2 VSWITCH, as this is automatically assigned"
- read MACADDR
- fi
- fi
- fi
- fi
-fi
-
-while [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" ]; do
- echo $"Enter the FQDN of your new Linux guest (e.g. s390.redhat.com):"
- read HOSTNAME
-done
-while [ -z "$IPADDR" ]; do
- echo $"Enter a valid IP address of your new Linux guest:"
- read IPADDR
- checkip $IPADDR
- ret=$?
- if [ $ret -eq 1 ]; then
- echo -n "Invalid IP address format. "
- unset IPADDR
- fi
-done
-while [ -z "$NETWORK" ]; do
- echo $"Enter a valid network address of the new Linux guest:"
- read NETWORK
- checkip $NETWORK
- ret=$?
- if [ $ret -eq 1 ]; then
- echo -n "Invalid network address format. "
- unset NETWORK
- fi
-done
-if [ "$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
- fi
-else # 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
- fi
-fi
-# 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 CTC
-if [ -n "$MTU" -a -z "$MMTU" ]; then
- MMTU="mtu $MTU"
fi
-# configure network-interface
-if [ ":$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.conf
-elif [ ":$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.conf
-elif [ "$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`
- DEVICE=eth0
- 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.conf
-elif [ "$NETTYPE" = "qeth" ]; then
- insmod ccwgroup$LO
- insmod crypto_api$LO
- insmod xfrm_nalgo$LO
- insmod qdio$LO
- insmod ipv6$LO
- insmod qeth$LO
- setupdevice
- DEVICE=`cat /sys/devices/qeth/${SUBCHANNELS//,*/}/if_name`
- if [ -n "$LAYER2" -a -n "$MACADDR" ]; then
- ifconfig $DEVICE hw ether $MACADDR
- fi
- 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.conf
-else
- echo $"Unknown network device, aborting installation"
- exit 1
-fi
-
-route add default gw $GATEWAY dev $DEVICE 2>/dev/null
-# BH FIXME: Workaround for manual MACADDR, need ping to update arp table
-ping -c 1 $GATEWAY > /dev/null
-
-if [ -z "$DNS" ]; then
- echo $"Enter your DNS server(s), separated by colons (:):"
- read DNS
-fi
-if [ -z "$DNS" ]; then
- echo $"You might encounter problems without a nameserver, especially"
- echo $"with FTP installs"
-fi
-
-if [ -n "$DNS" -a -z "$SEARCHDNS" ]; then
- echo $"Enter your DNS search domain(s) (if any), separated by colons (:):"
- read SEARCHDNS
-fi
-
-[ -n "$HOSTNAME" ] && hostname $HOSTNAME
-
-# show interfaces and routing table
-ifconfig -a
-route -n
-
-#echo $"Starting portmap."
-#portmap
-
-# convert to space-separated lists
-if [ -n "$SEARCHDNS" ]; then
- SEARCHDNS=`echo $SEARCHDNS |sed -e 's/:/ /g'`
- for i in "$SEARCHDNS"; do echo "search $i"; done >> /etc/resolv.conf
-fi
-if [ -n "$DNS" ]; then
- RESOLVDNS=`echo $DNS |sed -e 's/:/ /g'`
- for i in $RESOLVDNS; do echo "nameserver $i"; done >> /etc/resolv.conf
-fi
-
-# make sure we have an /etc/hosts file (required for telnetd)
-echo -e "127.0.0.1\tlocalhost.localdomain localhost" > /etc/hosts
-echo -e "::1\t\tlocalhost6.localdomain6 localhost6" >> /etc/hosts
-if [ ! -z "$HOSTNAME" -a ! -z "$IPADDR" ]; then
- echo -e "$IPADDR\t$HOSTNAME `echo $HOSTNAME | cut -d '.' -f 1`" >> /etc/hosts
+if [ "$do_net_install" = "yes" ]; then
+ # Perform a network installation
+ # Check for missing parameters, prompt for them if necessary
+ while [ -z "$NETTYPE" ]; do
+ echo $"Which kind of network device do you intend to use"
+ echo $" (e.g. ctc, iucv, qeth, lcs)."
+ echo $"Enter 'qeth' for OSA-Express Fast Ethernet, Gigabit Ethernet"
+ echo $" (including 1000Base-T), High Speed Token Ring, and ATM "
+ echo $" (running Ethernet LAN emulation) features in QDIO mode."
+ echo $"Enter 'lcs' for OSA­2 Ethernet/Token Ring, OSA-Express Fast Ethernet in"
+ echo $" non-QDIO mode, OSA-Express High Speed Token Ring in non-QDIO mode and"
+ echo $" Gigabit Ethernet in non-QDIO mode."
+ read NETTYPE
+ done
+ if [ "$NETTYPE" != "iucv" ]; then # iucv is the only interface without ccw config
+ if [ -n "$CHANDEV" ]; then
+ echo
+ echo $"The CHANDEV variable isn't used anymore, please update your "
+ echo $".parm or the .conf file"
+ echo
+ fi
+ while [ -z "$SUBCHANNELS" ]; do
+ echo $"Enter the bus ID and the device number of your CCW devices."
+ echo $"CTC/ESCON and LCS need two subchannels:"
+ echo $"(e.g. \"0.0.0600,0.0.0601\" will configure the CTC or ESCON interface"
+ echo $"with the subchannels 0x600 and 0x601)"
+ echo $"QETH needs three subchannels p.e. 0.0.0300,0.0.0301,0.0.0302"
+ read SUBCHANNELS
+ done
+ SUBCHANNELS=`echo $SUBCHANNELS | /sbin/busybox tr ABCDEF abcdef`
+ if [ "$NETTYPE" = "qeth" ]; then
+ if [ -z "$PORTNAME" ]; then
+ echo $"Portname of the OSA-Express feature in QDIO mode and z/VM Guest LAN"
+ echo $"This parameter is optional with z/VM 4.4.0 or z/VM 4.3.0 with"
+ echo $"APARs VM63308 and PQ73878"
+ echo $"Press enter if you don't want to enter a portname"
+ read PORTNAME
+ fi
+ if [ -z "$LAYER2" ]; then
+ echo $"Enter the mode of operation for the OSA device"
+ echo $"0 for layer 3 mode (default)"
+ echo $"1 for layer 2 mode"
+ read LAYER2
+ fi
+ if [ "$LAYER2" == 1 ]; then
+ if [ -z "$VSWITCH" -o "$VSWITCH" == 0 ]; then
+ if [ -z "$MACADDR" ]; then
+ echo $"Enter a unique MAC address (eg. 02:00:00:00:00:00)."
+ echo $"Leave this blank and press enter if connecting to a"
+ echo $"Layer 2 VSWITCH, as this is automatically assigned"
+ read MACADDR
+ fi
+ fi
+ fi
+ fi
+ fi
+
+ while [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" ]; do
+ echo $"Enter the FQDN of your new Linux guest (e.g. s390.redhat.com):"
+ read HOSTNAME
+ done
+ while [ -z "$IPADDR" ]; do
+ echo $"Enter a valid IP address of your new Linux guest:"
+ read IPADDR
+ checkip $IPADDR
+ ret=$?
+ if [ $ret -eq 1 ]; then
+ echo -n "Invalid IP address format. "
+ unset IPADDR
+ fi
+ done
+ while [ -z "$NETWORK" ]; do
+ echo $"Enter a valid network address of the new Linux guest:"
+ read NETWORK
+ checkip $NETWORK
+ ret=$?
+ if [ $ret -eq 1 ]; then
+ echo -n "Invalid network address format. "
+ unset NETWORK
+ fi
+ done
+ if [ "$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
+ fi
+ else # 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
+ fi
+ fi
+ # 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 CTC
+ if [ -n "$MTU" -a -z "$MMTU" ]; then
+ MMTU="mtu $MTU"
+ fi
+
+ # configure network-interface
+ if [ ":$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.conf
+ elif [ ":$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.conf
+ elif [ "$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`
+ DEVICE=eth0
+ 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.conf
+ elif [ "$NETTYPE" = "qeth" ]; then
+ insmod ccwgroup$LO
+ insmod crypto_api$LO
+ insmod xfrm_nalgo$LO
+ insmod qdio$LO
+ insmod ipv6$LO
+ insmod qeth$LO
+ setupdevice
+ DEVICE=`cat /sys/devices/qeth/${SUBCHANNELS//,*/}/if_name`
+ if [ -n "$LAYER2" -a -n "$MACADDR" ]; then
+ ifconfig $DEVICE hw ether $MACADDR
+ fi
+ 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.conf
+ else
+ echo $"Unknown network device, aborting installation"
+ exit 1
+ fi
+
+ route add default gw $GATEWAY dev $DEVICE 2>/dev/null
+ # BH FIXME: Workaround for manual MACADDR, need ping to update arp table
+ ping -c 1 $GATEWAY > /dev/null
+
+ if [ -z "$DNS" ]; then
+ echo $"Enter your DNS server(s), separated by colons (:):"
+ read DNS
+ fi
+ if [ -z "$DNS" ]; then
+ echo $"You might encounter problems without a nameserver, especially"
+ echo $"with FTP installs"
+ fi
+
+ if [ -n "$DNS" -a -z "$SEARCHDNS" ]; then
+ echo $"Enter your DNS search domain(s) (if any), separated by colons (:):"
+ read SEARCHDNS
+ fi
+
+ [ -n "$HOSTNAME" ] && hostname $HOSTNAME
+
+ # show interfaces and routing table
+ ifconfig -a
+ route -n
+
+ # convert to space-separated lists
+ if [ -n "$SEARCHDNS" ]; then
+ SEARCHDNS=`echo $SEARCHDNS |sed -e 's/:/ /g'`
+ for i in "$SEARCHDNS"; do echo "search $i"; done >> /etc/resolv.conf
+ fi
+ if [ -n "$DNS" ]; then
+ RESOLVDNS=`echo $DNS |sed -e 's/:/ /g'`
+ for i in $RESOLVDNS; do echo "nameserver $i"; done >> /etc/resolv.conf
+ fi
+
+ # make sure we have an /etc/hosts file (required for telnetd)
+ if [ ! -z "$HOSTNAME" -a ! -z "$IPADDR" ]; then
+ echo -e "$IPADDR\t$HOSTNAME `echo $HOSTNAME | cut -d '.' -f 1`" >> /etc/hosts
+ fi
fi
if [ -z "$DASD" ]; then
diff --git a/loader2/loader.c b/loader2/loader.c
index 3fc21527e..dd58e8143 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -115,9 +115,7 @@ int num_link_checks = 5;
int post_link_sleep = 0;
static struct installMethod installMethods[] = {
-#if !defined(__s390__) && !defined(__s390x__)
{ N_("Local CDROM"), "cdrom", 0, CLASS_CDROM, mountCdromImage },
-#endif
{ N_("Hard drive"), "hd", 0, CLASS_HD, mountHardDrive },
{ N_("NFS image"), "nfs", 1, CLASS_NETWORK, mountNfsImage },
{ "FTP", "ftp", 1, CLASS_NETWORK, mountUrlImage },
diff --git a/loader2/method.c b/loader2/method.c
index 2a0569b77..1905f9fc6 100644
--- a/loader2/method.c
+++ b/loader2/method.c
@@ -716,10 +716,8 @@ void setMethodFromCmdline(char * arg, struct loaderData_s * ld) {
ld->method = strncmp(arg, "ftp", 3) ? METHOD_HTTP : METHOD_FTP;
ld->methodData = calloc(sizeof(struct urlInstallData *), 1);
((struct urlInstallData *)ld->methodData)->url = strdup(arg);
-#if !defined(__s390__) && !defined(__s390x__)
} else if (!strncmp(arg, "cdrom:", 6)) {
ld->method = METHOD_CDROM;
-#endif
} else if (!strncmp(arg, "harddrive:", 10) ||
!strncmp(arg, "hd:", 3)) {
ld->method = METHOD_HD;
diff --git a/scripts/mk-images b/scripts/mk-images
index 2d60a1454..2ac15ae4d 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -110,6 +110,7 @@ INITRDMODS="$USBMODS $FIREWIREMODS $IDEMODS $SCSIMODS $FSMODS $LVMMODS $RAIDMODS
TRIMPCIIDS=$IMGPATH/usr/lib/anaconda-runtime/trimpciids
GETKEYMAPS=$IMGPATH/usr/lib/anaconda-runtime/getkeymaps
GENINITRDSZ=$IMGPATH/usr/lib/anaconda-runtime/geninitrdsz
+ MKS390CDBOOT=$IMGPATH/usr/lib/anaconda-runtime/mk-s390-cdboot
KEYMAPS=/tmp/keymaps-$BUILDARCH.$$
SCREENFONT=$IMGPATH/usr/lib/anaconda-runtime/screenfont-${BASEARCH}.gz
GETMODDEPS=$IMGPATH/usr/lib/anaconda-runtime/moddeps
diff --git a/scripts/mk-images.s390 b/scripts/mk-images.s390
index a7b3440e6..9a8886416 100644
--- a/scripts/mk-images.s390
+++ b/scripts/mk-images.s390
@@ -14,6 +14,13 @@ makeBootImages() {
cp -v $BOOTDISKDIR/generic.prm $TOPDESTPATH/images/generic.prm
cp -v $BOOTDISKDIR/generic.ins $TOPDESTPATH/generic.ins
+
+ $MKS390CDBOOT \
+ -i $TOPDESTPATH/images/kernel.img \
+ -r $TOPDESTPATH/images/initrd.img \
+ -p $TOPDESTPATH/images/generic.prm \
+ -o $TOPDESTPATH/images/cdboot.img
+
cat << __EOT__ >> $TOPDESTPATH/.treeinfo
[images-$KERNELARCH]
kernel = images/kernel.img
@@ -21,6 +28,7 @@ initrd = images/initrd.img
initrd.size = images/initrd.size
generic.prm = images/generic.prm
generic.ins = generic.ins
+cdboot.img = images/cdboot.img
__EOT__
}
diff --git a/utils/Makefile b/utils/Makefile
index d459947a3..8089219c8 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -13,10 +13,10 @@ LDFLAGS = -g
UTILS = modlist moddeps snarffont mapshdr readmap
ifeq (s390, $(ARCH))
-UTILS += geninitrdsz
+UTILS += geninitrdsz mk-s390-cdboot
endif
ifeq (s390x, $(ARCH))
-UTILS += geninitrdsz
+UTILS += geninitrdsz mk-s390-cdboot
endif
ifeq (.depend,$(wildcard .depend))
@@ -53,6 +53,9 @@ hash.o : hash.c
geninitrdsz: geninitrdsz.c
$(CC) $(CFLAGS) -o $@ $<
+mk-s390-cdboot: mk-s390-cdboot.c
+ $(CC) $(CFLAGS) -o $@ $<
+
depends:
install: all
@@ -68,6 +71,9 @@ install: all
if [ -x geninitrdsz ]; then \
install -m755 geninitrdsz $(DESTDIR)/$(RUNTIMEDIR) ; \
fi
+ if [ -x mk-s390-cdboot ]; then \
+ install -m755 mk-s390-cdboot $(DESTDIR)/$(RUNTIMEDIR) ; \
+ fi
clean:
rm -f modlist moddeps snarffont mapshdr readmap geninitrdsz \
diff --git a/utils/mk-s390-cdboot.c b/utils/mk-s390-cdboot.c
new file mode 100644
index 000000000..67340d15f
--- /dev/null
+++ b/utils/mk-s390-cdboot.c
@@ -0,0 +1,156 @@
+/*
+ * mk-s390-cdboot -- creates one big image using a kernel, a ramdisk and
+ * a parmfile
+ *
+ *
+ * 2003-07-24 Volker Sameske <sameske@de.ibm.com>
+ *
+ * compile with:
+ * gcc -Wall -o mk-s390-cdboot mk-s390-cdboot.c
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <getopt.h>
+#include <string.h>
+#include <stdarg.h>
+
+#define BUFFER_LEN 1024
+#define INITRD_START 0x0000000000800000LL
+#define START_PSW_ADDRESS 0x80010000
+#define PARAMETER_BUFFER_LEN 80
+
+static struct option getopt_long_options[]=
+{
+ { "image", 1, 0, 'i'},
+ { "ramdisk", 1, 0, 'r'},
+ { "parmfile", 1, 0, 'p'},
+ { "outfile", 1, 0, 'o'},
+ { "help", 0, 0, 'h'},
+ {0, 0, 0, 0}
+};
+
+
+static void usage(char *cmd)
+{
+ printf("%s [-h] [-v] -i <kernel> -r <ramdisk> -p <parmfile> -o <outfile>\n", cmd);
+}
+
+
+int main (int argc, char **argv)
+{
+ char *cmd = basename(argv[0]);
+ FILE *fd1;
+ FILE *fd2;
+ FILE *fd3;
+ FILE *fd4;
+ char buffer[BUFFER_LEN];
+ int rc, oc, index;
+ unsigned long long initrd_start = INITRD_START;
+ unsigned long long initrd_size;
+ char image[PARAMETER_BUFFER_LEN];
+ char ramdisk[PARAMETER_BUFFER_LEN];
+ char parmfile[PARAMETER_BUFFER_LEN];
+ char outfile[PARAMETER_BUFFER_LEN];
+ int image_specified = 0;
+ int ramdisk_specified = 0;
+ int parmfile_specified = 0;
+ int outfile_specified = 0;
+ int start_psw_address = START_PSW_ADDRESS;
+
+ opterr=0;
+ while (1)
+ {
+ oc = getopt_long(argc, argv, "i:r:p:o:h?", getopt_long_options, &index);
+ if (oc==-1) break;
+
+ switch (oc)
+ {
+ case '?':
+ case 'h':
+ usage(cmd);
+ exit(0);
+ case 'i':
+ strcpy(image, optarg);
+ image_specified = 1;
+ break;
+ case 'r':
+ strcpy(ramdisk, optarg);
+ ramdisk_specified = 1;
+ break;
+ case 'p':
+ strcpy(parmfile, optarg);
+ parmfile_specified = 1;
+ break;
+ case 'o':
+ strcpy(outfile, optarg);
+ outfile_specified = 1;
+ break;
+ default:
+ usage(cmd);
+ exit(0);
+ }
+ }
+
+ if (!image_specified || !ramdisk_specified ||
+ !parmfile_specified || !outfile_specified) {
+ usage(cmd);
+ exit(0);
+ }
+
+ printf("Creating bootable CD-ROM image...\n");
+ printf("kernel is : %s\n", image);
+ printf("ramdisk is : %s\n", ramdisk);
+ printf("parmfile is: %s\n", parmfile);
+ printf("outfile is : %s\n", outfile);
+
+ fd1 = fopen(outfile, "w");
+ fd2 = fopen(image, "r");
+ fd3 = fopen(ramdisk, "r");
+ fd4 = fopen(parmfile, "r");
+
+ printf("writing kernel...\n");
+ while (1) {
+ rc = fread(buffer, BUFFER_LEN, 1, fd2);
+ fwrite(buffer, BUFFER_LEN, 1, fd1);
+ if (rc == 0) break;
+ }
+
+ printf("writing initrd...\n");
+ fseek(fd1, initrd_start, SEEK_SET);
+ while (1) {
+ rc = fread(buffer, BUFFER_LEN, 1, fd3);
+ fwrite(buffer, BUFFER_LEN, 1, fd1);
+ if (rc == 0) break;
+ }
+
+ fseek(fd3, 0 ,SEEK_END);
+ initrd_size = ftell(fd3);
+
+ printf("changing start PSW address to 0x%08x...\n", start_psw_address);
+ fseek(fd1, 0x4, SEEK_SET);
+ fwrite(&start_psw_address, 4, 1, fd1);
+
+ printf("writing initrd address and size...\n");
+ printf("INITRD start: 0x%016llx\n", initrd_start);
+ printf("INITRD size : 0x%016llx\n", initrd_size);
+
+ fseek(fd1, 0x10408, SEEK_SET);
+ fwrite(&initrd_start, 8, 1, fd1);
+ fseek(fd1, 0x10410, SEEK_SET);
+ fwrite(&initrd_size, 8, 1, fd1);
+
+ printf("writing parmfile...\n");
+ fseek(fd1, 0x10480, SEEK_SET);
+ while (1) {
+ rc = fread(buffer, 1, 1, fd4);
+ fwrite(buffer, 1, 1, fd1);
+ if (rc == 0) break;
+ }
+
+ fclose(fd1);
+ fclose(fd2);
+ fclose(fd3);
+ fclose(fd4);
+ return 0;
+}