Bug 132358

Summary: hald doesn't produce /media/cdrom link
Product: [Fedora] Fedora Reporter: Steve Grubb <linux_4ever>
Component: halAssignee: David Zeuthen <davidz>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: mclasen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-09-12 16:22:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Output from verbose run
none
Output from lshal none

Description Steve Grubb 2004-09-11 15:10:29 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.4.2)
Gecko/20040308

Description of problem:
The hal package does not create a /media/cdrom link. The cdrom is
/dev/hdc.

Will attach output from lshal and verbose.

Version-Release number of selected component (if applicable):
hal-0.2.97.cvs20040901-1

How reproducible:
Always

Steps to Reproduce:
1. ls /media

Actual Results:  [root@buildhost hal]# ls /media/
idedisk  idedisk1  scsidisk  scsidisk1

Expected Results:  cdrom added to the above

Additional info:

[root@buildhost hal]# udevinfo -r -q name -p /block/hdc
/dev/hdc


from /var/log/messages:

Sep 11 10:45:42 buildhost fstab-sync[2653]: added mount point
/media/idedisk for /dev/hda5
Sep 11 10:45:42 buildhost fstab-sync[2659]: added mount point
/media/idedisk1 for /dev/hda1
Sep 11 10:45:43 buildhost fstab-sync[2690]: added mount point
/media/scsidisk for /dev/sda2
Sep 11 10:45:43 buildhost fstab-sync[2693]: added mount point
/media/scsidisk1 for /dev/sda1

Comment 1 Steve Grubb 2004-09-11 15:12:21 UTC
Created attachment 103722 [details]
Output from verbose run

Comment 2 Steve Grubb 2004-09-11 15:13:11 UTC
Created attachment 103723 [details]
Output from lshal

Comment 3 David Zeuthen 2004-09-12 08:56:55 UTC
Hi, it seems hal properly detects your cdrom drive but fstab-sync
refuses to add an entry to the fstab since a) there is already an
entry for /dev/cdrom; and b) /dev/cdrom is a symlink pointing to
/dev/hdc. 

In fact, since /dev/cdrom and /dev/hdc are the same, fstab-sync
actually changes the block.device property on the hal device object
representing your optical drive such that e.g. gnome-volume-manager
can simply do a 'mount /dev/cdrom' and everything works.

I suppose this entry was left by the installer or kudzu from back when
updfstab was part of kudzu. 

So, this is in fact a feature (and a nice one I might add: you don't
want two entries in the fstab for the same device), not a bug. Would
you agree? (I will close with NOTABUG if you concur)

Comment 4 Steve Grubb 2004-09-12 13:21:51 UTC
OK, I was under the impression that /dev/cdrom is deprecated and
/media/cdrom is the new location. Does this mean that all cdrom
software needs to be patched to try /dev/cdrom and /media/cdrom?

You can close this PR if this is the case.

Comment 5 David Zeuthen 2004-09-12 16:22:26 UTC
Well, using and relying on /dev/cdrom is kind of broken since there
may be more than one optical drive in the system. Also, relying on a
specific mount point is also broken for the same reason. As far as I
understand FHS2.3 all filesystems for removable media is to be mounted
in /media (and hotpluggable drives without removable media since I
consider such to be considered removable media as well).

My opinion: software in general and desktop software in particular
should rather be asking the hal daemon or looking at sysfs to find the
optical drive or other devices with the desired capabilities - thus it
needs to be patched anyway. 

And for good UI the software should rather expose

 TORISAN DVD-ROM DRD-U624 [X]
 LITEON DVDRW SOHW-812S   [ ]

or maybe even better

 Internal DVD-ROM drive       [X]
 External CD-RW/DVD-RW drive  [ ]

rather than asking for the device file

 [/dev/cdrom             ]

which may be /dev/sr0 or /dev/cdrom1 for an external USB2 drive. All
in all, neither special device files nor mount points should appear in
any user interface. But all this is still a bit in the future.

However, to preserve backwards compatibility udev now creates
/dev/cdrom, /dev/cdrom1, ... compat symlinks. Also then pam_console
gets it right and the right permissions are applied such that the user
can eject optical discs.