[Glibc-bsd-commits] r3900 - in trunk/freebsd-utils/debian: . patches

Robert Millan rmh at alioth.debian.org
Fri Nov 25 20:16:43 UTC 2011


Author: rmh
Date: 2011-11-25 20:16:43 +0000 (Fri, 25 Nov 2011)
New Revision: 3900

Added:
   trunk/freebsd-utils/debian/powerd.dirs
   trunk/freebsd-utils/debian/powerd.init
   trunk/freebsd-utils/debian/powerd.install
   trunk/freebsd-utils/debian/powerd.manpages
Modified:
   trunk/freebsd-utils/debian/changelog
   trunk/freebsd-utils/debian/control
   trunk/freebsd-utils/debian/copyright
   trunk/freebsd-utils/debian/patches/001_unused.diff
   trunk/freebsd-utils/debian/patches/032_libbsd_overlay.diff
   trunk/freebsd-utils/debian/rules
Log:
Add powerd package.

Modified: trunk/freebsd-utils/debian/changelog
===================================================================
--- trunk/freebsd-utils/debian/changelog	2011-11-25 18:52:39 UTC (rev 3899)
+++ trunk/freebsd-utils/debian/changelog	2011-11-25 20:16:43 UTC (rev 3900)
@@ -1,7 +1,6 @@
 freebsd-utils (8.2+ds3-13) UNRELEASED; urgency=low
 
-  * New snapshot (include powerd, move GEOM from 000_sys_geom.diff to orig
-    tarball).
+  * Add powerd package.
 
  -- Robert Millan <rmh at debian.org>  Fri, 25 Nov 2011 19:17:03 +0100
 

Modified: trunk/freebsd-utils/debian/control
===================================================================
--- trunk/freebsd-utils/debian/control	2011-11-25 18:52:39 UTC (rev 3899)
+++ trunk/freebsd-utils/debian/control	2011-11-25 20:16:43 UTC (rev 3900)
@@ -251,3 +251,12 @@
  .
  This version of PF has been ported to FreeBSD by the FreeBSD project, and
  subsequently to GNU/kFreeBSD by the Debian project.
+
+Package: powerd
+Priority: optional
+Section: admin
+Architecture: kfreebsd-any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: System utility for power control and energy saving
+ The powerd utility monitors the system state and sets various power control
+ options accordingly, such as CPU frequency and power management modes.

Modified: trunk/freebsd-utils/debian/copyright
===================================================================
--- trunk/freebsd-utils/debian/copyright	2011-11-25 18:52:39 UTC (rev 3899)
+++ trunk/freebsd-utils/debian/copyright	2011-11-25 20:16:43 UTC (rev 3900)
@@ -3077,3 +3077,30 @@
     LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     SUCH DAMAGE.
+
+    --
+
+    Copyright (c) 2004 Colin Percival
+    Copyright (c) 2005 Nate Lawson
+    All rights reserved.
+    
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted providing that the following conditions
+    are met:
+    1. Redistributions of source code must retain the above copyright
+       notice, this list of conditions and the following disclaimer.
+    2. Redistributions in binary form must reproduce the above copyright
+       notice, this list of conditions and the following disclaimer in the
+       documentation and/or other materials provided with the distribution.
+    
+    THIS SOFTWARE IS PROVIDED BY THE AUTHOR``AS IS'' AND ANY EXPRESS OR
+    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+    ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+    POSSIBILITY OF SUCH DAMAGE.

Modified: trunk/freebsd-utils/debian/patches/001_unused.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/001_unused.diff	2011-11-25 18:52:39 UTC (rev 3899)
+++ trunk/freebsd-utils/debian/patches/001_unused.diff	2011-11-25 20:16:43 UTC (rev 3900)
@@ -2324,3 +2324,14 @@
  {
    int pid, status;
    pid = wait4(-1, &status, WNOHANG, (struct rusage*)0);
+--- a/usr.sbin/powerd/powerd.c
++++ b/usr.sbin/powerd/powerd.c
+@@ -419,7 +419,7 @@
+ }
+ 
+ static void
+-handle_sigs(int __unused sig)
++handle_sigs(int __attribute__((unused)) sig)
+ {
+ 
+ 	exit_requested = 1;

Modified: trunk/freebsd-utils/debian/patches/032_libbsd_overlay.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/032_libbsd_overlay.diff	2011-11-25 18:52:39 UTC (rev 3899)
+++ trunk/freebsd-utils/debian/patches/032_libbsd_overlay.diff	2011-11-25 20:16:43 UTC (rev 3900)
@@ -122,3 +122,21 @@
  #include <stdlib.h>
  #include <string.h>
  #include <unistd.h>
+--- a/usr.sbin/powerd/powerd.c
++++ b/usr.sbin/powerd/powerd.c
+@@ -25,6 +25,7 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#include <stdlib.h>
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD$");
+ 
+@@ -42,7 +43,6 @@
+ #include <libutil.h>
+ #include <signal.h>
+ #include <stdio.h>
+-#include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+ 

Added: trunk/freebsd-utils/debian/powerd.dirs
===================================================================
--- trunk/freebsd-utils/debian/powerd.dirs	                        (rev 0)
+++ trunk/freebsd-utils/debian/powerd.dirs	2011-11-25 20:16:43 UTC (rev 3900)
@@ -0,0 +1 @@
+usr/sbin

Added: trunk/freebsd-utils/debian/powerd.init
===================================================================
--- trunk/freebsd-utils/debian/powerd.init	                        (rev 0)
+++ trunk/freebsd-utils/debian/powerd.init	2011-11-25 20:16:43 UTC (rev 3900)
@@ -0,0 +1,130 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:		powerd
+# Required-Start:	
+# Required-Stop:	
+# Should-Start:		$syslog
+# Should-Stop:		$syslog
+# Default-Start:	2 3 4 5 S
+# Default-Stop:		0 1 6
+# Short-Description:	System power control utility
+# Description:		The powerd utility monitors the system state and sets
+#			various power control options accordingly, such as CPU
+#			frequency and power management modes.
+### END INIT INFO
+
+PATH=/sbin:/bin
+DESC="System power control utility"
+NAME=powerd
+DAEMON=/usr/sbin/powerd
+DAEMON_ARGS=""
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x $DAEMON ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+	# Return
+	#   0 if daemon has been started
+	#   1 if daemon was already running
+	#   2 if daemon could not be started
+	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
+		|| return 1
+	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
+		$DAEMON_ARGS \
+		|| return 2
+	# Add code here, if necessary, that waits for the process to be ready
+	# to handle requests from services started subsequently which depend
+	# on this one.  As a last resort, sleep for some time.
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+	# Return
+	#   0 if daemon has been stopped
+	#   1 if daemon was already stopped
+	#   2 if daemon could not be stopped
+	#   other if a failure occurred
+	start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+	RETVAL="$?"
+	[ "$RETVAL" = 2 ] && return 2
+	# Wait for children to finish too if this is a daemon that forks
+	# and if the daemon is only ever run from this initscript.
+	# If the above conditions are not satisfied then add some other code
+	# that waits for the process to drop all resources that could be
+	# needed by services started subsequently.  A last resort is to
+	# sleep for some time.
+	start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+	[ "$?" = 2 ] && return 2
+	# Many daemons don't delete their pidfiles when they exit.
+	rm -f $PIDFILE
+	return "$RETVAL"
+}
+
+case "$1" in
+  start)
+    log_daemon_msg "Starting $DESC " "$NAME"
+    do_start
+    case "$?" in
+		0|1) log_end_msg 0 ;;
+		2) log_end_msg 1 ;;
+	esac
+  ;;
+  stop)
+	log_daemon_msg "Stopping $DESC" "$NAME"
+	do_stop
+	case "$?" in
+		0|1) log_end_msg 0 ;;
+		2) log_end_msg 1 ;;
+	esac
+	;;
+  status)
+       status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+       ;;
+  restart|force-reload)
+	#
+	# If the "reload" option is implemented then remove the
+	# 'force-reload' alias
+	#
+	log_daemon_msg "Restarting $DESC" "$NAME"
+	do_stop
+	case "$?" in
+	  0|1)
+		do_start
+		case "$?" in
+			0) log_end_msg 0 ;;
+			1) log_end_msg 1 ;; # Old process is still running
+			*) log_end_msg 1 ;; # Failed to start
+		esac
+		;;
+	  *)
+	  	# Failed to stop
+		log_end_msg 1
+		;;
+	esac
+	;;
+  *)
+	echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
+	exit 3
+	;;
+esac
+
+:

