apt uses hardcoded /cdrom, use hal instead (if it is availabe)

Bug #41689 reported by Sean Estrella
22
Affects Status Importance Assigned to Milestone
apt (Baltix)
Confirmed
Medium
Unassigned
apt (Ubuntu)
Won't Fix
Wishlist
Unassigned

Bug Description

While attempting to install the "alien" package in Synaptic, I was forced to insert the Ubuntu 6.06 Flight 6 Install CD. Upon inserting the CD into the CD RW drive and pressing okay, I was presented with the same dialog box asking me to insert the CD into /media/cdrom. Being a CD R, the CD was mounted in /media/cdrewriter. I was forced to open the terminal to mount the CD R in /media/cdrom. This should not be required of the user.

Revision history for this message
Sebastian Heinlein (glatzor) wrote :

Sadly apt only supports the hard coded cdrom path at the moment.

Changed in synaptic:
assignee: nobody → mvo
Revision history for this message
Sebastian Heinlein (glatzor) wrote :

A hal extension to apt would be nice.

Changed in apt:
status: Unconfirmed → Confirmed
Revision history for this message
Michael Vogt (mvo) wrote : Re: apt uses hardcoded /cdrom

Thinking about this problem it looks like we need something like methods/cdrom-hal (just as Sebastian suggested).

It should transparently fall back to methods/cdrom if no hal is available. If hal is available it should:
a) scan the hal device tree to see what cdroms are available on the system and what is mounted there.
 1. If anything is mounted already use IdentCdrom() to see if it is a disk we want
 2. If nothing is mounted prompt and ask the user to insert a CD, then repeat step 1 (this assumes that hal will auto-mount, if it does not, step one need to mount too)

This is complicated by the fact that we want to avoid having apt depend on hal obviously, so this needs to be a stricly optional feature.

Changed in apt:
importance: Medium → Wishlist
Revision history for this message
Michael Vogt (mvo) wrote :

Something like the attached code could be added (need fixup for e.g. the hardcoded cdrom size) and methods/cdrom.cc would try to dlopen() it. If that works, it can use hal_get_mounted_cdroms() and scan those mount-points for a ubuntu cd. Instead of dlopen() we could try to callout to a helper (most likely a shell script that uses hal-find-by-property).

Revision history for this message
Mantas Kriaučiūnas (mantas) wrote :

I think any removable media (not CD/DVD disks) could be used as packages repositories.

Revision history for this message
Michael Vogt (mvo) wrote :

Or with the shell:

$ hal-find-by-property --key "storage.drive_type" --string "cdrom"
/org/freedesktop/Hal/devices/storage_model_DVDRAM_GSA_4083N

$ hal-find-by-property --key "info.parent" --string "/org/freedesktop/Hal/devices/storage_model_DVDRAM_GSA_4083N"
/org/freedesktop/Hal/devices/volume_label_Ubuntu_7_04_i386

$ hal-get-property --udi "/org/freedesktop/Hal/devices/volume_label_Ubuntu_7_04_i386" --key volume.mount_point
/media/Ubuntu 7.04 i386

Changed in apt:
milestone: none → ubuntu-8.04
status: New → Invalid
Revision history for this message
Mantas Kriaučiūnas (mantas) wrote :

Michael, please don't close Baltix distro bugs, assigned to Baltix by main Baltix developer ;)

Changed in apt:
importance: Undecided → Medium
status: Invalid → Confirmed
Steve Langasek (vorlon)
Changed in apt:
milestone: ubuntu-8.04 → later
Revision history for this message
p33pG (p33pg) wrote :

so i had this problem on how no matter what i do the computer cant mount the cdrom.. on my pc i have a cd rom and a dvd rw drive... so i just unplugged the cd rom drive and now my computer reconize the drive and im playing muusic straight from the audio cd im going to try burning a dvd now will see what happens

Changed in apt (Ubuntu):
milestone: later → none
assignee: Michael Vogt (mvo) → nobody
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.