summaryrefslogtreecommitdiffstats
path: root/initrd/initrd-stuff/etc
diff options
context:
space:
mode:
Diffstat (limited to 'initrd/initrd-stuff/etc')
-rw-r--r--initrd/initrd-stuff/etc/functions27
1 files changed, 27 insertions, 0 deletions
diff --git a/initrd/initrd-stuff/etc/functions b/initrd/initrd-stuff/etc/functions
index 4125acf5..bb834756 100644
--- a/initrd/initrd-stuff/etc/functions
+++ b/initrd/initrd-stuff/etc/functions
@@ -10,7 +10,34 @@
#
# Version: 0.4.1b
+#######################################################################
+# generate events with the sysfs trigger
+function trigger_device_events() {
+ list=$(echo /sys/bus/*/devices/*/uevent)
+ list="$list $(echo /sys/class/*/*/uevent)"
+ list="$list $(echo /sys/block/*/uevent /sys/block/*/*/uevent)"
+ for i in $list; do
+ case "$i" in
+ */device/uevent|*\**)
+ continue
+ ;;
+ */class/mem/*|*/class/tty/*)
+ first="$first $i"
+ ;;
+ */block/md*)
+ last="$last $i"
+ ;;
+ */*)
+ default="$default $i"
+ ;;
+ esac
+ done
+ # trigger the sorted events
+ for i in \$first \$default \$last; do
+ echo "add" > "\$i"
+ done
+}
#######################################################################
# produce error message and if $2 is empty run (debug) shell