From: <kr...@us...> - 2006-11-14 02:46:56
|
Revision: 457 http://svn.sourceforge.net/astlinux/?rev=457&view=rev Author: krisk84 Date: 2006-11-13 18:46:53 -0800 (Mon, 13 Nov 2006) Log Message: ----------- final apcupsd fixes Modified Paths: -------------- trunk/package/apcupsd/apccontrol trunk/package/apcupsd/apcupsd.init trunk/package/apcupsd/apcupsd.mk trunk/target/generic/target_skeleton/stat/etc/rc.conf Added Paths: ----------- trunk/target/generic/target_skeleton/bin/ trunk/target/generic/target_skeleton/bin/mail trunk/target/generic/target_skeleton/usr/bin/ trunk/target/generic/target_skeleton/usr/bin/wall Modified: trunk/package/apcupsd/apccontrol =================================================================== --- trunk/package/apcupsd/apccontrol 2006-11-10 20:02:27 UTC (rev 456) +++ trunk/package/apcupsd/apccontrol 2006-11-14 02:46:53 UTC (rev 457) @@ -15,15 +15,15 @@ # # These variables are needed for set up the autoconf other variables. # -prefix=/home/kris/projects/astlinux-trunk/build_i586/staging_dir +prefix=/ exec_prefix=/usr APCPID=/var/run/apcupsd.pid -APCUPSD=/sbin/apcupsd -SHUTDOWN=/sbin/shutdown +APCUPSD=/usr/sbin/apcupsd +SHUTDOWN=/sbin/poweroff SCRIPTSHELL=/bin/sh -SCRIPTDIR=/etc -WALL=wall +SCRIPTDIR=/etc/apcupsd +WALL=logger # # Concatenate all output from this script to the events file Modified: trunk/package/apcupsd/apcupsd.init =================================================================== --- trunk/package/apcupsd/apcupsd.init 2006-11-10 20:02:27 UTC (rev 456) +++ trunk/package/apcupsd/apcupsd.init 2006-11-14 02:46:53 UTC (rev 457) @@ -6,6 +6,18 @@ if [ "$UPSTYPE" -a "$UPSCABLE" ] then +mkdir -p /tmp/etc/apcupsd + +if [ -d /stat/etc/apcupsd ] +then +cp -a /stat/etc/apcupsd/* /tmp/etc/apcupsd/ +fi + +if [ -d /mnt/kd/apcupsd ] +then +cp -a /mnt/kd/apcupsd/* /tmp/etc/apcupsd/ +fi + if [ "$UPSDEVICE" ] then UDEV="$UPSDEVICE" @@ -31,7 +43,8 @@ mknod /dev/usb/hid/hiddev15 c 180 111 fi -echo "UPSNAME $HOSTNAME-ups +echo "## apcupsd.conf v1.1 ## +UPSNAME $HOSTNAME-ups UPSCABLE $UPSCABLE UPSTYPE $UPSTYPE DEVICE $UDEV @@ -54,12 +67,12 @@ STATTIME 0 STATFILE /var/log/apcupsd.status LOGSTATS off -DATATIME 0" > /tmp/etc/apcupsd.conf +DATATIME 0" > /tmp/etc/apcupsd/apcupsd.conf fi } start () { -if [ -r /etc/apcupsd.conf ] +if [ -r /etc/apcupsd/apcupsd.conf ] then echo "Starting apcupsd..." /usr/sbin/apcupsd @@ -67,10 +80,10 @@ } stop () { -if `ps | grep -q apcupsd` +if [ -r /var/run/apcupsd.pid ] then echo "Stopping apcupsd..." -killall apcupsd 2> /dev/null +kill `cat /var/run/apcupsd.pid` fi } Modified: trunk/package/apcupsd/apcupsd.mk =================================================================== --- trunk/package/apcupsd/apcupsd.mk 2006-11-10 20:02:27 UTC (rev 456) +++ trunk/package/apcupsd/apcupsd.mk 2006-11-14 02:46:53 UTC (rev 457) @@ -28,9 +28,10 @@ --target=$(GNU_TARGET_NAME) \ --host=$(GNU_TARGET_NAME) \ --build=$(GNU_HOST_NAME) \ - --prefix=$(STAGING_DIR) \ + --prefix=/usr \ --exec-prefix=/usr \ - --sysconfdir=/etc \ + --sbindir=/usr/sbin \ + --sysconfdir=/etc/apcupsd \ --enable-usb \ ); touch $(APCUPSD_DIR)/.configured; @@ -39,10 +40,17 @@ $(MAKE1) CC=$(TARGET_CC) -C $(APCUPSD_DIR) $(TARGET_DIR)/$(APCUPSD_TARGET_BINARY): $(APCUPSD_DIR)/$(APCUPSD_BINARY) - $(MAKE1) -C $(APCUPSD_DIR) install - $(INSTALL -D -m 0755 package/apcupsd/apcupsd.init $(TARGET_DIR)/etc/init.d/apcupsd - ln -sf /tmp/etc/apcupsd.conf $(TARGET_DIR)/etc/apcupsd.conf + mkdir -p $(STAGING_DIR)/etc/rc.d/init.d + $(MAKE1) -C $(APCUPSD_DIR) DESTDIR=$(STAGING_DIR) install + $(INSTALL) -D -m 0755 package/apcupsd/apcupsd.init $(TARGET_DIR)/etc/init.d/apcupsd + mkdir -p $(TARGET_DIR)/stat/etc/apcupsd + -rm $(STAGING_DIR)/etc/apcupsd/*.orig $(STAGING_DIR)/etc/apcupsd/*.new + cp -a $(STAGING_DIR)/etc/apcupsd/* $(TARGET_DIR)/stat/etc/apcupsd/ + $(INSTALL) -D -m 0755 package/apcupsd/apccontrol $(TARGET_DIR)/stat/etc/apcupsd/apccontrol + ln -sf /tmp/etc/apcupsd $(TARGET_DIR)/etc/apcupsd + $(INSTALL) -D -m 0755 $(STAGING_DIR)/usr/sbin/apcaccess $(TARGET_DIR)/usr/sbin/apcaccess $(INSTALL) -D -m 0755 $(STAGING_DIR)/$(APCUPSD_TARGET_BINARY) $(TARGET_DIR)/$(APCUPSD_TARGET_BINARY) + $(STRIP) $(TARGET_DIR)/usr/sbin/apcaccess $(STRIP) $(TARGET_DIR)/$(APCUPSD_TARGET_BINARY) apcupsd: uclibc libusb $(TARGET_DIR)/$(APCUPSD_TARGET_BINARY) Added: trunk/target/generic/target_skeleton/bin/mail =================================================================== --- trunk/target/generic/target_skeleton/bin/mail (rev 0) +++ trunk/target/generic/target_skeleton/bin/mail 2006-11-14 02:46:53 UTC (rev 457) @@ -0,0 +1,4 @@ +#!/bin/sh +#Mail wrapper for things that insist on calling /bin/mail... +#For now, just /dev/null everything +echo -n "" Property changes on: trunk/target/generic/target_skeleton/bin/mail ___________________________________________________________________ Name: svn:executable + * Modified: trunk/target/generic/target_skeleton/stat/etc/rc.conf =================================================================== --- trunk/target/generic/target_skeleton/stat/etc/rc.conf 2006-11-10 20:02:27 UTC (rev 456) +++ trunk/target/generic/target_skeleton/stat/etc/rc.conf 2006-11-14 02:46:53 UTC (rev 457) @@ -303,6 +303,17 @@ #LED_NUM=3 #LED_TIME=1 +##APC UPS Support via apcupsd +##If you have built AstLinux with apcupsd support, you can monitor and safely shut down +##the system (as well as perform other actions) upon the loss of power when connected to +##a UPS that monitors this. Here you can specify the UPS type and UPS cable. I like +##usb because it is very simple to configure. +##If you are using something OTHER than usb, you can specify the device node to +##communicate with the device using UPSDEVICE. IF YOU ARE USING USB, LEAVE THIS BLANK!! +#UPSTYPE="usb" +#UPSCABLE="usb" +#UPSDEVICE="" + ###Misc. AstLinux ##AstBack Configuration Added: trunk/target/generic/target_skeleton/usr/bin/wall =================================================================== --- trunk/target/generic/target_skeleton/usr/bin/wall (rev 0) +++ trunk/target/generic/target_skeleton/usr/bin/wall 2006-11-14 02:46:53 UTC (rev 457) @@ -0,0 +1,4 @@ +#!/bin/sh +#wrapper script for wall +#/dev/null everything for now +echo -n "" Property changes on: trunk/target/generic/target_skeleton/usr/bin/wall ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |