]> git.sur5r.net Git - bacula/rescue/blob - rescue/linux/cdrom/roottree/etc/mount_cdrom
Initial revision
[bacula/rescue] / rescue / linux / cdrom / roottree / etc / mount_cdrom
1 #!/bin/sh 
2 #
3 # Try mounting the CDROM drive
4 #
5
6 echo "Doing mount_cdrom ..."
7 modprobe nls_iso8859-1 2>/dev/null >/dev/null
8 modprobe cdrom 2>/dev/null >/dev/null
9 modprobe scsi_mod 2>/dev/null >/dev/null
10
11 DISKS="/dev/hd?"
12 if [ -f /proc/scsi/scsi ] ; then 
13   HAVE_SCSI="yes"
14   DISKS="$DISKS /dev/scd? /dev/scd?? /dev/sd?[1-9] /dev/sd?[1-9][1-9]"
15 else
16   HAVE_SCSI="no"
17 fi
18 DISKS="$DISKS /dev/hd?[1-9] /dev/hd?[1-9][1-9]"
19
20 echo "Trying to find CDROM on ..."
21 for disk in $DISKS; do
22    if [ x$DEBUG = xyes ] ; then
23       echo "Trying to mount device $disk"
24    fi
25    if test -b $disk && mount -t iso9660 -o ro -n $disk /mnt/cdrom 2>/dev/null >/dev/null ; then
26 #  if test -b $disk && mount -t iso9660 -o ro -n $disk /mnt/cdrom ; then
27        if [ -e /mnt/cdrom/BaculaRescueCD ] ; then
28           echo "Found the Bacula Rescue CDROM on $disk"
29           sleep 3
30           exit
31        else
32          umount /mnt/cdrom
33        fi
34    else 
35       if [ x$DEBUG = xyes ] ; then
36          cat /proc/modules
37          sleep 2
38       fi
39    fi
40 done
41
42 echo "Sorry could not find the CDROM"
43 sleep 5