--- linux-2001-03-22/arch/mips/arc/cmdline.c.orig	Mon Dec 11 17:41:05 2000
+++ linux-2001-03-22/arch/mips/arc/cmdline.c	Sun Mar 25 01:48:41 2001
@@ -25,10 +25,54 @@
 	"SystemPartition=",
 	"OSLoader=",
 	"OSLoadPartition=",
-	"OSLoadFilename="
+	"OSLoadFilename=",
+	"OSLoadOptions="
 };
 #define NENTS(foo) ((sizeof((foo)) / (sizeof((foo[0])))))
 
+#ifdef CONFIG_SGI_IP22
+
+static char *used_ip22[][2] = {
+	{ "OSLoadPartition=", "root=" },
+	{ "OSLoadOptions=", "" }
+};
+
+#endif /* CONFIG_SGI_IP22 */
+
+char* ip22_cmdline(char* cp)
+{
+#ifdef CONFIG_SGI_IP22
+	char *s;
+	int actr, i;
+
+	actr = 1; /* Always ignore argv[0] */
+
+	while(actr < prom_argc) {
+		for(i = 0; i < NENTS(used_ip22); i++) {
+			int len = strlen(used_ip22[i][0]);
+
+			if(!strncmp(prom_argv[actr], used_ip22[i][0], len)) {
+			/* Ok, we want it. First append the replacement... */
+				strcat(cp, used_ip22[i][1]);
+				cp += strlen(used_ip22[i][1]);
+				/* ... and now the argument */
+				s = strstr(prom_argv[actr], "=");
+				if(s) {
+					s++;
+					strcpy(cp, s);
+					cp += strlen(s);
+				}
+				*cp++ = ' ';
+				break;
+			}
+		}
+		actr++;
+	}
+#endif /* CONFIG_SGI_IP22 */
+	return cp;
+}
+
+
 void __init prom_init_cmdline(void)
 {
 	char *cp;
@@ -37,6 +81,12 @@
 	actr = 1; /* Always ignore argv[0] */
 
 	cp = &(arcs_cmdline[0]);
+	/* 
+	 * make sure IP22 ``specials'' are the first thing on the kernel command line 
+	 * so they can be overridden by later arguments
+	 */
+	cp=ip22_cmdline(cp);
+
 	while(actr < prom_argc) {
 		for(i = 0; i < NENTS(ignored); i++) {
 			int len = strlen(ignored[i]);
