NAME
Tapper::Installer::Precondition - Base class with common functions for Tapper::Installer::Precondition modules
SYNOPSIS
use Tapper::Installer::Precondition;
FUNCTIONS
get_file_type
Return the file type of a given file. "rpm, "deb", "tar", "gzip", "bz2" and "iso" 9660 cd images are recognised at the moment. If file does not exists at the given file name, only suffix analysis will be available. To enforce any of the above mentioned types, just set the suffix of the file accordingly.
@param string - file name
@returnlist success - (0, rpm|deb|iso|tar|gzip|bzip2) @returnlist error - (1, error string)
gethostname
This function returns the host name of the machine. When NFS root is used together with DHCP the hostname set in the kernel usually equals the IP address received from DHCP as a string. In this case the kernel hostname is set to the DNS hostname associated to this IP address.
@return hostname of the machine as set in the kernel
log_and_exec
Execute a given command. Make sure the command is logged if requested and none of its output pollutes the console. In scalar context the function returns 0 for success and the output of the command on error. In array context the function always return a list containing the return value of the command and the output of the command.
@param string - command
@return success - 0 @return error - error string @returnlist success - (0, output) @returnlist error - (return value of command, output)
guest_install
Execute a command given as first parameter inside the partition given as second parameter which may be inside the image file given as third parameter or a device name (in which case the third arguement has to be undef)
@param sub - execute this function with base dir set to mounted image file @param string - partition number to mount inside the image @param string - (optional) image file path
@return success - 0 @return error - error string
file_save
Save output as file for MCP to find it and upload it to reports receiver.
@param string - output to be written to file @param string - basename of the file to write output to
@return success - 0 @return errorr - error string
AUTHOR
AMD OSRC Tapper Team, <tapper at amd64.org>
BUGS
None.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Tapper
ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
Copyright 2008-2011 AMD OSRC Tapper Team, all rights reserved.
This program is released under the following license: freebsd