Subject: sysinst: tester for wscons fix wanted
To: None <current-users@netbsd.org, tech-install@netbsd.org>
From: Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
List: current-users
Date: 09/19/2000 21:59:18
The enabling of wscons from sysinst is broken after rc.conf was moved to
/etc/default. Below is a patch that should fix this, but I cannot test it.
If someone could test this, I'd appreciate any feedback.

Just install (not upgrade!) a system as usual, and after you've rebooted
check that 
 1. rc_configured=YES and
 2. wscons=YES
in /etc/rc.conf. 

Please send your reply directly to me (hubertf@netbsd.org), asd I'm not on
this list.

Thanks!


 - Hubert

Index: md.c
===================================================================
RCS file: /cvsroot/basesrc/distrib/utils/sysinst/arch/i386/md.c,v
retrieving revision 1.36
diff -u -r1.36 md.c
--- md.c	2000/05/12 01:00:08	1.36
+++ md.c	2000/09/19 19:43:42
@@ -469,31 +469,40 @@
 {
 	char realfrom[STRSIZE];
 	char realto[STRSIZE];
-	char sedcmd[STRSIZE];
+	char cmd[STRSIZE];
 
 	strncpy(realfrom, target_expand("/etc/rc.conf"), STRSIZE);
 	strncpy(realto, target_expand("/etc/rc.conf.install"), STRSIZE);
-	sprintf(sedcmd, "sed "
+	sprintf(cmd, "sed "
 			"-e 's/rc_configured=NO/rc_configured=YES/' "
-			"-e 's/wscons=NO/wscons=YES/' "
 			" < %s > %s", realfrom, realto);
 	if (logging)
-		(void)fprintf(log, "%s\n", sedcmd);
+		(void)fprintf(log, "%s\n", cmd);
 	if (scripting)
-		(void)fprintf(script, "%s\n", sedcmd);
-	do_system(sedcmd);
+		(void)fprintf(script, "%s\n", cmd);
+	do_system(cmd);
+
+	/* put "wscons=YES" into rc.conf.install (which will be renamed
+	 * to rc.conf in a second) */
+	sprintf(cmd, "echo wscons=YES >> %s", realto);
+	if (logging)
+		(void)fprintf(log, "%s\n", cmd);
+	if (scripting)
+		(void)fprintf(script, "%s\n", cmd);
+	do_system(cmd);
+
 	run_prog(1, 0, NULL, "mv -f %s %s", realto, realfrom);
 
 	strncpy(realfrom, target_expand("/etc/ttys"), STRSIZE);
 	strncpy(realto, target_expand("/etc/ttys.install"), STRSIZE);
-	sprintf(sedcmd, "sed "
+	sprintf(cmd, "sed "
 			"-e '/^ttyE/s/off/on/'"
 			" < %s > %s", realfrom, realto);
 	if (logging)
-		(void)fprintf(log, "%s\n", sedcmd);
+		(void)fprintf(log, "%s\n", cmd);
 	if (scripting)
-		(void)fprintf(script, "%s\n", sedcmd);
-	do_system(sedcmd);
+		(void)fprintf(script, "%s\n", cmd);
+	do_system(cmd);
 	run_prog(1, 0, NULL, "mv -f %s %s", realto, realfrom);
 
 	run_prog(0, 0, NULL, "rm -f %s", target_expand("/sysinst"));

-- 
Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>