NAME

Tapper::Installer::Precondition

SYNOPSIS

use Tapper::Installer::Precondition;

NAME

Tapper::Installer::Precondition - Base class with common functions for Tapper::Installer::Precondition modules

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

cleanup

Clean up all remaining preparations (given in config).

@return success - 0 @return error - error string

handle_source_url

A preconditions source may need some preparation, e.g. if it's located on an NFS share we need to mount this share. This function handles these preparations.

@param hash ref - precondition

@return success - hash ref with updated precondition @return error - error string

precondition_install

Install a precondition with preparations up front. This could be mounting an NFS share or installing inside a virtualisation guest or even no preparation at all.

A guest can be given as image, partition or directory. This function makes the necessary preparations, calls the right precondition install function and cleans up afterwards. An image can be given as file name and partition or file name only. The later is supposed to be an image file containing just one partition.

@param hash ref - precondition

@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

AUTHORS

  • AMD OSRC Tapper Team <tapper@amd64.org>

  • Tapper Team <tapper-ops@amazon.com>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2024 by Advanced Micro Devices, Inc.

This is free software, licensed under:

The (two-clause) FreeBSD License