I'm currently trying to figure out a smart way to set IP, hostname, gateway and DNS settings during a kickstart (with user input during the kickstart). Doing this with firstboot after the install is not acceptable, so this must be done during %post.
I've tried to run the system-config-network
tool during post in tty6:
#!/bin/sh
chvt 6
exec < /dev/tty6 > /dev/tty6
/mnt/sysimage/usr/bin/system-config-network-tui
This doesn't work since for some reason I'm unable to catch user input.
I would prefer to use built in tools to change this during post, rather than write my own bash script to do this, since using the provided tools is less likely to break anything.
Does someone done anything like this or similar, and made it work?
Thanks
Well this is stupid. I use cobbler which already have support for setting hostname, ip, subnet and dns information. You have to add it as a system, like this:
cobbler system add --name=[...] --profile=[...]--ip=10.1.1.2 --gateway=10.1.1.1 --hostname=yourhostname.exmaple.org --name-servers="10.1.1.1" --static=true --mac=00:50:56:af:56:22
Cobbler then have a snippet that applies this for you, called "post_install_network_config". Let me know if anyone have any questions.
I know this is an old question, but I wanted to contribute this answer for any one finding this by search:
network --device=eth0 --bootproto=query
CentOS Wiki: Tips and tricks for anaconda and kickstart
I am downloading a script with
wget
and add the script to/etc/rc.d/rc.local
. Inside the script I am commenting the entry in rc.local so it does not run at further boots. In this script I am doing all the stuff I had in%post
.Edit:
In
%post
section of the KickStart script I have:So I do not have to connect on the machine that I am installing. Only on the KickStart server I will do the changes. On the KickStart server I have an apache and
192.168.1.10
is the IP address of the KickStart server.Edit:
Have you tried to use
open
?It looks like you're trying to set them with static values. If possible, use DHCP to set these items instead.
You mentioned trying to do user interaction during kickstart. I don't think that is possible, although I could be wrong. I do know that user interaction during RPM installations is impossible; this would make it impossible to script. The same could(and if I were the head architect , would) be impossible and for the same reasons. Instead, place these values on a floppy disk.