Bootloader::Tools(3)

NAME
Bootloader::Tools - set of high-level bootloader configuration functions

PREFACE
This package contains a set of high-level bootloader configuration functions

SYNOPSIS
"use BootTool;"

"$mp_ref = BootTool::ReadMountPoints ();"

"$part_ref = BootTool::ReadPartitions ();"

"$md_ref = BootTool::ReadMDArrays ();"

"$loader = BootTool::GetBootloader ();"

"BootTool::InitLibrary ();"

"BootTool::AddNewImageSection ($name, $image, $initrd, $default);"

"BootTool::CountImageSections ($image);"

"BootTool::RemoveImageSections ($image);"

DESCRIPTION

"$mp_ref = BootTool::ReadMountPoints ();"
    reads the information about mountpoints in the system. The returned data is needed to initialize the bootloader library properly.

    See InitLibrary function for example.

"$part_ref = BootTool::ReadPartitions ();"
    reads the information about disk partitions. This data is needed to initialize the bootloader library properly.

    See InitLibrary function for example.

"$md_ref = BootTool::ReadMDArrays ();"
    reads the information about disk MD RAID arrays. This data is needed to initialize the bootloader library properly.

"$loader = BootTool::GetBootloader ();"
    returns the used bootloader. Reads the value from sysconfig. Returns the string - bootloader type.

    See InitLibrary function for example.

"BootTool::InitLibrary ();"
    initializes the bootloader configuration library. Fills its internal structures needed for it to run properly.

"BootTool::AddNewImageSection ($name, $image, $initrd, $default);"
    Adds a new section to the bootloader menu via one function call (just the library needs to be initialized before). $initrd and $default are optional, if $default is defined and nonzero, the new section is marked as default.

    EXAMPLE:

      BootTool::InitLibrary ();
      BootTool::AddNewImageSection ("2.6.11", "/boot/vmlinuz-2.6.11", "/boot/initrd-2.6.11", 1);

"BootTool::CountImageSections ($image);"
    counts sections in the bootolader menu reffering to the specified kernel.

    EXAMPLE:

      BootTool::InitLibrary ();
      my $count = BootTool::CountImageSections ("/boot/vmlinuz-2.6.11");
      print "Sections: $count\n";

"BootTool::RemoveImageSections ($image);"
    removes all sections in the bootloader menu referring to the specified kernel.

    EXAMPLE:

      BootTool::InitLibrary ();
      BootTool::RemoveImageSections ("/boot/vmlinuz-2.6.11");