rpms/i8kutils/devel i8k.init, NONE, 1.1 i8k.sysconfig, NONE, 1.1 i8kutils.spec, 1.11, 1.12 i8kbuttons.init, 1.7, NONE

Matthias Saou (thias) fedora-extras-commits at redhat.com
Fri Jun 30 14:43:31 UTC 2006


Author: thias

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

Modified Files:
	i8kutils.spec 
Added Files:
	i8k.init i8k.sysconfig 
Removed Files:
	i8kbuttons.init 
Log Message:
Rename service to make more sense and no longer start i8kbuttons daemon by default since it's not required on modern hardware and only confuses users (#192345).



--- NEW FILE i8k.init ---
#!/bin/bash
#
# i8k          Make the system information and fan control available on Dell
#              laptops. Also enable multimedia buttons (volume up/down, mute)
#              usage on older laptops.
#
# chkconfig: 345 10 90
# description: Make the system information and fan control available on Dell
#              laptops. Also enable multimedia buttons (volume up/down, mute)
#              usage on older laptops.

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

# Source configuration (ENABLE_I8KBUTTONS)
. /etc/sysconfig/i8k

prog=i8kbuttons
amixer=/usr/bin/amixer
amount="10%"
module=i8k

RETVAL=0

start() {
	echo -n $"Loading $module kernel module: "
	if /sbin/modprobe i8k force=1 &>/dev/null; then
		echo_success
		RETVAL=0
		echo
	else
		echo_failure
		RETVAL=1
		echo
	fi

	# Start daemon only if ENABLE_I8KBUTTONS was set by the user
	if [ "${ENABLE_I8KBUTTONS}" = "yes" ]; then
		echo -n $"Starting $prog: "
		# If it's already running, then fail
		if pidofproc $prog &>/dev/null; then
			echo_failure
			RETVAL=1
		else
			$prog --up "$amixer -q set Master $amount+" --down "$amixer -q set Master $amount-" --mute "$amixer -q set Master 0" &
			echo_success
			touch /var/lock/subsys/i8k
			RETVAL=0
		fi
		echo
	fi
}

stop() {
	# Don't bother unloading the module, it doesn't make much sense...

	# Stop daemon only if ENABLE_I8KBUTTONS was set by the user or if
	# it is found to probably be running...
	if [ "${ENABLE_I8KBUTTONS}" = "yes" -o -f /var/lock/subsys/i8k ]; then
		echo -n $"Stopping $prog: "
		killproc $prog
		RETVAL=$?
		echo
		[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/i8k
	fi
}

i8kstatus() {
	# Check if the i8k module is leaded
	if [ -n "`lsmod | grep ^$module`" ]; then
		echo $"Module $module is loaded."
	else
		echo $"Module $module isn't loaded."
	fi
	# Status daemon only if ENABLE_I8KBUTTONS was set by the user
	if [ "${ENABLE_I8KBUTTONS}" = "yes" ]; then
		status $prog
	fi
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  status)
	i8kstatus
	RETVAL=$?
	;;
  restart)
	stop
	start
	;;
  *)
	echo $"Usage: $0 {start|stop|restart|status}"
	exit 1
esac

exit $RETVAL



--- NEW FILE i8k.sysconfig ---
# Set this to "yes" if you require i8kbuttons for multimedia keys to work
ENABLE_I8KBUTTONS=no


Index: i8kutils.spec
===================================================================
RCS file: /cvs/extras/rpms/i8kutils/devel/i8kutils.spec,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- i8kutils.spec	21 Apr 2006 09:28:42 -0000	1.11
+++ i8kutils.spec	30 Jun 2006 14:43:30 -0000	1.12
@@ -4,13 +4,14 @@
 Summary: Dell laptop (Inspiron 8000 and others) SMM BIOS support tools
 Name: i8kutils
 Version: 1.25
-Release: 8%{?dist}
+Release: 10%{?dist}
 License: GPL
 Group: System Environment/Base
 URL: http://people.debian.org/~dz/i8k/
 Source0: http://people.debian.org/~dz/i8k/i8kutils_%{version}.tar.gz
 Source1: http://www.coding-zone.com/i8krellm-%{gkrellmpluginver}.tar.gz
-Source2: i8kbuttons.init
+Source2: i8k.init
+Source3: i8k.sysconfig
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 Requires: alsa-utils, gkrellm >= 2.0.0, tcl, tk
 Requires(post): /sbin/chkconfig
@@ -53,17 +54,27 @@
     %{__cp} -a i8krellm.so %{buildroot}%{_libdir}/gkrellm2/plugins/
 popd
 
-%{__install} -D -m 0755 %{SOURCE2} \
-    %{buildroot}%{_sysconfdir}/rc.d/init.d/i8kbuttons
+%{__install} -p -D -m 0755 %{SOURCE2} \
+    %{buildroot}%{_sysconfdir}/rc.d/init.d/i8k
+
+%{__install} -p -D -m 0644 %{SOURCE3} \
+    %{buildroot}%{_sysconfdir}/sysconfig/i8k
 
 
 %post
-/sbin/chkconfig --add i8kbuttons
+/sbin/chkconfig --add i8k
+# This is the old service name... if we just updated, stop. Don't bother
+# starting the new service since its default configuration only loads the
+# kernel module, which is already loaded in this case!
+/sbin/chkconfig --del i8kbuttons &>/dev/null || :
+if [ -f /var/lock/subsys/i8kbuttons ]; then
+    /sbin/service i8kbuttons stop &>/dev/null
+fi
 
 %preun
 if [ $1 -eq 0 ]; then
-    /sbin/service i8kbuttons stop &>/dev/null
-    /sbin/chkconfig --del i8kbuttons
+    /sbin/service i8k stop &>/dev/null
+    /sbin/chkconfig --del i8k
 fi
 
 
@@ -76,13 +87,27 @@
 %doc README.i8kutils i8kmon.conf
 %doc i8krellm-%{gkrellmpluginver}/AUTHORS i8krellm-%{gkrellmpluginver}/README
 %doc i8krellm-%{gkrellmpluginver}/Changelog
-%{_sysconfdir}/rc.d/init.d/i8kbuttons
+%{_sysconfdir}/rc.d/init.d/i8k
+%config(noreplace) %{_sysconfdir}/sysconfig/i8k
 %{_bindir}/*
 %{_libdir}/gkrellm2/plugins/*
 %{_mandir}/man1/*
 
 
 %changelog
+* Fri Jun 30 2006 Matthias Saou <http://freshrpms.net/> 1.25-10
+- Rename init script to i8k since we don't only enable buttons.
+- Re-enable init script by default since all it does is load the i8k module.
+- Enable restart when upgrading from old packages (i8kbuttons -> i8k).
+- Have service only load i8k module by default (the typical for the most
+  recent Dell laptops like the Latitude Dx10 and Dx20), and leave it up to
+  the user to enable the special buttons daemon (only useful on older laptops).
+- Add sysconfig file for users to enable i8kbuttons (only) if needed.
+
+* Thu Jun  1 2006 Matthias Saou <http://freshrpms.net/> 1.25-9
+- Disable the i8kbuttons init script by default since it is no longer needed
+  on recent Dell laptops (multimedia keys are "normal" keys), although.
+
 * Fri Apr 21 2006 Matthias Saou <http://freshrpms.net/> 1.25-8
 - Add tcl requirement too... (#189567).
 


--- i8kbuttons.init DELETED ---




More information about the fedora-extras-commits mailing list