https://wiki.archlinux.org/api.php?action=feedcontributions&user=Mamciek&feedformat=atomArchWiki - User contributions [en]2024-03-28T12:24:06ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Bluetooth&diff=251063Bluetooth2013-03-17T20:29:07Z<p>Mamciek: /* Examples */</p>
<hr />
<div>[[Category:Bluetooth]]<br />
[[cs:Bluetooth]]<br />
[[de:Bluetooth]]<br />
[[es:Bluetooth]]<br />
[[fr:Bluetooth]]<br />
[[it:Bluetooth]]<br />
[[ru:Bluetooth]]<br />
[[zh-CN:Bluetooth]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers the installation and use of Bluetooth on Arch Linux.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Bluetooth mouse configuration}}<br />
{{Article summary end}}<br />
<br />
[http://www.bluetooth.org/ Bluetooth] is a standard for the short-range wireless interconnection of cellular phones, computers, and other electronic devices. In Linux, the canonical implementation of the Bluetooth protocol stack is [http://www.bluez.org/ BlueZ].<br />
<br />
== Installation ==<br />
To use Bluetooth, [[pacman|install]] {{Pkg|bluez}}, available in the [[Official Repositories]]. The {{ic|dbus}} daemon(start automatically by systemd) is used to read settings and for PIN pairing, while the {{ic|bluetooth}} daemon is required for the Bluetooth protocol.<br />
<br />
Start the bluetooth service:<br />
# systemctl start bluetooth.service<br />
<br />
Enable the bluetooth service at system boot up:<br />
# systemctl enable bluetooth.service<br />
<br />
== Graphical front-ends ==<br />
<br />
The following packages allow for a graphical interface to customize Bluetooth.<br />
<br />
=== Blueman ===<br />
<br />
[http://blueman-project.org Blueman] is a full featured Bluetooth manager written in [[GTK+]] and, as such, is recommended for [[GNOME]] or [[Xfce]]. You can install Blueman with the package {{Pkg|blueman}}, available in the [[Official Repositories]].<br />
<br />
Be sure that {{ic|bluetooth}} daemon is running as described above, and execute {{ic|blueman-applet}}. To make the applet run on login add {{ic|blueman-applet}} either under ''System -> Preferences -> Startup Applications'' (GNOME) or ''Xfce Menu -> Settings -> Session and Startup'' (Xfce).<br />
<br />
In order for a user to add and manage Bluetooth devices using Blueman, the user must be added to the 'lp' group. See /etc/dbus-1/system.d/bluetooth.conf for the section that enables users of the 'lp' group to communicate with the Bluetooth daemon.<br />
<br />
{{Note|If you are running Blueman outside GNOME/GDM (e.g., in Xfce using the {{ic|startx}} command) you should add {{ic|. /etc/X11/xinit/xinitrc.d/*}} on top of your {{ic|~/.xinitrc}} to make Nautilus capable to browse your devices.}}<br />
<br />
To receive files don't forget to right click on the ''Blueman tray icon -> Local Services -> Transfer -> File Receiving" and tick the square box next to "Enabled".<br />
<br />
==== Script for Thunar ====<br />
If you are not using Nautilus (for example Thunar) you may find the following script useful:<br />
{{hc|obex_thunar.sh|<br />
#!/bin/bash<br />
fusermount -u ~/bluetooth<br />
obexfs -b $1 ~/bluetooth<br />
thunar ~/bluetooth<br />
}}<br />
Now you will need to move the script to an appropriate location (e.g., {{ic|/usr/bin}}). After that, mark it as executable:<br />
{{bc|chmod +x /usr/bin/obex_thunar.sh}}<br />
The last step is to change the line in ''Blueman tray icon -> Local Services -> Transfer -> Advanced'' to {{ic|obex_thunar.sh %d}}.<br />
<br />
=== GNOME Bluetooth ===<br />
<br />
[http://live.gnome.org/GnomeBluetooth GNOME Bluetooth] is a fork of the old ''bluez-gnome'' and is focused on integration with the [[GNOME]] desktop environment. GNOME Bluetooth is required by {{Pkg|gnome-shell}}, so you should already have it installed if you are running GNOME 3. Otherwise, it can be installed with the package {{Pkg|gnome-bluetooth}}.<br />
<br />
Run {{ic|bluetooth-applet}} for a nice Bluetooth applet. You should now be able to setup devices and send files by right-clicking the Bluetooth icon. To make the applet run on login, add it to ''System -> Preferences -> Startup Applications''.<br />
<br />
To add a Bluetooth entry to the ''SendTo'' menu in Thunar's file properties menu, see instructions [http://thunar.xfce.org/pwiki/documentation/sendto_menu here].<br />
<br />
=== BlueDevil ===<br />
<br />
The Bluetooth tool for [[KDE]] is [https://projects.kde.org/projects/extragear/base/bluedevil BlueDevil]. It can be installed with the package {{Pkg|bluedevil}}, available in the [[Official Repositories]].<br />
<br />
Make sure {{ic|bluetooth}} daemon is running, as described above. You should get a Bluetooth icon both in Dolphin and in the system tray, from which you can configure BlueDevil and detect Bluetooth devices by clicking the icon. You can also configure BlueDevil from the KDE System Settings<br />
<br />
=== Fluxbox, Openbox, other WM ===<br />
Of course you can still use the preceding applications even if GNOME, Xfce or KDE are not your desktop manager. This list should help you figuring out which application does what:<br />
* bluetooth-applet -- tray icon with access to settings, pairing wizard, management of known devices<br />
* /usr/lib/gnome-user-share/gnome-user-share -- needs to be running if you're about to receive files via obexBT from a paired/bonded device<br />
<br />
if you're receiving an error during transmission and/or there's no file received add this into<br />
<br />
{{ic|/etc/dbus-1/system.d/bluetooth.conf}}<br />
<policy user="your_user_id"><br />
<allow own="org.bluez"/><br />
<allow send_destination="org.bluez"/><br />
<allow send_interface="org.bluez.Agent"/><br />
</policy><br />
<br />
* bluetooth-wizard -- for new devices to be paired<br />
* bluetooth-properties -- accessible also via bluetooth-applet icon<br />
* gnome-file-share-properties -- permissions on receiving files via bluetooth<br />
* bluez-sendto -- gui for sending files to a remote device<br />
<br />
== Manual configuration ==<br />
<br />
To configure BlueZ manually, you may need to edit the configuration files in {{ic|/etc/bluetooth}}. These are:<br />
audio.conf<br />
input.conf<br />
main.conf<br />
network.conf<br />
rfcomm.conf<br />
<br />
The default configuration should work for most purposes. Most configuration options are well-documented in these files, so customization is a simple matter of reading the option descriptions. For general options, start with {{ic|main.conf}}.<br />
<br />
<br />
=== Audio Streaming ===<br />
<br />
You can use {{aur|bluez-tools}} from the [[AUR]] with pulseaudio to stream audio to a bluetooth headset. <br />
Find the MAC of the headset:<br />
$ hcitool scan<br />
Connect to the headset:<br />
$ bt-audio -c XX:XX:XX:XX:XX:XX<br />
Open pulseaudio volume control:<br />
$ pavucontrol<br />
The headset should show up in the Configuration tab.<br />
<br />
== Pairing ==<br />
Many bluetooth devices require [http://en.wikipedia.org/wiki/Bluetooth#Pairing pairing].<br />
The exact procedure depends on the devices involved and their input functionality.<br />
<br />
The procedure on a mobile may be as follows:<br />
* The computer sends a connect request to the mobile. <br />
* A pin, determined by the computer, is prompted for at the mobile<br />
* The same key must be re-entered at the computer.<br />
<br />
To pair with a device without using the gnome-bluez package, the ''bluez-simple-agent'' utility that comes with the bluez package can be used. This utility depends on two packages from [extra]:<br />
<br />
# pacman -S python2-dbus python2-gobject <br />
<br />
First, scan for external devices:<br />
$ hcitool scan<br />
<br />
Run the script as root:<br />
<br />
# bluez-simple-agent<br />
<br />
The message "Agent registered" should be returned, press control-c to quit. <br />
<br />
Below is a basic example of pairing with a specific device. The script will ask for the passcode, enter the code and confirm with enter.<br />
<br />
# bluez-simple-agent hci0 00:11:22:33:AA:BB<br />
<br />
{{note|bluez-simple-agent is only needed once for pairing a device, not every time you want to connect.}}<br />
<br />
See the Examples section below for pairing examples with various devices.<br />
<br />
== Using Obex for sending and receiving files ==<br />
Another option, rather than using KDE or Gnome Bluetooth packages, is Obexfs which allows you to mount your phone and treat it as part of your filesystem. Note that to use Obexfs, you need a device that provides an Obex FTP service.<br />
<br />
To install;<br />
# pacman -S obexfs<br />
<br />
and then your phone can then be mounted running as root <br />
# obexfs -b <devices mac address> /mountpoint<br />
<br />
For more mounting options see http://dev.zuckschwerdt.org/openobex/wiki/ObexFs<br />
<br />
For devices don't support Obex FTP service, check if Obex Object Push is supported.<br />
<br />
# sdptool browse XX:XX:XX:XX:XX:XX<br />
<br />
Read the output, look for Obex Object Push, remember the channel for this service. If supported, you can use ussp-push to send files to this device:<br />
<br />
# ussp-push XX:XX:XX:XX:XX:XX@CHANNEL file wanted_file_name_on_phone<br />
<br />
== Examples ==<br />
<br />
=== Siemens S55 ===<br />
<br />
This is what I did to connect to my S55. (I have not figured out how to initiate the connection from the phone)<br />
* The steps under installation<br />
* <br />
$> hcitool scan<br />
Scanning ...<br />
XX:XX:XX:XX:XX:XX NAME<br />
$> B=XX:XX:XX:XX:XX:XX<br />
Start the simple-agent in a second terminal<br />
$> su -c bluez-simple-agent <br />
Password: <br />
Agent registered<br />
Back to the first console <br />
$> obexftp -b $B -l "Address book"<br />
# Phone ask for pin, I enter it and answer yes when asked if I want to save the device<br />
...<br />
<file name="5F07.adr" size="78712" modified="20030101T001858" user-perm="WD" group-perm="" /><br />
...<br />
$> obexftp -b 00:01:E3:6B:FF:D7 -g "Address book/5F07.adr"<br />
Browsing 00:01:E3:6B:FF:D7 ...<br />
Channel: 5<br />
Connecting...done<br />
Receiving "Address book/5F07.adr"... Sending "Address book"... done<br />
Disconnecting...done<br />
$> obexftp -b 00:01:E3:6B:FF:D7 -p a <br />
...<br />
Sending "a"... done<br />
Disconnecting...done<br />
<br />
=== Logitech Mouse MX Laser / M555b ===<br />
<br />
To quickly test the connection:<br />
<br />
$> hidd --connect XX:XX:XX:XX:XX:XX<br />
<br />
For automated reconnection, use your desktop wizard to configure the bluetooth mouse.<br />
If your desktop environment doesn't includes support for this task, see the [[Bluetooth mouse manual configuration]] guide.<br />
<br />
=== Motorola V900 ===<br />
<br />
After installing blueman and running blueman-applet, click "find me" under connections -> bluetooth in motorla device. In blueman-applet, scan devices, find the motorola, click "add" in blueman-applet. Click "bond" in blueman-applet, enter some pin, enter the same pin in motorola when it asks. In terminal:<br />
<br />
cd ~/<br />
mkdir bluetooth-temp<br />
obexfs -n xx:yy:zz:... ~/bluetooth-temp<br />
cd ~/bluetooth-temp<br />
<br />
and browse... Only audio, video, and pictures are available when you do this.<br />
<br />
=== Motorola RAZ ===<br />
<br />
> pacman -S obextool obexfs obexftp openobex bluez<br />
<br />
> lsusb<br />
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 002 Device 002: ID 03f0:171d Hewlett-Packard Wireless (Bluetooth + WLAN) Interface [Integrated Module]<br />
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
<br />
> hciconfig hci0 up<br />
<br />
> hciconfig<br />
hci0: Type: BR/EDR Bus: USB<br />
BD Address: 00:16:41:97:BA:5E ACL MTU: 1017:8 SCO MTU: 64:8<br />
UP RUNNING<br />
RX bytes:348 acl:0 sco:0 events:11 errors:0<br />
TX bytes:38 acl:0 sco:0 commands:11 errors:0<br />
<br />
> hcitool dev<br />
Devices:<br />
hci0 00:16:41:97:BA:5E<br />
<br />
'''Attention: make sure that bluetooth on your phone is enabled and your phone is visible! <br />
'''<br />
<br />
> hcitool scan<br />
Scanning ...<br />
00:1A:1B:82:9B:6D [quirxi]<br />
<br />
> hcitool inq<br />
Inquiring ...<br />
00:1A:1B:82:9B:6D clock offset: 0x1ee4 class: 0x522204<br />
<br />
> l2ping 00:1A:1B:82:9B:6D<br />
Ping: 00:1A:1B:82:9B:6D from 00:16:41:97:BA:5E (data size 44) ...<br />
44 bytes from 00:1A:1B:82:9B:6D id 0 time 23.94ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 1 time 18.85ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 2 time 30.88ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 3 time 18.88ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 4 time 17.88ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 5 time 17.88ms<br />
6 sent, 6 received, 0% loss<br />
<br />
> hcitool name 00:1A:1B:82:9B:6D<br />
[quirxi]<br />
<br />
# hciconfig -a hci0<br />
hci0: Type: BR/EDR Bus: USB<br />
BD Address: 00:16:41:97:BA:5E ACL MTU: 1017:8 SCO MTU: 64:8<br />
UP RUNNING<br />
RX bytes:9740 acl:122 sco:0 events:170 errors:0<br />
TX bytes:2920 acl:125 sco:0 commands:53 errors:0<br />
Features: 0xff 0xff 0x8d 0xfe 0x9b 0xf9 0x00 0x80<br />
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3<br />
Link policy:<br />
Link mode: SLAVE ACCEPT<br />
Name: 'BCM2045'<br />
Class: 0x000000<br />
Service Classes: Unspecified<br />
Device Class: Miscellaneous,<br />
HCI Version: 2.0 (0x3) Revision: 0x204a<br />
LMP Version: 2.0 (0x3) Subversion: 0x4176<br />
Manufacturer: Broadcoml / Corporation (15)<br />
<br />
> hcitool info 00:1A:1B:82:9B:6D<br />
Requesting information ...<br />
BD Address: 00:1A:1B:82:9B:6D<br />
Device Name: [quirxi]<br />
LMP Version: 1.2 (0x2) LMP Subversion: 0x309<br />
Manufacturer: Broadcom Corporation (15)<br />
Features: 0xff 0xfe 0x0d 0x00 0x08 0x08 0x00 0x00<br />
<3-slot packets> <5-slot packets> <encryption> <slot offset><br />
<timing accuracy> <role switch> <hold mode> <sniff mode><br />
<RSSI> <channel quality> <SCO link> <HV2 packets><br />
<HV3 packets> <A-law log> <CVSD> <power control><br />
<transparent SCO> <AFH cap. slave> <AFH cap. master><br />
<br />
'''Edit your main.conf and enter the proper class for your phone ( Class = 0x100100 ):'''<br />
> vim /etc/bluetooth/main.conf<br />
<br />
# Default device class. Only the major and minor device class bits are<br />
# considered.<br />
#Class = 0x000100<br />
Class = 0x100100<br />
<br />
> /etc/rc.d/dbus start<br />
:: Starting D-BUS system messagebus <br />
[DONE]<br />
<br />
> /etc/rc.d/bluetooth start<br />
:: Stopping bluetooth subsystem: pand dund rfcomm hidd bluetoothd<br />
[DONE]<br />
:: Starting bluetooth subsystem: bluetoothd<br />
<br />
'''Pairing with bluez-simple-agent only has to be done once. On your motorola-phone give 0000 in as your pin when phone asks for it !!'''<br />
> /usr/bin/bluez-simple-agent hci0 00:1A:1B:82:9B:6D<br />
RequestPinCode (/org/bluez/10768/hci0/dev_00_1A_1B_82_9B_6D)<br />
Enter PIN Code: 0000<br />
Release<br />
New device (/org/bluez/10768/hci0/dev_00_1A_1B_82_9B_6D)<br />
<br />
'''Now you can browse the filesystem of your phone with obexftp:'''<br />
> obexftp -v -b 00:1A:1B:82:9B:6D -B 9 -l<br />
Connecting..\done<br />
Tried to connect for 448ms<br />
Receiving "(null)"...-<?xml version="1.0" ?><br />
<!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd"><br />
<folder-listing><br />
<parent-folder /><br />
<folder name="audio" size="0" type="folder" modified="20101010T132323Z" user-perm="RW" /><br />
<folder name="video" size="0" type="folder" modified="20101010T132323Z" user-perm="RW" /><br />
<folder name="picture" size="0" type="folder" modified="20101010T132323Z" user-perm="RW" /><br />
</folder-listing><br />
done<br />
Disconnecting..\done<br />
<br />
'''Or you can mount your phone into a directory on your computer and treat it like a normal file system:'''<br />
<br />
> groupadd bluetooth<br />
> mkdir /mnt/bluetooth<br />
> chown root:bluetooth /mnt/bluetooth<br />
> chmod 775 /mnt/bluetooth<br />
> usermod -a -G bluetooth arno<br />
<br />
> obexfs -b 00:1A:1B:82:9B:6D /mnt/bluetooth/<br />
> l /mnt/bluetooth/<br />
total 6<br />
drwxr-xr-x 1 root root 0 10. Okt 13:25 .<br />
drwxr-xr-x 5 root root 4096 10. Okt 10:08 ..<br />
drwxr-xr-x 1 root root 0 10. Okt 2010 audio<br />
drwxr-xr-x 1 root root 0 10. Okt 2010 picture<br />
drwxr-xr-x 1 root root 0 10. Okt 2010 video<br />
<br />
=== Pairing with an iPhone using bluez-simple-agent ===<br />
<br />
Assuming a bluetooth device called hci0 and an iPhone that showed up in a hcitool scan as '00:00:DE:AD:BE:EF':<br />
<br />
# bluez-simple-agent hci0 00:00:DE:AD:BE:EF<br />
Passcode:<br />
<br />
=== Headset and Alsa Devices ===<br />
1. First if you have not already, install bluez<br />
# pacman -S bluez<br />
2. Scan for your device<br />
$ hcitool (-i <optional hci#>***) scan<br />
3. Pair your headset with your device<br />
$ bluez-simple-agent (optional hci# ***) XX:XX:XX:XX:XX:XX<br />
and put in your pin (0000 or 1234, etc)<br />
4. Add this to your/etc/asound.conf file<br />
#/etc/asound.conf<br />
<br />
pcm.btheadset {<br />
type plug<br />
slave {<br />
pcm {<br />
type bluetooth<br />
device XX:XX:XX:XX:XX:XX <br />
profile "auto"<br />
} <br />
} <br />
hint {<br />
show on<br />
description "BT Headset"<br />
} <br />
}<br />
ctl.btheadset {<br />
type bluetooth<br />
} <br />
<br />
5. Check to see if it has been added to alsa devices<br />
$ aplay -L<br />
<br />
6. Now play with aplay:<br />
$ aplay -D btheadset /path/to/audio/file<br />
<br />
or Mplayer:<br />
$ mplayer -ao alsa:device=btheadset /path/to/audio/or/video/file<br />
<br />
*** To find hci# for a usb dongle, type in <br />
$ hcitool dev<br />
<br />
=== Microsoft Bluetooth Mobile Keyboard 6000 ===<br />
<br />
1. Scan for your device<br />
$ hcitool (-i <optional hci#>***) scan<br />
Scanning ...<br />
00:11:22:33:44:55 Microsoft Bluetooth Mobile Keyboard 6000<br />
<br />
<br />
2. On second console run as root (do not terminate):<br />
# bluez-simple-agent<br />
Agent registered<br />
<br />
3. Back on first console run:<br />
$ bluez-simple-agent hci0 00:11:22:33:44:55<br />
Enter PIN Code: 1234<br />
(now enter that pin on the keyboard and press enter)<br />
Release<br />
New device (/org/bluez/5373/hci0/dev_00_11_22_33_44_55)<br />
<br />
4.<br />
$ bluez-test-device trusted 00:11:22:33:44:55<br />
<br />
5.<br />
$ bluez-test-input connect 00:11:22:33:44:55<br />
<br />
No your keyboard should work. You can terminate bluez-simple-agent on second console with Ctrl-C<br />
<br />
== Troubleshooting ==<br />
<br />
=== Segfaults in Bluez 4.95 ===<br />
If bluetoothd stops working after enabling or disabling your bluetooth device via rfkill or gnome-bluetooth applet, look at your dmesg output. If it looks like:<br />
<br />
bluetoothd[2330]: segfault at 1 ip 00007fcef2327b75 sp 00007fff9f769cb0 error 4 in libglib-2.0.so.0.2800.8[7fcef22ca000+e9000]<br />
<br />
then you should consider downgrading to 4.94 (just grab the PKGBUILD/etc from arch and change version to 4.94 and correct the md5sum for bluez) or wait for an update of bluez. [https://bugs.archlinux.org/task/25088?project=1&openedfrom=-1+week Here] is a (arch) bug report about it.<br />
<br />
=== passkey-agent ===<br />
$> passkey-agent --default 1234<br />
Can't register passkey agent<br />
The name org.bluez was not provided by any .service files<br />
You probably started {{ic|/etc/rc.d/bluetooth}} before {{ic|/etc/rc.d/dbus}}<br />
$> hciconfig dev<br />
# (no listing)<br />
Try running {{ic|hciconfig hc0 up}}<br />
<br />
=== Blueman ===<br />
If blueman-applet fails to start, try removing the entire ''/var/lib/bluetooth'' directory and restarting the machine (or just the hal, dbus, and bluetooth services).<br />
# rm -rf /var/lib/bluetooth<br />
# reboot<br />
<br />
=== gnome-bluetooth ===<br />
If you see this when trying to enable receiving files in bluetooth-properties:<br />
Bluetooth OBEX start failed: Invalid path<br />
Bluetooth FTP start failed: Invalid path<br />
Then run:<br />
# pacman -S xdg-user-dirs<br />
$ xdg-user-dirs-update<br />
You can edit the paths using:<br />
$ vi ~/.config/user-dirs.dirs<br />
<br />
=== Bluetooth USB Dongle ===<br />
If you are using a USB dongle, you should check that your Bluetooth dongle is recognized. You can do that by inspecting {{ic|/var/log/messages.log}} when plugging in the USB dongle (or running {{ic|journalctl -f}} with systemd). It should look something like the following (look out for hci):<br />
<br />
# tail -f /var/log/messages.log<br />
Feb 20 15:00:24 hostname kernel: [ 2661.349823] usb 4-1: new full-speed USB device number 3 using uhci_hcd<br />
Feb 20 15:00:24 hostname bluetoothd[4568]: HCI dev 0 registered<br />
Feb 20 15:00:24 hostname bluetoothd[4568]: Listening for HCI events on hci0<br />
Feb 20 15:00:25 hostname bluetoothd[4568]: HCI dev 0 up<br />
Feb 20 15:00:25 hostname bluetoothd[4568]: Adapter /org/bluez/4568/hci0 has been enabled<br />
<br />
For a list of supported hardware please refer to the [[Bluetooth#Resources|resources]] section on this page.<br />
<br />
If you only get the first two lines, you may see that it found the device but you need to bring it up.<br />
Example:<br />
<br />
hciconfig -a hci0<br />
hci0: Type: USB<br />
BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0<br />
DOWN <br />
RX bytes:0 acl:0 sco:0 events:0 errors:0<br />
TX bytes:0 acl:0 sco:0 commands:0 errors:<br />
sudo hciconfig hci0 up<br />
hciconfig -a hci0<br />
hci0: Type: USB<br />
BD Address: 00:02:72:C4:7C:06 ACL MTU: 377:10 SCO MTU: 64:8<br />
UP RUNNING <br />
RX bytes:348 acl:0 sco:0 events:11 errors:0<br />
TX bytes:38 acl:0 sco:0 commands:11 errors:0<br />
<br />
If this fails with an error like:<br />
Operation not possible due to RF-kill<br />
it could be due either to the {{ic|rfkill}} utility, in which case it should be resolved with<br />
# rfkill unblock all<br />
or, it could simply be the hardware switch of the computer. The hardware bluetooth switch (at least sometimes) controls access to USB bluetooth dongles also. Flip/press this switch and try bringing the device up again.<br />
<br />
To verify that the device was detected you can use {{ic|hcitool}} which is part of the {{ic|bluez-utils}}. You can get a list of available devices and their identifiers and their MAC address by issuing:<br />
<br />
$ hcitool dev<br />
Devices:<br />
hci0 00:1B:DC:0F:DB:40<br />
<br />
More detailed informations about the device can be retrieved by using {{ic|hciconfig}}.<br />
<br />
$ hciconfig -a hci0<br />
hci0: Type: USB<br />
BD Address: 00:1B:DC:0F:DB:40 ACL MTU: 310:10 SCO MTU: 64:8<br />
UP RUNNING PSCAN ISCAN <br />
RX bytes:1226 acl:0 sco:0 events:27 errors:0<br />
TX bytes:351 acl:0 sco:0 commands:26 errors:0<br />
Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80<br />
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 <br />
Link policy: RSWITCH HOLD SNIFF PARK <br />
Link mode: SLAVE ACCEPT <br />
Name: 'BlueZ (0)'<br />
Class: 0x000100<br />
Service Classes: Unspecified<br />
Device Class: Computer, Uncategorized<br />
HCI Ver: 2.0 (0x3) HCI Rev: 0xc5c LMP Ver: 2.0 (0x3) LMP Subver: 0xc5c<br />
Manufacturer: Cambridge Silicon Radio (10)<br />
<br />
=== Logitech Bluetooth USB Dongle ===<br />
There are Logitech dongles (ex. Logitech MX5000) that can work in two modes Embedded and HCI. In embedded mode dongle emulates a USB device so it seems to your PC that your using a normal USB mouse/keyoard.<br />
<br />
If you hold the little red Button on the USB BT mini-receiver it will enable the other mode. Hold the red button on the BT dongle and plug it into the computer, and after 3-5 seconds of holding the button, the Bluetooth icon will appear in the system tray. [http://ubuntuforums.org/showthread.php?t=1332197 Discussion]<br />
<br />
=== hcitool scan: Device not found ===<br />
* On some Dell laptops (e.g. Studio 15) you have to switch the Bluetooth mode from HID to HCI using<br />
# hid2hci<br />
<br />
{{Note|hid2hci is no longer in the $PATH, it is under /lib/udev/hid2hci, but udev should run it automatically for you.}}<br />
<br />
* If the device won't show up and you have a Windows operating system on your machine, try booting it and enable the bluetooth adapter from windows.<br />
<br />
* Sometimes also this simple command helps:<br />
# hciconfig hci0 up<br />
<br />
=== My computer isn't visible ===<br />
Can't discover computer from your phone? Enable PSCAN and ISCAN:<br />
# enable PSCAN and ISCAN<br />
$ hciconfig hci0 piscan <br />
# check it worked<br />
$ hciconfig <br />
hci0: Type: USB<br />
BD Address: 00:12:34:56:78:9A ACL MTU: 192:8 SCO MTU: 64:8<br />
'''UP RUNNING PSCAN ISCAN'''<br />
RX bytes:20425 acl:115 sco:0 events:526 errors:0<br />
TX bytes:5543 acl:84 sco:0 commands:340 errors:0<br />
<br />
{{Note | Check DiscoverableTimeout and PairableTimeout in /etc/bluetooth/main.conf}}<br />
<br />
Try changing device class in /etc/bluetooth/main.conf as following<br />
# Default device class. Only the major and minor device class bits are<br />
# considered.<br />
#Class = 0x000100 (from default config)<br />
Class = 0x100100<br />
<br />
This was the only solution to make my computer visible for my phone. <br />
<br />
=== Nautilus cannot browse files ===<br />
If nautilus doesn't open and show this error:<br />
Nautilus cannot handle obex: locations. Couldn't display "obex://[XX:XX:XX:XX:XX:XX]/".<br />
Install gvfs-obexftp package:<br />
# pacman -S gvfs-obexftp<br />
<br />
=== Bluetooth is disabled when starting GNOME ===<br />
If you have {{ic|dbus}} and {{ic|bluetooth}} backgrounded (@) in your {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}, it might happen that {{ic|bluetooth}} will be disabled when starting up GNOME. To solve this, make sure {{ic|dbus}} is not backgrounded.<br />
<br />
=== Sennheiser MM400 Headset connection problems ===<br />
If your {{ic|Sennheiser MM400 Headset}} immediately disconnects after connecting as {{ic|Headset Service}} with Blueman, try to connect it as {{ic|Audio Sink}}. Afterwards you can change the headset's {{ic|Audio Profile}} to {{ic|Telephony Duplex}} with a right click in Blueman.<br />
With this option headset functionality will be available although the headset was only connected as {{ic|Audio Sink}} in first place and no disconnection will happen (tested with bluez 4.96-3, pulseaudio 1.1-1 and blueman 1.23-2).<br />
<br />
=== My device is paired but no sound is played from it ===<br />
Try to first inspect '''/var/log/messages.log'''<br />
{{bc|# tail /var/log/messages.log<br />
Jan 12 20:08:58 localhost pulseaudio[1584]: [pulseaudio] module-bluetooth-device.c: Service not connected<br />
Jan 12 20:08:58 localhost pulseaudio[1584]: [pulseaudio] module-bluetooth-device.c: Bluetooth audio service not available}}<br />
<br />
If you see such messages, try first:<br />
{{bc|# pactl load-module module-bluetooth-device}}<br />
<br />
If the module fails to work, do this workaround:<br />
Open '''/etc/bluetooth/audio.conf''' and add after '''[General]''' (on a new line)<br />
{{bc|Enable&#61;Socket}}<br />
Then restart the bluetooth daemon with {{ic|/etc/rc.d/bluetooth restart}}.<br />
Pair again your device, and you should find it in the pulseaudio settings (advanced settings for the sound)<br />
<br />
[http://wiki.gentoo.org/index.php?title=Bluetooth_Headset&redirect=no More information on Gentoo Wiki]<br />
<br />
If after fixing this you still can't get sound, try using blueman (this is the only one that works for me), make sure that notify-osd is installed or it might show you weird error messages like this one: "Stream setup failed"<br />
<br />
fail (/usr/lib/python2.7/site-packages/blueman/gui/manager/ManagerDeviceMenu.py:134)<br />
fail (DBusException(dbus.String(u'Stream setup failed'),),)<br />
<br />
== See also ==<br />
*[http://www.gentoo.org/doc/en/bluetooth-guide.xml Gentoo Linux Bluetooth Guide]<br />
*[http://en.opensuse.org/HCL:Bluetooth openSUSE Bluetooth Hardware Compatibility List]<br />
*[http://linuxgazette.net/109/oregan3.html Accessing a Bluetooth phone (Linux Gazette)]<br />
*[http://www.adamish.com/blog/#a000361 Bluetooth computer visibility]</div>Mamciekhttps://wiki.archlinux.org/index.php?title=Udev&diff=198745Udev2012-04-23T18:52:03Z<p>Mamciek: Added Lightweight Device Mounter</p>
<hr />
<div>[[Category:Hardware detection and troubleshooting]]<br />
[[Category:Auto-mounting]]<br />
{{i18n|Udev}}<br />
{{Lowercase title}}<br />
<br />
{{ic|udev}} replaces the functionality of both {{Ic|hotplug}} and {{Ic|hwdetect}}.<br />
<br />
''"udev is the device manager for the Linux kernel. Primarily, it manages device nodes in {{ic|/dev}}. It is the successor of devfs and hotplug, which means that it handles the {{ic|/dev}} directory and all user space actions when adding/removing devices, including firmware load."'' Source: [[Wikipedia:Udev|Wikipedia article]]<br />
<br />
udev loads kernel modules by utilizing coding parallelism to provide a potential performance advantage versus loading these modules serially. The modules are therefore loaded asynchronously. The inherent disadvantage of this method is that udev does not always load modules in the same order on each boot. If the machine has multiple block devices, this may manifest itself in the form of device nodes changing designations randomly. For example, if the machine has two hard drives, {{ic|/dev/sda}} may randomly become {{ic|/dev/sdb}}. See below for more info on this.<br />
<br />
== About udev rules ==<br />
udev rules written by the administrator go in {{ic|/etc/udev/rules.d/}}, their file name has to end with {{ic|.rules}}. The udev rules shipped with various packages are found in {{ic|/lib/udev/rules.d/}}. If there are two files by the same name under {{ic|/lib}} and {{ic|/etc}}, the ones in {{ic|/etc}} take precedence.<br />
<br />
If you want to learn how to write udev rules, see [http://www.reactivated.net/writing_udev_rules.html Writing udev rules].<br />
<br />
To get a list of all of the attributes of a device you can use to write rules, run this command:<br />
# udevadm info -a -n [device name]<br />
<br />
Replace {{ic|[device name]}} with the device present in the system, such as {{ic|/dev/sda}} or {{ic|/dev/ttyUSB0}}.<br />
<br />
udev automatically detects changes to rules files, so changes take effect immediately without requiring udev to be restarted. However, the rules are not re-triggered automatically on already existing devices, so hot-pluggable devices, such as USB devices, will probably have to be reconnected for the new rules to take effect.<br />
<br />
== UDisks ==<br />
Simply [[pacman|install]] the {{pkg|udisks}} package, and all of your media should be automatically mounted in [[GNOME]] and [[KDE]] SC 4.6. There is no need for any additional rules this way.<br />
As an extra bonus you can remove [[HAL]] if you were only using that for auto mounting purposes.<br />
<br />
=== Automounting UDisks Wrappers ===<br />
A UDisks wrapper has the advantage of being very easy to install and needing no (or minimal) configuration. The wrapper will automatically mount things like CDs and flash drives.<br />
<br />
* [http://igurublog.wordpress.com/downloads/script-devmon/ devmon] - {{AUR|devmon}} is a configuration-less Bash wrapper script for udisks which automatically mounts optical discs and removable drives. It can also selectively automatically start applications or execute commands after mounting, ignore specified devices and volume labels, and unmount removable drives. A git version called {{AUR|devmon-git}} is also available.<br />
* [[udiskie]] - Written in Python. Enables automatic mounting and unmounting by any user.<br />
* {{AUR|udisksevt}} - Written in Haskell. Enables automatic mounting by any user. Designed to be integrated with {{AUR|traydevice}}.<br />
* The {{AUR|udisksvm}} Bash script uses udisks and {{AUR|traydevice}} to automatically mount removable media and to control in GUI, with mouse clicks in systray, the un-mounting and re-mounting of disks or the ejection of optical disks.<br />
<br />
=== UDisks Shell Functions ===<br />
While UDisks includes a simple method of (un)mounting devices via command-line, it can be tiresome to type the commands out each time. These shell functions will generally shorten and ease command-line usage.<br />
<br />
* [https://bbs.archlinux.org/viewtopic.php?id=109307 udisks_functions] - Written for Bash.<br />
* [https://bbs.archlinux.org/viewtopic.php?id=117674 bashmount] - {{AUR|bashmount}} is a menu-driven Bash script with a configuration file that makes it easy to configure and extend.<br />
<br />
==Other==<br />
* [https://aur.archlinux.org/packages.php?ID=52272 ldm] - A lightweight device mounter [https://bbs.archlinux.org/viewtopic.php?id=125918]<br />
<br />
==Tips and tricks==<br />
<br />
===Auto mounting USB devices===<br />
====Mount options====<br />
In the following rules the mount options are defined as {{Ic|<nowiki>ENV{mount_options}="relatime"</nowiki>}}, see {{Ic|man mount}} (and possibly {{Ic|man ntfs-3g}}) for all available options and [[Maximizing Performance#Mount options]] for performance-related options.<br />
* The {{Ic|users}} mount option will '''not''' allow users to unmount the filesystem.<br />
* The {{Ic|noexec}} mount option prevents execution of binaries on the mounted filesystem.<br />
* Mounting partitions in read-write mode while booting might prevent fsck from running. In this case, you will need to manually remount that partition in read-only mode. <br />
==== Mount under {{ic|/media}}; use partition label if present ====<br />
The following udev rule set automatically mounts devices/partitions that are represented by /dev/sd* (USB drives, external hard drives and sometimes SD cards). If a partition label is available, it mounts the device to /media/<label> and otherwise to /media/usbhd-sd* (ex: /media/usbhd-sdb1):<br />
{{hc|/etc/udev/rules.d/11-media-by-label-auto-mount.rules|2=<nowiki><br />
# Start at sdb to avoid system harddrive. <br />
KERNEL!="sd[b-z][0-9]", GOTO="media_by_label_auto_mount_end"<br />
<br />
# Import FS infos<br />
IMPORT{program}="/sbin/blkid -o udev -p %N"<br />
<br />
# Get a label if present, otherwise specify one<br />
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"<br />
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k"<br />
<br />
# Global mount options<br />
ACTION=="add", ENV{mount_options}="relatime"<br />
# Filesystem-specific mount options<br />
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"<br />
<br />
# Mount the device<br />
ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/%E{dir_name}"<br />
<br />
# Clean up after removal<br />
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"<br />
<br />
# Exit<br />
LABEL="media_by_label_auto_mount_end"<br />
</nowiki>}}<br />
{{Note|[http://git.kernel.org/?p&#61;linux/hotplug/udev.git;a&#61;commit;h&#61;c1ab0461 %N will create a temporary node for a callout a be substituted with the name of the node.]}}<br />
<br />
==== Mount under {{ic|/media}}; use partition label if present; supports LUKS encryption ====<br />
Similar to the above rule set, but if the device is a LUKS-encrypted partition it will open an xterm window to ask for the passphrase (provided that xterm is installed). Also see [http://bbs.archlinux.org/viewtopic.php?pid=696239#p696239 this post] and the follow-ups.<br />
<br />
{{Note|You may need to modify the path to cryptsetup, depending on the version installed (e.g., < 1.1.1_rc2-1).}}<br />
<br />
{{hc|/etc/udev/rules.d/11-media-by-label-auto-mount.rules|2=<nowiki><br />
KERNEL!="sd[a-z]*", GOTO="media_by_label_auto_mount_end"<br />
ACTION=="add", PROGRAM!="/sbin/blkid %N", GOTO="media_by_label_auto_mount_end"<br />
<br />
# Do not mount devices already mounted somewhere else to avoid entries for all your local partitions in /media<br />
ACTION=="add", PROGRAM=="/bin/grep -q ' /dev/%k ' /proc/self/mountinfo", GOTO="media_by_label_auto_mount_end"<br />
<br />
# Open LUKS partition if necessary<br />
PROGRAM=="/sbin/blkid -o value -s TYPE %N", RESULT=="crypto_LUKS", ENV{crypto}="mapper/", ENV{device}="/dev/mapper/%k"<br />
ENV{crypto}=="", ENV{device}="%N"<br />
ACTION=="add", ENV{crypto}!="", PROGRAM=="/usr/bin/xterm -display :0.0 -e 'echo Password for /dev/%k; /sbin/cryptsetup luksOpen %N %k'"<br />
ACTION=="add", ENV{crypto}!="", TEST!="/dev/mapper/%k", GOTO="media_by_label_auto_mount_end"<br />
<br />
# Global mount options<br />
ACTION=="add", ENV{mount_options}="noatime"<br />
# Filesystem-specific mount options<br />
ACTION=="add", PROGRAM=="/sbin/blkid -o value -s TYPE %E{device}", RESULT=="vfat|ntfs", ENV{mount_options}="%E{mount_options},utf8,gid=100,umask=002"<br />
<br />
# Get label if present, otherwise assign one<br />
PROGRAM=="/sbin/blkid -o value -s LABEL %E{device}", ENV{dir_name}="%c"<br />
# Use basename to correctly handle labels such as ../mnt/foo<br />
PROGRAM=="/usr/bin/basename '%E{dir_name}'", ENV{dir_name}="%c"<br />
ENV{dir_name}=="", ENV{dir_name}="usbhd-%k"<br />
<br />
# Mount the device<br />
ACTION=="add", ENV{dir_name}!="", RUN+="/bin/mkdir -p '/media/%E{dir_name}'", RUN+="/bin/mount -o %E{mount_options} /dev/%E{crypto}%k '/media/%E{dir_name}'"<br />
<br />
# Clean up after removal<br />
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l '/media/%E{dir_name}'"<br />
ACTION=="remove", ENV{crypto}!="", RUN+="/sbin/cryptsetup luksClose %k"<br />
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/rmdir '/media/%E{dir_name}'"<br />
<br />
# Exit<br />
LABEL="media_by_label_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Mount under {{ic|/media}}; use partition label if present; support user un-mounting ====<br />
This is a variation on the above rule set. It uses pmount (which will need to be installed) instead of mount, allowing a non-root user to unmount udev-mounted devices, and automatically removing the mount point. The required username (here tomk) must be hard-coded in the RUN command, so this rule set may not be suitable for multi-user systems. LUKS support has also been removed from the example, but can be easily reinstated as above. You must edit the /bin/su invocation to run as the correct user for your system. Note that the mount point will remain if the device is mounted and the system, with a persistent /media, is shutdown, since rc.shutdown uses umount, which does not remove the mount point. To avoid having /media contain old mount points, one solution is to mount /media as tmpfs.<br />
{{hc|/etc/udev/rules.d/11-media-by-label-with-pmount.rules|2=<nowiki><br />
KERNEL!="sd[a-z]*", GOTO="media_by_label_auto_mount_end"<br />
ACTION=="add", PROGRAM!="/sbin/blkid %N", GOTO="media_by_label_auto_mount_end"<br />
<br />
# Get label<br />
PROGRAM=="/sbin/blkid -o value -s LABEL %N", ENV{dir_name}="%c"<br />
# use basename to correctly handle labels such as ../mnt/foo<br />
PROGRAM=="/usr/bin/basename '%E{dir_name}'", ENV{dir_name}="%c"<br />
ENV{dir_name}=="", ENV{dir_name}="usbhd-%k"<br />
<br />
ACTION=="add", ENV{dir_name}!="", RUN+="/bin/su tomk -c '/usr/bin/pmount %N %E{dir_name}'"<br />
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/su tomk -c '/usr/bin/pumount /media/%E{dir_name}'"<br />
LABEL="media_by_label_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Mount under {{ic|/mnt}}; create symbolic link under {{ic|/media}} ====<br />
The following rule set does not make use of partition labels; instead it mounts devices as usbhd-sdXY under the /mnt directory (ex: /mnt/usbhd-sdb1) and creates a symbolic link under /media.<br />
{{hc|/etc/udev/rules.d/11-mnt-auto-mount.rules|2=<nowiki><br />
KERNEL!="sd[a-z][0-9]", GOTO="mnt_auto_mount_end"<br />
<br />
# Global mount options<br />
ACTION=="add", ENV{mount_options}="relatime"<br />
# Filesystem-specific mount options<br />
ACTION=="add", IMPORT{program}="/sbin/blkid -o udev -p %N"<br />
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"<br />
<br />
# Mount under /mnt and create the symbolic link in /media <br />
ACTION=="add", RUN+="/bin/mkdir -p /mnt/usbhd-%k", RUN+="/bin/mount -o $env{mount_options} /dev/%k /mnt/usbhd-%k", RUN+="/bin/ln -s /mnt/usbhd-%k /media/usbhd-%k"<br />
<br />
# Clean up after removal<br />
ACTION=="remove", RUN+="/bin/rm -f /media/usbhd-%k", RUN+="/bin/umount -l /mnt/usbhd-%k", RUN+="/bin/rmdir /mnt/usbhd-%k"<br />
<br />
# Exit<br />
LABEL="mnt_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Mount under {{ic|/media}} ''only'' if the partition has a label ====<br />
{{hc|/etc/udev/rules.d/11-media-by-label-only-auto-mount.rules|2=<nowiki><br />
KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_only_auto_mount_end"<br />
<br />
# Import FS infos<br />
IMPORT{program}="/sbin/blkid -o udev -p %N"<br />
ENV{ID_FS_LABEL}=="", GOTO="media_by_label_only_auto_mount_end"<br />
<br />
# Global mount options<br />
ACTION=="add", ENV{mount_options}="relatime"<br />
# Filesystem-specific mount options<br />
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"<br />
<br />
# Mount the device<br />
ACTION=="add", RUN+="/bin/mkdir -p /media/$env{ID_FS_LABEL}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/$env{ID_FS_LABEL}"<br />
<br />
# Clean up after removal<br />
ACTION=="remove", ENV{ID_FS_LABEL}!="", RUN+="/bin/umount -l /media/$env{ID_FS_LABEL}", RUN+="/bin/rmdir /media/$env{ID_FS_LABEL}"<br />
<br />
# Exit<br />
LABEL="media_by_label_only_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Mount under {{ic|/media}}; use partition label if present; ntfs-3g ====<br />
Yet another example, this time making use of ntfs-3g read/write drivers for NTFS filesystems:<br />
<br />
{{hc|/etc/udev/rules.d/10-my-media-automount.rules|2=<nowiki><br />
# vim:enc=utf-8:nu:ai:si:et:ts=4:sw=4:ft=udevrules:<br />
#<br />
# /etc/udev/rules.d/10-my-media-automount.rules<br />
<br />
# start at sdb to ignore the system hard drive<br />
KERNEL!="sd[b-z]*", GOTO="my_media_automount_end"<br />
ACTION=="add", PROGRAM!="/sbin/blkid %N", GOTO="my_media_automount_end"<br />
<br />
# import some useful filesystem info as variables<br />
IMPORT{program}="/sbin/blkid -o udev -p %N"<br />
<br />
# get the label if present, otherwise assign one based on device/partition<br />
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"<br />
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k"<br />
<br />
# create the dir in /media and symlink it to /mnt<br />
ACTION=="add", RUN+="/bin/mkdir -p '/media/%E{dir_name}'"<br />
<br />
# global mount options<br />
ACTION=="add", ENV{mount_options}="relatime"<br />
# filesystem-specific mount options (777/666 dir/file perms for ntfs/vfat) <br />
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},gid=100,dmask=000,fmask=111,utf8"<br />
<br />
# automount ntfs filesystems using ntfs-3g driver<br />
ACTION=="add", ENV{ID_FS_TYPE}=="ntfs", RUN+="/bin/mount -t ntfs-3g -o %E{mount_options} /dev/%k '/media/%E{dir_name}'"<br />
# automount all other filesystems<br />
ACTION=="add", ENV{ID_FS_TYPE}!="ntfs", RUN+="/bin/mount -t auto -o %E{mount_options} /dev/%k '/media/%E{dir_name}'"<br />
<br />
# clean up after device removal<br />
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l '/media/%E{dir_name}'", RUN+="/bin/rmdir '/media/%E{dir_name}'"<br />
<br />
# exit<br />
LABEL="my_media_automount_end"<br />
<br />
</nowiki>}}<br />
<br />
==== Mount SD cards ====<br />
The same rules as above can be used to auto-mount SD cards, you just need to replace {{Ic|sd[a-z][0-9]}} by {{Ic|mmcblk[0-9]p[0-9]}}:<br />
{{hc|/etc/udev/rules.d/11-sd-cards-auto-mount.rules|2=<nowiki><br />
KERNEL!="mmcblk[0-9]p[0-9]", GOTO="sd_cards_auto_mount_end"<br />
<br />
# Global mount options<br />
ACTION=="add", ENV{mount_options}="relatime"<br />
# Filesystem specific options<br />
ACTION=="add", IMPORT{program}="/sbin/blkid -o udev -p %N"<br />
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"<br />
<br />
ACTION=="add", RUN+="/bin/mkdir -p /media/sd-%k", RUN+="/bin/ln -s /media/sd-%k /mnt/sd-%k", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/sd-%k"<br />
ACTION=="remove", RUN+="/bin/umount -l /media/sd-%k", RUN+="/bin/rmdir /media/sd-%k"<br />
LABEL="sd_cards_auto_mount_end"<br />
</nowiki>}}<br />
<br />
==== Mount CDs ====<br />
To auto mount a CD a simple [[#Automounting_UDisks_Wrappers|UDisks wrapper]] will get the job done properly.<br />
{{Note|Maybe this should be merged to the Udisks wrapper section.}}<br />
<br />
==== Accessing iPod ====<br />
{{accuracy}}<br />
<br />
I have not tried this yet, but here is the basics:<br />
<br />
{{hc|/etc/udev/rules.d/00-ipod.rules|2=<nowiki><br />
BUS="scsi", SYSFS{model}="iPod*", NAME="ipod"<br />
</nowiki>}}<br />
<br />
==== Accessing Firmware Programmers and USB Virtual Comm Devices ====<br />
The following ruleset will allow normal users (within the "users" group) the ability to access the [http://www.ladyada.net/make/usbtinyisp/ USBtinyISP] USB programmer for AVR microcontrollers and a generic (SiLabs [http://www.silabs.com/products/interface/usbtouart CP2102]) USB to UART adapter and the [http://www.atmel.com/tools/AVRDRAGON.aspx?tab=overview Atmel AVR Dragon] programmer. Adjust the permissions accordingly. Verified as of 2010-02-11.<br />
<br />
{{hc|/etc/udev/rules.d/50-embedded_devices.rules|2=<nowiki><br />
# USBtinyISP Programmer rules<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c9f", GROUP="users", MODE="0666"<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="0479", GROUP="users", MODE="0666"<br />
# USBasp Programmer rules http://www.fischl.de/usbasp/<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", GROUP="users", MODE="0666"<br />
<br />
# Mdfly.com Generic (SiLabs CP2102) 3.3v/5v USB VComm adapter<br />
SUBSYSTEMS=="usb", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", GROUP="users", MODE="0666"<br />
<br />
#Atmel AVR Dragon (dragon_isp) rules<br />
SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2107", GROUP="users", MODE="0666"<br />
</nowiki>}}<br />
<br />
=== Execute on USB Insert ===<br />
See [[Execute_on_usb_insert|execute on usb insert]] article or the [http://igurublog.wordpress.com/downloads/script-devmon/ devmon wrapper script].<br />
<br />
=== Mount internal drives as a normal user ===<br />
If you want to mount an internal drive in KDE or Gnome (maybe on other Desktop Environments too) as a normal user (without the need to type your superuser password), you just have to create the following file in [[PolicyKit]] Local Authority:<br />
{{hc|/etc/polkit-1/localauthority/50-local.d/50-filesystem-mount-system-internal.pkla|2=<nowiki><br />
[Mount a system-internal device]<br />
Identity=*<br />
Action=org.freedesktop.udisks.filesystem-mount-system-internal<br />
ResultActive=yes<br />
</nowiki>}}<br />
<br />
=== Mark internal SATA-Ports as eSATA-Ports ===<br />
If you connected a eSATA bay or an other eSATA adapter the system will still recognize this disk as an internal SATA drive. Gnome and KDE will ask you for your root password all the time. The following rule will mark the specified SATA-Port as an external eSATA-Port. With that, a normal Gnome user can connect their eSATA drives to that port like a USB drive, without any root password and so on.<br />
<br />
{{hc|/etc/udev/rules.d/10-esata.rules|2=<nowiki><br />
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/host4/*", ENV{UDISKS_SYSTEM_INTERNAL}="0"<br />
</nowiki>}}<br />
<br />
{{Note| The DEVPATH can be found after connection the eSata drive with the following command (replace sdb to your needs):<br />
<br />
# find /sys/devices/ -name sdb<br />
/sys/devices/pci0000:00/0000:00:1f.2/host4/target4:0:0/4:0:0:0/block/sdb<br />
<br />
}}<br />
<br />
=== Setting static device names ===<br />
Because udev loads all modules asynchronously, they are initialized in a different order. This can result in devices randomly switching names. Udev rule can be added to use static device names.<br />
<br />
==== Network device ====<br />
For example, with two network cards, you may notice a switching of designations between {{Ic|eth0}} and {{Ic|eth1}}.<br />
<br />
One method for network card ordering is to use the udev-sanctioned method of statically-naming each interface. Create the following file to bind the MAC address of each of your cards to a certain interface name:<br />
{{hc|/etc/udev/rules.d/10-network.rules|2=<nowiki><br />
SUBSYSTEM=="net", ATTR{address}=="aa:bb:cc:dd:ee:ff", NAME="lan0"<br />
SUBSYSTEM=="net", ATTR{address}=="ff:ee:dd:cc:bb:aa", NAME="wlan0"<br />
</nowiki>}}<br />
<br />
A couple things to note:<br />
* To get the MAC address of each card, use this command: {{Ic|<nowiki>udevadm info -a -p /sys/class/net/<yourdevice> | grep address | tr [A-Z] [a-z]</nowiki>}}<br />
* Make sure to use the lower-case hex values in your udev rules. It doesn't like upper-case.<br />
* Some people have problems naming their interfaces after the old style: eth0, eth1, etc. Try something like "lan" or "wlan" if you experience this problem.<br />
<br />
Don't forget to update your {{ic|/etc/rc.conf}} and other configuration files using the old ethX notation!<br />
<br />
{{Note|With a recent version of udev, this problem should be solved automatically thanks to the {{ic|/lib/udev/write_net_rules}} program which runs the {{ic|75-persistent-net-generator.rules}} script which produces a {{ic|70-persistent-net.rules}}.}}<br />
<br />
==== iscsi device ====<br />
Test the output from scsi_id:<br />
/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sdb<br />
3600601607db11e0013ab5a8e371ce111<br />
<br />
{{hc|/etc/udev/rules.d/75-iscsi.rules|<nowiki><br />
# the iscsi device rules<br />
# this will create an iscsi device for each of the targets<br />
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM="/lib/udev/scsi_id --whitelisted --replace-whitespace /dev/$name", RESULT=="3600601607db11e0013ab5a8e371ce111",<br />
NAME="isda"<br />
</nowiki>}}<br />
<br />
== Troubleshooting ==<br />
=== Blacklisting Modules ===<br />
In rare cases, udev can make mistakes and load the wrong modules. To prevent it from doing this, you can blacklist modules. Once blacklisted, udev will never load that module. See [[blacklisting]]. Not at boot-time ''or'' later on when a hotplug event is received (eg, you plug in your USB flash drive).<br />
<br />
=== udevd hangs at boot ===<br />
After migrating to LDAP or updating an LDAP-backed system udevd can hang at boot at the message "Starting UDev Daemon". This is usually caused by udevd trying to look up a name from LDAP but failing, because the network is not up yet. The solution is to ensure that all system group names are present locally.<br />
<br />
Extract the group names referenced in udev rules and the group names actually present on the system:<br />
<br />
# fgrep -r GROUP /etc/udev/rules.d/ /lib/udev/rules.d | perl -nle '/GROUP\s*=\s*"(.*?)"/ && print $1;' | sort | uniq > udev_groups<br />
# cut -f1 -d: /etc/gshadow /etc/group | sort | uniq > present_groups<br />
<br />
To see the differences, do a side-by-side diff:<br />
<br />
# diff -y present_groups udev_groups<br />
...<br />
network <<br />
nobody <<br />
ntp <<br />
optical optical<br />
power | pcscd<br />
rfkill <<br />
root root<br />
scanner scanner<br />
smmsp <<br />
storage storage<br />
...<br />
<br />
In this case, the pcscd group is for some reason not present in the system. Add the missing groups:<br />
<br />
# groupadd pcscd<br />
<br />
Also, make sure local resources are looked up before resorting to LDAP. {{ic|/etc/nsswitch.conf}} should contain the line<br />
<br />
group: files ldap<br />
<br />
=== Known Problems with Hardware ===<br />
==== BusLogic devices can be broken and will cause a freeze during startup ====<br />
This is a kernel bug and no fix has been provided yet.<br />
<br />
==== Some devices, that should be treated as removable, are not ====<br />
Create a custom udev rule, setting {{ic|UDISKS_SYSTEM_INTERNAL<nowiki>=</nowiki>0}}. For more details, see the manpage of udisks.<br />
<br />
=== Known Problems with Auto-Loading ===<br />
==== CPU frequency modules ====<br />
The current detection method for the various CPU frequency controllers is inadequate, so this has been omitted from the auto-loading process for the time being. To use [[CPU Frequency Scaling]], load the proper module explicitly in your {{Ic|MODULES}} array in {{ic|/etc/rc.conf}}. Further reading: [[rc.conf]].<br />
<br />
==== Sound Problems or Some Modules Not Loaded Automatically ====<br />
Some users have traced this problem to old entries in {{ic|/etc/modprobe.d/sound.conf}}. Try cleaning that file out and trying again.<br />
{{Note|Since {{Ic|udev>&#61;171}}, the OSS emulation modules ({{Ic|snd_seq_oss, snd_pcm_oss, snd_mixer_oss}}) are not automatically loaded by default.}}<br />
<br />
=== Known Problems for Custom Kernel Users ===<br />
==== Udev doesn't start at all ====<br />
Make sure you have a kernel version later than or equal to 2.6.32. Earlier kernels do not have the necessary uevent stuff that udev needs for auto-loading.<br />
<br />
=== IDE CD/DVD-drive support ===<br />
Starting with version 170, udev doesn't support CD-ROM/DVD-ROM drives, which are loaded as traditional IDE drives with the {{Ic|ide_cd_mod}} module and show up as {{ic|/dev/hd*}}. The drive remains usable for tools which access the hardware directly, like cdparanoia, but is invisible for higher userspace programs, like KDE.<br />
<br />
A cause for the loading of the ide_cd_mod module prior to others, like sr_mod, could be e.g. that you have for some reason the module piix loaded with your initramfs. In that case you can just replace it with ata_piix in your {{ic|/etc/mkinitcpio.conf}}.<br />
<br />
=== Optical Drives Have Group ID Set To Disk ===<br />
If the group ID of your optical drive is set to ''disk'' and you want to have it set to ''optical'' you have to create a custom udev rule:<br />
{{hc|/etc/udev/rules.d|2=# permissions for IDE CD devices<br />
SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTR{removable}=="1", ATTRS{media}=="cdrom*", GROUP="optical"<br />
<br />
# permissions for SCSI CD devices<br />
SUBSYSTEMS=="scsi", KERNEL=="s[rg][0-9]*", ATTRS{type}=="5", GROUP="optical"}}<br />
<br />
==See also==<br />
* [http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html Udev Homepage]<br />
* [http://www.linux.com/news/hardware/peripherals/180950-udev An Introduction to Udev]<br />
* [http://vger.kernel.org/vger-lists.html#linux-hotplug Udev mailing list information]</div>Mamciekhttps://wiki.archlinux.org/index.php?title=Arch_Linux_AMIs_for_Amazon_Web_Services&diff=191904Arch Linux AMIs for Amazon Web Services2012-03-27T18:49:06Z<p>Mamciek: </p>
<hr />
<div>[[Category:Networking (English)]]<br />
{{i18n|Arch Linux AMIs for Amazon Web Services}}<br />
<br />
==Running public Arch AMIs==<br />
<br />
===Archlinux AMI===<br />
64 bit AMI with stock kernel and enabled Xen modules is available [https://aws.amazon.com/amis/archlinux https://aws.amazon.com/amis/archlinux]<br />
<br />
===Other AMIs===<br />
Verified working public arch liunx AMIs are below<br />
<br />
{{bc|<br />
AMI Store Build Release Kernel Last verified<br />
ami-07be766e EBS 64 bit 2011-04-15 3.0+ 2012-01-14 <br />
ami-19be7670 EBS 64 bit 2011-11-18 3.0+ 2012-01-14 <br />
ami-26e8144f EBS 32 bit 2011-04-15 2.6 2012-01-14 <br />
ami-38e81451 EBS 32 bit 2011-04-15 2.6 2012-01-14 <br />
}}<br />
<br />
These AMIs ship with Arch linux kernels that are booted by PV-GRUB.<br />
<br />
(2012-01-14) The 64 bit AMIs consistently failed to boot on Micro instances in us-east-1a and us-east-1d. In us-east-1b and us-east-1c the AMIs occasionally fail to boot. Stop and start the instance to reassign it a random machine in these cases.<br />
<br />
This may be an issue with Amazon running different versions of Xen on different machines / older availability zones.<br />
<br />
==Building Arch AMIs==<br />
<br />
linux-ec2 in AUR compiles the Arch linux kernel for AWS with Xen modules enabled and the XSAVE patch applied.</div>Mamciekhttps://wiki.archlinux.org/index.php?title=Haskell_package_guidelines&diff=167756Haskell package guidelines2011-10-27T22:32:06Z<p>Mamciek: </p>
<hr />
<div>[[Category:Package development (English)]]<br />
<br />
{{i18n|Haskell package guidelines}}<br />
<br />
'''Haskell on Arch Linux'''<br />
<br />
Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, a growing number of packages made available by the ArchHaskell group, and a large part of [http://hackage.haskell.org hackage.haskell.org] library database [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go available via AUR].<br />
<br />
The community around Haskell on Arch is active and well organized but your help is always welcome.<br />
<br />
== Community ==<br />
<br />
All the details on the [[ArchHaskell]] group is available on its own page.<br />
<br />
== Haskell Packages ==<br />
<br />
The core Haskell tools are available in the core system (extra):<br />
<br />
==== <nowiki>[Extra]</nowiki> ====<br />
<br />
* [http://www.archlinux.org/packages/?arch=x86_64&repo=Extra&q=haskell&last_update=&limit=50 Haskell packages in the core system]<br />
<br />
Our policy for [extra] is to provide the Haskell platform, and popular Haskell applications.<br />
<br />
==== <nowiki>[haskell]</nowiki> ====<br />
<br />
The packages maintained by the ArchHaskell group can be accessed by adding the following entry to pacman.conf:<br />
<br />
[haskell]<br />
Server = http://andromeda.kiwilight.com/$repo/$arch<br />
<br />
==== <nowiki>AUR</nowiki> ====<br />
<br />
* [http://aur.archlinux.org/packages.php?O=0&L=0&C=0&K=arch-haskell&SeB=m&SB=n&SO=a&PP=100&do_Search=Go Haskell packages in AUR]<br />
<br />
A huge number (almost 2000) packages built from http://hackage.haskell.org<br />
<br />
These generally improve on installing directly from Hackage as they resolve required C libraries. They can be installed as, for example:<br />
<br />
sudo paktahn -S haskell-csv<br />
<br />
Anything not found here can be installed via [http://aur.archlinux.org/packages.php?ID=17411 cabal-install] direct from Hackage.<br />
<br />
== Guidelines ==<br />
<br />
In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool. It is strongly recommended that you use the latest released version of this tool, as it implements the packaging policy for Haskell packages. You can get it in several ways:<br />
<br />
* Add the <nowiki>[haskell]</nowiki> repository to pacman.conf and use pacman do install the latest release.<br />
* Download and build the [http://aur.archlinux.org/packages.php?ID=17471 source from AUR], either manually or using one of the many [[AUR Helpers]].<br />
* Install directly from Hackage using "cabal install cabal2arch".<br />
<br />
===cabal2arch: an example===<br />
<br />
This example illustrates how to create a new package with cabal2arch. We'll make a new package for the delimited continuations library, CC-delcont:<br />
<br />
First, set the name and email address to be used in the generated PKGBUILD:<br />
<br />
export ARCH_HASKELL='My Name <my.name@domain.org>'<br />
<br />
Second, find [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont the hackage page for CC-delcont], then identify the link to the .cabal file. Use this link as an argument to cabal2arch:<br />
<br />
<pre><br />
% cd /tmp<br />
% cabal2arch http://hackage.haskell.org/packages/archive/pandoc/1.6.0.1/pandoc.cabal<br />
Using /tmp/tmp.D7HAJJx2js/pandoc.cabal<br />
Feeding the PKGBUILD to `makepkg -g`...<br />
==> Retrieving Sources...<br />
-> Downloading pandoc-1.6.0.1.tar.gz...<br />
--2011-05-14 07:25:39-- http://hackage.haskell.org/packages/archive/pandoc/1.6.0.1/pandoc-1.6.0.1.tar.gz<br />
Resolving hackage.haskell.org... 69.30.63.204<br />
Connecting to hackage.haskell.org|69.30.63.204|:80... connected.<br />
HTTP request sent, awaiting response... 200 OK<br />
Length: 355477 (347K) [application/x-tar]<br />
Saving to: “pandoc-1.6.0.1.tar.gz.part”<br />
<br />
0K .......... .......... .......... .......... .......... 14% 210K 1s<br />
50K .......... .......... .......... .......... .......... 28% 393K 1s<br />
100K .......... .......... .......... .......... .......... 43% 338K 1s<br />
150K .......... .......... .......... .......... .......... 57% 419K 0s<br />
200K .......... .......... .......... .......... .......... 72% 404K 0s<br />
250K .......... .......... .......... .......... .......... 86% 554K 0s<br />
300K .......... .......... .......... .......... ....... 100% 506K=0.9s<br />
<br />
2011-05-14 07:25:40 (369 KB/s) - “pandoc-1.6.0.1.tar.gz.part” saved [355477/355477]<br />
<br />
==> Generating checksums for source files...<br />
</pre><br />
<br />
Checking what was created:<br />
<br />
% ls<br />
haskell-pandoc<br />
% cd haskell-pandoc<br />
% ls<br />
haskell-pandoc.install PKGBUILD<br />
<br />
You can now inspect the PKGBUILD and install script for the library:<br />
<br />
<pre><br />
# Maintainer: <br />
_hkgname=pandoc<br />
pkgname=haskell-pandoc<br />
pkgver=1.6.0.1<br />
pkgrel=1<br />
pkgdesc="Conversion between markup formats"<br />
url="http://hackage.haskell.org/package/${_hkgname}"<br />
license=('GPL')<br />
arch=('i686' 'x86_64')<br />
makedepends=()<br />
depends=('ghc' 'haskell-http=4000.1.1' 'haskell-bytestring=0.9.1.10' 'haskell-containers=0.4.0.0' 'haskell-directory=1.1.0.0' 'haskell-extensible-exceptions=0.1.1.2' 'haskell-filepath=1.2.0.0' 'haskell-mtl=2.0.1.0' 'haskell-network=2.3.0.2' 'haskell-old-time=1.0.0.6' 'haskell-parsec=3.1.1' 'haskell-pretty=1.0.1.2' 'haskell-process=1.0.1.5' 'haskell-random=1.0.0.3' 'haskell-syb=0.3' 'haskell-texmath<0.5' 'haskell-utf8-string>=0.3' 'haskell-xhtml=3000.2.0.1' 'haskell-xml<1.4' 'haskell-zip-archive<0.2')<br />
options=('strip')<br />
source=(http://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz)<br />
install=${pkgname}.install<br />
md5sums=('d19a630462595941b3100dff6f839aa3')<br />
build() {<br />
cd ${srcdir}/${_hkgname}-${pkgver}<br />
runhaskell Setup configure -O ${PKGBUILD_HASKELL_ENABLE_PROFILING:+-p } --enable-split-objs --enable-shared \<br />
--prefix=/usr --docdir=/usr/share/doc/${pkgname} --libsubdir=\$compiler/site-local/\$pkgid<br />
runhaskell Setup build<br />
runhaskell Setup haddock<br />
runhaskell Setup register --gen-script<br />
runhaskell Setup unregister --gen-script<br />
sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh<br />
}<br />
package() {<br />
cd ${srcdir}/${_hkgname}-${pkgver}<br />
install -D -m744 register.sh ${pkgdir}/usr/share/haskell/${pkgname}/register.sh<br />
install -m744 unregister.sh ${pkgdir}/usr/share/haskell/${pkgname}/unregister.sh<br />
install -d -m755 ${pkgdir}/usr/share/doc/ghc/html/libraries<br />
ln -s /usr/share/doc/${pkgname}/html ${pkgdir}/usr/share/doc/ghc/html/libraries/${_hkgname}<br />
runhaskell Setup copy --destdir=${pkgdir}<br />
}<br />
</pre><br />
<br />
It follows the conventions for Haskell packages:<br />
<br />
* Libraries are prefixed with "haskell-"<br />
* All libraries that the package depend on are listed (libraries shipped with ghc are dealt with by having the ghc package provide them)<br />
* It uses cabal to generate a post-install register/unregister script, with a standard name.<br />
* We use haddock to build the documentation.<br />
<br />
All Haskell libraries should follow these naming conventions, and using the latest release of cabal2arch will ensure this is the case.<br />
<br />
NOTE: Beginning with cabal2arch 1.1-2, a new environment variable, '''PKGBUILD_HASKELL_ENABLE_PROFILING''', is generated into the PKGBUILD. If this variable is of non-zero length, such as "1" or "true", then profiling builds will occur. Thus, if a user desires profiling, then it is advised to export this environment variable in a file such as ~/.bashrc or ~/.zshrc.<br />
<br />
===Guidelines for Libraries===<br />
<br />
In general, each .cabal file should map to one PKGBUILD. The following conventions hold:<br />
<br />
* libraries have their cabal names prefixed with "haskell-"<br />
* all libraries have a dependency on 'ghc'<br />
* all libraries that are depended on must be listed in the depends-array in the PKGBUILD<br />
* be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"<br />
<br />
Registering Haskell libraries is done via a register hook, see above.<br />
<br />
===Guidelines for Programs ===<br />
<br />
* Have their normal name. Examples: hmp3, xmonad, ghc, cabal-install<br />
<br />
* Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries have a runtime dependency on 'gmp'. OpenGL or GtT-based binaries will have additional 'depends'. cabal2arch will attempt to work out the C dependencies, but there may be others implied by Haskell dependencies that are missed.<br />
<br />
* Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.<br />
<br />
== Automatic local building of Hackage Packages with cabal2arch using Bauerbill ==<br />
{{Warning|''Bauerbill'' development has been officially discontinued: its latest version does not work with ''pacman>&#61;3.5''. See [https://bbs.archlinux.org/viewtopic.php?id&#61;115660].}}<br />
Although there are a number of haskell packages on AUR, there will always be outdated packages on AUR. If this happens and you want to create a fully updated package you would normally use cabal2arch. This however can become painful/time consuming if you have numerous packages with different dependencies (some of which may/may not be updated). Instead you can automatic this process by using [[Bauerbill]] which has the --hackage flag, allowing you to create AUR packages from Hackage locally. Below is an example of some common commands<br />
<br />
bauerbill -S --hackage [pkgs] : build [pkgs] directly from Hackage*<br />
bauerbill -Si --hackage [pkgs] : look up information about [pkgs]<br />
bauerbill -Ss --hackage [args] : search for [args]<br />
bauerbill -Qu --hackage : list upgradable Hackage packages<br />
<br />
Syncing packages with the --hackage flag will interactively download all dependencies of the package from Hackage, convert them using cabal2arch and then build/install them (while checking dependencies). You can combine this with the --aur flag to give precedence to Hackage packages that are on AUR</div>Mamciekhttps://wiki.archlinux.org/index.php?title=Qingy&diff=167619Qingy2011-10-26T12:05:39Z<p>Mamciek: </p>
<hr />
<div>[[Category:Display managers (English)]]<br />
[[Category:Eye candy (English)]]<br />
{{i18n|Qingy}}<br />
[http://qingy.sourceforge.net/ Qingy] is a replacement for [[Getty]] and login-managers like slim, kdm gdm and so on, using [http://www.directfb.org DirectFB] to provide a fast, nice GUI without the overhead of the X Window System. It allows users to log in and start the session of their choice (text console, gnome, kde, wmaker, etc.). Running several X sessions is also possible.<br />
<br />
==How to get qingy?==<br />
First you need a working DirectFB.<br />
I'm recommending [http://wiki.archlinux.org/index.php/Uvesafb Uvesafb] but if you have some graphical issues with it use vesafb. Qingy may not work with [[KMS]].<br />
<br />
A package is available in the [community] repo. To install:<br />
# pacman -S qingy <br />
<br />
Several extra themes are also available. In [community] repo, there is an Arch specific theme:<br />
# pacman -S qingy-theme-arch<br />
<br />
A package of several various themes is available in AUR:<br />
<br />
*[http://aur.archlinux.org/packages.php?do_Details=1&ID=5501 qingy-themes]<br />
<br />
==Replace *getty with qingy==<br />
To use qingy, you'll need to edit /etc/inittab.<br />
<br />
Replace:<br />
c1:2345:respawn:/sbin/agetty -8 38400 vc/1 linux<br />
c2:2345:respawn:/sbin/agetty -8 38400 vc/2 linux<br />
c3:2345:respawn:/sbin/agetty -8 38400 vc/3 linux<br />
c4:2345:respawn:/sbin/agetty -8 38400 vc/4 linux<br />
c5:2345:respawn:/sbin/agetty -8 38400 vc/5 linux<br />
c6:2345:respawn:/sbin/agetty -8 38400 vc/6 linux<br />
<br />
with:<br />
c1:2345:respawn:/sbin/qingy tty1<br />
c2:2345:respawn:/sbin/qingy tty2<br />
c3:2345:respawn:/sbin/qingy tty3<br />
c4:2345:respawn:/sbin/qingy tty4<br />
c5:2345:respawn:/sbin/qingy tty5<br />
c6:2345:respawn:/sbin/agetty -8 38400 vc/6 linux<br />
<br />
Qingy's author suggest to keep agetty on a console (here on console 6) as a safety measure as qingy is still beta software.<br />
<br />
Because qingy uses tty0-9 insead of vc/1-6 so you need add tty to /etc/securetty (NOTE : this should no longer be necessary since vc/1-6 have been replaced by tty0-9 with the new version of agetty): <br />
#<br />
# /etc/securetty<br />
#<br />
console<br />
vc/1<br />
vc/2<br />
vc/3<br />
vc/4<br />
vc/5<br />
vc/6<br />
tty0<br />
tty1<br />
tty2<br />
tty3<br />
tty4<br />
tty5<br />
tty6<br />
tty7<br />
<br />
==Configuring qingy==<br />
<br />
You can configure qingy by editing /etc/qingy/settings.<br />
<br />
The default settings for X are fine so only edit them if you really know what you are doing.<br />
# Full path to the X server<br />
#x_server = "/usr/bin/Xorg"<br />
# Full path to the 'xinit' executable<br />
xinit = "/usr/bin/xinit"<br />
# Parameter we should pass to the X server<br />
x_args = "-nolisten tcp -br"<br />
<br />
I recommend to set <br />
log_facilities = console, file<br />
so you can look for errors in /var/log/qingy.log, too.<br />
<br />
All other options are well explained.<br />
<br />
You may need to set the path to the X server e.g.<br />
# Full path to the X server<br />
x_server = "/usr/bin/X"<br />
<br />
==Starting X==<br />
<br />
Please do note that .xinitrc is different from .xsession. The default login script, .xinitrc, works with startx, but graphical login managers generally do not look for .xinitrc. Instead, they look for a file named .xsession in your home directory.<br />
<br />
If you want to start X with qingy you need to edit your .xsession.<br />
<br />
Here a default .xsession for qingy.<br />
#!/bin/sh<br />
exec <login-shell command> <window manager starter><br />
An example:<br />
#!/bin/sh<br />
exec bash --login -c 'openbox-session'<br />
<br />
The start of the window manager using a login shell is needed because qingy starts the X-session directly without the help of a shell.<br />
This causes issues like no umlauts in xterm and malfunction of control keys like "Home", "End", "Del" and so on in the terminal.<br />
<br />
For more details, visit the Ubuntu CustomXSession wiki at [https://wiki.ubuntu.com/CustomXSession]<br />
<br />
==Adding a session entry==<br />
<br />
If you've changed the variable x_sessions or text_session in the config file of qingy replace the following paths with the path you've set.<br />
<br />
===Text mode session===<br />
<br />
Create a file /etc/qingy/sessions/<sessionname>.<br />
<br />
The file name is shown as entry in the session list.<br />
<br />
The file should be a shell script. For an example have a look into /etc/qingy/sessions/emacs.<br />
<br />
===X mode session===<br />
<br />
Create the folder /etc/X11/Sessions/ and save a new script file into it. (see Text mode session)<br />
<br />
The name of the file is shown in the session list.<br />
<br />
==Troubleshooting==<br />
<br />
=== Synaptic touchpad and keyboard issue ===<br />
<br />
Qingy (and quite possibly other DirectFB applications) has some issues using Synaptics touchpad. Also the keyboard can behave strangely (like if each keys were pressed twice).<br />
<br />
This can be solved by adding:<br />
disable-module=linux_input<br />
to /etc/directfbrc. If the file does not exist, create it. This will enable you to use your touchpad, however some extra functionality like tapping or tap-dragging might not work.<br />
<br />
=== ConsoleKit locks tty ===<br />
<br />
If you use ck-launch-session to start your session, then console-kit-daemon will lock currently active tty on it's first start. This is especially nasty if you use x_server_tty=qingy_tty parameter: tty you've logged in first becomes disposable.<br />
<br />
There is a bug about this behavior [https://bugs.freedesktop.org/show_bug.cgi?id=29920] and a workaround: start console-kit-daemon on some useless tty, i.e. 63 by adding this to /etc/rc.local:<br />
<br />
openvt -c 63 -f -- console-kit-daemon --no-daemon &</div>Mamciek