Package: casper
Version: 1.71+debian-1
Severity: wishlist
Tags: patch

The current code checks for CD or usb, and only boots from those devices.  I
need to boot a removable IDE drive (cold-pluggable), which didn't work due to
explicit checks.  The attached patch removes them, and thus allows booting
from any medium.

It also contains the patch from #394308.

Thanks,
Bas

-- 
I encourage people to send encrypted e-mail (see http://www.gnupg.org).
If you have problems reading my e-mail, use a better reader.
Please send the central message of e-mails as plain text
   in the message body, not as HTML and definitely not as MS Word.
Please do not use the MS Word format for attachments either.
For more information, see http://pcbcn10.phys.rug.nl/e-mail.html
diff -ur orig/scripts/casper casper-1.71+debian/scripts/casper
--- orig/scripts/casper 2006-10-20 16:23:22.000000000 +0200
+++ casper-1.71+debian/scripts/casper   2006-10-21 20:41:25.000000000 +0200
@@ -438,43 +438,18 @@
 find_livefs() {
     mounted=
     for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v 
ram); do
-        devname=$(sys2dev "${sysblock}")
-        fstype=$(get_fstype "${devname}")
-        if /lib/udev/cdrom_id ${devname} > /dev/null; then
-            mount -t ${fstype} -o ro "$devname" $mountpoint || continue
-            if is_casper_path $mountpoint; then
-                echo $mountpoint
-                return
-            else
-                umount $mountpoint
-            fi
-        elif is_usb_device "$sysblock"; then
-            for dev in $(subdevices "${sysblock}"); do
-                devname=$(sys2dev "${dev}")
-                fstype=$(get_fstype "${devname}")
-                case ${fstype} in
-                    vfat|iso9660|udf)
-                        mount -t ${fstype} -o ro "${devname}" $mountpoint || 
continue
-                        if is_casper_path $mountpoint; then
-                            echo $mountpoint
-                            return
-                        else
-                            umount $mountpoint
-                        fi
-                        ;;
-                esac
-            done
-        elif [ "${fstype}" = "squashfs" ||  \
-                "${fstype}" = "ext2" ]; then
-
-            # This is an ugly hack situation, the block device has
-            # an image directly on it.  It's hopefully
-            # casper, so take it and run with it.
-
-            ln -s "${devname}" "${devname}.${fstype}"
-            echo "${devname}.${fstype}"
-            return
-        fi
+       # Try to find casper on this device, or on a partition of it
+        for dev in $(subdevices "${sysblock}"); do
+            devname=$(sys2dev "${dev}")
+            fstype=$(get_fstype "${devname}")
+           mount -t ${fstype} -o ro "$devname" $mountpoint || continue
+           if is_casper_path $mountpoint; then
+               echo $mountpoint
+               return
+           else
+               umount $mountpoint
+           fi
+       done
     done
 }
 
@@ -520,6 +495,9 @@
             if [ "${livefs_root}" ]; then
                 break
             fi
+           # Don't go through the checks too fast, the device may need some
+           # time to appear.
+           sleep 2
         done
 
         if [ "$?" -gt 0 ]; then

Attachment: signature.asc
Description: Digital signature

Reply via email to