These are patches from the work done on rhel5-branch for 5.3 that need to find their way on to the master branch.
IBM's update to mk-s390-cdboot.c to support large kernel images and large initrd images. --- utils/mk-s390-cdboot.c | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 40 insertions(+), 7 deletions(-)
diff --git a/utils/mk-s390-cdboot.c b/utils/mk-s390-cdboot.c index 99d4fef..4a58258 100644 --- a/utils/mk-s390-cdboot.c +++ b/utils/mk-s390-cdboot.c @@ -122,7 +122,8 @@ int main (int argc, char **argv) {
printf("writing kernel...\n"); while (1) { - rc = fread(buffer, BUFFER_LEN, 1, fd2); + rc = fread(buffer, 1, 1, fd2); + if (rc == 0) { break; } @@ -132,17 +133,23 @@ int main (int argc, char **argv) { abort(); }
- wc = fwrite(buffer, BUFFER_LEN, 1, fd1); + wc = fwrite(buffer, 1, 1, fd1); if (feof(fd1) || ferror(fd1)) { fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno)); abort(); } + + if (wc != rc) { + fprintf(stderr, "could only write %i of %i bytes of kernel\n", + wc, rc); + } }
printf("writing initrd...\n"); fseek(fd1, initrd_start, SEEK_SET); while (1) { - rc = fread(buffer, BUFFER_LEN, 1, fd3); + rc = fread(buffer, 1, 1, fd3); + if (rc == 0) { break; } @@ -152,11 +159,16 @@ int main (int argc, char **argv) { abort(); }
- wc = fwrite(buffer, BUFFER_LEN, 1, fd1); + wc = fwrite(buffer, 1, 1, fd1); if (feof(fd1) || ferror(fd1)) { fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno)); abort(); } + + if (wc != rc) { + fprintf(stderr, "could only write %i of %i bytes of initrd\n", + wc, rc); + } }
if (fseek(fd3, 0, SEEK_END) == -1) { @@ -175,12 +187,17 @@ int main (int argc, char **argv) { abort(); }
- wc = fwrite(&start_psw_address, 4, 1, fd1); + wc = fwrite(&start_psw_address, 1, 4, fd1); if (feof(fd1) || ferror(fd1)) { fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno)); abort(); }
+ if (wc != 4) { + fprintf(stderr, "could only write %i of %i bytes of PSW address\n", + wc, 4); + } + printf("writing initrd address and size...\n"); printf("INITRD start: 0x%016llx\n", initrd_start); printf("INITRD size : 0x%016llx\n", initrd_size); @@ -190,23 +207,33 @@ int main (int argc, char **argv) { abort(); }
- wc = fwrite(&initrd_start, 8, 1, fd1); + wc = fwrite(&initrd_start, 1, 8, fd1); if (feof(fd1) || ferror(fd1)) { fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno)); abort(); }
+ if (wc != 8) { + fprintf(stderr, "could only write %i of %i bytes of INITRD start\n", + wc, 8); + } + if (fseek(fd1, 0x10410, SEEK_SET) == -1) { fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno)); abort(); }
- wc = fwrite(&initrd_size, 8, 1, fd1); + wc = fwrite(&initrd_size, 1, 8, fd1); if (feof(fd1) || ferror(fd1)) { fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno)); abort(); }
+ if (wc != 8) { + fprintf(stderr, "could only write %i of %i bytes of INITRD size\n", + wc, 8); + } + printf("writing parmfile...\n"); if (fseek(fd1, 0x10480, SEEK_SET) == -1) { fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno)); @@ -215,6 +242,7 @@ int main (int argc, char **argv) {
while (1) { rc = fread(buffer, 1, 1, fd4); + if (rc == 0) { break; } @@ -229,6 +257,11 @@ int main (int argc, char **argv) { fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno)); abort(); } + + if (wc != 1) { + fprintf(stderr, "could only write %i of %i bytes of parmfile\n", + wc, 1); + } }
if (fclose(fd1) == EOF) {
David Cantrell wrote:
IBM's update to mk-s390-cdboot.c to support large kernel images and large initrd images.
utils/mk-s390-cdboot.c | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 40 insertions(+), 7 deletions(-)
Looks good,
Regards,
Hans
diff --git a/utils/mk-s390-cdboot.c b/utils/mk-s390-cdboot.c index 99d4fef..4a58258 100644 --- a/utils/mk-s390-cdboot.c +++ b/utils/mk-s390-cdboot.c @@ -122,7 +122,8 @@ int main (int argc, char **argv) {
printf("writing kernel...\n"); while (1) {
rc = fread(buffer, BUFFER_LEN, 1, fd2);
rc = fread(buffer, 1, 1, fd2);
if (rc == 0) { break; }
@@ -132,17 +133,23 @@ int main (int argc, char **argv) { abort(); }
wc = fwrite(buffer, BUFFER_LEN, 1, fd1);
wc = fwrite(buffer, 1, 1, fd1); if (feof(fd1) || ferror(fd1)) { fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno)); abort(); }
if (wc != rc) {
fprintf(stderr, "could only write %i of %i bytes of kernel\n",
wc, rc);
}
}
printf("writing initrd...\n"); fseek(fd1, initrd_start, SEEK_SET); while (1) {
rc = fread(buffer, BUFFER_LEN, 1, fd3);
rc = fread(buffer, 1, 1, fd3);
if (rc == 0) { break; }
@@ -152,11 +159,16 @@ int main (int argc, char **argv) { abort(); }
wc = fwrite(buffer, BUFFER_LEN, 1, fd1);
wc = fwrite(buffer, 1, 1, fd1); if (feof(fd1) || ferror(fd1)) { fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno)); abort(); }
if (wc != rc) {
fprintf(stderr, "could only write %i of %i bytes of initrd\n",
wc, rc);
}
}
if (fseek(fd3, 0, SEEK_END) == -1) {
@@ -175,12 +187,17 @@ int main (int argc, char **argv) { abort(); }
- wc = fwrite(&start_psw_address, 4, 1, fd1);
wc = fwrite(&start_psw_address, 1, 4, fd1); if (feof(fd1) || ferror(fd1)) { fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno)); abort(); }
if (wc != 4) {
fprintf(stderr, "could only write %i of %i bytes of PSW address\n",
wc, 4);
}
printf("writing initrd address and size...\n"); printf("INITRD start: 0x%016llx\n", initrd_start); printf("INITRD size : 0x%016llx\n", initrd_size);
@@ -190,23 +207,33 @@ int main (int argc, char **argv) { abort(); }
- wc = fwrite(&initrd_start, 8, 1, fd1);
wc = fwrite(&initrd_start, 1, 8, fd1); if (feof(fd1) || ferror(fd1)) { fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno)); abort(); }
if (wc != 8) {
fprintf(stderr, "could only write %i of %i bytes of INITRD start\n",
wc, 8);
}
if (fseek(fd1, 0x10410, SEEK_SET) == -1) { fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno)); abort(); }
- wc = fwrite(&initrd_size, 8, 1, fd1);
wc = fwrite(&initrd_size, 1, 8, fd1); if (feof(fd1) || ferror(fd1)) { fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno)); abort(); }
if (wc != 8) {
fprintf(stderr, "could only write %i of %i bytes of INITRD size\n",
wc, 8);
}
printf("writing parmfile...\n"); if (fseek(fd1, 0x10480, SEEK_SET) == -1) { fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno));
@@ -215,6 +242,7 @@ int main (int argc, char **argv) {
while (1) { rc = fread(buffer, 1, 1, fd4);
if (rc == 0) { break; }
@@ -229,6 +257,11 @@ int main (int argc, char **argv) { fprintf(stderr, "%s (%d): %s\n", __func__, __LINE__, strerror(errno)); abort(); }
if (wc != 1) {
fprintf(stderr, "could only write %i of %i bytes of parmfile\n",
wc, 1);
}
}
if (fclose(fd1) == EOF) {
Load the SCSI modules earlier for CD/DVD installs on s390. Also, always set up the network interface because you still need that to ssh in and run loader. --- loader/linuxrc.s390 | 536 +++++++++++++++++++++++++-------------------------- 1 files changed, 267 insertions(+), 269 deletions(-)
diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390 index 08d5755..2643ffe 100644 --- a/loader/linuxrc.s390 +++ b/loader/linuxrc.s390 @@ -254,8 +254,6 @@ if [ -n "$CMSDASD" -a -n "$CMSCONFFILE" ]; then source /tmp/$CMSCONFFILE #2>/dev/null fi
-do_net_install="yes" - if [ -r /sys/firmware/ipl/ipl_type ]; then if [ "`cat /sys/firmware/ipl/ipl_type`" = "fcp" ]; then while [ 1 ]; do @@ -265,17 +263,19 @@ if [ -r /sys/firmware/ipl/ipl_type ]; then case $do_cd_install in y|Y|[Yy][Ee][Ss]) # set up FCP cdrom here + insert_module qdio$LO + insert_module scsi_mod$LO + insert_module scsi_transport_fc$LO + insert_module zfcp$LO 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 ;; *) @@ -289,273 +289,271 @@ if [ -r /sys/firmware/ipl/ipl_type ]; then fi fi
-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 OSA2 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 +# 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 OSA2 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 "$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="255.255.255.255" + 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="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 - 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 [ ":$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
if [ -z "$DASD" ]; then
David Cantrell wrote:
Load the SCSI modules earlier for CD/DVD installs on s390. Also, always set up the network interface because you still need that to ssh in and run loader.
loader/linuxrc.s390 | 536 +++++++++++++++++++++++++-------------------------- 1 files changed, 267 insertions(+), 269 deletions(-)
<Ugh> this one is large, I can not find anything obviously wrong, but I'm no expert on this area :)
Regards,
Hans
diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390 index 08d5755..2643ffe 100644 --- a/loader/linuxrc.s390 +++ b/loader/linuxrc.s390 @@ -254,8 +254,6 @@ if [ -n "$CMSDASD" -a -n "$CMSCONFFILE" ]; then source /tmp/$CMSCONFFILE #2>/dev/null fi
-do_net_install="yes"
if [ -r /sys/firmware/ipl/ipl_type ]; then if [ "`cat /sys/firmware/ipl/ipl_type`" = "fcp" ]; then while [ 1 ]; do @@ -265,17 +263,19 @@ if [ -r /sys/firmware/ipl/ipl_type ]; then case $do_cd_install in y|Y|[Yy][Ee][Ss]) # set up FCP cdrom here
insert_module qdio$LO
insert_module scsi_mod$LO
insert_module scsi_transport_fc$LO
insert_module zfcp$LO 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 ;; *)
@@ -289,273 +289,271 @@ if [ -r /sys/firmware/ipl/ipl_type ]; then fi fi
-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
+# 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"
fiecho
- 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="255.255.255.255"
- 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="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
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 [ ":$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
if [ -z "$DASD" ]; then
Hans de Goede wrote:
David Cantrell wrote:
Load the SCSI modules earlier for CD/DVD installs on s390. Also, always set up the network interface because you still need that to ssh in and run loader.
loader/linuxrc.s390 | 536 +++++++++++++++++++++++++-------------------------- 1 files changed, 267 insertions(+), 269 deletions(-)
<Ugh> this one is large, I can not find anything obviously wrong, but I'm no expert on this area :)
Regards,
Hans
I know this one was large. That's primarily because everything had been indented for some test/check and then that test was changed and everything moved back to where it was before.
The main motivation for this patch on rawhide is to bring the rawhide s390 bits in line with the rhel5-branch s390 bits.
diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390 index 08d5755..2643ffe 100644 --- a/loader/linuxrc.s390 +++ b/loader/linuxrc.s390 @@ -254,8 +254,6 @@ if [ -n "$CMSDASD" -a -n "$CMSCONFFILE" ]; then source /tmp/$CMSCONFFILE #2>/dev/null fi
-do_net_install="yes"
if [ -r /sys/firmware/ipl/ipl_type ]; then if [ "`cat /sys/firmware/ipl/ipl_type`" = "fcp" ]; then while [ 1 ]; do @@ -265,17 +263,19 @@ if [ -r /sys/firmware/ipl/ipl_type ]; then case $do_cd_install in y|Y|[Yy][Ee][Ss]) # set up FCP cdrom here
insert_module qdio$LO
insert_module scsi_mod$LO
insert_module scsi_transport_fc$LO
insert_module zfcp$LO 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 ;; *)
@@ -289,273 +289,271 @@ if [ -r /sys/firmware/ipl/ipl_type ]; then fi fi
-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
+# 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"
fiecho
- 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="255.255.255.255"
- 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="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
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 [ ":$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
if [ -z "$DASD" ]; then
Anaconda-devel-list mailing list Anaconda-devel-list@redhat.com https://www.redhat.com/mailman/listinfo/anaconda-devel-list
On Mon, 2008-12-01 at 12:03 -1000, David Cantrell wrote:
Load the SCSI modules earlier for CD/DVD installs on s390. Also, always set up the network interface because you still need that to ssh in and run loader.
There's nothing that seems out of place here in a quick look given the surrounding aspect of linuxrc.s390. Has it been tested in the context of something more rawhide-ish? Things like insmod instead of modprobe jump out at me as potentially problematic. I'm going to have to say I have no clue where the Fedora on s390 efforts stand these days.
But taking a step back to some more general thoughts on linuxrc.s390, is there an effort to actually get it using the same things we use everywhere else? There's a lot of manual module probing instead of letting things be done by udev and then manual network configuration instead of using NetworkManager. As we've moved more of these bits to be common, we really probably need to sit down and rework the entire way that the script works. The goal of it is that it takes the place of loader/init.c with a few notable and important differences * Prompting for information on things like network setup if you don't set it in the parm file. This pretty much has to be "custom" for s390 and doing it with shell is as easy as anything else * Getting modules loaded. We don't do this until in the loader on other arches, but we need to do it to get the network up. But we really probably want to let udev do it as much as we can * Starting the network. Which we do with spawning NetworkManager in the "normal" case
Jeremy
Jeremy Katz wrote:
On Mon, 2008-12-01 at 12:03 -1000, David Cantrell wrote:
Load the SCSI modules earlier for CD/DVD installs on s390. Also, always set up the network interface because you still need that to ssh in and run loader.
There's nothing that seems out of place here in a quick look given the surrounding aspect of linuxrc.s390. Has it been tested in the context of something more rawhide-ish? Things like insmod instead of modprobe jump out at me as potentially problematic. I'm going to have to say I have no clue where the Fedora on s390 efforts stand these days.
Tested on rawhide? No. Tested on rhel5? Yes. These patches are meant to bring the master branch in line with rhel5-branch. IBM did a lot of contributions to linuxrc.s390 for 5.3.
Fedora on s390 is progressing, but slowly. There is an F-9 build now and koji set up, but things are not quite there yet for regular development. In the mean time, IBM and myself have been doing development on the 5.3 nightlies. Things are getting closer though.
But taking a step back to some more general thoughts on linuxrc.s390, is there an effort to actually get it using the same things we use everywhere else? There's a lot of manual module probing instead of letting things be done by udev and then manual network configuration instead of using NetworkManager. As we've moved more of these bits to be common, we really probably need to sit down and rework the entire way that the script works. The goal of it is that it takes the place of loader/init.c with a few notable and important differences
- Prompting for information on things like network setup if you don't
set it in the parm file. This pretty much has to be "custom" for s390 and doing it with shell is as easy as anything else
- Getting modules loaded. We don't do this until in the loader on other
arches, but we need to do it to get the network up. But we really probably want to let udev do it as much as we can
- Starting the network. Which we do with spawning NetworkManager in the
"normal" case
This mirrors a conversation I've had with IBM recently. Personally, I'd like linuxrc.s390 to go entirely. It's a maintenance nightmare and init.c can just grow to include s390 code where needed. Not only is there a different init for the s390 initrd, the initrd itself is significantly different from the other architectures.
IBM is very interested in reworking the linuxrc.s390 system as well. For 5.x, they have a nice rewrite that improves the input loops and module loading. For rawhide, I am at least wanting to get away from having linuxrc.s390 at all. Even if we keep the linuxrc.s390 script, reducing it to bare minimum and turning things over to the real init when we are done are better than what we have now. s390 is such a special case anyway though, it'll take some more planning.
Right now, I am happy with IBM improving the init system we have now. They are far more knowledgeable about their platform than I am.
On Tue, 2008-12-02 at 07:52 -1000, David Cantrell wrote:
Jeremy Katz wrote:
On Mon, 2008-12-01 at 12:03 -1000, David Cantrell wrote:
Load the SCSI modules earlier for CD/DVD installs on s390. Also, always set up the network interface because you still need that to ssh in and run loader.
There's nothing that seems out of place here in a quick look given the surrounding aspect of linuxrc.s390. Has it been tested in the context of something more rawhide-ish? Things like insmod instead of modprobe jump out at me as potentially problematic. I'm going to have to say I have no clue where the Fedora on s390 efforts stand these days.
Tested on rawhide? No. Tested on rhel5? Yes. These patches are meant to bring the master branch in line with rhel5-branch. IBM did a lot of contributions to linuxrc.s390 for 5.3.
Fedora on s390 is progressing, but slowly. There is an F-9 build now and koji set up, but things are not quite there yet for regular development. In the mean time, IBM and myself have been doing development on the 5.3 nightlies. Things are getting closer though.
Okay, sounds sane. I know that your intention was largely syncing, I just wasn't sure how much/if any testing was doable right now. Given that it's s390, lack of testing doesn't imply that we shouldn't get things synced :)
But taking a step back to some more general thoughts on linuxrc.s390, is there an effort to actually get it using the same things we use everywhere else? There's a lot of manual module probing instead of letting things be done by udev and then manual network configuration instead of using NetworkManager. As we've moved more of these bits to be common, we really probably need to sit down and rework the entire way that the script works. The goal of it is that it takes the place of loader/init.c with a few notable and important differences
- Prompting for information on things like network setup if you don't
set it in the parm file. This pretty much has to be "custom" for s390 and doing it with shell is as easy as anything else
- Getting modules loaded. We don't do this until in the loader on other
arches, but we need to do it to get the network up. But we really probably want to let udev do it as much as we can
- Starting the network. Which we do with spawning NetworkManager in the
"normal" case
This mirrors a conversation I've had with IBM recently. Personally, I'd like linuxrc.s390 to go entirely. It's a maintenance nightmare and init.c can just grow to include s390 code where needed. Not only is there a different init for the s390 initrd, the initrd itself is significantly different from the other architectures.
Yep. And now that we've bit the bullet and accept a "larger" initrd for most cases, there are people that would actually really like the ssh functionality that we have on s390.
IBM is very interested in reworking the linuxrc.s390 system as well. For 5.x, they have a nice rewrite that improves the input loops and module loading. For rawhide, I am at least wanting to get away from having linuxrc.s390 at all. Even if we keep the linuxrc.s390 script, reducing it to bare minimum and turning things over to the real init when we are done are better than what we have now. s390 is such a special case anyway though, it'll take some more planning.
Right now, I am happy with IBM improving the init system we have now. They are far more knowledgeable about their platform than I am.
100% agreed, and to be honest, that was kind of what I was getting at without wanting to explicitly call them out and say "hey, come to the party and let's work to make this suck less" :)
Jeremy
On 12/02/2008 07:36 PM, Jeremy Katz wrote:
On Tue, 2008-12-02 at 07:52 -1000, David Cantrell wrote:
Jeremy Katz wrote:
But taking a step back to some more general thoughts on linuxrc.s390, is there an effort to actually get it using the same things we use everywhere else?
and then manual network configuration instead of using NetworkManager.
AFAIK, NetworkManager is able to manage network devices such as ethX if they already exist. On most platforms this is the case after loading the correct driver kernel module which can be triggered by udev with the help of modaliases.
In the following, I'd like to point out why s390 looks different. I only work on s390 since about a year now. Prior to that, I worked with Linux on x86 for more than a decade. Therefore, I can see the differences from both "sides" and hopefully shed some light on s390's specialties without much bias.
On s390, udev may also automatically load (network) driver modules (except for some hacking required for LCS and CTC).
After loading driver modules, the probing as we are used to on other platforms does not happen in the same way and _no_ (network) device kernel structures are allocated at this point. We must not touch devices which might be meant for another LPAR/VM. Hence, only the user can decide which one (or few) of all the available devices should be made available to the local Linux instance. Only then, a (network) device gets allocated and the remaining configuration (e.g. IP on layer 3) may very well be done as on any other hardware platform.
Yet, I don't think the steps for an actual allocation of a network device on s390 should be integrated into NetworkManager. Those steps are nothing more than a little pre-init we need on s390 to get our devices going and available for e.g. HAL/NetworkManager. It's best to code the pre-init at one place in the anaconda package and independent of any of anaconda's dependencies such as NetworkManager since they apparently change over the course of time.
Also, NetworkManager relies on DHCP for e.g. auto-configuring network layer addresses. We cannot assume to have a DHCP server for Linux guests on System z environments. Therefore, we need a way to manually configure network addresses in any case. And that is what we already have in linuxrc.s390 and if I understood it correctly, NetworkManager may just use the pre-configured devices and everything would just work out fine.
Above said holds not only true for network devices but also for e.g. mass storage such as DASD or FCP on s390. S390 might currently be the only platform requiring such a pre-initialization of devices due to the fact that there might be thousands of them and allocating a kernel device structure for each of them just in case is prohibitively expensive in terms of memory and probing time. I think the huge difference in number of devices is what s390 currently separates from other platforms and should be accepted this way. As other platforms grow they might sooner or later just get into the exact same situation where they can no longer afford to init and allocate each detected device just in case. Then they may make use of the current "special" handling of s390 and platforms will behave similar again.
As we've moved more of these bits to be common, we really probably need to sit down and rework the entire way that the script works. The goal of it is that it takes the place of loader/init.c with a few notable and important differences
- Prompting for information on things like network setup if you don't
set it in the parm file. This pretty much has to be "custom" for s390 and doing it with shell is as easy as anything else
- Getting modules loaded. We don't do this until in the loader on other
arches, but we need to do it to get the network up. But we really probably want to let udev do it as much as we can
- Starting the network. Which we do with spawning NetworkManager in the
"normal" case
This mirrors a conversation I've had with IBM recently. Personally, I'd like linuxrc.s390 to go entirely. It's a maintenance nightmare and init.c can just grow to include s390 code where needed.
Honestly, I fear that much of the necessary s390 code in init.c will remain so special that still nobody wants to maintain it. We would wind up in the same situation we already have with linuxrc.s390. Therefore, a _full_ integration of linuxrc.s390 into init.c does not seem worth it.
Not only is there a different init for the s390 initrd, the initrd itself is significantly different from the other architectures.
I see that point.
Yep. And now that we've bit the bullet and accept a "larger" initrd for most cases, there are people that would actually really like the ssh functionality that we have on s390.
OK, this functionality might indeed be interesting for all platforms and may become non-s390-specific if it was in init.c. In fact, we would make s390 behave like other platforms by making all platforms behave like s390 already does. It brings us closer to having almost the same initrd on s390 as on other platforms. Be aware though, that loader may then no longer be init's child and they would have to communicate with each other by means of IPC as is the case for linuxrc.s390 already. If we used the same IPC interface for all platforms, we had no problem and everything was fine. But this is a major change affecting all platforms which requires testing on all platforms, of course.
IBM is very interested in reworking the linuxrc.s390 system as well. For 5.x, they have a nice rewrite that improves the input loops and module loading. For rawhide, I am at least wanting to get away from having linuxrc.s390 at all. Even if we keep the linuxrc.s390 script, reducing it to bare minimum and turning things over to the real init when we are done are better than what we have now.
After digging into F10's init.c (as a more recent/rawhidish version) and finding some code duplicates between init.c and linuxrc.s390, I really like that idea and am willing to give it a try. However, I'm still unsure how to test it. Maybe I can use the preliminary F9 build on s390.
Anyway, the idea is as follows: Reducing code duplicates and thus improving maintenance by doing the common environment initialization in init.c. An example is the function createDevices which also exists in linuxrc.s390 doing the exactly same thing as in init.c, namely manually creating some basic device nodes in /dev before firing up udevd.
At the point where init.c would fork the loader, we would statically replace this with an #ifdef and instead fork a stripped down linuxrc.s390 which only contains the s390-specific device pre-init including the necessary UI. Of course it needs some more glue to support the IPC between init and the loader, which gets started later on when the user logs on via ssh.
What do you think?
s390 is such a special case anyway though, it'll take some more planning.
Right now, I am happy with IBM improving the init system we have now. They are far more knowledgeable about their platform than I am.
100% agreed, and to be honest, that was kind of what I was getting at without wanting to explicitly call them out and say "hey, come to the party and let's work to make this suck less" :)
We're already there and working on that. But maybe we have a slightly different focus. We try to improve usability and actively contribute to Fedora on s390 to provide a solid basis for RHEL6. We approach the latter by getting it to work gradually in small steps without breaking existing functionality and if necessary reuse working code from RHEL5.
Please correct me if I'm wrong, but your focus seems to be on improving maintenance by treating all platforms the same way. This is basically a good thing.
I think we can achieve the best of both worlds by following our approach until we got something working and after that there's still the chance to redesign bit by bit if there's need. The big advantage is that we continually had a working code-base which is very important for getting Fedora on s390 in the long run IMHO.
Steffen
Linux on System z Development
IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschäftsführung: Erich Baier Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
Steffen Maier wrote:
On 12/02/2008 07:36 PM, Jeremy Katz wrote:
On Tue, 2008-12-02 at 07:52 -1000, David Cantrell wrote:
Jeremy Katz wrote:
But taking a step back to some more general thoughts on linuxrc.s390, is there an effort to actually get it using the same things we use everywhere else?
and then manual network configuration instead of using NetworkManager.
AFAIK, NetworkManager is able to manage network devices such as ethX if they already exist. On most platforms this is the case after loading the correct driver kernel module which can be triggered by udev with the help of modaliases.
Correct.
In the following, I'd like to point out why s390 looks different. I only work on s390 since about a year now. Prior to that, I worked with Linux on x86 for more than a decade. Therefore, I can see the differences from both "sides" and hopefully shed some light on s390's specialties without much bias.
On s390, udev may also automatically load (network) driver modules (except for some hacking required for LCS and CTC).
I still don't understand the hacking aspect of setting up an LCS or CTC device.
After loading driver modules, the probing as we are used to on other platforms does not happen in the same way and _no_ (network) device kernel structures are allocated at this point. We must not touch devices which might be meant for another LPAR/VM. Hence, only the user can decide which one (or few) of all the available devices should be made available to the local Linux instance. Only then, a (network) device gets allocated and the remaining configuration (e.g. IP on layer 3) may very well be done as on any other hardware platform.
Right, which is what's happening now. The direction I'd like to see is getting rid of the current way we find devices and set them up. Is there any good reason that it's still all manual on s390? Can this information not be provided to us by the kernel? The whole point of linuxrc.s390 is to collect parameters so that we can load the modules with the right parameters. It seems so outdated. Why can't the system provide that information for us?
And this isn't a problem that we can solve in anaconda, it's a kernel thing. If the kernel can provide that information to us, we can really improve linuxrc.s390 and possibly do away with it entirely.
I've only been working on s390 for a few years, but what I've seen regarding setting up a VM is very redundant. Set up your devices in z/VM, then set them up again once we boot up the installer. Perhaps it's just my environment and/or lack of s390 knowledge.
Yet, I don't think the steps for an actual allocation of a network device on s390 should be integrated into NetworkManager. Those steps are nothing more than a little pre-init we need on s390 to get our devices going and available for e.g. HAL/NetworkManager. It's best to code the pre-init at one place in the anaconda package and independent of any of anaconda's dependencies such as NetworkManager since they apparently change over the course of time.
The reason we mentioned hal and NetworkManager is that anaconda is using those pieces now, so the correct location to fix things is always the dependent component whenever possible. The more special case device setup knowledge we put in to linuxrc.s390, the more difficult it becomes to maintain. While we probably can't eliminate linuxrc.s390, it would be nice to expand hal and other dependent components to perform tasks that are more appropriate to them. Rather than crawling /sys in linuxrc.s390, let hal do it (as an example). We can then ask hal for the information. Maintenance of that information is now in one location rather than in anaconda AND in hal.
Also, NetworkManager relies on DHCP for e.g. auto-configuring network layer addresses. We cannot assume to have a DHCP server for Linux guests on System z environments. Therefore, we need a way to manually configure network addresses in any case. And that is what we already have in linuxrc.s390 and if I understood it correctly, NetworkManager may just use the pre-configured devices and everything would just work out fine.
That's not entirely true. NetworkManager does have static IPv4 support now, but better than that it comes with nm-system-settings. If you look through loader in rawhide, you'll see that we write out /etc/sysconfig/network-scripts/ifcfg-DEVICE files and nm-system-settings manages those and speaks to NetworkManager for us.
Above said holds not only true for network devices but also for e.g. mass storage such as DASD or FCP on s390. S390 might currently be the only platform requiring such a pre-initialization of devices due to the fact that there might be thousands of them and allocating a kernel device structure for each of them just in case is prohibitively expensive in terms of memory and probing time. I think the huge difference in number of devices is what s390 currently separates from other platforms and should be accepted this way. As other platforms grow they might sooner or later just get into the exact same situation where they can no longer afford to init and allocate each detected device just in case. Then they may make use of the current "special" handling of s390 and platforms will behave similar again.
We definitely have other technologies that require 'pre-init' before we can work with them. Things like iSCSI, for instance, which is strange magical storage technology and fairly complex in terms of wrapping your head around.
The fact that s390 essentially provides two types of devices to VMs: disks and network interfaces (apologies to Hans Picht, but I really haven't worked with the tape device), I really don't see why the kernel can't be involved for a lot of this pre-initialization. Maybe not all of it, but some. Again, my knowledge of the architecture is limited and every time I talk to you guys, I learn something knew. But I think if we push in the direction of the kernel doing more rather than linuxrc.s390 doing more, it will make our life easier.
I do understand the s390 is special, but rather than taking that at face value, it's try top reduce linuxrc.s390 to the bare minimum that needs to happen.
As we've moved more of these bits to be common, we really probably need to sit down and rework the entire way that the script works. The goal of it is that it takes the place of loader/init.c with a few notable and important differences
- Prompting for information on things like network setup if you don't
set it in the parm file. This pretty much has to be "custom" for s390 and doing it with shell is as easy as anything else
- Getting modules loaded. We don't do this until in the loader on other
arches, but we need to do it to get the network up. But we really probably want to let udev do it as much as we can
- Starting the network. Which we do with spawning NetworkManager in the
"normal" case
This mirrors a conversation I've had with IBM recently. Personally, I'd like linuxrc.s390 to go entirely. It's a maintenance nightmare and init.c can just grow to include s390 code where needed.
Honestly, I fear that much of the necessary s390 code in init.c will remain so special that still nobody wants to maintain it. We would wind up in the same situation we already have with linuxrc.s390. Therefore, a _full_ integration of linuxrc.s390 into init.c does not seem worth it.
I think we're looking at this the wrong way. Not necessarily init.c gaining the capabilities of linuxrc.s390, but loader gaining them when appropriate. That's where we do everything else.
Additionally, rawhide might lose init soon as we are working on integrating upstart to replace anaconda's special init process.
Not only is there a different init for the s390 initrd, the initrd itself is significantly different from the other architectures.
I see that point.
Yep. And now that we've bit the bullet and accept a "larger" initrd for most cases, there are people that would actually really like the ssh functionality that we have on s390.
OK, this functionality might indeed be interesting for all platforms and may become non-s390-specific if it was in init.c. In fact, we would make s390 behave like other platforms by making all platforms behave like s390 already does. It brings us closer to having almost the same initrd on s390 as on other platforms. Be aware though, that loader may then no longer be init's child and they would have to communicate with each other by means of IPC as is the case for linuxrc.s390 already. If we used the same IPC interface for all platforms, we had no problem and everything was fine. But this is a major change affecting all platforms which requires testing on all platforms, of course.
The less special case stuff we have for s390, the better. If we move to upstart in anaconda, life becomes easier as well. Especially if loader takes over doing what linuxrc.s390 has to do.
IBM is very interested in reworking the linuxrc.s390 system as well. For 5.x, they have a nice rewrite that improves the input loops and module loading. For rawhide, I am at least wanting to get away from having linuxrc.s390 at all. Even if we keep the linuxrc.s390 script, reducing it to bare minimum and turning things over to the real init when we are done are better than what we have now.
After digging into F10's init.c (as a more recent/rawhidish version) and finding some code duplicates between init.c and linuxrc.s390, I really like that idea and am willing to give it a try. However, I'm still unsure how to test it. Maybe I can use the preliminary F9 build on s390.
Speaking of Fedora on s390, who is heading that up? We should really have that set up as a downstream arch now that pulls in each rawhide build that gets submitted. Or however it can happen. Working with F-9 is uselsss now.
Anyway, the idea is as follows: Reducing code duplicates and thus improving maintenance by doing the common environment initialization in init.c. An example is the function createDevices which also exists in linuxrc.s390 doing the exactly same thing as in init.c, namely manually creating some basic device nodes in /dev before firing up udevd.
At the point where init.c would fork the loader, we would statically replace this with an #ifdef and instead fork a stripped down linuxrc.s390 which only contains the s390-specific device pre-init including the necessary UI. Of course it needs some more glue to support the IPC between init and the loader, which gets started later on when the user logs on via ssh.
What do you think?
I think this is a reasonable thing to try. Keep an eye out for patches that may take us to upstart. Rather than putting things in init.c, might go for loader.c instead.
s390 is such a special case anyway though, it'll take some more planning.
Right now, I am happy with IBM improving the init system we have now. They are far more knowledgeable about their platform than I am.
100% agreed, and to be honest, that was kind of what I was getting at without wanting to explicitly call them out and say "hey, come to the party and let's work to make this suck less" :)
We're already there and working on that. But maybe we have a slightly different focus. We try to improve usability and actively contribute to Fedora on s390 to provide a solid basis for RHEL6. We approach the latter by getting it to work gradually in small steps without breaking existing functionality and if necessary reuse working code from RHEL5.
Please correct me if I'm wrong, but your focus seems to be on improving maintenance by treating all platforms the same way. This is basically a good thing.
Yes, that's one aspect. The other is actually improving anaconda by rewriting/reworking/implementing large parts.
I think we can achieve the best of both worlds by following our approach until we got something working and after that there's still the chance to redesign bit by bit if there's need. The big advantage is that we continually had a working code-base which is very important for getting Fedora on s390 in the long run IMHO.
Correct. Another thing to keep in mind is that large projects like this that we want to do on the Fedora side become basically impossible to backport to a RHEL release. But that's ok, because the functionality will land in the next major RHEL release.
On 01/16/2009 02:47 PM, David Cantrell wrote:
Steffen Maier wrote:
On 12/02/2008 07:36 PM, Jeremy Katz wrote:
On Tue, 2008-12-02 at 07:52 -1000, David Cantrell wrote:
On s390, udev may also automatically load (network) driver modules (except for some hacking required for LCS and CTC).
I still don't understand the hacking aspect of setting up an LCS or CTC device.
Currently, modaliases for both LCS and CTC devices are in the module cu3088 which both lcs and ctc depend on. I.e. udev loads the dependent module cu3088 but not the necessary driver on top. We're looking at this and see if/how we can fix that, so udev would just work out of the box. Otherwise we could use some udev rule to pull in lcs/ctc based on the control unit model, as soon as some device with control unit type 3088 gets sensed by the common-I/O layer. See also RHIT 116546 and the hack that resulted for RHEL (same problem persists with CTC though):
--- modprobe.conf.dist.orig +++ modprobe.conf.dist @@ -162,3 +162,5 @@ install eth1394 /bin/true
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 && /sbin/modprobe snd-emu10k1-synth
+install cu3088 /sbin/modprobe --ignore-install cu3088; /sbin/modprobe lcs
After loading driver modules, the probing as we are used to on other platforms does not happen in the same way and _no_ (network) device kernel structures are allocated at this point. We must not touch devices which might be meant for another LPAR/VM. Hence, only the user can decide which one (or few) of all the available devices should be made available to the local Linux instance. Only then, a (network) device gets allocated and the remaining configuration (e.g. IP on layer 3) may very well be done as on any other hardware platform.
Right, which is what's happening now. The direction I'd like to see is getting rid of the current way we find devices and set them up. Is there any good reason that it's still all manual on s390?
Yes, as mentioned, it is prohibitive to set all visible devices online and allocate device structures in terms of time and memory. Also, this might lead to interference between guests competing for the same full set of devices.
Can this information not be provided to us by the kernel?
Which information? The kernel has no knowledge of which devices the user wants to use.
The whole point of linuxrc.s390 is to collect parameters so that we can load the modules with the right parameters.
Sorry for nitpicking, but it's not parameters for module loading. Device driver modules for s390 nowadays mostly don't use load parameters any more. The parameters linuxrc.s390 collects are applied to sysfs after module loading, since setting a device online is a dynamic process.
And this isn't a problem that we can solve in anaconda, it's a kernel thing. If the kernel can provide that information to us, we can really improve linuxrc.s390 and possibly do away with it entirely.
Ah, OK, now I can see where you think this should be going.
You want all devices to be accessible through sysfs. We cannot afford to set all devices online to be in the required state. So what could the kernel do to help here?
The only thing I could think of from the top of my head was some shadow view presented by the kernel to the user space, e.g. via sysfs. In this view all devices look as if they were accessible but in fact they are not yet online and no device kernel structures have been allocated. Problem 1 here is that this requires a good load of heuristic with network devices where subchannels need to be grouped before they make up a potential network device (that's the way the NIC firmware works and we won't change that). I compare such a heuristic to the policy of routing algorithms which is also implemented by a daemon in user space and not in the kernel, where only the mechanics reside, i.e. the packet forwarding. Hence, such a heuristic should reside in user space. Now, if something tries to really work with such a shadow device, the kernel would have to group it, set it online, allocate a real device structure. Problem 2: I'm already ignoring the load of parameters the user might want to configure before setting the device online (because that is how the NIC firmware works). How would we support that if the kernel does magic on his own? Events that trigger something in user space? Then we'd better do all in user space right from the start.
I've only been working on s390 for a few years, but what I've seen regarding setting up a VM is very redundant. Set up your devices in z/VM, then set them up again once we boot up the installer.
You only tell VM which devices are available in a guest, that's different from setting devices online in the guest. It is not redundant.
Yet, I don't think the steps for an actual allocation of a network device on s390 should be integrated into NetworkManager. Those steps are nothing more than a little pre-init we need on s390 to get our devices going and available for e.g. HAL/NetworkManager. It's best to code the pre-init at one place in the anaconda package and independent of any of anaconda's dependencies such as NetworkManager since they apparently change over the course of time.
The reason we mentioned hal and NetworkManager is that anaconda is using those pieces now, so the correct location to fix things is always the dependent component whenever possible. The more special case device setup knowledge we put in to linuxrc.s390, the more difficult it becomes to maintain. While we probably can't eliminate linuxrc.s390, it would be nice to expand hal and other dependent components to perform tasks that are more appropriate to them. Rather than crawling /sys in linuxrc.s390, let hal do it (as an example). We can then ask hal for the information. Maintenance of that information is now in one location rather than in anaconda AND in hal.
Our current pre-init in linuxrc.s390 sets up devices so that they can be used with hal and friends without even having to change the latter. Maintenance of that information is already in one place, namely anaconda. Your suggestion just moves the maintenance to another place and brings a lot of unsolved issues we currently don't even have:
A solution that suggests itself, would be to set all visible devices online => hal and friends will explode with thousands of devices. As mentioned above, there are even more reasons why we MUST NOT set all devices online just in case we need them later on.
Side node: cio_ignore. The common-I/O layer senses devices on s390 so they appear in sysfs. Even that might take too long with thousands of devices (tens of minutes), so there is a device blacklist where you can stop common-I/O from even sensing certain devices. And all this even happens long before device kernel structures could be allocated and hal gets anything to see. Hope you understand my point, that even long before hal there might already be show stoppers, so the later we would try to set all of them online in this device setup process the bigger the explosion will be.
Just like described for the kernel variant above, hal and friends could alternatively be extended to provide a shadow view of all visible devices without actually setting them online and without actual kernel device structures. Only when a user wants to use one of those devices, hal would have to set it online on short notice. That's a lot of code to get this working reliably. Each time hal gets replaced by something else, you would have to recode all this. To me, this sounds even worse than the kernel solution.
All my solutions assume that hal does not have any interactive component where the user may choose devices to use. I hope this constraint is valid.
At the risk of repeating myself: All this is no problem, since after our little pre-init helper the devices are there and ready to be used as on all other platforms. Pre-init is good.
Also, NetworkManager relies on DHCP for e.g. auto-configuring network layer addresses. We cannot assume to have a DHCP server for Linux guests on System z environments. Therefore, we need a way to manually configure network addresses in any case. And that is what we already have in linuxrc.s390 and if I understood it correctly, NetworkManager may just use the pre-configured devices and everything would just work out fine.
That's not entirely true. NetworkManager does have static IPv4 support now, but better than that it comes with nm-system-settings. If you look through loader in rawhide, you'll see that we write out /etc/sysconfig/network-scripts/ifcfg-DEVICE files and nm-system-settings manages those and speaks to NetworkManager for us.
You're right, that's what I meant. Sorry for my vague wording due to missing knowledge. Meanwhile I've seen the new anaconda code and with our pre-init in linuxrc.s390 it should just work. If parameters from the UI or parm file get handed to the loader and the loader writes such an ifcfg, then the use of the network device happens transparently as you described and we're good.
Above said holds not only true for network devices but also for e.g. mass storage such as DASD or FCP on s390.
[snip]
We definitely have other technologies that require 'pre-init' before we can work with them. Things like iSCSI, for instance, which is strange magical storage technology and fairly complex in terms of wrapping your head around.
So does s390 and the more I think about it the more I like it. It's comparable to the Unix approach on the command line where you have small tools, each one doing some specific thing. Then you combine them to achieve bigger things. On s390 we combine the pre-init of linuxrc.s390 with the existing loader and anaconda.
I think we're looking at this the wrong way. Not necessarily init.c gaining the capabilities of linuxrc.s390, but loader gaining them when appropriate. That's where we do everything else.
So far, I've been assuming loader requires a curses capable terminal since it uses newt for its TUI, right? We cannot assume to have such a terminal on s390. Hence, it is impossible to do interactive pre-inits in loader. Or did I get something wrong here?
Additionally, rawhide might lose init soon as we are working on integrating upstart to replace anaconda's special init process.
Now I learnt something new. So in a nutshell, upstart seems to be a more flexible replacement for sysV-init and it is used since F9 in the installed system. Unfortunately, I could neither find any information on what are the implications using upstart in an installer nor do I have any clue what this means. Could you please point me to some more information?
Even if we keep the linuxrc.s390 script, reducing it to bare minimum and turning things over to the real init when we are done are better than what we have now.
After digging into F10's init.c (as a more recent/rawhidish version) and finding some code duplicates between init.c and linuxrc.s390, I really like that idea and am willing to give it a try.
[snip]
Anyway, the idea is as follows: Reducing code duplicates and thus improving maintenance by doing the common environment initialization in init.c.
[snip]
At the point where init.c would fork the loader, we would statically replace this with an #ifdef and instead fork a stripped down linuxrc.s390 which only contains the s390-specific device pre-init including the necessary UI.
[snip]
I think this is a reasonable thing to try.
Cool, so I'll give that a try. Might take some time, though. I'll post an untested prototype for review. I defer upstart conversion to a 2nd step and make it working with the current init first.
Steffen
Linux on System z Development
IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschäftsführung: Erich Baier Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
On 01/16/2009 06:17 PM, Steffen Maier wrote:
On 01/16/2009 02:47 PM, David Cantrell wrote:
Steffen Maier wrote:
On 12/02/2008 07:36 PM, Jeremy Katz wrote:
On Tue, 2008-12-02 at 07:52 -1000, David Cantrell wrote:
I think we're looking at this the wrong way. Not necessarily init.c gaining the capabilities of linuxrc.s390, but loader gaining them when appropriate. That's where we do everything else.
So far, I've been assuming loader requires a curses capable terminal since it uses newt for its TUI, right? We cannot assume to have such a terminal on s390. Hence, it is impossible to do interactive pre-inits in loader. Or did I get something wrong here?
Additionally, rawhide might lose init soon as we are working on integrating upstart to replace anaconda's special init process.
Even if we keep the linuxrc.s390 script, reducing it to bare minimum and turning things over to the real init when we are done are better than what we have now.
After digging into F10's init.c (as a more recent/rawhidish version) and finding some code duplicates between init.c and linuxrc.s390, I really like that idea and am willing to give it a try.
[snip]
Anyway, the idea is as follows: Reducing code duplicates and thus improving maintenance by doing the common environment initialization in init.c.
[snip]
At the point where init.c would fork the loader, we would statically replace this with an #ifdef and instead fork a stripped down linuxrc.s390 which only contains the s390-specific device pre-init including the necessary UI.
[snip]
I think this is a reasonable thing to try.
What I understood so far is: - init shall be platform independent and will be replaced by upstart, and this is the main reason why linuxrc.s390 should no longer be a replacement for init.c - loader should maybe do the s390-specific pre-init of (network) devices - the installer initrd should be built the same way on all platforms
What we're trying to achieve is to improve usability of RHEL/Fedora on s390 and due to lack of Rawhide on s390 we implemented this on the basis of RHEL5. Apparently, our code now does not fit in Rawhide. We would like to adapt our code to any suitable interface that Rawhide provides to enable the setup of devices on s390 which used to be done by linuxrc.s390. Could you as the maintainers of the anaconda package please provide such an interface? For planning, I would further like to know until when you think you could provide a prototypical implementation of such interface so I can adapt and test our code to fit in Rawhide?
With my latest understanding of your requirements and other constraints, e.g. those of the s390 architecture, I could roughly suggest the following as a basis for a required interface: We need a line mode UI, which must not be part of init/upstart and cannot be part of the loader which uses a newt TUI and needs already preconfigured s390 devices. Therefore, we could call a stripped down version of linuxrc.s390, which I would provide and only does the necessary s390 pre-init, somewhere at the end of init/upstart or before the beginning of the loader. The necessary bash and module-init-tools etc. required by our code are already part of the cross-platform initrd. I think this would fulfill all requirements nicely.
Please keep in mind, that we need the functionality to ssh into the installer image in order to start the loader in a curses capable terminal. Since you already mentioned interest in having this for all platforms, there will be general need for a user decision on whether he/she wants to continue installation in the same console session (all other platforms so far) or continue installation by logging in through ssh (s390 so far). This question should appear before our s390 pre-init and obviously needs to take place before loader. It would be nice, if the choice could be handed to our code as a parameter, since there are situations where a text-mode installation from FCP-attached CD/DVD in the same console session on s390 makes sense. If so, we obviously don't need to set up the network during pre-init and users might not even have one when they decide to install from CD/DVD.
Steffen
Linux on System z Development
IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschäftsführung: Erich Baier Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
Steffen Maier (maier@linux.vnet.ibm.com) said:
On s390, udev may also automatically load (network) driver modules (except for some hacking required for LCS and CTC).
After loading driver modules, the probing as we are used to on other platforms does not happen in the same way and _no_ (network) device kernel structures are allocated at this point. We must not touch devices which might be meant for another LPAR/VM. Hence, only the user can decide which one (or few) of all the available devices should be made available to the local Linux instance. Only then, a (network) device gets allocated and the remaining configuration (e.g. IP on layer 3) may very well be done as on any other hardware platform.
Not that it's going to get much traction at this stage of s390's lifecycle, but this seems a fundamental design flaw - why would you trust each VM with making sure it doesn't step on other VMs' resources? Wouldn't this best be done in the hypervisor itself?
Yet, I don't think the steps for an actual allocation of a network device on s390 should be integrated into NetworkManager. Those steps are nothing more than a little pre-init we need on s390 to get our devices going and available for e.g. HAL/NetworkManager. It's best to code the pre-init at one place in the anaconda package
No, it should be in udev. anaconda should not have hardware-specific code.
Also, NetworkManager relies on DHCP for e.g. auto-configuring network layer addresses.
NM can use static IP addressess, and we already have code for setting them up. There's no need for anything s390 specific here.
At the point where init.c would fork the loader, we would statically replace this with an #ifdef and instead fork a stripped down linuxrc.s390 which only contains the s390-specific device pre-init including the necessary UI. Of course it needs some more glue to support the IPC between init and the loader, which gets started later on when the user logs on via ssh.
What do you think?
That's still doing it wrong... period. The idea is to eventually get away from a custom init entirely, as I understand it.
Bill
On 01/16/2009 04:45 PM, Bill Nottingham wrote:
Steffen Maier (maier@linux.vnet.ibm.com) said:
On s390, udev may also automatically load (network) driver modules (except for some hacking required for LCS and CTC).
After loading driver modules, the probing as we are used to on other platforms does not happen in the same way and _no_ (network) device kernel structures are allocated at this point. We must not touch devices which might be meant for another LPAR/VM. Hence, only the user can decide which one (or few) of all the available devices should be made available to the local Linux instance. Only then, a (network) device gets allocated and the remaining configuration (e.g. IP on layer 3) may very well be done as on any other hardware platform.
Not that it's going to get much traction at this stage of s390's lifecycle, but this seems a fundamental design flaw - why would you trust each VM with making sure it doesn't step on other VMs' resources? Wouldn't this best be done in the hypervisor itself?
I did not say you cannot do it in a safe way in the hypervisor in case of z/VM or in the I/O configuration of the hardware in case of LPAR. You can do it, some people do it, and then you don't have problems because you might see more than you actually should. Still you might have thousands of devices and have to cope with them. But there are also configurations that "span" devices among different VMs/LPARs for various reasons.
Yet, I don't think the steps for an actual allocation of a network device on s390 should be integrated into NetworkManager. Those steps are nothing more than a little pre-init we need on s390 to get our devices going and available for e.g. HAL/NetworkManager. It's best to code the pre-init at one place in the anaconda package
No, it should be in udev. anaconda should not have hardware-specific code.
OK, I think I get an initial picture of how this could be. But where from would you get the information which devices to actually allocate which is in turn only known by the user?
Also, NetworkManager relies on DHCP for e.g. auto-configuring network layer addresses.
NM can use static IP addressess, and we already have code for setting them up. There's no need for anything s390 specific here.
That's what I was trying to say a bit below of what you quoted here.
At the point where init.c would fork the loader, we would statically replace this with an #ifdef and instead fork a stripped down linuxrc.s390 which only contains the s390-specific device pre-init including the necessary UI.
[snip]
That's still doing it wrong... period. The idea is to eventually get away from a custom init entirely, as I understand it.
Any suggestions?
Steffen
Linux on System z Development
IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschäftsführung: Erich Baier Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
--- loader/linuxrc.s390 | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390 index 2643ffe..f6d3f42 100644 --- a/loader/linuxrc.s390 +++ b/loader/linuxrc.s390 @@ -263,10 +263,10 @@ if [ -r /sys/firmware/ipl/ipl_type ]; then case $do_cd_install in y|Y|[Yy][Ee][Ss]) # set up FCP cdrom here - insert_module qdio$LO - insert_module scsi_mod$LO - insert_module scsi_transport_fc$LO - insert_module zfcp$LO + insmod qdio$LO + insmod scsi_mod$LO + insmod scsi_transport_fc$LO + insmod zfcp$LO CD_DEVICE="`cat /sys/firmware/ipl/device`" WWPN="`cat /sys/firmware/ipl/wwpn`" LUN="`cat /sys/firmware/ipl/lun`"
David Cantrell wrote:
loader/linuxrc.s390 | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
Looks good,
Regards,
Hans
diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390 index 2643ffe..f6d3f42 100644 --- a/loader/linuxrc.s390 +++ b/loader/linuxrc.s390 @@ -263,10 +263,10 @@ if [ -r /sys/firmware/ipl/ipl_type ]; then case $do_cd_install in y|Y|[Yy][Ee][Ss]) # set up FCP cdrom here
insert_module qdio$LO
insert_module scsi_mod$LO
insert_module scsi_transport_fc$LO
insert_module zfcp$LO
insmod qdio$LO
insmod scsi_mod$LO
insmod scsi_transport_fc$LO
insmod zfcp$LO CD_DEVICE="`cat /sys/firmware/ipl/device`" WWPN="`cat /sys/firmware/ipl/wwpn`" LUN="`cat /sys/firmware/ipl/lun`"
On Mon, 2008-12-01 at 12:03 -1000, David Cantrell wrote:
loader/linuxrc.s390 | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390 index 2643ffe..f6d3f42 100644 --- a/loader/linuxrc.s390 +++ b/loader/linuxrc.s390 @@ -263,10 +263,10 @@ if [ -r /sys/firmware/ipl/ipl_type ]; then case $do_cd_install in y|Y|[Yy][Ee][Ss]) # set up FCP cdrom here
insert_module qdio$LO
insert_module scsi_mod$LO
insert_module scsi_transport_fc$LO
insert_module zfcp$LO
insmod qdio$LO
insmod scsi_mod$LO
insmod scsi_transport_fc$LO
insmod zfcp$LO CD_DEVICE="`cat /sys/firmware/ipl/device`" WWPN="`cat /sys/firmware/ipl/wwpn`" LUN="`cat /sys/firmware/ipl/lun`"
So is s390 also using module-init-tools now then? I haven't looked at it in a while since the last time it blew up on me in RHEL5 over a rogue kernel patch someone had submitted :)
Jon.
Jon Masters wrote:
On Mon, 2008-12-01 at 12:03 -1000, David Cantrell wrote:
loader/linuxrc.s390 | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390 index 2643ffe..f6d3f42 100644 --- a/loader/linuxrc.s390 +++ b/loader/linuxrc.s390 @@ -263,10 +263,10 @@ if [ -r /sys/firmware/ipl/ipl_type ]; then case $do_cd_install in y|Y|[Yy][Ee][Ss]) # set up FCP cdrom here
insert_module qdio$LO
insert_module scsi_mod$LO
insert_module scsi_transport_fc$LO
insert_module zfcp$LO
insmod qdio$LO
insmod scsi_mod$LO
insmod scsi_transport_fc$LO
insmod zfcp$LO CD_DEVICE="`cat /sys/firmware/ipl/device`" WWPN="`cat /sys/firmware/ipl/wwpn`" LUN="`cat /sys/firmware/ipl/lun`"
So is s390 also using module-init-tools now then? I haven't looked at it in a while since the last time it blew up on me in RHEL5 over a rogue kernel patch someone had submitted :)
Did s390 ever use something other than the standard kernel module utils? The insert_module command was a wrapper function that IBM had written for debugging purposes. The calls were left in the first iteration of a patch from them.
anaconda-devel@lists.fedoraproject.org