Add CentOS 6 support
This commit is contained in:
committed by
Axel Beckert
parent
cab677bab0
commit
107bd59724
2
Makefile
2
Makefile
@@ -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
|
||||
|
||||
1
hooks/centos-6/10-disable-tls
Symbolic link
1
hooks/centos-6/10-disable-tls
Symbolic link
@@ -0,0 +1 @@
|
||||
../common/10-disable-tls
|
||||
1
hooks/centos-6/15-setup-arch
Symbolic link
1
hooks/centos-6/15-setup-arch
Symbolic link
@@ -0,0 +1 @@
|
||||
../common/15-disable-hwclock
|
||||
1
hooks/centos-6/20-setup-yum
Symbolic link
1
hooks/centos-6/20-setup-yum
Symbolic link
@@ -0,0 +1 @@
|
||||
../common/20-setup-yum
|
||||
80
hooks/centos-6/25-setup-kernel
Normal file
80
hooks/centos-6/25-setup-kernel
Normal 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
|
||||
1
hooks/centos-6/30-disable-gettys
Symbolic link
1
hooks/centos-6/30-disable-gettys
Symbolic link
@@ -0,0 +1 @@
|
||||
../common/30-disable-gettys
|
||||
1
hooks/centos-6/35-setup-users
Symbolic link
1
hooks/centos-6/35-setup-users
Symbolic link
@@ -0,0 +1 @@
|
||||
../common/35-setup-users
|
||||
1
hooks/centos-6/40-setup-networking
Symbolic link
1
hooks/centos-6/40-setup-networking
Symbolic link
@@ -0,0 +1 @@
|
||||
../common/40-setup-networking-rpm
|
||||
1
hooks/centos-6/50-setup-hostname
Symbolic link
1
hooks/centos-6/50-setup-hostname
Symbolic link
@@ -0,0 +1 @@
|
||||
../common/50-setup-hostname-rpm
|
||||
1
hooks/centos-6/55-create-dev
Symbolic link
1
hooks/centos-6/55-create-dev
Symbolic link
@@ -0,0 +1 @@
|
||||
../common/55-create-dev
|
||||
1
hooks/centos-6/65-copy-user-files
Symbolic link
1
hooks/centos-6/65-copy-user-files
Symbolic link
@@ -0,0 +1 @@
|
||||
../common/65-copy-user-files
|
||||
1
hooks/centos-6/70-install-ssh
Symbolic link
1
hooks/centos-6/70-install-ssh
Symbolic link
@@ -0,0 +1 @@
|
||||
../common/70-install-ssh-rpm
|
||||
1
hooks/centos-6/75-fixup-securetty
Symbolic link
1
hooks/centos-6/75-fixup-securetty
Symbolic link
@@ -0,0 +1 @@
|
||||
../common/75-fixup-securetty
|
||||
1
hooks/centos-6/80-install-modules
Symbolic link
1
hooks/centos-6/80-install-modules
Symbolic link
@@ -0,0 +1 @@
|
||||
../common/80-install-modules-rpm
|
||||
1
hooks/centos-6/90-make-fstab
Symbolic link
1
hooks/centos-6/90-make-fstab
Symbolic link
@@ -0,0 +1 @@
|
||||
../common/90-make-fstab
|
||||
1
hooks/centos-6/99-clean-image
Symbolic link
1
hooks/centos-6/99-clean-image
Symbolic link
@@ -0,0 +1 @@
|
||||
../common/99-clean-image-rpm
|
||||
Reference in New Issue
Block a user