DaemonForums  

Go Back   DaemonForums > Miscellaneous > Guides

Guides All Guides and HOWTO's.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 15th May 2008
BSDKaffee's Avatar
BSDKaffee BSDKaffee is offline
Real Name: Jason Hale
Coffee Addict
 
Join Date: May 2008
Location: Wintersville, Ohio
Posts: 212
Default Automounting CDs/DVDs in KDE on FreeBSD

Automounting CDs/DVDs in KDE on FreeBSD

This guide was written for all officially supported versions of FreeBSD with the most current ports versions. If you are having trouble with these instructions, first make sure you are using the latest available versions of the ports mentioned. Specifically, this guide was written for the following ports with the following versions:
  • x11/kdebase3 (3.5.8+) and/or x11/kdebase4 (4.1.1+)
  • sysutils/hal (0.5.11.r2+)
  • sysutils/policykit (0.7+)

1) Hardware Abstraction Layer
KDE uses a system called Hardware Abstraction Layer (HAL) to automatically mount CDs and DVDs. By default, KDE 3.x and KDE 4.x are built with HAL support. The KDE 3.x ports allow you to disable HAL support, so make sure you did not disable it. If you are not sure, try running the following command:
$ find `kde-config --prefix`/lib/kde3/media_propsdlgplugin.so && echo "HAL is enabled."
This will search the prefix that you installed KDE 3.x in (most likely /usr/local) for a certain file that is only installed if HAL is enabled. If HAL is enabled, "HAL is enabled" will be echoed to the screen and you may proceed. If HAL is not enabled, you will see a message from find saying that the file does not exist. At this point, you will have to rebuild x11/kdebase3 with HAL enabled.

2) Permissions / Groups
You will need to be sure you have correct permissions to use the CD/DVD device. You should at least set the read bit for your device, otherwise you will not be able to use the "Eject" feature. If you use ATAPICAM, HAL will make use of the device created by it, so be sure to set the permissions for this device. For example, if you have one ATAPI CD-ROM drive with ATAPICAM enabled, set the following permissions:
# chmod 644 /dev/acd0 /dev/cd0
If you have a CD-Writer with ATAPICAM enabled, you may want to set the write bit as well:
# chmod 666 /dev/acd0 /dev/cd0
You will probably want these permissions set at boot time. Among other methods, you can use rulesets to accomplish this. Rulesets are defined in /etc/devfs.rules and you may have to create this file if it does not already exist. Below is an example /etc/devfs.rules to set read/write permissions on all of the CD drives attached to the computer:
Code:
# MYBOX's rules
#
[mybox_rules=100]
add path 'acd*' mode 666
add path 'cd*' mode 666
Then add the following line to /etc/rc.conf:
Code:
devfs_system_ruleset="mybox_rules"
Along with the proper permissions, you also need to be a member of the proper group. Your user must be a member of the operator group. For example if you want to add a user called "BSDKaffee" to the operator group, use the following command:
# pw groupmod operator -m BSDKaffee

References:
devfs(8)
devfs.rules(5)

3) /etc/fstab
Make sure you DO NOT have lines in /etc/fstab representing your CD/DVD drive. For example, if your fstab looks like this:
Code:
# Device	Mountpoint	FStype	Options		Dump	Pass#
/dev/ad0s1b	none		swap	sw		0	0
/dev/ad0s1a	/		ufs	rw		1	1
/dev/ad0s1e	/tmp		ufs	rw		2	2
/dev/ad0s1f	/usr		ufs	rw		2	2
/dev/ad0s1d	/var		ufs	rw		2	2
/dev/acd0	/cdrom		cd9660	ro,noauto	0	0
/dev/cd0	/cdrom		cd9660	ro,noauto	0	0
Then either comment out the lines for /dev/acd0 and /dev/cd0, or remove them. I would recommend just commenting them in case you want to use your drive(s) without HAL later.

4) /etc/rc.conf
You will need to add a few lines to /etc/rc.conf to enable HAL and a few other related services. Add the following lines to /etc/rc.conf:
Code:
dbus_enable="YES"
hald_enable="YES"
You will have to start these services manually if you don't want to reboot.
Code:
# /usr/local/etc/rc.d/dbus start
# /usr/local/etc/rc.d/hald start
5) PolicyKit
HAL uses PolicyKit to verify that you are authorized to mount the CD/DVD. You will need to edit /usr/local/etc/PolicyKit/PolicyKit.conf and specify that your username is authorized. Below is an example PolicyKit.conf file that authorizes root to do any action and a user named BSDKaffee to mount a CD/DVD.
Code:
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->

<!DOCTYPE pkconfig PUBLIC "-//freedesktop//DTD PolicyKit Configuration 1.0//EN"
"http://hal.freedesktop.org/releases/PolicyKit/1.0/config.dtd">

<!-- See the manual page PolicyKit.conf(5) for file format -->

<config version="0.1">
    <match user="root">
        <return result="yes"/>
    </match>
    <define_admin_auth group="wheel"/>
    <match action="org.freedesktop.hal.storage.mount-removable">
      <match user="BSDKaffee">
        <return result="yes"/>
      </match>
    </match>
</config>
References:
PolicyKit.conf(5)
http://www.freebsd.org/gnome/docs/halfaq.html

6) Restart KDE
After making all of these changes, you will need to restart KDE.

7) Desktop Icons
This is optional and only for KDE 3.x, but you may like an icon to automatically appear on your desktop whenever you insert a CD/DVD for easy access. To do this, open the KDE Control Center. Click on Desktop --> Behavior. Click the Device Icons tab. Check the boxes for Mounted CD Writer, Mounted CD-ROM, and Mounted DVD.

Depending on the type of drive you have, you may not need to check all of these boxes but it won't hurt if you do. For example if you just have a plain read-only CD-ROM drive, you will not need to check Mounted CD Writer or Mounted DVD. Now click on Apply.

KDE 4.x uses a device manager which is in the panel by default. The icon looks like a laptop computer. If you click on it, it will show you a list of CDs/DVDs you have in your drive(s). You can chose to mount them, unmount them, and eject them through this interface. Alternatively, Dolphin provides access to your optical media.

----
I think that's about everything there is to Automounting in KDE. Most of this should apply to other OSes, but I am only familiar with FreeBSD so I can't claim that it will work. Any suggestions to improve this How-To are appreciated.

Last edited by BSDKaffee; 8th October 2008 at 11:22 PM. Reason: add notes for KDE 4.x
Reply With Quote
  #2   (View Single Post)  
Old 17th May 2008
mfaridi's Avatar
mfaridi mfaridi is offline
Spam Deminer
 
Join Date: May 2008
Location: Afghanistan
Posts: 320
Default

Can we use this guide for auto mounting CDs/DVDs in Gnome on FreeBSD 7 ??
Reply With Quote
  #3   (View Single Post)  
Old 21st May 2008
BSDKaffee's Avatar
BSDKaffee BSDKaffee is offline
Real Name: Jason Hale
Coffee Addict
 
Join Date: May 2008
Location: Wintersville, Ohio
Posts: 212
Default

Quote:
Originally Posted by mfaridi View Post
Can we use this guide for auto mounting CDs/DVDs in Gnome on FreeBSD 7 ??
I am not familiar with GNOME (KDE for life! ). However, most of the information should still apply to GNOME if you don't use GDM, at least Steps 2-5.

If you do use GDM (or want to), then modify Step 4 so you add to /etc/rc.conf:
Code:
gnome_enable="YES"
And omit:
Code:
dbus_enable="YES"
hald_enable="YES"
If you use GDM, you may skip Step 5 too.

You may also want to look at the FreeBSD GNOME HAL FAQ.
Reply With Quote
  #4   (View Single Post)  
Old 4th September 2008
rex rex is offline
Real Name: Nikhil Rathod
Shell Scout
 
Join Date: May 2008
Location: Chicago
Posts: 114
Default

So did anybody tried with gnome. Did it worked? what else should we take care of apart from what ever is mentioned my the author.
Reply With Quote
  #5   (View Single Post)  
Old 4th September 2008
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,056
Default

Quote:
Originally Posted by rex View Post
So did anybody tried with gnome. Did it worked? what else should we take care of apart from what ever is mentioned my the author.
Yes it worked.
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
  #6   (View Single Post)  
Old 4th September 2008
BuSerD's Avatar
BuSerD BuSerD is offline
Real Name: Alejandro
Noob In Training
 
Join Date: Aug 2008
Location: Houston, TX
Posts: 14
Default

Quote:
Originally Posted by rex View Post
So did anybody tried with gnome. Did it worked? what else should we take care of apart from what ever is mentioned my the author.
I can also confirm that it works.
Reply With Quote
  #7   (View Single Post)  
Old 5th September 2008
s0xxx's Avatar
s0xxx s0xxx is offline
Package Pilot
 
Join Date: May 2008
Posts: 192
Default

I might be wrong, but when I was setting up automounting on FreeBSD I needed polkitd_enable="YES" also. I don't have FreeBSD to try out right now though.
__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn.
If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD
Reply With Quote
  #8   (View Single Post)  
Old 5th September 2008
BSDKaffee's Avatar
BSDKaffee BSDKaffee is offline
Real Name: Jason Hale
Coffee Addict
 
Join Date: May 2008
Location: Wintersville, Ohio
Posts: 212
Default

Quote:
Originally Posted by s0xxx View Post
I might be wrong, but when I was setting up automounting on FreeBSD I needed polkitd_enable="YES" also. I don't have FreeBSD to try out right now though.
PolicyKit has changed. polkitd has migrated from sbin to libexec. Starting with version 0.7, adding polkitd_enable="YES" to /etc/rc.conf won't do anything, since there is no longer an rc file for polkitd.
Reply With Quote
  #9   (View Single Post)  
Old 11th September 2008
running_fist running_fist is offline
Port Guard
 
Join Date: May 2008
Location: NEPennsylvania
Posts: 12
Default Error mounting flashdrive - solved

I was getting the following error trying to mount a jumpdrive
Error: org.freedesktop.hal.storage.mount-removable no <-- (action, result)

found this , I don't know what Lunar is but the policykit addition solved my problem:
http://foo-projects.org/pipermail/lu...st/008081.html

Error: org.freedesktop.hal.storage.mount-removable no <-- (action, result) [Resolved]
Zbigniew Luszpinski zbiggy at o2.pl
Sat Aug 16 14:14:05 CEST 2008

Previous message: weekly news - 20080815
Next message: weekly news - 20080822
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello,

if you use kde3 (or other DM) in Lunar and insert pendrive or any other hot
plugable device the kde will show you option to mount it. If an user will
agree to mount it the error will appear:
"org.freedesktop.hal.storage.mount-removable no <-- (action, result)"

There is easy fix for this error. Just define security rules
in /etc/PolicyKit/PolicyKit.conf like these:

<config version="0.1">

<match action="org.freedesktop.hal.storage.mount-removable">
<match user="Put user account name here">
<return result="yes"/>
</match>
</match>

<match action="org.freedesktop.hal.storage.mount-fixed">
<match user="Put user account name here">
<return result="yes"/>
</match>
</match>

</config>

First rule allows automounting pendrives, the second one is for fixed disks
like hard drives.

have a nice day,
Zbigniew 'zbiggy' Luszpinski

Previous message: weekly news - 20080815
Next message: weekly news - 20080822
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Lunar mailing list


JLT
Reply With Quote
Old 20th December 2008
maxrussell maxrussell is offline
Package Pilot
 
Join Date: May 2008
Location: Montrose, Angus
Posts: 181
Default

For me that turns up as an unmounted UDF volume on the desktop...

also, the UDF Volume count increases if I remove the disc and replace, without seeing any files...

Last edited by maxrussell; 20th December 2008 at 04:40 PM.
Reply With Quote
Old 10th October 2009
Mr-Biscuit Mr-Biscuit is offline
Banned
 
Join Date: May 2008
Posts: 272
Default

Code:
# vi fstab

# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ad4s3b             none            swap    sw              0       0
/dev/ad4s3a             /               ufs     rw              1       1
/dev/ad4s3f             /home           ufs     rw              2       2
/dev/ad4s3d             /tmp            ufs     rw              2       2
/dev/ad4s3g             /usr            ufs     rw              2       2
/dev/ad4s3e             /var            ufs     rw              2       2
#/dev/acd0              /cdrom          cd9660  ro,noauto       0       0
linproc       /usr/compat/linux/proc  linprocfs  rw             0       0
Can't chmod because commented and do not have user permissions to mount and use drive.
Commented out the entry to allow dbus and hal to control mounting of media.
The other problem is that I use a different desktop environment for each user account. Ejecting the cd worked in kde4 but in gnome, the disc was not released.
I've noticed that in ports, there are three versions of policykit: default, kde, and gnome. Is it going to be necessary to install anything more than the default?

Edit: This error has been solved.

Last edited by Mr-Biscuit; 18th October 2009 at 04:52 AM.
Reply With Quote
Reply

Tags
freebsd, hal, kde

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automounting DVD/USB rex FreeBSD General 2 4th September 2008 08:03 PM
Automounting USB devices with HAL/KDE vinegaroon FreeBSD General 1 13th June 2008 02:16 PM
Automounting drives jwhal OpenBSD General 4 12th June 2008 05:00 PM
Playing DVDs drhowarddrfine FreeBSD Ports and Packages 9 30th May 2008 02:46 PM


All times are GMT. The time now is 11:00 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick