2012-10-20, 20:42
mount on boot can also be done via fstab
(2012-10-20, 19:43)uNiversal Wrote:(2012-05-02, 22:37)fritsch Wrote: @weemaaan
create the file /etc/polkit-1/localauthority/50-local.d/custom-actions.pkla
with the following content:
Code:[Actions for xbmc user]
Identity=unix-user:xbmc
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes
And to make it complete, if you want to mount and umount usb sticks, that are connected during a xbmc sessions
do:
Code:sudo adduser xbmc users
and create the file /etc/udev/rules.d/11-media-by-label-auto-mount.rules
Code:# Start at sdb to avoid system harddrive.
KERNEL!="sd[b-z][0-9]", GOTO="media_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}="usbhd-%k"
# Global mount options
ACTION=="add", ENV{mount_options}="relatime"
# Filesystem-specific mount options
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"
# Mount the device
ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/%E{dir_name}"
# 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="media_by_label_auto_mount_end"
Now Reboot.
Shutdown, logout, suspend, etc. should be fine afterwards. Also mounting and umount of usb drives should now be possible.
@wsnipex:
Perhaps we should add this into the howto? As the polkit console commands are not there anymore?
This may be old but, just installed minimal Ubuntu + XBMC and with this, I only get usb mounting when I plug the usb in, if its plugged in during boot it wont show up!
Is there something that should be installed in Ubuntu minimal? (e.g. automount or autofs perhpas something else, usbmount doesnt work either with or without this.
TIA
uNi
(2012-10-20, 21:13)john.cord Wrote: Check is you use proper GID UID becaus in my case i had to change them to 1000 and check if you got the udisks package. For me automount is working with devices connected before boot.
:~# id xbmc
uid=1000(xbmc) gid=1000(xbmc) groups=1000(xbmc),4(adm),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),104(fuse)
(2012-10-20, 21:37)john.cord Wrote: But the point is that it should be unnecessary if a device is plugged in before the machine is running. It should be mounted in both cases...
(2012-10-21, 00:26)john.cord Wrote: BTW: Maybe add this to the guide ??
--> USB Wakeup via UDEV Rule on Ubuntu 12.04
:~# id xbmc
uid=1000(xbmc) gid=1000(xbmc) groups=1000(xbmc),4(adm),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),104(fuse)
ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"
sudo adduser xbmc users
:~# id xbmc
uid=1000(xbmc) gid=1000(xbmc) groups=1000(xbmc),4(adm),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),100(users),104(fuse)
<audio>
<streamsilence>1</streamsilence>
</audio>
<advancedsettings>
<audio>
<streamsilence>1</streamsilence>
</audio>
</advancedsettings>
13:38:41 T:3045804864 DEBUG: CSoftAE::Run - Sink restart flagged
13:38:41 T:3045804864 INFO: CSoftAE::InternalOpenSink - sink incompatible, re-starting
13:38:41 T:3045804864 INFO: CAESinkALSA::Initialize - Attempting to open device "hdmi:CARD=NVidia,DEV=0"
13:38:41 T:3045804864 INFO: CAESinkALSA - ALSA: pcm_hw.c:1293:(snd_pcm_hw_open) open '/dev/snd/pcmC0D3p' failed (-16): Device or resource busy
13:38:41 T:3045804864 INFO: CAESinkALSA - Unable to open device "hdmi:CARD=NVidia,DEV=0,AES0=0x04,AES1=0x82,AES2=0x00,AES3=0x00" for playback
13:38:41 T:3045804864 INFO: CAESinkALSA - ALSA: pcm_hw.c:1293:(snd_pcm_hw_open) open '/dev/snd/pcmC0D3p' failed (-16): Device or resource busy
13:38:41 T:3045804864 INFO: CAESinkALSA - Unable to open device "hdmi:CARD=NVidia,DEV=0" for playback
13:38:41 T:3045804864 ERROR: CAESinkALSA::Initialize - failed to initialize device "hdmi:CARD=NVidia,DEV=0"
13:38:41 T:3045804864 DEBUG: CSoftAE::InternalOpenSink - NULL Initialized:
(2012-10-21, 15:33)uNiversal Wrote: I will try with no menu sounds, but if I disable syncback to display sound works, though with or without sound judder is a issue.
TIA
uNi