Installing a Custom Operating System with HP Insight Control for Linux

8
After you sourced in the GUID.vars file, you can begin substituting the macros in your installation
configuration file with actual values. Insight Control for Linux makes a copy of your original
installation configuration file and names it
/opt/repository/instconfig/custom/tmp/GUID.template
Therefore, you perform macro substitutions on the copy, not in the original installation configuration
file. You can use the template_file variable contained in GUID.vars file to refer to the copy.
The following example illustrates how a macro substitution works. This example substitutes the
%%password%% macro in a Kickstart file with the root password of the target server. First, this script
determines if the root password is encrypted. Then the %%password%% macro is substituted with the
appropriate value, depending on whether the password is encrypted.
passwd_macro() {
FILE=$1
if [ "${password_encrypted}" == "true" ]
then
/bin/sed -i 's!%%password%%!--iscrypted \
'${root_password}'!g' ${FILE}
else
/bin/sed -i 's!%%password%%! \
'${root_password}'!g' ${FILE}
fi
}
During an unattended installation, there are two messages that the installation configuration file
must send, as it is being executed on the target server, to Insight Control for Linux on the CMS.
The first message is usually sent from the pre-script section of the installation configuration file to let
Insight Control for Linux know that the OS’s installer has started successfully on the target server. For
example, your installation configuration file must contain a macro similar to the one shown here in the
pre-script section:
%pre
%%osramdiskup%%
Your auto_config script substitutes variables contained in the GUID.vars file for the
%%osramdiskup%% macro, The %%osramdiskup%% macro is shown here:
osramdiskup_macro() {
FILE=$1
cmd="wget -O /dev/null
http://${cms_http_ip}:${cms_http_port}/taskservice/osRamDiskUp.jsp\\\\\\?
N=${guid}\\\\\\&K=${security_key}"
/bin/sed -i 's!%%osramdiskup%%!'"$cmd"'!g' ${FILE}
}
Thus, after the auto_config script runs, the pre-script section of your Kickstart file might resemble
the following:
%pre
wget -O /dev/null
http://172.0.0.100:60000/taskservice/osRamDiskUp.jsp\?N=00000026551f557c0
000000300000002\&K=423037