Solaris::DeviceTree::OBP - Utility functions for OBP access
Value access:
$tree = Solaris::DeviceTree::Libdevinfo->new; $aliases = obp_aliases($tree); my $disk = $aliases->{'disk'}; $chosen_boot_device = obp_chosen_boot_device($tree); @boot_devices = obp_boot_devices($tree); @diag_devices = obp_diag_devices($tree);
Path transformation:
$resolved_path = obp_resolve_path( aliases => $aliases, path => "disk:c" );
The Solaris::DeviceTree::OBP module implements functions for manipulating OBP pathes according to IEEE 1275. For most of the functions you need to specify a devicetree containing PROM property nodes, which are most likely to find in an Solaris::DeviceTree::Libdevinfo tree.
Solaris::DeviceTree::OBP
The following functions are exported on demand:
This functions transforms the specified path in an alias-free path using the path resolution procedure described in 1275.pdf - 4.3.1 Path resolution procedure according to the specified reference to an alias mapping.
1275.pdf - 4.3.1 Path resolution procedure
This method returns a reference to a hash which maps all aliases to their corresponding values.
This method returns the device from which the system has most recently booted.
This method returns a list with all boot devices entered in the OBP.
This method returns a list with all diag devices entered in the OBP.
The following export tags are defined:
L</obp_chosen_boot_device>, L</obp_boot_devices>, L</obp_diag_devices>.
L</obp_aliases>.
L</obp_resolve_path>.
In the following example the resolved physical pathname of the device last booted from is printed:
use Solaris::DeviceTree::OBP; use Solaris::DeviceTree::Libdevinfo; my $tree = Solaris::DeviceTree::Libdevinfo->new; $bootpath = $tree->find_prop( devfs_path => "/chosen", prom_prop_name => "bootpath" ); $resolved_path = obp_resolve_path( aliases => $tree->aliases, path => $bootpath->string ); print "Last boot from $resolved_path\n";
Dagobert Michelsen, <dam@baltic-online.de>
Open Firmware Homepage http://playground.sun.com/1275/home.html, eeprom(1m).
1 POD Error
The following errors were encountered while parsing the POD:
=back doesn't take any parameters, but you said =back 4
To install Solaris::DeviceTree::Libdevinfo::Impl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Solaris::DeviceTree::Libdevinfo::Impl
CPAN shell
perl -MCPAN -e shell install Solaris::DeviceTree::Libdevinfo::Impl
For more information on module installation, please visit the detailed CPAN module installation guide.