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

Bug#408375: Missing support for qeth network devices in layer2 mode makes debian installer unuseable (patch attached)



Package: s390-netdevice
Version: 0.0.14
Severity: important

Installing debian etch on IBM zSeries(s390) fails if the network
device used for installation is a qeth device in layer2 mode.
(e.g. a NIC connected to a z/VM vswitch in ethernet mode).
qeth defaults to layer3 mode and setting the device online fails
if mode is not set up correctly.
Without network connectivity installation can't proceed.

Attached patch for s390-netdevice adds the possibility to set the
device to layer2 mode before activating it. Also the configuration
file in /etc/sysconfig/hardware/<config file for qeth device>
will be set up correctly for normal system startup.

Greetings,
Martin

-- 
------------------------------------------------------------------
Martin Grimm                             martin.grimm@millenux.com
Mi||enux                                  phone: +49.711.88770.300
Lilienthalstrasse 2                         fax: +49.711.88770.349
70825 Stuttgart-Korntal, Germany
Key fingerprint: 9BB0 AFE1 C133 F88B A27F 4F12 348D C7C0 C817 7FB1
------------------------------------------------------------------
         Linux without limits: http://linux.zSeries.org
--- s390-netdevice-0.0.14/debian/s390-netdevice.templates	2006-10-24 19:14:12.000000000 +0200
+++ s390-netdevice-0.0.15/debian/s390-netdevice.templates	2007-01-17 13:51:38.000000000 +0100
@@ -55,6 +55,7 @@
   channels = ${device0}, ${device1}, ${device2}
   port     = ${port}
   portname = ${portname}
+  layer2   = ${layer2}
 
 Template: s390-netdevice/qeth/no
 Type: error
@@ -81,6 +82,16 @@
 _Description: Port:
  Please enter a relative port for this connection.
 
+Template: s390-netdevice/qeth/layer2
+Type: boolean
+Default: false
+_Description: layer2 mode 
+ Do you want to run this card in layer2-Mode?
+ This will make the OSA-Express adapter keep the MAC
+ addresses of IPV4 packets. By default, the
+ OSA-Express adapter removes LLC headers from incoming
+ IPv4 packets.
+
 Template: s390-netdevice/iucv/confirm
 Type: boolean
 Default: true
diff -Naur s390-netdevice-0.0.14/netdevice.c s390-netdevice-0.0.15/netdevice.c
--- s390-netdevice-0.0.14/netdevice.c	2006-10-24 19:14:12.000000000 +0200
+++ s390-netdevice-0.0.15/netdevice.c	2007-01-22 13:54:09.000000000 +0100
@@ -58,6 +58,7 @@
 		{
 			struct channel *channels[3];
 			int port;
+			int layer2;
 			char portname[32];
 		} qeth;
 		struct
@@ -104,6 +105,7 @@
 	GET_CTC_CHANNELS,
 	GET_CTC_PROTOCOL,
 	GET_QETH_DEVICE,
+	GET_QETH_LAYER2,
 	GET_QETH_PORT,
 	GET_QETH_PORTNAME,
 	GET_IUCV_DEVICE,
@@ -447,6 +449,22 @@
 	return WANT_NEXT;
 }
 
+static enum state_wanted get_qeth_layer2 (void)
+{
+	char *ptr;
+	int ret = my_debconf_input ("critical", TEMPLATE_PREFIX "qeth/layer2", &ptr);
+
+	if (ret == 30)
+		return WANT_BACKUP;
+	if (ret)
+		return WANT_ERROR;
+
+	device_current->qeth.layer2 = strstr(ptr, "true") ? 1 : 0;
+
+	return WANT_NEXT;
+
+}
+
 static enum state_wanted get_qeth_port (void)
 {
 	char *ptr;
@@ -561,7 +579,7 @@
 	return WANT_ERROR;
 }
 
-static enum state_wanted write_ccwgroup (const char *driver_name, const char *device_name, const char *group)
+static enum state_wanted write_ccwgroup (const char *driver_name, const char *device_name, const char *group, int layer2)
 {
 	struct sysfs_device *device;
 	struct sysfs_driver *driver;
@@ -583,6 +601,15 @@
 	if (!device)
 		return WANT_ERROR;
 
+	if (layer2)
+	{
+		attr = sysfs_get_device_attr (device, "layer2");
+		if (!attr)
+			return WANT_ERROR;
+		if (sysfs_write_attribute (attr, "1", 1) < 0)
+			return WANT_ERROR;
+	}
+
 	attr = sysfs_get_device_attr (device, "online");
 	if (!attr)
 		return WANT_ERROR;
@@ -605,7 +632,7 @@
 
 	snprintf (buf, sizeof (buf), "%s,%s\n", device_current->ctc.channels[0]->name, device_current->ctc.channels[1]->name);
 
-	ret = write_ccwgroup ("ctc", device_current->ctc.channels[0]->name, buf);
+	ret = write_ccwgroup ("ctc", device_current->ctc.channels[0]->name, buf, 0);
 	if (ret)
 		return ret;
 
@@ -632,7 +659,7 @@
 
 	snprintf (buf, sizeof (buf), "%s,%s,%s\n", device_current->qeth.channels[0]->name, device_current->qeth.channels[1]->name, device_current->qeth.channels[2]->name);
 
-	ret = write_ccwgroup ("qeth", device_current->qeth.channels[0]->name, buf);
+	ret = write_ccwgroup ("qeth", device_current->qeth.channels[0]->name, buf, device_current->qeth.layer2);
 	if (ret)
 		return ret;
 
@@ -643,6 +670,11 @@
 
 	snprintf (buf, sizeof (buf), "CCWGROUP_CHANS=(%s %s %s)\n", device_current->qeth.channels[0]->name, device_current->qeth.channels[1]->name, device_current->qeth.channels[2]->name);
 	fwrite (buf, strlen (buf), 1, config);
+	if (device_current->qeth.layer2)
+	{
+		snprintf (buf, sizeof (buf), "QETH_OPTIONS=layer2\n");
+		fwrite (buf, strlen (buf), 1, config);
+	}
 
 	fclose (config);
 
@@ -696,6 +728,9 @@
 			case GET_QETH_DEVICE:
 				state_want = get_qeth_device ();
 				break;
+			case GET_QETH_LAYER2:
+				state_want = get_qeth_layer2 ();
+				break;
 			case GET_QETH_PORT:
 				state_want = get_qeth_port ();
 				break;
@@ -767,6 +802,9 @@
 						state = CONFIRM_CTC;
 						break;
 					case GET_QETH_DEVICE:
+						state = GET_QETH_LAYER2;
+						break;
+					case GET_QETH_LAYER2:
 						/* state = GET_QETH_PORT; */
 						state = CONFIRM_QETH;
 						break;

Reply to: