rpms/apmud/devel apmud-1.0.0-fcntl.patch, NONE, 1.1 apmud-1.0.0-init.patch, NONE, 1.1 apmud.spec, NONE, 1.1 pmud-0.10-fixes.patch, NONE, 1.1 pmud-0.10-ydl.patch, NONE, 1.1 trackpad.init, NONE, 1.1 trackpad.sysconfig, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

David Woodhouse (dwmw2) fedora-extras-commits at redhat.com
Tue Feb 15 17:14:25 UTC 2005


Author: dwmw2

Update of /cvs/extras/rpms/apmud/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20441/devel

Modified Files:
	.cvsignore sources 
Added Files:
	apmud-1.0.0-fcntl.patch apmud-1.0.0-init.patch apmud.spec 
	pmud-0.10-fixes.patch pmud-0.10-ydl.patch trackpad.init 
	trackpad.sysconfig 
Log Message:
auto-import apmud-1.0.0-1 on branch devel from apmud-1.0.0-1.src.rpm

apmud-1.0.0-fcntl.patch:

--- NEW FILE apmud-1.0.0-fcntl.patch ---
--- apmud/pmud.c.orig	2005-02-13 19:06:41.000000000 +0000
+++ apmud/pmud.c	2005-02-13 19:07:48.000000000 +0000
@@ -367,7 +367,7 @@
 
 	chk(pmu_fd < 0, "Couldn't open " PMU_FILE " or " PMU_DEVFS_FILE);
 
-	chk((fl = fcntl(pmu_fd, F_GETFL, fl)) < 0, "fcntl(F_GETFL)");
+	chk((fl = fcntl(pmu_fd, F_GETFL, &fl)) < 0, "fcntl(F_GETFL)");
 
 	fl |= O_NONBLOCK;
 	chk(fcntl(pmu_fd, F_SETFL, fl) < 0, "fcntl(F_SETFL)");
@@ -1204,7 +1204,7 @@
 	chk(fcntl(fe, F_GETFL, &fl) < 0, "fcntl(F_GETFL)");
 
 	fl |= O_NONBLOCK;
-	chk(fcntl(fe, F_SETFL, &fl) < 0, "fcntl(F_SETFL)");
+	chk(fcntl(fe, F_SETFL, fl) < 0, "fcntl(F_SETFL)");
 
 	ss = malloc(sizeof(*ss));
 	if (ss == 0) 

apmud-1.0.0-init.patch:

--- NEW FILE apmud-1.0.0-init.patch ---
--- apmud/pmud.rc.orig	2005-02-13 19:12:05.000000000 +0000
+++ apmud/pmud.rc	2005-02-13 19:20:15.000000000 +0000
@@ -17,26 +17,60 @@
 # Source power daemon options
 [ -f /etc/sysconfig/power ] && . /etc/sysconfig/power
 
-# See how we were called.
-case "$1" in
-  start)
-	echo -n "Starting pmud daemon: "
+RETVAL=0
+
+start() {
+    RETVAL=1
+    if grep -i "PowerBook" /proc/cpuinfo >/dev/null; then
+	echo -n $"Starting pmud daemon: "
+        /usr/bin/trackpad notap &> /dev/null
 	daemon pmud $PMUD_FLAGS
+	RETVAL=$?
 	echo
-	touch /var/lock/subsys/pmud
-	;;
-  stop)
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/pmud
+    fi
+    return $RETVAL
+}
+
+stop() {
+    RETVAL=1
+    if grep -i "PowerBook" /proc/cpuinfo >/dev/null; then
 	echo -n "Stopping pmud daemon: "
 	killproc pmud
+	RETVAL=$?
 	echo
 	rm -f /var/lock/subsys/pmud
+    fi
+    return $RETVAL
+}
+
+# See how we were called.
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
 	;;
   status)
 	status pmud
+	RETVAL=$?
 	;;
+  restart|reload)
+        stop
+        start
+        RETVAL=$?
+        ;;
+  condrestart)
+        if [ -f /var/lock/subsys/pmud ]; then
+            stop
+            start
+            RETVAL=$?
+        fi
+        ;;
   *)
-	echo "Usage: pmud {start|stop|status}"
+	echo "Usage: pmud {start|stop|restart|condrestart|status}"
 	exit 1
 esac
 
-exit 0
+exit $RETVAL


--- NEW FILE apmud.spec ---
%define _prefix /usr

Name: apmud 
Version: 1.0.0
Release: 1
Summary: Power management daemon for Apple laptops.
Source0: http://linuxppc.jvc.nl/apmud-%{version}.tgz
Source1: trackpad.init
Source2: trackpad.sysconfig
Patch0: pmud-0.10-ydl.patch
Patch1: apmud-1.0.0-init.patch
Patch2: pmud-0.10-fixes.patch
Patch3: apmud-1.0.0-fcntl.patch
License: GPL
Group: Utilities/System
BuildRoot: %{_tmppath}/pmud-%{version}-buildroot
Prereq: chkconfig
Obsoletes: trackpad, pmud
ExclusiveArch: ppc

%description 
pmud is a daemon which periodically polls the PMU (power manager) and performs 
functions such as enabling or disabling devices appropriately when the power 
source changes. It can also be instructed to signal init(8) that a power-
failure has occured.  pmud works on Apple PowerBooks and iBooks.

A tool for configuring the trackpad on Apple PowerBooks and iBooks is
also included.  See /etc/sysconfig/trackpad.

Tools for enabling video mirroring for ATI Rage 128 Mobility (m3mirror)
and ATI Radeon Mobility (m6mirror) enabled PowerBooks are also included.
 
%prep
%setup -q -n apmud
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1

%build
make CFLAGS="$RPM_OPT_FLAGS"
make CFLAGS="$RPM_OPT_FLAGS" -C contrib/

%install
rm -fr $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/sbin
mkdir -p $RPM_BUILD_ROOT/usr/X11R6/bin
mkdir -p $RPM_BUILD_ROOT/usr/bin
mkdir -p $RPM_BUILD_ROOT/usr/sbin
mkdir -p $RPM_BUILD_ROOT/etc/power
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
mkdir -p $RPM_BUILD_ROOT/usr/share/man/man8

make PREFIX=$RPM_BUILD_ROOT install
make PREFIX=$RPM_BUILD_ROOT -C contrib/ install

cd $RPM_BUILD_ROOT/usr/bin; ln -s ../../sbin/snooze apm 

install -m755 %{SOURCE1} $RPM_BUILD_ROOT/etc/init.d/trackpad
install -m644 %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/trackpad

%clean
rm -rf $RPM_BUILD_ROOT

%post 
/sbin/chkconfig --add pmud
/sbin/chkconfig --add trackpad

%preun
/sbin/chkconfig --del pmud
/sbin/chkconfig --del trackpad

