LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   Handling Kickstart post-install script GUI (https://www.linuxquestions.org/questions/red-hat-31/handling-kickstart-post-install-script-gui-738571/)

adrianmarsh 07-08-2009 06:19 AM

Handling Kickstart post-install script GUI
 
Hi,

I'm experimenting with Kickstart/Centos5.3

Basic question: How can you handle interactive questions from within a kickstart environment, with a graphical installer?


All of my scripts work fine under a text-only install, but when (Anaconda?) is running a GUI and gets to the post-install scripts, my one and only interactive script causes problems.

Basically, I think my script is waiting for input, but (Anaconda?) is hiding the interface. What I see is the graphical install, but it sits there at post-install.

The script is there to ask for the hostname:

Quote:

function sethostname
{
#setup hostname
echo "`date`,sethostname,start" >> $LOG
exec < /dev/tty6 > /dev/tty6
chvt 6
FILE=/etc/sysconfig/network
clear
echo -n "What is my hostname?? : "
read linein
linein=`echo $linein | tr '[:lower:]' '[:upper:]'`
#remove old
cp $FILE $FILE.centos
grep -v HOSTNAME= $FILE.centos > /tmp/a
echo HOSTNAME=$linein >> /tmp/a
mv /tmp/a $FILE
echo "OK: Hostname will be $linein"
echo "`date`,sethostname,stop,$LINEIN" >> $LOG
}
sethostname is called from a script higher up. I found I had to switch tty's.

My ks.cfg is:

Quote:

#platform=x86, AMD64, or Intel EM64T
#vnc --password=secret
# System authorization information
auth --useshadow --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --linux --initlabel
autopart
# Use graphical install
graphical
# Firewall configuration
firewall --disabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard uk
# System language
lang en_GB
# Installation logging level
logging --level=info
# Use network installation
url --url=http://centosmirror.ubiquisys.local/centos/5/os/i386/
repo --name Updates --baseurl=http://centosmirror.ubiquisys.local/centos/5/updates/i386/
#Root password
rootpw --iscrypted xxxxxx
# SELinux configuration
selinux --permissive
# System timezone
timezone Europe/London
# Install OS instead of upgrade
install
# X Window System configuration information
xconfig --defaultdesktop=GNOME --depth=8 --resolution=1024x768
reboot
#POST Install scripts
%post
cd /root
TESTING=TRUE
echo "cd /root
rm /root/post-script-testing.sh 2> /dev/null
wget http://centosmirror.ubiquisys.local/...ipt-testing.sh
sh /root/post-script-testing.sh
rm -f /root/post-script-testing.sh" > run.sh
sh run.sh


(post-script-testing.sh is the parent script that in turn calls the function sethostname)

Dump_Weed 07-08-2009 02:44 PM

We use kick start with cobbler and build the profiles for the servers etc. The best way is to do a text install and feed it all the required information.

adrianmarsh 07-10-2009 08:43 AM

Cobbler ?

mcjohn87 08-10-2009 09:37 PM

thanks so much for useful info

mcjohn87 08-10-2009 09:37 PM

Great work .. really informative .. and thanks a lot for sharing ..
script install


All times are GMT -5. The time now is 06:15 AM.