Subject: rc_configured=no on alpha, macppc, pc532, hp300, mvme68k, x68k
To: None <tech-install@NetBSD.org, port-alpha-maintainer@NetBSD.org,>
From: Hubert Feyrer <hubert@feyrer.de>
List: tech-install
Date: 08/11/2006 14:28:46
As pointed out on comp.unix.bsd.netbsd.misc in
<hmcCg.11392$rd1.4157@trnddc01> and after looking at
src/distrib/distrib/sysinst, it seems that all but the following ports do
enable rc_configured=yes in sysinst:
alpha, macppc, pc532, hp300, mvme68k, x68k
Is there a good reason not to be consistent here?
Or even go as far as moving the steps
enable_rc_conf();
run_program(0, "rm -f %s", target_expand("/sysinst"));
run_program(0, "rm -f %s", target_expand("/.termcap"));
run_program(0, "rm -f %s", target_expand("/.profile"));
out of md_cleanup_install() into a mi_cleanup_install(), as most (but not
all!) ports run them?
FWIW, patch #1 below would enable rc_configured on the above platforms
that don't list a good reason for not enabling things.
For those that don't have space in the ramdisk (the 68k ones), I wonder if
enable_rc_conf() could use the sed of the newly installed system, as in
patch #2 below.
Comments?
- Hubert
Patch #1:
Here's the patch to enable rc_configured=yes on all platforms.
Portmasters please test! :)
Index: arch/alpha/md.c
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/arch/alpha/md.c,v
retrieving revision 1.42
diff -u -r1.42 md.c
--- arch/alpha/md.c 6 Apr 2006 17:18:11 -0000 1.42
+++ arch/alpha/md.c 11 Aug 2006 12:21:57 -0000
@@ -173,6 +173,11 @@
void
md_cleanup_install(void)
{
+ enable_rc_conf();
+
+ run_program(0, "rm -f %s", target_expand("/sysinst"));
+ run_program(0, "rm -f %s", target_expand("/.termcap"));
+ run_program(0, "rm -f %s", target_expand("/.profile"));
}
int
Index: arch/macppc/md.c
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/arch/macppc/md.c,v
retrieving revision 1.36
diff -u -r1.36 md.c
--- arch/macppc/md.c 5 Apr 2006 16:55:06 -0000 1.36
+++ arch/macppc/md.c 11 Aug 2006 12:21:57 -0000
@@ -175,7 +175,11 @@
void
md_cleanup_install(void)
{
+ enable_rc_conf();
+ run_program(0, "rm -f %s", target_expand("/sysinst"));
+ run_program(0, "rm -f %s", target_expand("/.termcap"));
+ run_program(0, "rm -f %s", target_expand("/.profile"));
}
int
Index: arch/pc532/md.c
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/arch/pc532/md.c,v
retrieving revision 1.33
diff -u -r1.33 md.c
--- arch/pc532/md.c 5 Apr 2006 16:55:06 -0000 1.33
+++ arch/pc532/md.c 11 Aug 2006 12:21:57 -0000
@@ -117,6 +117,11 @@
void
md_cleanup_install(void)
{
+ enable_rc_conf();
+
+ run_program(0, "rm -f %s", target_expand("/sysinst"));
+ run_program(0, "rm -f %s", target_expand("/.termcap"));
+ run_program(0, "rm -f %s", target_expand("/.profile"));
}
int
Patch #2:
Index: util.c
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/util.c,v
retrieving revision 1.143
diff -u -r1.143 util.c
--- util.c 26 Feb 2006 10:25:52 -0000 1.143
+++ util.c 11 Aug 2006 12:28:38 -0000
@@ -1225,11 +1225,9 @@
void
enable_rc_conf(void)
{
- const char *tp = target_prefix();
-
- run_program(0, "sed -an -e 's/^rc_configured=NO/rc_configured=YES/;"
- "H;$!d;g;w %s/etc/rc.conf' %s/etc/rc.conf",
- tp, tp);
+ run_program(RUN_CHROOT,
+ "sed -an -e 's/^rc_configured=NO/rc_configured=YES/;"
+ "H;$!d;g;w /etc/rc.conf' /etc/rc.conf");
}
int