I commited (to the packaging branch) a similar change using udisks (when 
present), checking for the "removable" flag.
If set to 0 for the device we're about to eject, it skips the eject call and 
the prompt.

Diff below:
=== modified file 'debian/casper.init'
--- debian/casper.init  2011-12-14 18:28:01 +0000
+++ debian/casper.init  2011-12-14 20:35:12 +0000
@@ -93,6 +93,14 @@
         cache_path "$path"
     done
 
+    # If the device isn't marked as removable, skip the prompt
+    if which udisks > /dev/null; then
+        device="$(grep " /cdrom " /proc/mounts | cut -d' ' -f1)" || device=
+        if [ -n "$device" ] && [ "$(udisks --show-info $device | grep 
removable | awk '{print $NF}')" = "0" ]; then
+            return 0
+        fi
+    fi
+
     eject -p -m /cdrom >/dev/null 2>&1
 
     [ "$prompt" ] || return 0

** Changed in: casper (Ubuntu)
       Status: New => Fix Committed

** Changed in: casper (Ubuntu)
     Assignee: (unassigned) => Stéphane Graber (stgraber)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/600740

Title:
  Don't try to eject non-ejectable devices

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/casper/+bug/600740/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to