Added: trunk/freebsd-utils/debian/powerd.install
===================================================================
--- trunk/freebsd-utils/debian/powerd.install	                        (rev 0)
+++ trunk/freebsd-utils/debian/powerd.install	2011-11-25 20:16:43 UTC (rev 3900)
@@ -0,0 +1 @@
+usr.sbin/powerd/powerd		/usr/sbin/

Added: trunk/freebsd-utils/debian/powerd.manpages
===================================================================
--- trunk/freebsd-utils/debian/powerd.manpages	                        (rev 0)
+++ trunk/freebsd-utils/debian/powerd.manpages	2011-11-25 20:16:43 UTC (rev 3900)
@@ -0,0 +1 @@
+usr.sbin/powerd/powerd.8

Modified: trunk/freebsd-utils/debian/rules
===================================================================
--- trunk/freebsd-utils/debian/rules	2011-11-25 18:52:39 UTC (rev 3899)
+++ trunk/freebsd-utils/debian/rules	2011-11-25 20:16:43 UTC (rev 3900)
@@ -90,7 +90,7 @@
 	$(MAKE) -C lib
 	touch $@
 
-build-arch: freebsd-utils gbde geli kbdcontrol vidcontrol kldutils freebsd-net-tools freebsd-nfs-utils freebsd-ppp
+build-arch: freebsd-utils gbde geli kbdcontrol vidcontrol kldutils freebsd-net-tools freebsd-nfs-utils freebsd-ppp powerd
 
 freebsd-utils: freebsd-utils-stamp
 freebsd-utils-stamp: $(RPCHDRS)
@@ -194,6 +194,11 @@
 	$(PMAKE) -C usr.sbin/nfsd
 	touch $@
 
+powerd: powerd-stamp
+powerd-stamp:
+	$(PMAKE) -C usr.sbin/powerd
+	touch $@
+
 build-indep: build-indep-stamp
 build-indep-stamp:
 	touch $@
@@ -271,6 +276,7 @@
 	$(PMAKE) -C usr.sbin/rpc.lockd clean
 	$(PMAKE) -C usr.sbin/mountd clean
 	$(PMAKE) -C usr.sbin/nfsd clean
+	$(PMAKE) -C usr.sbin/powerd clean
 
 	$(RM) $(RPCHDRS)
 
@@ -310,6 +316,7 @@
 	dh_installinit -pdevd -- start 03 S . stop 01 0 1 6 .
 	dh_installinit -pkldutils --no-start -- start 12 S .
 	dh_installinit -pkbdcontrol -- start 20 S .
+	dh_installinit -ppowerd -- start 20 2 3 4 5 S . stop 80 0 1 6 .
 	dh_installinit -pfreebsd-ppp -- start 20 2 3 4 5 . stop 80 0 1 6 .
 	dh_installinit -pfreebsd-nfs-common --name=rpc.statd -- start 20 2 3 4 5 S . stop 20 0 1 6 .
 	dh_installinit -pfreebsd-nfs-common --name=rpc.lockd -- start 20 2 3 4 5 S . stop 20 0 1 6 .




More information about the Glibc-bsd-commits mailing list