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

Bug#258108: Acknowledgement (s390-netdevice: IUCV not implemented)



Yet another tweak to the patch: this one writes module option
information to /etc/modutils/options.

I really don't know where the line

"option iucv0 iucv=<peer>" should go, or how that's going to get
automatically moved from the installer system to the installer system. 
What's the right answer for this?  Right now I'm having to manually move
it before rebooting.

Adam

 
--- netdevice.c.orig	2004-07-07 17:34:36.000000000 -0400
+++ netdevice.c	2004-07-07 16:49:07.000000000 -0400
@@ -44,6 +44,7 @@
 static int device_selected, device_ctc_protocol, device_qeth_lcs_port;
 static char *device_qeth_portname, *device_qeth_portname_display;
 static char *type_text = "", chandev_parm[256], chandev_module_parm[256];
+static char *iucv_peername, *iucv_peername_display;
 
 #define TEMPLATE_PREFIX	"debian-installer/s390/netdevice/"
 
@@ -206,7 +207,7 @@
 					items_ctc++;
 				if (channels[i].chantype & chantype_escon)
 					items_escon++;
-				if (channels[i].chantype & chantype_lcs)
+			if (channels[i].chantype & chantype_lcs)
 					items_lcs++;
 			}
 		}
@@ -352,6 +353,36 @@
 	return 0;
 }
 
+static int get_iucv_peername (void)
+{
+	char *ptr;
+	int ret, j, k;
+
+	ret = my_debconf_input ("critical", TEMPLATE_PREFIX "iucv/peer", &ptr);
+	if (ret)
+		return ret;
+
+	free (iucv_peername);
+
+	j = strlen (ptr);
+	if (j)
+	{
+		di_log (DI_LOG_LEVEL_WARNING, "length: %d", j);
+		iucv_peername = strdup (ptr);
+		for (k = 0; k < j; k++)
+			iucv_peername[k] = toupper (iucv_peername[k]);
+		iucv_peername_display = iucv_peername;
+	}
+	else
+	{
+		iucv_peername = NULL; 
+		iucv_peername_display = "-";
+		return 1;
+	}
+
+	return 0;
+}
+
 static int confirm (void)
 {
 	char *template, buf[10], *ptr;
@@ -368,6 +399,9 @@
 		case TYPE_LCS:
 			template = TEMPLATE_PREFIX "lcs/confirm";
 			break;
+         	case TYPE_IUCV:
+                        template = TEMPLATE_PREFIX "iucv/confirm";
+			break;
 		default:
 			return -1;
 	}
@@ -460,6 +494,22 @@
 	if (mkdir ("/etc/modutils", 777) && errno != EEXIST)
 		return 1;
 
+	if (strncmp(type_text,"iucv",4) == 0) {
+	  /* IUCV, not chandev, stuff */
+
+	  f = fopen("/etc/modutils/options", "a");
+	  if (!f)
+                return 1;
+	  fprintf(f,"options iucv0 iucv=%s\n",iucv_peername);
+	  fclose(f);
+
+	  snprintf (buf, sizeof (buf), "modprobe netiucv iucv=%s",iucv_peername);
+
+	  di_exec_shell_log (buf);
+
+	  return 0;
+	}
+
 	chandev = fopen ("/proc/chandev", "a");
 
 	if (!chandev)
@@ -516,7 +566,7 @@
 	{
 		BACKUP, GET_NETWORKTYPE, GET_IUCV, GET_CHANNEL,
 		GET_CTC_PROTOCOL, GET_QETH_LCS_PORT, GET_QETH_PORTNAME,
-		CONFIRM
+		CONFIRM, GET_IUCV_PEERNAME
 	}
 	state = GET_NETWORKTYPE;
 
@@ -549,7 +599,8 @@
 				}
 				break;
 			case GET_IUCV:
-				return 1;
+			        state = GET_IUCV_PEERNAME;
+			        break;
 			case GET_CHANNEL:
 				ret = get_channel ();
 				switch (ret)
@@ -625,6 +676,17 @@
 						return 1;
 				}
 				break;
+			case GET_IUCV_PEERNAME:
+				ret = get_iucv_peername ();
+				switch (ret)
+				{
+					case 0:
+						state = CONFIRM;
+						break;
+					default:
+						return 1;
+				}
+				break;
 			case CONFIRM:
 				ret = confirm ();
 				switch (ret)

Reply to: