Kickstart and Hostnames

The basic purpose to use kickstarts is to install numerous systems at a time with given para.

Configuring each system post install is tedious.

I found a workaround (that worked for me on Oracle Linux 6 and RHEL 6 and should most probably work for similar distros) to automate this task post install as well. If you know better solution, drop a comment below.

In the %post% section,

Add this:

exec < /dev/tty6 > /dev/tty6 2> /dev/tty6
chvt 6

This will switch to the 6th TTY and will drop into interactive shell. This allows installer to ask for information.Let's try to ask for information:

Now that we have information, we can use the inbuilt cmd to configure the interface. I assumed first interface as eth0 (which it is in most cases. If you are not sure, you might want to add this to automation to detect what interface you have).

The system-config-network-cmd helps us import /tmp/network-config file.Restarting network service later loads the new configuration.To drop out of the TTY 6 and resume back to anaconda use chvt trick again: