Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 141199 - Have CD auto-eject before reboot (Knoppix-style)
Summary: Have CD auto-eject before reboot (Knoppix-style)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Release Media
Classification: Unclassified
Component: LiveCD/DVD/USB (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Release Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-20 12:23 UTC by Stefan Kienzl
Modified: 2011-09-14 13:35 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
isolinux.cfg (isolinux.cfg,3.74 KB, text/plain)
2011-06-19 16:50 UTC, Jorge Manuel B. S. Vicetto (RETIRED)
Details
0001-boot-from-local-hd-if-no-response-to-boot-menu.patch (0001-boot-from-local-hd-if-no-response-to-boot-menu.patch,1.18 KB, text/plain)
2011-06-19 18:24 UTC, William Hubbs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Kienzl 2006-07-20 12:23:44 UTC
If I reboot my laptop (with a toshiba dvd drive) after doing some things with the livecd or minimal-install cd,I am not able to eject the cdrom.I can only boot the cd again. The only way to boot the systen from harddisk, is to completely switch of the laptop.
Comment 1 Andrew Gaffney (RETIRED) gentoo-dev 2006-07-22 18:33:34 UTC
As far as I know, there is nothing that the init scripts or kernel do that would prevent you from ejecting the CD-ROM after a reboot. Perhaps this is just a weird quirk with your laptop? Do older Gentoo CDs do this, too? What about other Linux CDs like Knoppix?
Comment 2 Stefan Kienzl 2006-07-23 07:04:29 UTC
Yes, migth be a problem with the cdrom of my laptop, because the cdrom doesn't get unmounted or something like that. Older gentoo cds do this too I think. 

With knoppix there is no problem, caused by this "eject - close the cdrom drive and hit enter to reboot"-thing. So it would be nice if you implement something to eject the cd before reboot or poweroff the computer. This would eliminate this issue and would also be a nice feature.
Comment 3 Chris Gianelloni (RETIRED) gentoo-dev 2006-08-23 09:27:42 UTC
OK.  I'm changing this to a feature request.
Comment 4 Mark Knecht 2011-02-16 23:07:14 UTC
Well, here it is, 2011, and I'll pop in and ask for the same feature. A new Asus laptop I got today won't eject the CD upon reboot so I cannot get to Windows to check that my Gentoo install is not messing up the Windows stuff.

I have to go into BIOS, change boot orders, then exit BIOS, enter Windows, eject the CD, etc.

It would be nice to have a way to eject the CD on reboot, even if it was just an option, etc.
Comment 5 William Hubbs gentoo-dev 2011-02-17 00:36:52 UTC
How is a cd/dvd rom ejected from the command line?

If I know that I might be able to implement something.

Comment 6 Mark Knecht 2011-02-17 01:44:10 UTC
I'm not a programmer so I don't know the details but the program cdrecord can do it from the command line using the -eject option. Maybe there's some clues there.

Very different animal - audio CDs which aren't mounted, but maybe it will help to look
Comment 7 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-02-17 02:51:50 UTC
The eject command allows to eject a CD from the command line. The question is whether it'll work with the mounted CD and whether it'll be able to determine the correct CD drive or instead if we can correctly do it and pass to eject the device name.
Comment 8 William Hubbs gentoo-dev 2011-02-17 05:31:17 UTC
I just emerged eject here and found out a couple of things:

- When you eject a cd, the eject program will first unmount the cd.

- The default device it unmounts is /dev/cdrom, and if that isn't
always correct, it is possible to pass a device to it on the
command line.

Jorge, what do you think? I'm thinking this could be implemented farely
easily as an init.d script that would be part of the livecd-tools
package.

Comment 9 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-02-17 12:14:05 UTC
(In reply to comment #8)
> I just emerged eject here and found out a couple of things:
> 
> - When you eject a cd, the eject program will first unmount the cd.

Will that work if we try to call eject when the CD is still mounted? Will that work if we call it after we unmount the partitions in the shutdown init level?

> - The default device it unmounts is /dev/cdrom, and if that isn't
> always correct, it is possible to pass a device to it on the
> command line.

Right. If /dev/cdrom doesn't work, are we sure we know the device name to handle to eject?

> Jorge, what do you think? I'm thinking this could be implemented farely
> easily as an init.d script that would be part of the livecd-tools
> package.

That is what I was thinking about, if the above 2 are not an issue.
Comment 10 William Hubbs gentoo-dev 2011-06-19 16:06:01 UTC
Another thing to consider for this feature is remote installs. If
someone is doing a remote install, do we still want the cd to auto
eject?
Comment 11 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-06-19 16:09:39 UTC
As we (me, William and Raúl) were talking just now on #gentoo-dev, probably the safest option would be to have the shutdown process asking the user to press a key if he wants to eject the CD. After X seconds without user action the system would continue the reboot without ejecting the CD.
Comment 12 Fernando (likewhoa) 2011-06-19 16:42:19 UTC
(In reply to comment #10)
> Another thing to consider for this feature is remote installs. If
> someone is doing a remote install, do we still want the cd to auto
> eject?

on the LiveDVD if no user action is taken then it boots the local disk. This is done within isolinux using.

ONTIMEOUT localhost # this is so the livedvd doesn't boot up again on a remote install.

label localhost # creates the localhost menu which boots the first hard drive and hides it from view
  localboot -1
  MENU HIDE
Comment 13 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-06-19 16:50:39 UTC
Created attachment 277541 [details]
isolinux.cfg

Before I lose it, I'm attaching the complete isolinux.cfg likewhoa gave me that's being used in the liveDVD.
Comment 14 William Hubbs gentoo-dev 2011-06-19 18:24:58 UTC
Created attachment 277549 [details]
0001-boot-from-local-hd-if-no-response-to-boot-menu.patch

This is a patch to catalyst based on likewhoa's suggestion.

Let me know what you think.
Comment 15 William Hubbs gentoo-dev 2011-06-19 19:25:43 UTC
I just thought of a concern about this patch.
It requires intervention at the place where the cd is being booted to
make sure the cd boots. If you do not respond to the boot menu the hard
drive gets booted. Jorge, is this what we want?
Comment 16 William Hubbs gentoo-dev 2011-06-19 19:31:11 UTC
Thinking about this, you can disregard my last comment, because someone
has to be at the server to start an ssh server to begin with.
Comment 17 William Hubbs gentoo-dev 2011-06-19 19:46:34 UTC
Looking at this further, it looks like the posix read command doesn't
support a timeout like bash's read command does, so I do not know of a
way to delay for a specific amount of time during shutdown to allow the
user to specify whether they want us to eject the cd.
Comment 18 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-07-05 18:51:16 UTC
I've applied the patch locally to catalyst and the built CDs only boot from the CD if the user presses a key.
I'll leave this bug open until we have working stages (doing the automatic login) and the OP and others can comment if this route is an acceptable alternative to this bug original request.
Comment 19 Mark Knecht 2011-07-05 18:54:19 UTC
Hi - dunno if I'm the OP at this point. I guess I was for 2011. :-)

First - thanks for working on this. Second - I'm not sure how to access your solution without burning a CD. Is there an iso file you could post that I could try out?
Comment 20 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-07-05 19:14:09 UTC
(In reply to comment #19)
> Hi - dunno if I'm the OP at this point. I guess I was for 2011. :-)
> 
> First - thanks for working on this. Second - I'm not sure how to access your
> solution without burning a CD. Is there an iso file you could post that I could
> try out?

Not yet. I got a ISO working here, but I need to update some packages in the tree before we get official ISOs working. I'll upload my testing ISO when I finally get my new vserver working.
Comment 21 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-07-06 12:50:24 UTC
If anyone wants to test it, I've uploaded the ISO to my server:
http://www.jmbsvicetto.name/releases/
Comment 22 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-08-19 03:51:53 UTC
We finally have this working on the install CDs - booting from the disk unless a key is pressed during boot.
I'm inclined to close this bug as fixed. Does any of you feel like what we did is not enough and that being able to eject the CD is a "required" feature?
Comment 23 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-09-14 13:35:48 UTC
No objections, so I'm closing this as fixed.