99base/init: fall back to manual cdrom polling
parent
1489c9b1af
commit
5b2cc025f4
|
|
@ -230,15 +230,18 @@ while :; do
|
||||||
# some time.
|
# some time.
|
||||||
for cdrom in /sys/block/sr*; do
|
for cdrom in /sys/block/sr*; do
|
||||||
[ -e "$cdrom" ] || continue
|
[ -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=$(while read a; do echo $a;done < "$cdrom"/events_poll_msecs)
|
||||||
[ "$msecs" = "-1" ] && \
|
if [ "$msecs" = "-1" ]; then
|
||||||
echo 1000 > "$cdrom"/events_poll_msecs
|
echo 250 > "$cdrom"/events_poll_msecs
|
||||||
|
> "/tmp/.poll_${cdrom##*/}"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
# skip, if cdrom medium was already found
|
echo change > "$cdrom/uevent"
|
||||||
strstr "$(udevadm info --query=env --path=${cdrom##/sys})" \
|
|
||||||
ID_CDROM_MEDIA && continue
|
|
||||||
echo change > "$cdrom/uevent"
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue