Bug 61677 - Unable to open CDROM tray if boot_cdrom is in loader.conf
Summary: Unable to open CDROM tray if boot_cdrom is in loader.conf
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 4.8-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2004-01-21 16:00 UTC by Jim Bauer
Modified: 2021-07-08 23:18 UTC (History)
1 user (show)

See Also:

file.diff (1.68 KB, patch)
2004-01-21 16:00 UTC, Jim Bauer
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Bauer 2004-01-21 16:00:23 UTC
If loader.conf contains: boot_cdrom="YES" (the value is unimportant, just the existence seems to matter) but you don't actually boot from the CDROM drive (because it does not contain a CD) then the cdrom tray will remain locked.

As the system boots, the kernel will try to mount the CDROM trying 3 different CD devices.  All will fail as there is no CD in any cdrom drive.  The kernel will then fallback and mount the root FS from the hard disk.

Once the system is up and running you can login and see that nothing is mounted from the (empty) cdrom drive, but the eject command (CDIOCEJECT ioctl) will return EBUSY.  Also, pressing the eject button on the drive will fail to open the tray.

It looks like the mount attempt is not fully cleaning up and leaving the device in a busy state.

Fix: This patch seem to fix the problem.
How-To-Repeat: 1) Place this in your loader.conf file: boot_cdrom="YES"
2) Make sure there is no CD in the drive
3) Reboot (the kernel will attempt to mount the CD, fail and mount hard disk as usual)
4) Try to open the CD tray via either the eject command or the pressing the eject button on the cd drive.  Both will fail to open the tray.
Comment 1 josef freebsd_committer 2004-05-24 22:58:47 UTC
Responsible Changed
From-To: freebsd-bugs->josef

i'll handle this one.
Comment 2 josef freebsd_committer 2004-06-01 19:23:00 UTC
State Changed
From-To: open->feedback

I modified the patch, have some open questions, asked 
author for feedback.
Comment 3 josef freebsd_committer 2004-10-13 23:14:50 UTC
Responsible Changed
From-To: josef->freebsd-bugs

Throw this one back into the pool. 
I am working on other areas now.
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2008-03-01 20:25:39 UTC
State Changed
From-To: feedback->suspended

Although feedback has not been received, it may be that the patch is 
still valid.
Comment 5 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 23:53:49 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

- Set Status to "Open"
Comment 6 Warner Losh freebsd_committer 2021-07-08 23:18:51 UTC
I don't believe this is a bug anymore
And the patch supplied doesn't apply and would require substantial rework.