Need help to install packages from external repository during CentOS install
Axel Thimm
Axel.Thimm at ATrpms.net
Sat Jan 26 07:54:08 UTC 2008
Hi Craig,
On Fri, Jan 25, 2008 at 09:22:34AM -0600, Craig Huff wrote:
> About a week ago it was suggested that I use a kickstart file to
> install packages from an external repository (ATrpms) during CentOS
> 5.1 installs, so I have been giving it a go, unsuccessfully. I
> finally got enough information from the failures to figure out the
> problem, but I don't know what the solution is. It appears that
> despite having this:
>
> network --device=eth0 --bootproto=dhcp
>
> in the command section, the network is not working during %post
> execution and probably not during the system installation phase,
> either. I have tried installing nvidia-graphics169.07 (and the
> related pieces) in several ways, none of which worked.
> %post
> ( #Note: using subshell for logging, but it never works.
> yum -y --disablerepo=extras install nvidia-graphics169.07
> ) 1>/root/Anaconda_post.log 2>&1
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
|
| source /etc/sysconfig/network
| hostname ${HOSTNAME}
| hostname=`hostname -s`
| installdir=/srv/domain.tld/install
| installtree=$installdir/installtrees/$hostname
| logdir=$installdir/logs/${hostname}
|
| mkdir -p /dev/shm; mount -t tmpfs none /dev/shm
| mkdir -p $installdir
| mount install.domain.tld:$installdir $installdir
|
| mkdir -p $logdir
| if test -e $installtree/hostscript.sh ; then
| $installtree/hostscript.sh install > $logdir/install-`date +%Y%m%d-%H%M%S`.log 2>&1 < /dev/null
| fi
| mv -f /root/anaconda-ks.cfg $logdir/
| rm -f /srv/domain.tld/install/tftpboot/pxelinux.cfg/AAAAAAAA
|
| umount $installdir
| umount /dev/shm; rmdir /dev/shm
It's a bit obfuscated to protect the customers' data (e.g. the
domain.tld and AAAAAAAA bits). But it basically boils down to adding
as much as is needed for proper netwroking support, nfs-mounting a
central folder and calling a postinstall script there.
In this script I copy over the *.repo files I need and call yum
(actually that's a lie I'm copying channels and use smart, but it will
work with yum as well).
Using the above method gives you at the very least a cheap way to
centrally monitor your installs. There is also cobbler, a project that
does this in a more professional way: http://cobbler.et.redhat.com/
--
Axel.Thimm at ATrpms.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/kickstart-list/attachments/20080126/0489e13e/attachment.sig>
More information about the Kickstart-list
mailing list