Need help to install packages from external repository during CentOS install

Craig Huff huffcslists at gmail.com
Mon Jan 28 00:25:30 UTC 2008


On Jan 26, 2008 1:54 AM, Axel Thimm <Axel.Thimm at atrpms.net> wrote:
> Hi Craig,
>
> This is what I use for DHCP/PXE kickstart files that are compatible
> from FC5-F9 and RHEL4-5:
>
> | %post --interpreter /bin/sh
> | #! /bin/sh
> |
> | exec > /root/post-install.log 2>&1
> | set -vx
> |
<snip>
> |
>

FWIW, I finally found the roots of my problem getting a %post script
to work on a CentOS 5.1 install.  They were two fold:
First, I made the mistake of editing my ks.cfg file on a windoze pc at
one point which inserted cr/lf pairs at the ends of all the lines.  It
seems that this was okay in the command section and the %packages
section, but the shell interpreting the %post script went nuts,
thinking they were text tokens and complaining about them not being
valid parameters to all the commands (as far as it went before
aborting).  To make matters worse, I wasn't seeing them when I edited
with vi on my linux boxen because apparently the "enhanced with vim"
vi editors automatically made allowances and treated it as a "dosfile"
so it wasn't until it registered that ^M wasn't a linefeed character
but a carriage return that I figured out what was amiss.  Changed the
file type in a vi edit session on the file and all was fixed
automagically.  Finally I was getting a log file and able to see what
else was amiss.
Then I had to deal with the second problem -- network access problems.
 It took me awhile to determine that while the documentation implied
that networking would be available if I specified the networking
parameters even for a CD based install, my DHCP based install would
not be able to resolve names to IP addresses.  I tried using nslookup
to get IP addresses for the repositories and other links, but even
when I got ones that would work, that didn't solve the problem.  A
call to ifconfig in my %post script told the sad story.  No IP, no
networking.  Period. Axel's example (excerpted above) got me going and
eventually I just ran "/etc/init.d/network start" at the start of my
%post script.  Once I got there, I had full network support, including
name resolution, so back to name references in the network calls for
repositories and wgets of GPG keys, etc.

BTW, I am using a USB thumb drive since there's no spare disk or
floppy drive to use for the kickstart file and I find that I have to
boot the system into a linux session and reboot with "shutdown -r now"
or else the install CD environment won't see the USB drive.  Even when
it does, it reports that it couldn't find the kickstart file and I
have to hit return to say I *really* meant the path I gave and again
to say "go look again" before it will find the kickstart file and take
off.

Hope this helps someone else spend less time scratching their head and
more time making progress.

Craig.




More information about the Kickstart-list mailing list