[Patch] add support for ccwgroup device (mainframe)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Attached is a patch for ccwgroup devices with kernel-2.6 on mainframes.
It basically writes up to two new variables into ifcfg-xxx which are then
picked up by the initscripts and written to some special files in /sys

   Karsten

--
 Karsten Hopp <karsten@xxxxxxxxx>   GPG 1024D/70ABD02C
 Fingerprint D2D4 3B6B 2DE4 464C A432 210A DFF8 A140 70AB D02C
 Red Hat Deutschland, Hauptstaetter Str.58
 70178 Stuttgart, Tel.+49-711-96437-0, Fax +49-711-96437-111
RCS file: /usr/local/CVS/anaconda/network.py,v
retrieving revision 1.49
diff -u -r1.49 network.py
--- network.py	6 May 2004 21:58:28 -0000	1.49
+++ network.py	26 May 2004 12:07:28 -0000
@@ -138,6 +138,8 @@
 	    self.info["TYPE"] = "IUCV"
 	elif dev.startswith('escon'):
 	    self.info["TYPE"] = "ESCON"
+	elif dev.startswith('lcs'):
+	    self.info["TYPE"] = "LCS"
 	elif dev.startswith('tr'):
 	    self.info["TYPE"] = "\"Token Ring\""
 	else:
@@ -172,12 +174,16 @@
 	    self.isConfigured = 1
             for line in lines:
                 netinf = string.splitfields(line, '=')
-                info [netinf[0]] = string.strip(netinf[1])
+                if len(netinf) == 2:
+                    info [netinf[0]] = string.strip(netinf[1])
             self.netdevices [info["DEVICE"]] = NetworkDevice(info["DEVICE"])
             for key in ("IPADDR", "NETMASK", "BOOTPROTO", "ONBOOT", "MTU",
-                        "REMIP"):
+                        "REMIP", "QETH", "SUBCHANNELS", "PORTNAME"):
                 if info.has_key(key):
                     self.netdevices [info["DEVICE"]].set((key, info[key]))
+            # KH: Hack for special case qeth devices which show up as ethX:
+            if info.has_key("QETH"):
+                self.netdevices [info["DEVICE"]].info["TYPE"] = "QETH";
             if info.has_key("GATEWAY"):
                 self.gateway = info["GATEWAY"]
             if info.has_key("DOMAIN"):
Index: loader2/linuxrc.s390
===================================================================
RCS file: /usr/local/CVS/anaconda/loader2/linuxrc.s390,v
retrieving revision 1.31
diff -u -r1.31 linuxrc.s390
--- loader2/linuxrc.s390	19 May 2004 15:59:31 -0000	1.31
+++ loader2/linuxrc.s390	26 May 2004 12:07:28 -0000
@@ -163,6 +163,7 @@
 		read SUBCHANNELS
    done
 	if [ "$NETTYPE" = "eth" -o "$NETTYPE" = "hsi" ]; then
+      QETH="yes"
 		if [ -z "$PORTNAME" ]; then
 			echo $"Each OSA-Express feature in QDIO mode must be associated with a port name"
 			echo $"Enter additional parameters for your QETH device"
@@ -366,6 +367,7 @@
 HOSTNAME=$HOSTNAME
 MTU=$MTU
 SUBCHANNELS=$SUBCHANNELS
+QETH=$QETH
 EOF
 
 # so that the vars get propagated into the sshd shells
Index: loader2/loader.c
===================================================================
RCS file: /usr/local/CVS/anaconda/loader2/loader.c,v
retrieving revision 1.115
diff -u -r1.115 loader.c
--- loader2/loader.c	5 May 2004 19:00:21 -0000	1.115
+++ loader2/loader.c	26 May 2004 12:07:28 -0000
@@ -428,6 +428,15 @@
            if (strstr(vname, "REMIP")) {
                loaderData->ptpaddr = strdup(vparm);
            }
+           if (strstr(vname, "SUBCHANNELS")) {
+               loaderData->subchannels = strdup(vparm);
+           }
+           if (strstr(vname, "PORTNAME")) {
+               loaderData->portname = strdup(vparm);
+           }
+           if (strstr(vname, "QETH")) {
+               loaderData->qeth = strdup(vparm);
+           }
        }
    }
    fclose(f);
