121 lines
2.6 KiB
Diff
121 lines
2.6 KiB
Diff
--- /dev/null 2006-02-07 10:47:25.401206250 +0100
|
|
+++ udev-084/extras/check-cdrom.sh 2006-02-07 10:58:51.000000000 +0100
|
|
@@ -0,0 +1,39 @@
|
|
+#!/bin/bash
|
|
+
|
|
+pos=0
|
|
+n=0
|
|
+sp="$1"
|
|
+what="$2"
|
|
+found=0
|
|
+
|
|
+[ -e /proc/sys/dev/cdrom/info ] || exit 1
|
|
+
|
|
+/bin/cat /proc/sys/dev/cdrom/info | {
|
|
+ while read line; do
|
|
+ if [ "$found" = "0" -a "${line/drive name:}" != "$line" ]; then
|
|
+ set ${line/drive name:}
|
|
+ while [ $# -gt 0 ]; do
|
|
+ pos=$[$pos+1]
|
|
+ if [ "$1" == "$sp" ]; then
|
|
+ found=1
|
|
+ break
|
|
+ fi
|
|
+ shift
|
|
+ done
|
|
+ [ "$found" = "0" ] && exit 1
|
|
+ elif [ "${line/$what:}" != "$line" ]; then
|
|
+ set ${line##*$what:}
|
|
+ while [ $# -gt 0 ]; do
|
|
+ n=$[$n+1]
|
|
+ if [ "$n" == "$pos" ]; then
|
|
+ if [ "$1" = "1" ]; then
|
|
+ exit 0
|
|
+ fi
|
|
+ break
|
|
+ fi
|
|
+ shift
|
|
+ done
|
|
+ fi
|
|
+ done
|
|
+ exit 1
|
|
+}
|
|
--- /dev/null 2006-02-07 10:47:25.401206250 +0100
|
|
+++ udev-084/extras/run_directory/MAKEDEV.dev 2006-02-07 10:58:51.000000000 +0100
|
|
@@ -0,0 +1,38 @@
|
|
+#!/bin/sh
|
|
+
|
|
+if [ "$ACTION" = "add" -a -e "$DEVNAME" ]; then
|
|
+ if [ -x /usr/bin/logger ]; then
|
|
+ LOGGER=/usr/bin/logger
|
|
+ elif [ -x /bin/logger ]; then
|
|
+ LOGGER=/bin/logger
|
|
+ else
|
|
+ unset LOGGER
|
|
+ fi
|
|
+ #
|
|
+ # for diagnostics
|
|
+ #
|
|
+ if [ -f /etc/udev/udev.conf ]; then
|
|
+ . /etc/udev/udev.conf
|
|
+ fi
|
|
+
|
|
+
|
|
+ if [ -t 1 -o -z "$LOGGER" ]; then
|
|
+ mesg () {
|
|
+ echo "$@"
|
|
+ }
|
|
+ else
|
|
+ mesg () {
|
|
+ $LOGGER -t $(basename $0)"[$$]" "$@"
|
|
+ }
|
|
+ fi
|
|
+
|
|
+ debug_mesg () {
|
|
+ test -z "$UDEV_LOG" -o "$UDEV_LOG" != "1" && return
|
|
+ mesg "$@"
|
|
+ }
|
|
+
|
|
+ debug_mesg "/sbin/MAKEDEV ${DEVNAME#$udev_root}"
|
|
+ /sbin/MAKEDEV "${DEVNAME#$udev_root}"
|
|
+ debug_mesg "Restoring permissions for " $DEVNAME*
|
|
+ /sbin/pam_console_apply $DEVNAME*
|
|
+fi
|
|
--- /dev/null 2006-02-07 10:47:25.401206250 +0100
|
|
+++ udev-084/extras/load_floppy_module.sh 2006-02-07 10:58:51.000000000 +0100
|
|
@@ -0,0 +1,35 @@
|
|
+#!/bin/sh
|
|
+########################################################################
|
|
+#
|
|
+# Description : load_floppy_module
|
|
+#
|
|
+# Authors : Based on Open Suse Udev Rules
|
|
+# kay.sievers at suse.de
|
|
+#
|
|
+# Notes : Loads the floppy module based upon contents of the NVRAM
|
|
+#
|
|
+########################################################################
|
|
+
|
|
+PROC=/proc/driver/nvram
|
|
+
|
|
+# wait for /proc file to appear
|
|
+loop=10
|
|
+while ! test -e $PROC; do
|
|
+ sleep 0.1;
|
|
+ test "$loop" -gt 0 || break
|
|
+ loop=$(($loop - 1))
|
|
+done
|
|
+
|
|
+if [ ! -r /proc/driver/nvram ]; then
|
|
+ exit 0;
|
|
+fi
|
|
+
|
|
+floppy_devices=$(cat $PROC | sed -n '/Floppy.*\..*/p')
|
|
+
|
|
+if [ -n "$floppy_devices" ]; then
|
|
+ /sbin/modprobe block-major-2-
|
|
+else
|
|
+ /bin/true
|
|
+fi
|
|
+
|
|
+exit $?
|