%files
%defattr(-,root,root)
%doc TODO BUGS README INSTALL CHANGES THANKS
/sbin/pmud
/sbin/snooze
/sbin/wakebay
/sbin/fblevel
%{_prefix}/sbin/m3mirror
%{_prefix}/sbin/m6mirror
%{_prefix}/bin/apm
%{_prefix}/bin/Batmon
%{_prefix}/bin/trackpad
%{_prefix}/X11R6/bin/xmouse
%config %attr(0755,root,root) /etc/power/pwrctl
%config(noreplace) %attr(0755,root,root) /etc/power/pwrctl-local
/etc/init.d/pmud 
/etc/init.d/trackpad
%config(noreplace) /etc/sysconfig/power
%config(noreplace) /etc/sysconfig/trackpad
%{_prefix}/share/man/man8/*

%changelog
* Sun Feb 13 2005 David Woodhouse <dwmw2 at infradead.org>
- Import into Fedora extras
- update pmud init script
- fix fcntl bugs

* Wed Aug 11 2004 Owen Stampflee <ostampflee at terrasoftsolutions.com>
- do a trackpad notap on init

* Tue May  8 2004 Owen Stampflee <ostampflee at terrasoftsolutions.com>
- linux 2.6 ugly hack patch

* Fri Aug 29 2003 Dan Burcaw <dburcaw at terrasoftsolutions.com>
- fixes wakeup problem reported by Stefan Bruda (#49)

* Fri Mar 21 2003 Dan Burcaw <dburcaw at terrasoftsolutions.com>
- stupid pmud

* Wed Mar 05 2003 Dan Burcaw <dburcaw at terrasoftsolutions.com>
- enable trackpad

* Wed Jan 05 2003 Dan Burcaw <dburcaw at terrasoftsolutions.com>
- updated trackpad init script

* Mon Nov 25 2002 Dan Burcaw <dburcaw at terrasoftsolutions.com>
- fixed trackpad init script

* Sat Oct 12 2002 Dan Burcaw <dburcaw at terrasoftsolutions.com>
- provide m3mirror and m6mirror
- trackpad compile warning cleanups

* Wed Oct 02 2002 Dan Burcaw <dburcaw at terrasoftsolutions.com>
- provide trackpad init script and sysconfig
- /etc/rc.d/init.d -> /etc/init.d

* Tue Jan 15 2002 Dan Burcaw <dburcaw at terrasoftsolutions.com>
- updated to 0.10-1
- added trackpad in
- build-rooted
- disable beep on sleep or wake

* Sun Feb 04 2001 Dan Burcaw <dburcaw at terrasoftsolutions.com>
- fixed the spec a bit more (updated files list)
- remove %pre for making /dev/{adb,pmu}; we now
  handle this in the dev package as it should be.

* Sun Feb 04 2001 Dan Burcaw <dburcaw at terrasoftsolutions.com>
- fixed the spec (removed packager, moved man pages where they
  belong)
- patched pmud for kernel 2.4 headers

* Mon Nov 20 2000 Hollis Blanchard <hollis at terrasoftsolutions.com>
- started changelog
- allowed for gzipped man pages
- fixed /usr/sbin/apm -> /var/tmp/pmud-buildroot/...
- removed redundant version/Version and release/Release macros
- removed %{release} from "Source: pmud-%{version}.%{release}.tar.gz"; release is for RPM revs (independant of original source)

pmud-0.10-fixes.patch:

--- NEW FILE pmud-0.10-fixes.patch ---
--- pmud-0.10/pmud.c.o	2003-08-29 13:07:52.000000000 -0600
+++ pmud-0.10/pmud.c	2003-08-29 13:08:16.000000000 -0600
@@ -510,7 +510,7 @@
 				fbon(1);
 				 run_program(POWERLEVEL_SCRIPT, 
 						 "lid-opened",
-						ac ? "ac" : "battery"
+						powermode ? "ac" : "battery"
 					);
 			}
 		}

pmud-0.10-ydl.patch:

--- NEW FILE pmud-0.10-ydl.patch ---
diff -uNr pmud-0.10.o/contrib/backlight.c pmud-0.10/contrib/backlight.c
--- pmud-0.10.o/contrib/backlight.c	2001-12-07 04:31:53.000000000 -0700
+++ pmud-0.10/contrib/backlight.c	2002-10-12 16:55:51.000000000 -0600
@@ -24,10 +24,10 @@
 #include <sys/types.h>
 #include <linux/ioctl.h>
 #include <linux/types.h>
-#include <asm/adb_mouse.h>
-#include <asm/cuda.h>
-#include <asm/adb.h>
-#include <asm/pmu.h>
+#include <linux/adb_mouse.h>
+#include <linux/cuda.h>
+#include <linux/adb.h>
+#include <linux/pmu.h>
 
 #undef DEBUG_SCAN
 #define DEBUG_REPLY
diff -uNr pmud-0.10.o/contrib/m3mirror.c pmud-0.10/contrib/m3mirror.c
--- pmud-0.10.o/contrib/m3mirror.c	1969-12-31 17:00:00.000000000 -0700
+++ pmud-0.10/contrib/m3mirror.c	2002-10-12 16:55:55.000000000 -0600
@@ -0,0 +1,75 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+
+#define ATY_MIRROR_LCD_ON	0x00000001
+#define ATY_MIRROR_CRT_ON	0x00000002
+
+#define __u32 unsigned int
+
+/* out param: u32*	backlight value: 0 to 15 */
+#define FBIO_ATY128_GET_MIRROR	_IOR('@', 1, sizeof(__u32*))
+/* in param: u32*	backlight value: 0 to 15 */
+#define FBIO_ATY128_SET_MIRROR	_IOW('@', 2, sizeof(__u32*))
+
+static void
+usage(void)
+{
+	printf("syntax: m3mirror [crt:0|1] [lcd:0|1]\n");
+}
+
+int main(int ac, char **av)
+{
+	int fd, rc, i;
+	unsigned long value, orig;
+
+	printf("ATI Rage M3 mirror tool, v0.1\n");
+	fd = open("/dev/fb0", 0);
+	if (fd < 0) {
+		perror("open /dev/fb0");
+		exit(1);
+	}
+	rc = ioctl(fd, FBIO_ATY128_GET_MIRROR, &value);
+	if (rc != 0) {
+		printf("error %d getting mirror value\n", rc);
+		goto bail;
+	}
+	printf("Mirror is currently: lcd: %s, crt: %s\n",
+		(value & ATY_MIRROR_LCD_ON) ? "on" : "off",
+		(value & ATY_MIRROR_CRT_ON) ? "on" : "off");
+	orig = value;
+	for(i=1; i<ac; i++) {
+		if (!strncmp(av[i], "lcd:", 4)) {
+			if (atoi((av[i])+4))
+				value |= ATY_MIRROR_LCD_ON;
+			else
+				value &= ~ATY_MIRROR_LCD_ON;
+		} else if (!strncmp(av[i], "crt:", 4)) {
+			if (atoi((av[i])+4))
+				value |= ATY_MIRROR_CRT_ON;
+			else
+				value &= ~ATY_MIRROR_CRT_ON;
+		} else {
+			usage();
+			rc = -EINVAL;
+			goto bail;
+		}
+	}
+	if (orig != value) {
+		rc = ioctl(fd, FBIO_ATY128_SET_MIRROR, &value);
+		if (rc != 0) {
+			printf("error %d setting mirror value\n", rc);
+			exit(rc);
+		}
+		printf("Mirror is now: lcd: %s, crt: %s\n",
+			(value & ATY_MIRROR_LCD_ON) ? "on" : "off",
+			(value & ATY_MIRROR_CRT_ON) ? "on" : "off");
+	}
+bail:
+	close(fd);	
+	exit(rc);
+}
diff -uNr pmud-0.10.o/contrib/m6mirror.c pmud-0.10/contrib/m6mirror.c
--- pmud-0.10.o/contrib/m6mirror.c	1969-12-31 17:00:00.000000000 -0700
+++ pmud-0.10/contrib/m6mirror.c	2002-10-12 16:55:55.000000000 -0600
@@ -0,0 +1,75 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/ioctl.h>
+
+#define ATY_RADEON_LCD_ON       0x00000001
+#define ATY_RADEON_CRT_ON       0x00000002
+
+#define __u32 unsigned int
+
+#define FBIO_RADEON_GET_MIRROR  _IOR('@', 3, sizeof(__u32*))
+#define FBIO_RADEON_SET_MIRROR  _IOW('@', 4, sizeof(__u32*))
+
+
+static void
+usage(void)
+{
+        printf("syntax: m6mirror [crt:0|1] [lcd:0|1]\n");
+}
+
+int main(int ac, char **av)
+{
+        int fd, rc, i;
+        unsigned long value, orig;
+
+        printf("ATI Radeon M6 mirror tool, v0.1\n");
+        fd = open("/dev/fb0", 0);
+        if (fd < 0) {
+                perror("open /dev/fb0");
+                exit(1);
+        }
+        rc = ioctl(fd, FBIO_RADEON_GET_MIRROR, &value);
+        if (rc != 0) {
+                printf("error %d getting mirror value\n", rc);
+                goto bail;
+        }
+        printf("Mirror is currently: lcd: %s, crt: %s\n",
+                (value & ATY_RADEON_LCD_ON) ? "on" : "off",
+                (value & ATY_RADEON_CRT_ON) ? "on" : "off");
+        orig = value;
+        for(i=1; i<ac; i++) {
+                if (!strncmp(av[i], "lcd:", 4)) {
+                        if (atoi((av[i])+4))
+                                value |= ATY_RADEON_LCD_ON;
+                        else
+                                value &= ~ATY_RADEON_LCD_ON;
+                } else if (!strncmp(av[i], "crt:", 4)) {
+                        if (atoi((av[i])+4))
+                                value |= ATY_RADEON_CRT_ON;
+                        else
+                                value &= ~ATY_RADEON_CRT_ON;
+                } else {
+                        usage();
+                        rc = -EINVAL;
+                        goto bail;
+                }
+        }
+        if (orig != value) {
+                rc = ioctl(fd, FBIO_RADEON_SET_MIRROR, &value);
+                if (rc != 0) {
+                        printf("error %d setting mirror value\n", rc);
+                        exit(rc);
+                }
+                printf("Mirror is now: lcd: %s, crt: %s\n",
+                        (value & ATY_RADEON_LCD_ON) ? "on" : "off",
+                        (value & ATY_RADEON_CRT_ON) ? "on" : "off");
+        }
+bail:
+        close(fd);
+        exit(rc);
+}
+
diff -uNr pmud-0.10.o/contrib/Makefile pmud-0.10/contrib/Makefile
--- pmud-0.10.o/contrib/Makefile	1969-12-31 17:00:00.000000000 -0700
+++ pmud-0.10/contrib/Makefile	2002-10-12 16:55:55.000000000 -0600
@@ -0,0 +1,25 @@
+CFLAGS = -Wall -O2
+PROGS = trackpad m3mirror m6mirror
+PREFIX = /
+
+all:	$(PROGS)
+
+trackpad: trackpad.c
+	$(CC) $(CFLAGS) -o trackpad trackpad.c
+
+fnset: fnset.c
+	$(CC) $(CFLAGS) -o fnset fnset.c
+
+m3mirror: m3mirror.c
+	$(CC) $(CFLAGS) -o m3mirror m3mirror.c
+
+m6mirror: m6mirror.c
+	$(CC) $(CFLAGS) -o m6mirror m6mirror.c
+
+install:
+	install -m 755 -c trackpad $(PREFIX)/usr/bin/trackpad
+	install -m 755 -c m3mirror $(PREFIX)/usr/sbin/m3mirror
+	install -m 755 -c m6mirror $(PREFIX)/usr/sbin/m6mirror
+
+clean:
+	rm -f $(PROGS) *.o
diff -uNr pmud-0.10.o/contrib/trackpad.c pmud-0.10/contrib/trackpad.c
--- pmud-0.10.o/contrib/trackpad.c	2001-12-07 04:31:54.000000000 -0700
+++ pmud-0.10/contrib/trackpad.c	2002-10-12 16:55:51.000000000 -0600
@@ -7,6 +7,8 @@
  *
  * 3/17/99 - Minor Fix: usage display used to leave /dev/adb open
  *
+ * 10/12/02 - Fixed warnings <dburcaw at terrasoftsolutions.com>
+ *
  * Pieces from mousehack, from numerous contributors...
  *
  */
@@ -16,9 +18,9 @@
 #include <unistd.h>
 #include <errno.h>
 #include <fcntl.h>
-#include <asm/adb_mouse.h>
-#include <asm/cuda.h>
-#include <asm/adb.h>
+#include <string.h>
+#include <linux/cuda.h>
+#include <linux/adb.h>
 
 //#define DEBUG
 
diff -uNr pmud-0.10.o/Makefile pmud-0.10/Makefile
--- pmud-0.10.o/Makefile	2001-12-15 14:57:47.000000000 -0700
+++ pmud-0.10/Makefile	2002-10-12 16:55:51.000000000 -0600
@@ -22,7 +22,8 @@
 #
 
 CFLAGS = -Wall -O2
-PROGS= pmud snooze wakebay fblevel xmouse
+PROGS = pmud snooze wakebay fblevel xmouse
+PREFIX = /
 
 all:	$(PROGS)
 
@@ -45,16 +46,22 @@
 	$(CC) $(CFLAGS) -c tcp.c
 
 install:
-	install -c pmud /sbin
-	install -c snooze /sbin
-	install -c wakebay /sbin
-	install -c fblevel /sbin
-	install -c xmouse /usr/X11R6/bin
-	install -c Batmon /usr/bin
-	install -c -D pwrctl /etc/power/pwrctl
-	cp pmud.rc /etc/rc.d/init.d/pmud
-	ln -s /sbin/snooze /usr/bin/apm
-	chkconfig --add pmud
+	install -m 755 -c pmud $(PREFIX)/sbin
+	install -m 755 -c snooze $(PREFIX)/sbin
+	install -m 755 -c wakebay $(PREFIX)/sbin
+	install -m 755 -c fblevel $(PREFIX)/sbin
+	install -m 755 -c xmouse $(PREFIX)/usr/X11R6/bin
+	install -m 755 -c Batmon $(PREFIX)/usr/bin
+	install -m 644 -c -D pwrctl $(PREFIX)/etc/power/pwrctl
+	install -m 644 -c -D pwrctl-local $(PREFIX)/etc/power/pwrctl-local
+	install -m 755 -c  pmud.rc $(PREFIX)/etc/init.d/pmud
+	install -m 644 -c power.conf $(PREFIX)/etc/sysconfig/power
+	cp pmud.8 $(PREFIX)/usr/share/man/man8
+	cp snooze.8 $(PREFIX)/usr/share/man/man8
+	cp fblevel.8 $(PREFIX)/usr/share/man/man8
+	cp batmon.8 $(PREFIX)/usr/share/man/man8
+	cp xmouse.8 $(PREFIX)/usr/share/man/man8
+
 
 clean:
 	rm -f $(PROGS) *.o