Index: loader2/loader.h
===================================================================
RCS file: /usr/local/CVS/anaconda/loader2/loader.h,v
retrieving revision 1.18
diff -u -r1.18 loader.h
--- loader2/loader.h	16 Apr 2004 01:53:34 -0000	1.18
+++ loader2/loader.h	26 May 2004 12:07:28 -0000
@@ -87,7 +87,7 @@
     int netDev_set;
     char * netCls;
     int netCls_set;
-    char * ip, * netmask, *gateway, *dns, *hostname, *ptpaddr, *ethtool;
+    char * ip, *netmask, *gateway, *dns, *hostname, *ptpaddr, *ethtool, *subchannels, *portname, *qeth;
     int mtu;
     int noDns;
     int ipinfo_set;
Index: loader2/net.c
===================================================================
RCS file: /usr/local/CVS/anaconda/loader2/net.c,v
retrieving revision 1.39
diff -u -r1.39 net.c
--- loader2/net.c	6 May 2004 21:43:39 -0000	1.39
+++ loader2/net.c	26 May 2004 12:07:28 -0000
@@ -297,13 +297,23 @@
     }
 
     if (loaderData->mtu) {
-        cfg->dev.mtu = loaderData->mtu;
-        cfg->dev.set |= PUMP_INTFINFO_HAS_MTU;
+        cfg->mtu = loaderData->mtu;
     }
 
     if (loaderData->ptpaddr && (inet_aton(loaderData->ptpaddr, &addr))) {
-        cfg->dev.ptpaddr = addr;
-        cfg->dev.set |= PUMP_INTFINFO_HAS_PTPADDR;
+        cfg->ptpaddr = addr;
+    }
+
+    if (loaderData->subchannels) {
+        cfg->subchannels = strdup(loaderData->subchannels);
+    }
+
+    if (loaderData->portname) {
+        cfg->portname = strdup(loaderData->portname);
+    }
+
+    if (loaderData->qeth) {
+        cfg->qeth = strdup(loaderData->qeth);
     }
 
     if (loaderData->ethtool) {
@@ -595,10 +605,16 @@
         fprintf(f, "HOSTNAME=%s\n", dev->dev.hostname);
     if (dev->dev.set & PUMP_NETINFO_HAS_DOMAIN)
         fprintf(f, "DOMAIN=%s\n", dev->dev.domain);
-    if (dev->dev.set & PUMP_INTFINFO_HAS_MTU)
-        fprintf(f, "MTU=%d\n", dev->dev.mtu);
-    if (dev->dev.set & PUMP_INTFINFO_HAS_PTPADDR)
-        fprintf(f, "REMIP=%s\n", inet_ntoa(dev->dev.ptpaddr));
+    if (dev->mtu)
+        fprintf(f, "MTU=%d\n", dev->mtu);
+    if (dev->ptpaddr.s_addr)
+        fprintf(f, "REMIP=%s\n", inet_ntoa(dev->ptpaddr));
+    if (dev->subchannels)
+        fprintf(f, "SUBCHANNELS=%s\n", dev->subchannels);
+    if (dev->portname)
+        fprintf(f, "PORTNAME=%s\n", dev->portname);
+    if (dev->qeth)
+        fprintf(f, "QETH=%s\n", dev->qeth);
     
     fclose(f);
 
Index: loader2/net.h
===================================================================
RCS file: /usr/local/CVS/anaconda/loader2/net.h,v
retrieving revision 1.7
diff -u -r1.7 net.h
--- loader2/net.h	6 Jan 2004 23:37:50 -0000	1.7
+++ loader2/net.h	26 May 2004 12:07:28 -0000
@@ -4,11 +4,15 @@
 #include "loader.h"
 #include "pump.h"
 
+
 struct networkDeviceConfig {
     struct pumpNetIntf dev;
     int isDynamic;
     int noDns;
     int preset;
+    int mtu;
+    struct in_addr ptpaddr;
+    char *subchannels, *portname, *qeth;
 };
 
 int readNetConfig(char * device, struct networkDeviceConfig * dev, 

Attachment: pgp40flf5Uo5N.pgp
Description: PGP signature


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux