[PATCH] lshal - The next generation

Pierre Ossman drzeus-list at drzeus.cx
Mon Oct 31 06:57:04 PST 2005


Richard Hughes wrote:
> On Sun, 2005-10-30 at 21:24 +0100, Pierre Ossman wrote:
>   
>> This is a rather extensive patch to lshal which adds a number of new 
>> functions. My goal was to make it more like lspci or lsusb.
>>
>> * Short and long output, where long is the original output and short 
>> prints as little as possible.
>>
>> * Sorting of devices so that parents always appear above children.
>>
>> * Tree view (only in short mode).
>>
>> * Filter to select just one device (even works with monitor).
>>
>> * Version option (-V).
>>
>> Comments welcome! :)
>>     
>
> Hi Pierre,
>
> Could you attach the outputs of each of the modes here, so we don't have
> to apply and rebuild just to see the output?
>
>   

Sure. A brief summary:

Short mode:

[drzeus at poseidon]$ ./lshal
computer
acpi_PWRF
acpi_C1BE
acpi_C136
acpi_C134
acpi_CPU0
acpi_C11F
computer_alsa_timer
...

[drzeus at poseidon]$ ./lshal -m
computer
acpi_PWRF
...
pnp_PNP0c02
pnp_WEC0518_mmc_host removed
pnp_WEC0518_mmc_host added

Tree mode:

[drzeus at poseidon]$ ./lshal -t
computer
  acpi_PWRF
  acpi_C1BE
...
  pci_8086_24ca
    pci_8086_24ca_ide_0_0
      storage_serial_151N5475S
        volume_uuid_2f8ed5d5_be4b_423b_b914_771314b80730
...

Filter:

[drzeus at poseidon]$ ./lshal -s 
volume_uuid_2f8ed5d5_be4b_423b_b914_771314b80730
volume_uuid_2f8ed5d5_be4b_423b_b914_771314b80730

[drzeus at poseidon]$ ./lshal -s 
volume_uuid_2f8ed5d5_be4b_423b_b914_771314b80730 -l
udi = 
'/org/freedesktop/Hal/devices/volume_uuid_2f8ed5d5_be4b_423b_b914_771314b80730'
  volume.policy.desired_mount_point = 'idedisk'  (string)
  volume.policy.mount_filesystem = 'ext3'  (string)
  volume.policy.should_mount = true  (bool)
  info.udi = 
'/org/freedesktop/Hal/devices/volume_uuid_2f8ed5d5_be4b_423b_b914_771314b80730'  
(string)
  volume.partition.msdos_part_table_type = 131  (0x83)  (int)
  info.product = 'Volume (ext3)'  (string)
  volume.size = 100606464  (0x5ff2200)  (uint64)
  volume.num_blocks = 196497  (0x2ff91)  (int)
  volume.block_size = 512  (0x200)  (int)
  volume.partition.number = 1  (0x1)  (int)
  info.capabilities = {'volume', 'block'} (string list)
  info.category = 'volume'  (string)
  volume.is_partition = true  (bool)
  volume.is_disc = false  (bool)
  volume.is_mounted = true  (bool)
  volume.mount_point = '/boot'  (string)
  volume.label = ''  (string)
  volume.uuid = '2f8ed5d5-be4b-423b-b914-771314b80730'  (string)
  volume.fsversion = ''  (string)
  volume.fsusage = 'filesystem'  (string)
  volume.fstype = 'ext3'  (string)
  block.storage_device = 
'/org/freedesktop/Hal/devices/storage_serial_151N5475S'  (string)
  block.is_volume = true  (bool)
  block.minor = 1  (0x1)  (int)
  block.major = 3  (0x3)  (int)
  block.device = '/dev/hda1'  (string)
  linux.hotplug_type = 3  (0x3)  (int)
  info.parent = '/org/freedesktop/Hal/devices/storage_serial_151N5475S'  
(string)
  linux.sysfs_path_device = '/sys/block/hda/hda1'  (string)
  linux.sysfs_path = '/sys/block/hda/hda1'  (string)

Version:

[drzeus at poseidon]$ ./lshal -V
lshal version 0.5.4

New help:

[drzeus at poseidon]$ ./lshal -h
lshal version 0.5.4

usage : /home/drzeus/Development/hal/tools/.libs/lt-lshal [options]

Options:
    -m, --monitor        Monitor device list
    -l, --long           Long output
    -t, --tree           Tree view
    -s, --show <udi>     Show only the specified device
    -h, --help           Show this information and exit
    -V, --version        Print version number

Shows all devices and their properties. If the --monitor option is given
then the device list and all devices are monitored for changes.

Rgds
Pierre


More information about the hal mailing list