]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
99base/init: fall back to manual cdrom polling
authorHarald Hoyer <harald@redhat.com>
Mon, 28 Mar 2011 15:46:03 +0000 (17:46 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 28 Mar 2011 15:52:33 +0000 (17:52 +0200)
modules.d/99base/init

index b6b599f6c295c89d600ec7d9e5366c6f53b2e07b..b6f4e92ab4d8c50b3609e5d656903c89ce9a7cd8 100755 (executable)
@@ -230,15 +230,18 @@ while :; do
     # some time.
     for cdrom in /sys/block/sr*; do
         [ -e "$cdrom" ] || continue 
-        if [ -e "$cdrom"/events_poll_msecs ]; then
+        # skip, if cdrom medium was already found
+        strstr "$(udevadm info --query=env --path=${cdrom##/sys})" \
+            ID_CDROM_MEDIA && continue
+
+        if [ -e "$cdrom"/events_poll_msecs -a -n -e "/tmp/.poll_${cdrom##*/}" ]; then
             msecs=$(while read a; do echo $a;done < "$cdrom"/events_poll_msecs)
-            [ "$msecs" = "-1" ] && \
-                echo 1000 > "$cdrom"/events_poll_msecs
+            if [ "$msecs" = "-1" ]; then
+                echo 250 > "$cdrom"/events_poll_msecs
+                > "/tmp/.poll_${cdrom##*/}"
+            fi
         else
-            # skip, if cdrom medium was already found
-            strstr "$(udevadm info --query=env --path=${cdrom##/sys})" \
-                ID_CDROM_MEDIA && continue
-            echo change > "$cdrom/uevent"        
+            echo change > "$cdrom/uevent"
         fi
     done