[CentOS] continuing issues with %post

Christoph Maser cmr at financial.com
Fri Oct 16 07:46:33 UTC 2009


Am Donnerstag, den 15.10.2009, 04:17 +0200 schrieb David Mehler:
> 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*

Wich keys are that? You don't need that for the standard repos.

> /usr/bin/yum -y update

The yum is obsolete use the repo kickstart feature instead.


> When they're uncommented the box hangs, i'd love to see output.

Change to vt3, manually by using Alt+F3, automatic by using "chvt 3" as
first line in %post

>       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.
Well sed is a choice or patch or maybe replace the file all together.

>       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.

If you use the serial console already at installation everything will be
done for you. Appends will be automatically set and dealt with on kernel
updates.

>       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.
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos


financial.com AG

Munich head office/Hauptsitz München: Maria-Probst-Str. 19 | 80939 München | Germany
Frankfurt branch office/Niederlassung Frankfurt: Messeturm | Friedrich-Ebert-Anlage 49 | 60327 Frankfurt | Germany
Management board/Vorstand: Dr. Steffen Boehnert | Dr. Alexis Eisenhofer | Dr. Yann Samson | Matthias Wiederwach
Supervisory board/Aufsichtsrat: Dr. Dr. Ernst zur Linden (chairman/Vorsitzender)
Register court/Handelsregister: Munich – HRB 128 972 | Sales tax ID number/St.Nr.: DE205 370 553


More information about the CentOS mailing list