tech-userlevel archive

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

Re: Making powerd=YES default



On 27.07.2011 20:13, Martin Husemann wrote:
> On Wed, Jul 27, 2011 at 11:18:01AM -0400, Julio Merino wrote:
>> What I meant is that, if sysinst is going to decide if powerd should
>> start or not based on the architecture, I don't see why the powerd rc.d
>> script could not decide this by itself.  And by doing so, you'd avoid
>> the need for the postinstall check.
> 
> The difference is: the user can easily change the value sysinst put into
> rc.conf - but we can not recommend the user to hack rc.d/powerd.

Sooo... let's make another attempt, until I finally get a solution
acceptable by everyone (or at least the ones who raise their voice).

Instead of hiding this step in sysinst, the attached patch uses the
Makefiles living under src/etc/. It mimics the MD disktab logic: takes
the default rc.conf that lives under etc/ or the one under etc.MACHINE/
(when it exists).

Obviously, the MD rc.conf have wscons/powerd=YES inside.

Why I am suggesting this: as rc.conf gets patched directly in the MD
sets, it will be managed by etcupdate(8). So anyone who is updating is
seeing the wscons/powerd=YES lines now, instead of just those that use
sysinst-install.

Opinions?

-- 
Jean-Yves Migeon
jeanyves.migeon%free.fr@localhost
Index: distrib/utils/sysinst/arch/i386/md.c
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/arch/i386/md.c,v
retrieving revision 1.128
diff -u -p -r1.128 md.c
--- distrib/utils/sysinst/arch/i386/md.c        4 Apr 2011 08:30:32 -0000       
1.128
+++ distrib/utils/sysinst/arch/i386/md.c        31 Jul 2011 17:35:33 -0000
@@ -386,7 +386,6 @@ md_cleanup_install(void)
 {
 #ifndef DEBUG
        enable_rc_conf();
-       add_rc_conf("wscons=YES\n");
 
 # if defined(__i386__) && defined(SET_KERNEL_TINY)
        /*
Index: distrib/utils/sysinst/arch/shark/md.c
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/arch/shark/md.c,v
retrieving revision 1.26
diff -u -p -r1.26 md.c
--- distrib/utils/sysinst/arch/shark/md.c       4 Apr 2011 08:30:42 -0000       
1.26
+++ distrib/utils/sysinst/arch/shark/md.c       31 Jul 2011 17:35:33 -0000
@@ -177,7 +177,6 @@ md_cleanup_install(void)
 {
 #ifndef DEBUG
        enable_rc_conf();
-       add_rc_conf("wscons=YES\n");
 
        /* Configure a single screen. */
        run_program(RUN_CHROOT,
Index: etc/Makefile
===================================================================
RCS file: /cvsroot/src/etc/Makefile,v
retrieving revision 1.391
diff -u -p -r1.391 Makefile
--- etc/Makefile        30 Jun 2011 18:15:13 -0000      1.391
+++ etc/Makefile        31 Jul 2011 17:35:33 -0000
@@ -94,17 +94,23 @@ BIN1+=      bootptab changelist csh.cshrc csh
        locate.conf login.conf mailer.conf man.conf monthly monthly.conf \
        mrouted.conf named.conf netconfig networks newsyslog.conf \
        nsswitch.conf ntp.conf passwd.conf phones printcap profile protocols \
-       rbootd.conf rc rc.conf rc.local rc.subr rc.shutdown remote rpc \
+       rbootd.conf rc rc.local rc.subr rc.shutdown remote rpc \
        security security.conf services shells shrc sysctl.conf syslog.conf \
        weekly weekly.conf wscons.conf
 
-# Use machine-specific disktab if it exists, or the MI one otherwise
+# Use MD disktab and rc.conf if they exist, or the MI ones otherwise
 .if exists(etc.${MACHINE}/disktab)
 BIN1+= etc.${MACHINE}/disktab
 .else
 BIN1+= disktab
 .endif
 
+.if exists(etc.${MACHINE}/rc.conf)
+BIN1+= etc.${MACHINE}/rc.conf
+.else
+BIN1+= rc.conf
+.endif
+
 .if exists(etc.${MACHINE}/ld.so.conf)
 BIN1+= etc.${MACHINE}/ld.so.conf
 .endif
--- /dev/null   2011-07-31 19:32:05.000000000 +0200
+++ etc/etc.amd64/rc.conf       2011-07-31 18:49:57.000000000 +0200
@@ -0,0 +1,23 @@
+#      $NetBSD: rc.conf,v 1.96 2000/10/14 17:01:29 wiz Exp $
+#
+# see rc.conf(5) for more information.
+#
+# Use program=YES to enable program, NO to disable it. program_flags are
+# passed to the program on the command line.
+#
+
+# Load the defaults in from /etc/defaults/rc.conf (if it's readable).
+# These can be overridden below.
+#
+if [ -r /etc/defaults/rc.conf ]; then
+       . /etc/defaults/rc.conf
+fi
+
+# If this is not set to YES, the system will drop into single-user mode.
+#
+rc_configured=NO
+
+# Add local overrides below
+#
+wscons=YES
+powerd=YES
--- /dev/null   2011-07-31 19:32:05.000000000 +0200
+++ etc/etc.i386/rc.conf        2011-07-31 18:49:47.000000000 +0200
@@ -0,0 +1,23 @@
+#      $NetBSD: rc.conf,v 1.96 2000/10/14 17:01:29 wiz Exp $
+#
+# see rc.conf(5) for more information.
+#
+# Use program=YES to enable program, NO to disable it. program_flags are
+# passed to the program on the command line.
+#
+
+# Load the defaults in from /etc/defaults/rc.conf (if it's readable).
+# These can be overridden below.
+#
+if [ -r /etc/defaults/rc.conf ]; then
+       . /etc/defaults/rc.conf
+fi
+
+# If this is not set to YES, the system will drop into single-user mode.
+#
+rc_configured=NO
+
+# Add local overrides below
+#
+wscons=YES
+powerd=YES
--- /dev/null   2011-07-31 19:32:05.000000000 +0200
+++ etc/etc.shark/rc.conf       2011-07-31 18:52:21.000000000 +0200
@@ -0,0 +1,22 @@
+#      $NetBSD: rc.conf,v 1.96 2000/10/14 17:01:29 wiz Exp $
+#
+# see rc.conf(5) for more information.
+#
+# Use program=YES to enable program, NO to disable it. program_flags are
+# passed to the program on the command line.
+#
+
+# Load the defaults in from /etc/defaults/rc.conf (if it's readable).
+# These can be overridden below.
+#
+if [ -r /etc/defaults/rc.conf ]; then
+       . /etc/defaults/rc.conf
+fi
+
+# If this is not set to YES, the system will drop into single-user mode.
+#
+rc_configured=NO
+
+# Add local overrides below
+#
+wscons=YES


Home | Main Index | Thread Index | Old Index