| Linux-Bootloader documentation | view source | Contained in the Linux-Bootloader distribution. |
Linux::Bootloader - Base class interacting with Linux bootloaders
use Linux::Bootloader;
my $bootloader = new Linux::Bootloader();
my $config_file='/boot/grub/menu.lst';
$bootloader->read($config_file);
$bootloader->print_info('all');
$bootloader->add(%hash);
$bootloader->update(%hash);
$bootloader->remove(2);
$bootloader->get_default();
$bootloader->set_default(2);
%hash = $bootloader->read_entry(0);
$bootloader->write($config_file);
This module provides base functions for working with bootloader configuration files.
Creates a new Linux::Bootloader object.
Reads configuration file into an array. Takes: string. Returns: undef on error.
Writes configuration file. Takes: string. Returns: undef on error.
Prints information from config. Takes: string. Returns: undef on error.
Parse config into array of hashes. Takes: nothing. Returns: array of hashes.
Determine current default kernel. Takes: nothing. Returns: integer, undef on error.
Set new default kernel. Takes: integer. Returns: undef on error.
Add new kernel to config. Takes: hash. Returns: undef on error.
Update args of an existing kernel entry. Takes: hash. Returns: undef on error.
Remove kernel from config. Takes: string. Returns: undef on error.
Read an existing entry into a hash suitable to add or update from. Takes: integer or title Returns: undef or hash
Sets or gets the current debug level, 0-5.
Returns: Debug level
Conducts a basic check for kernel validity
Returns: true if checks out okay,
false if not okay,
undef on error
Converts title into position.
Takes: string.
Returns: integer,
undef on error
Jason N., Open Source Development Labs, Engineering Department <eng@osdl.org>
Copyright (C) 2006 Open Source Development Labs All Rights Reserved.
This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Linux-Bootloader documentation | view source | Contained in the Linux-Bootloader distribution. |