bramvanoploo / xbmc-ubuntu-minimal

http://forum.xbmc.org/showthread.php?tid=141369
16 stars 18 forks source link

Optical media DVD's DATA CD's and other types like Bluray etc including Music cd's are not mounted by XBMC #14

Closed un1versal closed 8 years ago

un1versal commented 11 years ago

[bug] This is a big problem it needs to be fixed in XBMC but C++ is already beyond my scope as is bash scripting anyway.

The problem is serious and default udev rules are not enough to handle mount on change

see http://trac.xbmc.org/ticket/14129 Thats not tooo bad but bad enough.

this http://trac.xbmc.org/ticket/14128 is the mother of all misery.

also not so bad in the greater picture but would also be nice to see fixed http://trac.xbmc.org/ticket/13509

Some assistance please!

un1versal commented 11 years ago

Found this via http://chakra.sourceforge.net/wiki/index.php/Udev but the udev rule works if you leave media in drive when you boot reboot otherwise it does nothing on resume or for e.g. changing media while system is up.

The PLAY DISC works fine without but filemanager and VIDEO>FILES is toast.

also looks wrong but I dont understand enough about Linux or udev rules. Some assistance please.

KERNEL!="sr[0-9]*", GOTO="disc_by_label_auto_mount_end"

# Get label
ACTION=="add", PROGRAM=="/sbin/blkid -o value -s LABEL %E{device}", ENV{dir_name}="%c"

ACTION=="add", RUN+="/bin/mkdir -p '/media/%E{dir_name}'", RUN+="/bin/mount -o %E{mount_options} /dev/%k '/media/%E{dir_name}'"
ACTION=="add", RUN+="/bin/ln -s /media/%E{dir_name} /media/disc"
ACTION=="remove", RUN+="/bin/umount -l '/media/%E{dir_name}'", RUN+="/bin/rmdir '/media/%E{dir_name}'"

LABEL="disc_by_label_auto_mount_end"

KERNEL!="sr[0-9]*", GOTO="disc_by_label_auto_mount_end"

# Import FS infos
IMPORT{program}="/sbin/blkid -o udev -p %N"

# Get a label if present, otherwise specify one
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
ENV{ID_FS_LABEL}=="", ENV{dir_name}="%k"

# Mount the device
ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount /dev/%k /media/%E{dir_name}"
ACTION=="add", RUN+="/bin/ln -s /media/%E{dir_name} /media/disc"

# Clean up after removal
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"

# Exit
LABEL="disc_by_label_auto_mount_end"
un1versal commented 11 years ago

any feedback on this? @Bram77

un1versal commented 8 years ago

and another one for MiddleFinger's Ville.