I'm attempting to achieve a hands off Linux installation with minimal input from the user. I've been successful so far with the exception of including the network parameters. I've included within my Kickstart the following code:
%include /tmp/network.txt
%pre
#!/bin/bash
exec < /dev/tty3 > /dev/tty3 2>&1
chvt 3
HOSTNAME=""
IPADDR=""
NETMASK=""
GATEWAY=""
while [ "$HOSTNAME" == "" ]; do
clear
echo " *** Please enter the hostname: *** "
echo
read -p "Hostname: " HOSTNAME
done
clear
while [ "$IPADDR" == "" ]; do
echo " *** Please enter the IP address: ***"
echo
read -p "IP Address: " IPADDR
done
clear
while [ "$NETMASK" == "" ]; do
echo " *** Please enter the netmask: ***"
echo
read -p "Netmask: " NETMASK
done
clear
while [ "$GATEWAY" == "" ]; do
echo " *** Please enter default gateway: ***"
echo
read -p "Default Gateway: " GATEWAY
done
clear
chvt 1
echo "network --device eth0 --bootproto static --noipv6 --hostname=${HOSTNAME} --ip=${IPADDR} --netmask=${NETMASK} --gateway=${GATEWAY}" > /tmp/network.txt
%end
Which works fine. I can see the relevant prompts i.e. hostname, ipaddr and netmask during the installation. There are probably better ways to gather this type of information but at this point I'm just trying to capture it and use it accordingly. The problem I have is that the pre script always kicks in after the point where the anaconda installer normally asks for this type of information (Manual TCP/IP Configuration). No matter where I place the %include /tmp/network.txt
it seems I always see the manual TCP/IP section of the installer prior to the output of the pre script. I've yet to check the contents of the /tmp/network.txt
file and ensure everything is correct so I'll do that next.
Any pointers; simular experiences and tips would be greatly appreciated.
Thanks, DJC.