RHEL Kickstart Pre-Install script

Hey all,

I'm not sure if this possible but I had tested it out manually during the installation (placed a sleep in the pre-installation) and it worked. I'm trying to have a pexpect script to log into the mysql and input a new row for the pre-installation, which will end up displaying on a web page stating the installation is starting. (later in the post installation stating its complete). I'm running out ideas, a beginner can only bang his head against the wall so much :wall:

%pre
#!/bin/sh
mkdir /pexpect
mount 192.168.16.1:/pexpect /pexpect
mount 192.168.16.1:/usr/lib /usr/lib
cd /pexpect/pexpect-2.3/
python setup.py install
 
#!/usr/bin/env python
import pexpect
import getpass, os
import sys, time
child = pexpect.spawn('ssh root@192.168.16.1')
child.expect("Are you sure you want to continue connecting (yes/)?")
child.sendline('yes')
child.expect('password: ')
child.sendline('root_pass')
child.expect('#')
child.sendline('/usr/bin/mysql --user=user --password=pass mysql')
time.sleep (1)
child.expect('mysql>')
child.sendline('use Test;')
child.expect('mysql>')
child.sendline("INSERT INTO system_check (Serial_Number,Description")
child.expect('->')
child.sendline(" VALUES ('KQxXxXx','Kickstart Test');")
child.expect('mysql>')
child.sendline('exit;')
child.expect('#')
child.sendline('exit')
child.close()
 
%post

---------- Post updated at 08:02 PM ---------- Previous update was at 01:17 PM ----------

I got a little bit farther.

It seems to have been erroring out because it couldn't recognize the import command and needed the libMagick.so.10 file. So added the following to the shell portion

mount 192.168.16.1:/usr/lib64 /usr/lib64
mount 192.168.16.1:/usr/bin /usr/bin

Its hanging now at 'Running kickstart %%pre script(s)'.

While it was hung I tried going to another vty but it couldn't recognize any commands.

Any thought?