From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QtaPg-0003Nu-IZ for garchives@archives.gentoo.org; Wed, 17 Aug 2011 07:19:44 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C66A721C327; Wed, 17 Aug 2011 07:19:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 780C321C327 for ; Wed, 17 Aug 2011 07:19:31 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A7BF51B4062 for ; Wed, 17 Aug 2011 07:19:30 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 617) id 6AACF2004C; Wed, 17 Aug 2011 07:19:29 +0000 (UTC) From: "Sven Vermeulen (swift)" To: gentoo-doc-cvs@lists.gentoo.org Subject: [gentoo-doc-cvs] gentoo commit in xml/htdocs/doc/en: power-management-guide.xml X-VCS-Repository: gentoo X-VCS-Files: power-management-guide.xml X-VCS-Directories: xml/htdocs/doc/en X-VCS-Committer: swift X-VCS-Committer-Name: Sven Vermeulen Content-Type: text/plain; charset=utf8 Message-Id: <20110817071929.6AACF2004C@flycatcher.gentoo.org> Date: Wed, 17 Aug 2011 07:19:29 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-doc-cvs@lists.gentoo.org Reply-to: docs-team@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 4e6be449ee254e85cf818fab20fb8d19 swift 11/08/17 07:19:29 Modified: power-management-guide.xml Log: Bug #367145 - Update pmg_switch_runlevel.sh script and add a note in th= e beginning of the document that this script has been updated Revision Changes Path 1.48 xml/htdocs/doc/en/power-management-guide.xml file : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/en/powe= r-management-guide.xml?rev=3D1.48&view=3Dmarkup plain: http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/en/powe= r-management-guide.xml?rev=3D1.48&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/en/powe= r-management-guide.xml?r1=3D1.47&r2=3D1.48 Index: power-management-guide.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/power-management-guide.xm= l,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- power-management-guide.xml 17 Aug 2011 07:10:12 -0000 1.47 +++ power-management-guide.xml 17 Aug 2011 07:19:29 -0000 1.48 @@ -1,6 +1,6 @@ - + =20 Power Management Guide @@ -24,7 +24,7 @@ =20 -3 +4 2011-08-17 =20 @@ -32,6 +32,18 @@
=20 + + +Since the introduction of OpenRC, the pmg_switch_runlevel.sh scri= pt +needs to be updated. If you have issues after the OpenRC upgrade, please= update +this script according to this guide. + +

Capacity and lifetime of laptop batteries have improved much in the last= years. Nevertheless modern processors consume much more energy than older ones = and @@ -291,34 +303,42 @@

 #!/bin/bash
=20
-# BEGIN configuration
+# BEGIN configuration
 RUNLEVEL_AC=3D"default"
 RUNLEVEL_BATTERY=3D"battery"
-# END configuration
+
+if [ -x /usr/bin/logger ]; then
+    LOGGER=3D"/usr/bin/logger -s -p daemon.info -t /etc/acpi/actions/pmg=
_switch_runlevel.sh"
+else
+    LOGGER=3D"/bin/echo"
+fi
+
+ON_AC_POWER=3D/usr/bin/on_ac_power
+# END configuration
=20
=20
 if [ ! -d "/etc/runlevels/${RUNLEVEL_AC}" ]
 then
-    logger "${0}: Runlevel ${RUNLEVEL_AC} does not exist. Aborting."
+    ${LOGGER} "${0}: Runlevel ${RUNLEVEL_AC} does not exist. Aborting."
     exit 1
 fi
=20
 if [ ! -d "/etc/runlevels/${RUNLEVEL_BATTERY}" ]
 then
-    logger "${0}: Runlevel ${RUNLEVEL_BATTERY} does not exist. Aborting.=
"
+    ${LOGGER} "${0}: Runlevel ${RUNLEVEL_BATTERY} does not exist. Aborti=
ng."
     exit 1
 fi
=20
-if on_ac_power
+if ${on_ac_power}
 then
-    if [[ "$(</var/lib/init.d/softlevel)" !=3D "${RUNLEVEL_AC}" ]]
+    if [[ "$(rc-status --runlevel)" !=3D "${RUNLEVEL_AC}" ]]
     then
-        logger "Switching to ${RUNLEVEL_AC} runlevel"
-         /sbin/rc ${RUNLEVEL_AC}
+        ${LOGGER} "Switching to ${RUNLEVEL_AC} runlevel"
+        /sbin/rc ${RUNLEVEL_AC}
     fi
-elif [[ "$(</var/lib/init.d/softlevel)" !=3D "${RUNLEVEL_BATTERY}" ]]
+elif [[ "$(rc-status --runlevel)" !=3D "${RUNLEVEL_BATTERY}" ]]
 then
-    logger "Switching to ${RUNLEVEL_BATTERY} runlevel"
+    ${LOGGER} "Switching to ${RUNLEVEL_BATTERY} runlevel"
     /sbin/rc ${RUNLEVEL_BATTERY}
 fi