diff -uNr pmud-0.10.o/pmud.c pmud-0.10/pmud.c
--- pmud-0.10.o/pmud.c	2001-12-16 02:50:41.000000000 -0700
+++ pmud-0.10/pmud.c	2002-10-12 16:55:51.000000000 -0600
@@ -1011,7 +1011,7 @@
 	{
 		apm.battery_status = 2; /* critical */
 
-		beep(BEEP_TIME, BEEP_WARN);
+		//beep(BEEP_TIME, BEEP_WARN);
 
 		if(!(state&FLG_SIGPWR))
 		{
@@ -1029,7 +1029,7 @@
 
 			if (++critical_time >= critical_margin) 
 			{
-				beep(BEEP_TIME, BEEP_WARN);
+				//beep(BEEP_TIME, BEEP_WARN);
 
 				syslog(LOG_CRIT, "battery critically low: %s\n",
 					flags&FLG_SIGPWR ?
@@ -1385,7 +1385,7 @@
 	if(id >= 0)
 		ts = get_trackpad_settings(adb_fd, id);
 	
-	beep(BEEP_TIME, BEEP_OK);
+	//beep(BEEP_TIME, BEEP_OK);
 
 	if(flags&FLG_DEBUG)
 		syslog(LOG_DEBUG, "calling sync()");
@@ -1400,7 +1400,7 @@
 	else
 		syslog(LOG_INFO, "system awake again");
 
-	beep(BEEP_TIME, BEEP_OK);
+	//beep(BEEP_TIME, BEEP_OK);
 
 	if(id >= 0)
 		set_trackpad_settings(adb_fd, id, ts);
@@ -1506,8 +1506,8 @@
 
 static void bye(int ret, const char *msg)
 {
-	if(ret)
-		beep(BEEP_TIME, BEEP_ERR);
+	//if(ret)
+		//beep(BEEP_TIME, BEEP_ERR);
 
 	syslog(ret == EXIT_SUCCESS ? LOG_INFO : LOG_ERR, 
 		"daemon stopped (%s)",
diff -uNr pmud-0.10.o/power.conf pmud-0.10/power.conf
--- pmud-0.10.o/power.conf	2001-12-07 04:31:46.000000000 -0700
+++ pmud-0.10/power.conf	2002-10-12 16:55:51.000000000 -0600
@@ -17,7 +17,11 @@
 #                this does not put the machine to sleep as
 #                another SIGPWR needs to be send to init(8)
 #                when power is restored.
+# -u	       : use AF_UNIX sockets instead of TCP. Batmon does not
+#		 support this option.
 # -v           : print the version string of pmud.
+# -K	       : put machine to sleep when lid closed and no ac power.
+#		 If lid closed and on ac power, then only power off screen.
 # 
 # see also pmud(8)
 # -----------------------------------------------------------------------------


--- NEW FILE trackpad.init ---
#!/bin/sh
#
# trackpad	This shell script takes care configuring the trackpad
#
# chkconfig: 345 30 70
# description: set trackpad defaults from /etc/sysconfig/trackpad

# Source function library.
. /etc/init.d/functions

RETVAL=0

start() {
	if grep -i "PowerBook" /proc/cpuinfo >/dev/null; then
	   if [ -f /etc/sysconfig/trackpad -a -x /usr/bin/trackpad ]; then
  	      . /etc/sysconfig/trackpad
  	      if [ -n "$TRACKPAD_OPT" ]; then
                 action "Setting default trackpad options" \
      		     /usr/bin/trackpad $TRACKPAD_OPT
  	      fi
 	   fi
	fi
	RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/trackpad
	return $RETVAL
}

stop() {
	RETVAL=$?
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/trackpad
	return $RETVAL
}

# See how we were called.
case "$1" in
  start)
	start
        ;;
  stop)
	stop
        ;;
  status)
	status trackpad 
	RETVAL=$?
	;;
  restart|reload)
	stop
	start
	RETVAL=$?
	;;
  condrestart)
	if [ -f /var/lock/subsys/trackpad ]; then
	    stop
	    start
	    RETVAL=$?
	fi
	;;
  *)
        echo $"Usage: $0 {start|stop|restart|condrestart|status}"
        exit 1
esac

exit $RETVAL


--- NEW FILE trackpad.sysconfig ---
# The following trackpad option gets run at startup
# by /etc/init.d/trackpad.  The available options are:
# notap, tap, drag, lock 
TRACKPAD_OPT=notap


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/apmud/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	15 Feb 2005 17:12:10 -0000	1.1
+++ .cvsignore	15 Feb 2005 17:14:23 -0000	1.2
@@ -0,0 +1 @@
+apmud-1.0.0.tgz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/apmud/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	15 Feb 2005 17:12:10 -0000	1.1
+++ sources	15 Feb 2005 17:14:23 -0000	1.2
@@ -0,0 +1 @@
+51f3d8a65e92d26ceee7b2e9e06773d3  apmud-1.0.0.tgz




More information about the fedora-extras-commits mailing list