1
0
mirror of synced 2026-02-26 16:23:27 +00:00

Add CentOS 6 support

This commit is contained in:
Johan Schurer
2012-06-07 12:56:16 +02:00
committed by Axel Beckert
parent cab677bab0
commit 107bd59724
16 changed files with 96 additions and 0 deletions

View File

@@ -148,9 +148,11 @@ install-hooks:
for i in ${prefix}/usr/lib/xen-tools/*.d; do if [ -L "$$i" ]; then rm -vf "$$i"; fi; done
mkdir -p ${prefix}/usr/lib/xen-tools/centos-4.d/
mkdir -p ${prefix}/usr/lib/xen-tools/centos-5.d/
mkdir -p ${prefix}/usr/lib/xen-tools/centos-6.d/
mkdir -p ${prefix}/usr/lib/xen-tools/fedora-core-6.d/
cp -R hooks/centos-4/*-* ${prefix}/usr/lib/xen-tools/centos-4.d
cp -R hooks/centos-5/*-* ${prefix}/usr/lib/xen-tools/centos-5.d
cp -R hooks/centos-6/*-* ${prefix}/usr/lib/xen-tools/centos-6.d
cp -R hooks/fedora-core-6/*-* ${prefix}/usr/lib/xen-tools/fedora-core-6.d
-cd ${prefix}/usr/lib/xen-tools/ && ln -s fedora-core-6.d fedora-core-4.d
-cd ${prefix}/usr/lib/xen-tools/ && ln -s fedora-core-6.d fedora-core-5.d

View File

@@ -0,0 +1 @@
../common/10-disable-tls

View File

@@ -0,0 +1 @@
../common/15-disable-hwclock

1
hooks/centos-6/20-setup-yum Symbolic link
View File

@@ -0,0 +1 @@
../common/20-setup-yum

View File

@@ -0,0 +1,80 @@
#/bin/sh
#
# This script sets up the kernel and fstab for CentOS 5.
#
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
# Make the console work
sed -i "/Cancelled/ {G;s/$/co:2345:respawn:\/sbin\/mingetty console/;}" ${prefix}/etc/inittab
sed -i "s/^1:2345/#1:2345/" ${prefix}/etc/inittab
# MAKEDEV is needed at this point
chroot ${prefix} ln -s /sbin/MAKEDEV /dev/MAKEDEV
chroot ${prefix} /sbin/MAKEDEV sda sdb sdc sdd
# Create fstab
cat > ${prefix}/etc/fstab << EOF
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
none /dev/pts devpts mode=0620 0 0
EOF
for i in `seq 1 $NUMPARTITIONS`; do
echo -n "/dev/sda$i " >> ${prefix}/etc/fstab
eval part=\$PARTITION$i
if [ ! -z "`echo $part | grep swap`" ]; then
echo "none swap ws 0 0" >> ${prefix}/etc/fstab
else
echo $part | awk -F: '{print $4,$3,$5,0,1}' >> ${prefix}/etc/fstab
fi
done
# Install the kernel, grub and perl
chroot ${prefix} yum clean expire-cache
chroot ${prefix} yum -y install kernel-xen grub.x86_64 perl.x86_64
KERNELVERSION=`chroot ${prefix} yum list installed version kernel-xen | grep installed | awk '{print $2}'`xen
# Create grub's menu.list
mkdir -p ${prefix}/boot/grub
cat > ${prefix}/boot/grub/menu.lst << EOF
# WARNING : Don't forget to update this when you upgrade kernel !
# You can also exclude kernel-xen from updates by putting
# exclude=kernel-xen in in [main] in yum.conf
default=0
timeout=5
title CentOS ($KERNELVERSION)
kernel /boot/vmlinuz-$KERNELVERSION
initrd /boot/initrd-$KERNELVERSION.img
EOF
# Some use lvm but mkinitrd will generate a wrong initrd when these are present.
rm -f ${prefix}/etc/lvm/backup/* ${prefix}/etc/lvm/archive/*
# Generate a correct initrd.
chroot ${prefix} mkinitrd --with=xenblk --with=xennet --preload=xenblk --preload=xennet\
-f /boot/initrd-$KERNELVERSION.img $KERNELVERSION
#
# Log our finish
#
logMessage Script $0 finished

View File

@@ -0,0 +1 @@
../common/30-disable-gettys

View File

@@ -0,0 +1 @@
../common/35-setup-users

View File

@@ -0,0 +1 @@
../common/40-setup-networking-rpm

View File

@@ -0,0 +1 @@
../common/50-setup-hostname-rpm

View File

@@ -0,0 +1 @@
../common/55-create-dev

View File

@@ -0,0 +1 @@
../common/65-copy-user-files

View File

@@ -0,0 +1 @@
../common/70-install-ssh-rpm

View File

@@ -0,0 +1 @@
../common/75-fixup-securetty

View File

@@ -0,0 +1 @@
../common/80-install-modules-rpm

View File

@@ -0,0 +1 @@
../common/90-make-fstab

View File

@@ -0,0 +1 @@
../common/99-clean-image-rpm