[CentOS] continuing issues with %post

Thu Oct 15 02:17:14 UTC 2009
David Mehler <dave.mehler at gmail.com>

Hello,
I'm trying to do an unattended CentOS 5.3 install. For the most part
it's working. As of right now i'm statically assigning the machine an
IP which i believe will allow %post to resolve names? I also like
knowing where the box will show up.
	I am however having a few issues and I'm probably thinking to
complicated on them. My first one is the fact that updates aren't
working from %post. Under the assumption name resolution is working,
see above with the static configuration, the issue is then most likely
importing of gpg keys. I've got these lines in %post:

# GPG keys
echo "Importing GPG keys ..."
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
/usr/bin/yum -y update

When they're uncommented the box hangs, i'd love to see output.
	My second issue is a cosmetic one. I want to set a standard prompt in
/etc/bashrc. Out of the box the bashrc PS1 lines:

if [ "$PS1" ]; then
[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "

	I have to make changes to that second line so a sed substitution
would probably be my best bet. I'm not sure how to grab the part i
need and change it. Manually i change that line to:

PS1='\u@\h:\w\$'

I'd like to get %post to do that for me.
	Next, i'd like to alter /boot/grub/grub.conf. I want to set it up for
serial terminal support, so i have to add a serial and terminal lines
at the top of the file say after any comment blocks that might or
might not be there plus add console=tty0 and/or console=ttyS0,9600n8
to the append lines to however many kernels are there. Again, i'm
assuming sed but i'm not sure how to get the parts i need and edit.
	I want to do other things, mostly with security, increasing password
complexity requirements and pam, but that should be easy once i figure
out how to alter the right sections in files. Any help appreciated.
Thanks.
Dave.