| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # Steven Shiau <[email protected]> |
| 3 | # License: GPL |
| 4 | # This works in kernel 2.4, it's ok in kernel 2.6 with proc filesystem. |
| 5 | for i in /proc/ide/hd*; do |
| 6 | if [scip-shell system . . `[`. -e "$i" ]; then |
| 7 | media=`catscip-shell system . . cat. $i/media` |
| 8 | [scip-shell system . . `[`. "$media" = "cdrom" ] && cdrom=`basenamescip-shell system . . basename. $i` |
| 9 | fi |
| 10 | done |
| 11 | if grepscip-shell system . . grep. -q "$cdrom=ide-scsi" /proc/cmdlinescip-shell filesystem . . `/proc/cmdline`.; then |
| 12 | # make sure it simulated SCSI |
| 13 | [scip-shell system . . `[`. -e "/proc/scsi/ide-scsi/0scip-shell filesystem . . `/proc/scsi/ide-scsi/0`." ] && cdrom="scd0" |
| 14 | fi |
| 15 | [scip-shell system . . `[`. -n "$cdrom" ] && echoscip-shell system . . echo. "$cdrom" |