Difference between revisions of "HAL"

From CBLFS
Jump to navigationJump to search
(I added the "Contents" section from BLFS.)
(HAL Rules)
 
(43 intermediate revisions by 10 users not shown)
Line 2: Line 2:
 
|-valign="top"
 
|-valign="top"
 
!Download Source:
 
!Download Source:
| http://people.freedesktop.org/~david/dist/hal-0.5.8.1.tar.gz
+
| http://hal.freedesktop.org/releases/hal-{{HAL-Version}}.tar.gz
 
|}
 
|}
  
 
----
 
----
  
== Introduction to HAL ==
+
{{Package-Introduction|HAL is a hardware abstraction layer and aims to provide a live list of devices present in the system at any point in time. HAL tries to understand both physical devices (such as PCI, USB) and the device classes (such as input, net and block) physical devices have, and it allows merging of information from so called device info files specific to a device.
  
HAL is a hardware abstraction layer, which is a piece of software that provides a view of the various hardware attached to a system. In addition to this, HAL keeps detailed metadata for each piece of hardware and provides hooks such that system and desktop-level software can react to changes in the hardware configuration in order to maintain system policy.
+
HAL provides a network API through D-BUS for querying devices and notifying when things change. Finally, HAL provides some monitoring (in an unintrusive way) of devices, presently ethernet link detection and volume mounts are monitored.|http://www.freedesktop.org/Software/hal/}}
  
The most important goal of HAL is to provide plug-and-play facilities for UNIX-like desktops with focus on providing a rich and extensible description of device characteristics and features. One example of the functionality provided by HAL is when you plug in a USB storage device. HAL can automatically create a mount point in /media and mount the device.
+
{{Note|Hal uses now the bklib module which is provided by the util-linux-ng package.
 +
You must build util-linux-ng with --with-fsprobe<nowiki>=</nowiki>builtin option and after build the e2fsprogs package with "--disable-libblkid", "--disable-libuuid" and "--disable-uuidd" options, since those libraries and the uuidd daemon have been moved to the util-linux-ng package.}}
  
 
== Dependencies ==
 
== Dependencies ==
  
As of '''hal-0.5.8''' libvolume_id.so (From Udev) is a required dependency. On multilib systems you must have more then one copy of this library, (32bit,64bit,N32). Please refer to the [http://cross-lfs.org/view/svn/ clfs-svn] book for information on configuring a multilib udev. '''''WARNING: Installing a newer or older version of udev then what is currently installed on your system can cause problems booting because of the frequent changes in the rules format.''''' Please use the same version you currently have, or make the appropriate changes/upgrades to your rule set.
+
As of '''hal-0.5.8''' libvolume_id.so (From Udev) is a required dependency. On multilib systems you must have more than one copy of this library, (32bit,64bit,N32). Please refer to the [http://cross-lfs.org/view/svn/ clfs-svn] book for information on configuring a multilib udev. '''''WARNING: Installing a newer or older version of udev than what is currently installed on your system can cause problems booting because of the frequent changes in the rules format.''''' Please use the same version you currently have, or make the appropriate changes/upgrades to your rule set.
 +
 
 +
== Dependencies ==
  
 
=== Required ===
 
=== Required ===
* [[DBUS]] (With Glib Binding)
+
* [[D-BUS Glib]]
 
* [[Glib2]]
 
* [[Glib2]]
* [[PolicyKit]]
 
 
* [[Python]]
 
* [[Python]]
=== Reccomended ===
+
* [[Perl_Module_XML::Parser]]
 +
=== Recommended ===
 +
* [[Expat]]
 +
* [[hal-info]]
 
* [[PCI Utilities]]
 
* [[PCI Utilities]]
 +
* [[libusb]]
 
* [[usbutils]]
 
* [[usbutils]]
 +
* [[PolicyKit]] and [[ConsoleKit]]
 
=== Optional ===
 
=== Optional ===
 
* [[Parted]]
 
* [[Parted]]
 +
* [[dmidecode]]
 
* [[Acpid]]
 
* [[Acpid]]
* [[Expat]]
 
* [[libusb]]
 
 
* [[Doxygen]]
 
* [[Doxygen]]
 
* [[DocBook Utils]]
 
* [[DocBook Utils]]
 
* [[intltool]]
 
* [[intltool]]
 
* [[Gtk-Doc]]
 
* [[Gtk-Doc]]
 +
* [[pm-utils]]
 +
* [[eject]]
 +
* [[libsmbios]]
  
 
== HalDaemon User/Group ==
 
== HalDaemon User/Group ==
Line 43: Line 52:
 
== Configuration Information ==
 
== Configuration Information ==
  
If you have [[Parted]] installed and you would like to link HAL against libparted pass the following to configure:
+
The following are some options you may wish to pass to HAL:
  
--enable-parted
+
{|
 +
|<i>--enable-parted</i> use [[Parted]]
 +
|-
 +
|<i>--enable-policy-kit</i> use [[PolicyKit]]
 +
|-
 +
|<i>--enable-console-kit</i> use [[ConsoleKit]]
 +
|-
 +
|<i>--enable-acl-management</i> use ACL management
 +
|-
 +
|<i>--enable-umount-helper</i> provide umount.hal helper
 +
|}
  
 
== Non-Multilib ==
 
== Non-Multilib ==
Line 52: Line 71:
  
 
  ./configure --prefix=/usr --sysconfdir=/etc \
 
  ./configure --prefix=/usr --sysconfdir=/etc \
     --libexecdir=/usr/lib/hal --localstatedir=/var &&
+
     --libexecdir=/usr/lib/hal --localstatedir=/var \
 +
    --enable-policy-kit --enable-console-kit \
 +
    --enable-acl-management --enable-umount-helper \
 +
    --enable-parted &&
 
  make
 
  make
  
Line 59: Line 81:
 
  make install &&
 
  make install &&
 
  install -v -m755 -d /var/run/hald
 
  install -v -m755 -d /var/run/hald
 
=== Command Explanations ===
 
 
''--libexecdir=/usr/lib/hal'': This parameter forces the installation of libexec files to /usr/lib/hal instead of /usr/libexec.
 
 
''--localstatedir=/var'': This parameter forces the creation of the pid file to /var/run/hald instead of /usr/var/run/hald.
 
  
 
== Multilib ==
 
== Multilib ==
Line 73: Line 89:
  
 
  export USE_ARCH=32 &&
 
  export USE_ARCH=32 &&
  CC="gcc ${BUILD32}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" \
+
  CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" \
 
  ./configure --prefix=/usr --sysconfdir=/etc \
 
  ./configure --prefix=/usr --sysconfdir=/etc \
     --libexecdir=/usr/lib/hal --localstatedir=/var &&
+
     --libexecdir=/usr/lib/hal --localstatedir=/var \
 +
    --enable-policy-kit --enable-console-kit \
 +
    --enable-acl-management --enable-umount-helper \
 +
    --enable-parted &&
 
  make
 
  make
  
Line 86: Line 105:
  
 
  export USE_ARCH=n32 &&
 
  export USE_ARCH=n32 &&
  CC="gcc ${BUILDN32}" PKG_CONFIG_PATH="${PKG_CONFIG_PATHN32}" \
+
  CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" PKG_CONFIG_PATH="${PKG_CONFIG_PATHN32}" \
 
  ./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib32 \
 
  ./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib32 \
     --libexecdir=/usr/lib/hal --localstatedir=/var &&
+
     --libexecdir=/usr/lib/hal --localstatedir=/var \
 +
    --enable-policy-kit --enable-console-kit \
 +
    --enable-acl-management --enable-umount-helper \
 +
    --enable-parted &&
 
  make
 
  make
  
Line 99: Line 121:
  
 
  export USE_ARCH=64 &&
 
  export USE_ARCH=64 &&
  CC="gcc ${BUILD64}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" \
+
  CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" \
 
  ./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 \
 
  ./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 \
     --libexecdir=/usr/lib/hal --localstatedir=/var &&
+
     --libexecdir=/usr/lib/hal --localstatedir=/var \
 +
    --enable-policy-kit --enable-console-kit \
 +
    --enable-acl-management --enable-umount-helper \
 +
    --enable-parted &&
 
  make
 
  make
  
Line 111: Line 136:
  
 
== Configuration ==
 
== Configuration ==
 +
 +
This would be a good time to install the [[hal-info]] package.
  
 
=== Bootscript ===
 
=== Bootscript ===
  
Install the bootscript from the [[blfs-bootscripts]] package with the following command:
+
Install the bootscript from the [[bootscripts]] package with the following command:
  
 
  make install-haldaemon
 
  make install-haldaemon
  
= Contents =
+
=== HAL Rules ===
 +
 
 +
Download the example preferences.fdi file and install it in /etc/hal/fdi/policy.
 +
 
 +
wget http://cross-lfs.org/~cosmo/wiki_files/preferences.fdi
 +
mv preferences.fdi /etc/hal/fdi/policy/
 +
 
 +
Edit this file to add rules.  Use hal-device-manager to find key values for writing rules.  For example, to prevent HAL from automounting every volume it finds, add lines similar to the following to your preferences.fdi.  This example shows two methods of referencing a device, using the block.device key and using the info.udi key.
 +
 
 +
<nowiki><device>
 +
  <match key="block.device" string="/dev/hda1">
 +
      <merge key="volume.ignore" type="bool">true</merge>
 +
  </match>
 +
</device>
 +
<device>
 +
  <match key="info.udi" string="/org/freedesktop/Hal/devices/volume_uuid_c574fd03_c44f_4a97_85a5_06a112fb636a">
 +
      <merge key="volume.ignore" type="bool">true</merge>
 +
  </match>
 +
</device></nowiki>
 +
 
 +
If you installed [[hal-info]], refer to the *.fdi files in /usr/share/hal/fdi/policy for rules that can be assigned to devices.
 +
 
 +
== Contents ==
  
 
{| style="text-align: left;"
 
{| style="text-align: left;"
Line 129: Line 178:
 
|-valign="top"
 
|-valign="top"
 
! Installed Directories:
 
! Installed Directories:
| /etc/hal, /usr/include/hal, /usr/lib/hal, /usr/share/doc/hal-0.5.7, /usr/share/hal and /var/run/hald
+
| /etc/hal, /usr/include/hal, /usr/lib/hal, /usr/share/doc/hal-{{HAL-Version}}, /usr/share/hal and /var/run/hald
 
|}
 
|}
  
Line 166: Line 215:
 
| contains the API functions required by the HAL storage and volume utility programs.
 
| contains the API functions required by the HAL storage and volume utility programs.
 
|}
 
|}
 +
 +
[[Category:General Utilities]]

Latest revision as of 05:21, 25 January 2010

Download Source: http://hal.freedesktop.org/releases/hal-0.5.14.tar.gz

Introduction to HAL

HAL is a hardware abstraction layer and aims to provide a live list of devices present in the system at any point in time. HAL tries to understand both physical devices (such as PCI, USB) and the device classes (such as input, net and block) physical devices have, and it allows merging of information from so called device info files specific to a device.

HAL provides a network API through D-BUS for querying devices and notifying when things change. Finally, HAL provides some monitoring (in an unintrusive way) of devices, presently ethernet link detection and volume mounts are monitored.

Project Homepage: http://www.freedesktop.org/Software/hal/

Caution.png

Note

Hal uses now the bklib module which is provided by the util-linux-ng package. You must build util-linux-ng with --with-fsprobe=builtin option and after build the e2fsprogs package with "--disable-libblkid", "--disable-libuuid" and "--disable-uuidd" options, since those libraries and the uuidd daemon have been moved to the util-linux-ng package.

Dependencies

As of hal-0.5.8 libvolume_id.so (From Udev) is a required dependency. On multilib systems you must have more than one copy of this library, (32bit,64bit,N32). Please refer to the clfs-svn book for information on configuring a multilib udev. WARNING: Installing a newer or older version of udev than what is currently installed on your system can cause problems booting because of the frequent changes in the rules format. Please use the same version you currently have, or make the appropriate changes/upgrades to your rule set.

Dependencies

Required

Recommended

Optional

HalDaemon User/Group

groupadd -g 19 haldaemon &&
useradd -c "HAL Daemon User" -d /dev/null \
        -u 19 -g haldaemon -s /bin/false haldaemon

Configuration Information

The following are some options you may wish to pass to HAL:

--enable-parted use Parted
--enable-policy-kit use PolicyKit
--enable-console-kit use ConsoleKit
--enable-acl-management use ACL management
--enable-umount-helper provide umount.hal helper

Non-Multilib

Compile the package:

./configure --prefix=/usr --sysconfdir=/etc \
    --libexecdir=/usr/lib/hal --localstatedir=/var \
    --enable-policy-kit --enable-console-kit \
    --enable-acl-management --enable-umount-helper \
    --enable-parted &&
make

Install the package

make install &&
install -v -m755 -d /var/run/hald

Multilib

32Bit

Compile the package:

export USE_ARCH=32 &&
CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" \
./configure --prefix=/usr --sysconfdir=/etc \
    --libexecdir=/usr/lib/hal --localstatedir=/var \
    --enable-policy-kit --enable-console-kit \
    --enable-acl-management --enable-umount-helper \
    --enable-parted &&
make

Install the package

make install &&
unset USE_ARCH

N32

export USE_ARCH=n32 &&
CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" PKG_CONFIG_PATH="${PKG_CONFIG_PATHN32}" \
./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib32 \
    --libexecdir=/usr/lib/hal --localstatedir=/var \
    --enable-policy-kit --enable-console-kit \
    --enable-acl-management --enable-umount-helper \
    --enable-parted &&
make

Install the package

make install &&
unset USE_ARCH

64Bit

export USE_ARCH=64 &&
CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" \
./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 \
    --libexecdir=/usr/lib/hal --localstatedir=/var \
    --enable-policy-kit --enable-console-kit \
    --enable-acl-management --enable-umount-helper \
    --enable-parted &&
make

Install the package

make install &&
unset USE_ARCH &&
install -v -m755 -d /var/run/hald

Configuration

This would be a good time to install the hal-info package.

Bootscript

Install the bootscript from the bootscripts package with the following command:

make install-haldaemon

HAL Rules

Download the example preferences.fdi file and install it in /etc/hal/fdi/policy.

wget http://cross-lfs.org/~cosmo/wiki_files/preferences.fdi
mv preferences.fdi /etc/hal/fdi/policy/

Edit this file to add rules. Use hal-device-manager to find key values for writing rules. For example, to prevent HAL from automounting every volume it finds, add lines similar to the following to your preferences.fdi. This example shows two methods of referencing a device, using the block.device key and using the info.udi key.

<device>
   <match key="block.device" string="/dev/hda1">
      <merge key="volume.ignore" type="bool">true</merge>
   </match>
</device>
<device>
   <match key="info.udi" string="/org/freedesktop/Hal/devices/volume_uuid_c574fd03_c44f_4a97_85a5_06a112fb636a">
      <merge key="volume.ignore" type="bool">true</merge>
   </match>
</device>

If you installed hal-info, refer to the *.fdi files in /usr/share/hal/fdi/policy for rules that can be assigned to devices.

Contents

Installed Programs: hal-device, hal-device-manager, hal-find-by-capability, hal-find-by-property, hal-get-property, hal-set-property, hald and lshal
Installed Libraries: libhal.{so,a} and libhal-storage,{so,a}
Installed Directories: /etc/hal, /usr/include/hal, /usr/lib/hal, /usr/share/doc/hal-0.5.14, /usr/share/hal and /var/run/hald

Short Descriptions

hal-device is used to create, remove or show a HAL device.
hal-device-manager shows a graphical representation of all the devices HAL is aware of. This program requires GNOME-Python. Here is a screenshot of hal-device-manager communicating with the HAL daemon and displaying a tree of device objects. The shown properties in the screenshot are for a device object representing a hard disk.
hal-find-by-capability prints the Unique Device Identifiers for HAL device objects of a given capability.
hal-find-by-property prints the Unique Device Identifiers for HAL device objects where a given property assumes a given value.
hal-get-property retrieves a property from a device.
hal-set-property attempts to set property for a device. Note that, due to security considerations, it may not be possible to set a property.
hald is the HAL daemon program.
lshal shows all devices and their properties. If the --monitor option is given then the device list and all devices are monitored for changes.
libhal.{so,a} contains the API functions required by the HAL programs.
libhal-storage.{so,a} contains the API functions required by the HAL storage and volume utility programs.
Retrieved from "?title=HAL&oldid=19870"