Go to main content

man pages section 3: Extended Library Functions, Volume 1

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

devfs_bootdev_set_list (3DEVINFO)

Name

devfs_bootdev_set_list -

Synopsis

#include <device_info.h>
int devfs_bootdev_set_list(const char *dev_name,
const uint_t options)

Parameters

dev_name

Non-NULL string containing the absolute path name for a logical device, /dev. If BOOTDEV_LITERAL is specified in option, this parameter must contain a prom device name or alias.

options

Flag indicating modifications to the default behavior of devfs_bootdev_set_list(). If options is 0, the default behavior is assumed.

Default behavior is to prepend the boot-device entry and to use the most compact representation of the device name possible, that is, resolve to an alias if possible. Flag values are set by performing the "or" operation on the appropriate flag values. Valid values are:

BOOTDEV_LITERAL

Disables automatic aliasing and uses device_name value explicitly

BOOTDEV_PROMDEV

Translates device_name to the equivalent prom device path name

BOOT_OVERWRITE

Overwrites the existing entries with the new entries

Description

Modifies the default boot device list in the corresponding system boot firmware on OBP systems, when possible.

The supported modifications are:

  1. Prepends the entry. Inserts an entry at the head of the boot-device list. If the device being prepended resolves to the same prom path as another entry in the list, the existing entry is removed from its current location before the prepend operation is executed. In this case, the prepend action implements an entry relocation. This is the default behavior.

  2. Overwrites the list with a single entry. Removes all existing boot device values, and then prepends the entry to the head of the now-empty list. For more information, see BOOTDEV_OVERWRITE.

The function attempts to resolve device_name to a prom name in the following manner, in order of preference:

  1. Exact Alias match

    Finds an alias which is an exact match to the prom path name, with defaults expanded. If there are multiple entries, the first alias found in collation order is used.

  2. Inexact Alias match

    If an alias matches all but the minor device specifier, then that alias is used with the :specifier override. If there are multiple entries, the first alias found in collation order is used.

  3. Prom Path Match

    Uses the absolute prom path name, with defaults expanded.


Note -  Selecting by collation order, we keep the function's action in line with the devfs_get_prom_names() interface.

The level of resolution may be restricted by setting the appropriate values in the options_flag.


Note -  Restrictions: SPARC only.

Return Values

The devfs_bootdev_set_list() function returns the following values:

0

Device specified successfully is set as the default boot device.

<0

Attempt to set default boot device failed. Possible causes of failure are:

DEVFS_NOMEM

No memory.

DEVFS_INVAL

Invalid argument.

DEVFS_ERR

diag-switch? or diagonistic-mode? configuration variable is turned on.

DEVFS_PERM

Not root

DEVFS_NOTSUP

Operation not supported.