59f9af3305
- set cdrom in kernel polling
55 lines
1.8 KiB
Diff
55 lines
1.8 KiB
Diff
From 9edf1b206b69a9f6d6d038d333d8b855145ed4d6 Mon Sep 17 00:00:00 2001
|
|
From: Harald Hoyer <harald@redhat.com>
|
|
Date: Fri, 18 Feb 2011 13:27:31 +0100
|
|
Subject: [PATCH] init: set cdrom polling in kernel
|
|
|
|
and reset to -1 after we are done.
|
|
---
|
|
modules.d/99base/init | 22 +++++++++++++++++-----
|
|
1 files changed, 17 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/modules.d/99base/init b/modules.d/99base/init
|
|
index 0a05e91..b49c87a 100755
|
|
--- a/modules.d/99base/init
|
|
+++ b/modules.d/99base/init
|
|
@@ -203,15 +203,19 @@ while :; do
|
|
# dirty hack for some cdrom drives,
|
|
# which report no medium for quiet
|
|
# some time.
|
|
- if [ ! -e /sys/module/block/parameters/events_dfl_poll_msecs ]; then
|
|
- for cdrom in /sys/block/sr*; do
|
|
- [ -e "$cdrom" ] || continue
|
|
+ for cdrom in /sys/block/sr*; do
|
|
+ [ -e "$cdrom" ] || continue
|
|
+ if [ -e "$cdrom"/events_poll_msecs ]; then
|
|
+ msecs=$(while read a; do echo $a;done < "$cdrom"/events_poll_msecs)
|
|
+ [ "$msecs" = "-1" ] && \
|
|
+ echo 1000 > "$cdrom"/events_poll_msecs
|
|
+ else
|
|
# skip, if cdrom medium was already found
|
|
strstr "$(udevadm info --query=env --path=${cdrom##/sys})" \
|
|
ID_CDROM_MEDIA && continue
|
|
echo change > "$cdrom/uevent"
|
|
- done
|
|
- fi
|
|
+ fi
|
|
+ done
|
|
|
|
i=$(($i+1))
|
|
[ $i -gt $RDRETRY ] \
|
|
@@ -220,6 +224,14 @@ done
|
|
unset job
|
|
unset queuetriggered
|
|
|
|
+# reset cdrom polling
|
|
+for cdrom in /sys/block/sr*; do
|
|
+ [ -e "$cdrom" ] || continue
|
|
+ if [ -e "$cdrom"/events_poll_msecs ]; then
|
|
+ echo -1 > "$cdrom"/events_poll_msecs
|
|
+ fi
|
|
+done
|
|
+
|
|
# pre-mount happens before we try to mount the root filesystem,
|
|
# and happens once.
|
|
getarg 'rd.break=pre-mount' 'rdbreak=pre-mount' && emergency_shell -n pre-mount "Break pre-mount"
|