From nobody@FreeBSD.org  Tue Jan  8 16:57:02 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id 7F3B0A93
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  8 Jan 2013 16:57:02 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 706EAD32
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  8 Jan 2013 16:57:02 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r08Gv2r5090392
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 8 Jan 2013 16:57:02 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r08Gv2ok090391;
	Tue, 8 Jan 2013 16:57:02 GMT
	(envelope-from nobody)
Message-Id: <201301081657.r08Gv2ok090391@red.freebsd.org>
Date: Tue, 8 Jan 2013 16:57:02 GMT
From: jb <jb.1234abcd@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bsdinstall(8) - do not offer services invalid in installation env (e.g. VirtualBox)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         175139
>Category:       bin
>Synopsis:       bsdinstall(8) - do not offer services invalid in installation env (e.g. VirtualBox)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-sysinstall
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 08 17:00:00 UTC 2013
>Closed-Date:    Sat Jan 12 16:03:56 UTC 2013
>Last-Modified:  Sat Jan 12 16:10:00 UTC 2013
>Originator:     jb
>Release:        FreeBSD 9.1-RELEASE #0 r243826
>Organization:
>Environment:
FreeBSD 9.1-RELEASE #0 r243826 ... i386

>Description:
This applies to any installation env (VirtualBox, other hardware platforms).

On VirtualBox, I selected powerd service during install, but at boot time there
was an error msg:
starting powerd
powerd lookup freq: No such file or directory
/etc/rc: WARNING failed to start powerd

Disabling powerd in /etc/rc.conf to get rid of the error message is a fix, but
not a solution to a problem.
Making a statement that in VirtualBox powerd doesn't work because the guest
OS can not control the frequency of the host CPU is true, but is not a solution
as well.

The solution is to NOT offer bugus/invalid services for installation env, real
or virtual.

Bsdinstall can discover this condition with checking for lack of
sysctl -a | grep dev.cpu.0.freq
sysctl -a | grep dev.cpu.0.freq_levels
in /usr/libexec/bsdinstall/services,

exactly as it does (in powerd.c) with
     if (sysctlnametomib("dev.cpu.0.freq", freq_mib, &len))
       err(1, "lookup freq");
       ...
     if (sysctlnametomib("dev.cpu.0.freq_levels", levels_mib, &len))
       err(1, "lookup freq_levels");
in /usr/sbin/powerd (via /etc/rc.d/powerd).

Bsdinstall already does similar checks for other features, see:
$ grep -ir sysctl /usr/libexec/bsdinstall/









>How-To-Repeat:
as above
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-sysinstall 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Jan 12 08:14:54 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=175139 
State-Changed-From-To: open->closed 
State-Changed-By: nwhitehorn 
State-Changed-When: Sat Jan 12 16:02:06 UTC 2013 
State-Changed-Why:  
Added note that powerd may not work on all systems in r245333. Runtime 
checks are deliberately avoided since bsdinstall can be used directly to 
set up disk images from a running system (useful for setting up virtualized 
systems) where such checks are not meaningful. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=175139 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/175139: commit references a PR
Date: Sat, 12 Jan 2013 16:02:10 +0000 (UTC)

 Author: nwhitehorn
 Date: Sat Jan 12 16:01:58 2013
 New Revision: 245333
 URL: http://svnweb.freebsd.org/changeset/base/245333
 
 Log:
   Note that cpufreq(4) is not available on all hardware.
   
   PR:		bin/175139
   MFC after:	2 weeks
 
 Modified:
   head/usr.sbin/bsdinstall/scripts/services
 
 Modified: head/usr.sbin/bsdinstall/scripts/services
 ==============================================================================
 --- head/usr.sbin/bsdinstall/scripts/services	Sat Jan 12 15:58:20 2013	(r245332)
 +++ head/usr.sbin/bsdinstall/scripts/services	Sat Jan 12 16:01:58 2013	(r245333)
 @@ -45,7 +45,7 @@ DAEMONS=$(dialog --backtitle "FreeBSD In
  	sshd	"Secure shell daemon" ${sshd_enable:-off} \
  	moused	"PS/2 mouse pointer on console" ${moused_enable:-off} \
  	ntpd	"Synchronize system and network time" ${ntpd_enable:-off} \
 -	powerd	"Adjust CPU frequency dynamically" ${powerd_enable:-off} \
 +	powerd	"Adjust CPU frequency dynamically if supported" ${powerd_enable:-off} \
  2>&1 1>&3)
  exec 3>&-
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
