Advertisement
Guest User

Untitled

a guest
Feb 9th, 2012
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.21 KB | None | 0 0
  1. #======================================
  2. # CDDevice
  3. #--------------------------------------
  4. function CDDevice {
  5.     # /.../
  6.     # changed this function so that it finds config.isoclient on vfat disks, e.g. USB drives
  7.     # added more changes to work on hdd located iso (by LeKaresz)
  8.     # ----
  9.     find /lib/modules/*/kernel/fs/nls/nls* -exec insmod {} \; # needed for vfat filesystemMikor
  10.         find /lib/modules/*/kernel/fs/*fat/*.ko -exec insmod {} \; # needed for vfat filesystem
  11.     find /lib/modules/*/kernel/fs/ext*/*.ko -exec insmod {} \; # needed for ext filesystem
  12.         insmod /lib/modules/*/kernel/drivers/usb/storage/usb-storage.ko # needed for USB
  13.     find /lib/modules/*/kernel/drivers/ata/sata*.ko -exec insmod {} \; # needed for SATA
  14.     sleep 5 # fixme; do this in a proper way
  15.     cddevs=`/usr/sbin/hwinfo --disk | grep sd | grep "Device File:" | cut -f2 -d: | cut -f2 -d " "` # looks for disks instead of CDs
  16.     echo cddevs $cddevs
  17.     for i in $cddevs;do
  18.         i=$i"1" # fixme; looks on the first partition only
  19.         echo i $i
  20.         if [ -b $i ];then
  21.             test -z $cddev && cddev=$i || cddev=$cddev:$i
  22.             echo cddev $cddev
  23.         fi
  24.     done
  25.     if [ -z $cddev ]; then
  26.         systemException \
  27.             "Failed to detect CD drive !" \
  28.         "reboot"
  29.     fi
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement