1
0
mirror of synced 2026-02-25 07:50:01 +00:00
Files
xen-tools.xen-tools/hooks/centos4/20-setup-yum
steve d27df26181 2006-08-18 15:08:24 by steve
1.  Copy "resolv.conf" before running apt-get update / yum update.
      Without this DNS is probably not available/working.

  2.  Copy /etc/sudoers from the host, if we're installing sudo.
2006-08-18 15:08:24 +00:00

57 lines
941 B
Bash
Executable File

#!/bin/sh
#
# This script sets up the Yum for CentOS4.
#
# Steve
# --
# http://www.steve.org.uk/
prefix=$1
#
# Source our common functions
#
if [ -e /usr/lib/xen-tools/common.sh ]; then
. /usr/lib/xen-tools/common.sh
else
. ./hooks/common.sh
fi
#
# Log our start
#
logMessage Script $0 starting
#
# DNS is probably required to run "yum update".
#
cp /etc/resolv.conf ${prefix}/etc
#
# Transform yum so that it works.
#
perl -pi.bak -e 's/enabled=0/enabled=1/g' ${prefix}/etc/yum.repos.d/*.repo
perl -pi.bak -e 's/gpgcheck=1/gpgcheck=0/g' ${prefix}/etc/yum.repos.d/*.repo
perl -pi.bak -e 's/^\#baseurl/baseurl/g' ${prefix}/etc/yum.repos.d/*.repo
perl -pi.bak -e 's/^mirrorlist/#mirrorlist/g' ${prefix}/etc/yum.repos.d/*.repo
perl -pi.bak -e 's/\$releasever/4/g' ${prefix}/etc/yum.repos.d/*.repo
#
# Update yum
#
chroot ${prefix}/usr/bin/yum update
#
# Log our finish
#
logMessage Script $0 finished