[Bug 600740] Re: Don't try to eject non-ejectable devices
Brian Murray
brian at ubuntu.com
Fri Oct 21 19:49:24 UTC 2011
** Changed in: casper (Ubuntu)
Importance: Undecided => High
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to casper in Ubuntu.
https://bugs.launchpad.net/bugs/600740
Title:
Don't try to eject non-ejectable devices
Status in “casper” package in Ubuntu:
New
Bug description:
Binary package hint: casper
I was debugging a shutdown issue on a system where there was a ntfs
recovery partition on the disk. That is, a casper system and a
ubiquity install on, say, /dev/sda1.
During shutdown, the machine would just stop and not finish shutting
down. I didn't see any error or message why. It turns out that
casper was trying to tell me to eject the machine and press Enter.
But the message wasn't getting to the console (not sure why) and I
didn't know what it was waiting for.
The no-message issue is a separate bug, but not a useful one for me to
report because my setup is weird and I didn't debug it further.
But, I did add a workaround for why we were even trying to eject in
the first place. It seems to me that casper shouldn't try to eject a
non-ejectable device like my /dev/sda1. So I added the hacky solution
below. It should be possible to write something really sexy using
udisks or such, that asks if something is ejectable, right?
diff -Nru casper-1.236/debian/casper.init casper-1.236test1/debian/casper.init
--- casper-1.236/debian/casper.init 2010-04-12 15:57:54.000000000 +0100
+++ casper-1.236test1/debian/casper.init 2010-07-01 02:02:58.000000000 +0100
@@ -93,6 +93,12 @@
cache_path "$path"
done
+ cddev=$(mount | grep /cdrom | cut -d' ' -f1 | tr -d 0-9)
+ # ideally we'd check if device is non-ejectable, but for now just check if it's sda
+ if [ "$cddev" = "/dev/sda" ]; then
+ return
+ fi
+
eject -p -m /cdrom >/dev/null 2>&1
[ "$prompt" ] || return 0
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/casper/+bug/600740/+subscriptions
More information about the foundations-bugs
mailing list