[Debian-eeepc-commits] [SCM] Maintenance of eeepc-acpi-scripts debian package branch, master, updated. 25cd68ba345f60502ffec782c5f13d0618b78d75

Darren Salt linux at youmustbejoking.demon.co.uk
Sun Mar 29 02:02:18 UTC 2009


The following commit has been merged in the master branch:
commit 25cd68ba345f60502ffec782c5f13d0618b78d75
Author: Darren Salt <linux at youmustbejoking.demon.co.uk>
Date:   Sun Mar 29 00:16:49 2009 +0000

    Switch to using udev for caching audio control names etc.
    (modprobe-post-install support was removed in alsa-base 1.0.19-1.)
    
    We currently run the cache script twice, since the first run during boot
    (from a udev RUN action) is too early: /var is either unavailable or mounted
    read-only.

diff --git a/debian/dirs b/debian/dirs
index ad38e46..f0bb760 100644
--- a/debian/dirs
+++ b/debian/dirs
@@ -3,6 +3,7 @@ etc/acpi/actions
 etc/acpi/events
 etc/acpi/lib
 etc/modprobe.d
-etc/alsa/modprobe-post-install.d
+etc/udev/rules.d
+lib/udev
 usr/share/eeepc-acpi-scripts
 var/cache/eeepc-acpi-scripts
diff --git a/debian/eeepc-acpi-scripts.init b/debian/eeepc-acpi-scripts.init
index 1fa8f4f..7927e7c 100644
--- a/debian/eeepc-acpi-scripts.init
+++ b/debian/eeepc-acpi-scripts.init
@@ -48,6 +48,15 @@ case "$1" in
         ;;
     esac
 
+    # Run our udev action now.
+    # Running it when udev is started is too early; if we can avoid running
+    # that too early (we wait on something which indicates when /var is
+    # writable) then we can remove this.
+
+    log_action_begin_msg 'Initialising eeepc-acpi-scripts'
+    /lib/udev/eeepc-acpi-scripts - || log_failure_msg
+    log_action_end_msg 0
+
     # Now load the modules. We ignore failure since it's possible that
     # they're built into the running kernel.
 
diff --git a/debian/rules b/debian/rules
index 54ef99b..22883a9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -32,8 +32,9 @@ install: build
 	install -m 0755 etc/acpi/actions/* $(TMP)/etc/acpi/actions
 	install -m 0644 etc/acpi/events/* $(TMP)/etc/acpi/events
 	install -m 0644 etc/acpi/lib/* $(TMP)/etc/acpi/lib
-	install -m 0755 etc/alsa/modprobe-post-install.d/* $(TMP)/etc/alsa/modprobe-post-install.d
 	install -m 0644 etc/modprobe.d/* $(TMP)/etc/modprobe.d
+	install -m 0644 etc/udev/rules.d/* $(TMP)/etc/udev/rules.d
+	install -m 0755 lib/udev/* $(TMP)/lib/udev
 	install -m 0644 functions.sh $(TMP)/usr/share/$(PKG)/
 
 binary-indep: build install
diff --git a/etc/udev/rules.d/z60_eeepc-acpi-scripts.rules b/etc/udev/rules.d/z60_eeepc-acpi-scripts.rules
new file mode 100644
index 0000000..05ae01a
--- /dev/null
+++ b/etc/udev/rules.d/z60_eeepc-acpi-scripts.rules
@@ -0,0 +1 @@
+KERNEL=="controlC[0-7]", ACTION=="add", RUN+="/lib/udev/eeepc-acpi-scripts"
diff --git a/etc/alsa/modprobe-post-install.d/eeepc-acpi-scripts b/lib/udev/eeepc-acpi-scripts
similarity index 71%
rename from etc/alsa/modprobe-post-install.d/eeepc-acpi-scripts
rename to lib/udev/eeepc-acpi-scripts
index 65380b4..4f24d7a 100644
--- a/etc/alsa/modprobe-post-install.d/eeepc-acpi-scripts
+++ b/lib/udev/eeepc-acpi-scripts
@@ -1,4 +1,7 @@
 #! /bin/sh
+(
+#. /lib/udev/hotplug.functions
+#wait_for_file ... something which will indicate /var being r/w?
 . /etc/acpi/lib/sound.sh
 
 SOUND_LABEL=
@@ -16,6 +19,7 @@ echo DEF_SOUND_SWITCH=\'"$(echo "$SOUND_SWITCH" | sed -e "s/'/'\\''/g")"\'
 echo DEF_SOUND_SWITCH_EXCLUSIVE=\'"$(echo "$SOUND_SWITCH_EXCLUSIVE" | sed -e "s/'/'\\''/g")"\'
 echo DEF_SOUND_VOLUME_STEP=\'"$(echo "$SOUND_VOLUME_STEP" | sed -e "s/'/'\\''/g")"\'
 )"
-echo "$SOUND_VARS" | {
-  test -f "$SOUND_FILE" && cmp -s - "$SOUND_FILE" || echo "$SOUND_VARS" >"$SOUND_FILE"
-}
+OLD_SOUND_VARS="$(cat "$SOUND_FILE" 2>/dev/null)"
+test "$SOUND_VARS" = "$OLD_SOUND_VARS" || echo "$SOUND_VARS" >"$SOUND_FILE"
+) &
+test "$1" = '' || wait %1

-- 
Maintenance of eeepc-acpi-scripts debian package



More information about the Debian-eeepc-commits mailing list