]> xenbits.xensource.com Git - people/dariof/xen-tools.git/commitdiff
Add CentOS 6 support
authorJohan Schurer <johannes.schurer@alcatel-lucent.com>
Thu, 7 Jun 2012 10:56:16 +0000 (12:56 +0200)
committerAxel Beckert <abe@deuxchevaux.org>
Thu, 7 Jun 2012 10:56:16 +0000 (12:56 +0200)
16 files changed:
Makefile
hooks/centos-6/10-disable-tls [new symlink]
hooks/centos-6/15-setup-arch [new symlink]
hooks/centos-6/20-setup-yum [new symlink]
hooks/centos-6/25-setup-kernel [new file with mode: 0644]
hooks/centos-6/30-disable-gettys [new symlink]
hooks/centos-6/35-setup-users [new symlink]
hooks/centos-6/40-setup-networking [new symlink]
hooks/centos-6/50-setup-hostname [new symlink]
hooks/centos-6/55-create-dev [new symlink]
hooks/centos-6/65-copy-user-files [new symlink]
hooks/centos-6/70-install-ssh [new symlink]
hooks/centos-6/75-fixup-securetty [new symlink]
hooks/centos-6/80-install-modules [new symlink]
hooks/centos-6/90-make-fstab [new symlink]
hooks/centos-6/99-clean-image [new symlink]

index 1e95e42553cceb62a6d3ca1767ca23081622acbe..5c1915e9550c143e0572ad2b148f47ff31887381 100644 (file)
--- a/Makefile
+++ b/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
diff --git a/hooks/centos-6/10-disable-tls b/hooks/centos-6/10-disable-tls
new file mode 120000 (symlink)
index 0000000..9ae8088
--- /dev/null
@@ -0,0 +1 @@
+../common/10-disable-tls
\ No newline at end of file
diff --git a/hooks/centos-6/15-setup-arch b/hooks/centos-6/15-setup-arch
new file mode 120000 (symlink)
index 0000000..0ecc42a
--- /dev/null
@@ -0,0 +1 @@
+../common/15-disable-hwclock
\ No newline at end of file
diff --git a/hooks/centos-6/20-setup-yum b/hooks/centos-6/20-setup-yum
new file mode 120000 (symlink)
index 0000000..51cb79d
--- /dev/null
@@ -0,0 +1 @@
+../common/20-setup-yum
\ No newline at end of file
diff --git a/hooks/centos-6/25-setup-kernel b/hooks/centos-6/25-setup-kernel
new file mode 100644 (file)
index 0000000..b99b48a
--- /dev/null
@@ -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
diff --git a/hooks/centos-6/30-disable-gettys b/hooks/centos-6/30-disable-gettys
new file mode 120000 (symlink)
index 0000000..114c431
--- /dev/null
@@ -0,0 +1 @@
+../common/30-disable-gettys
\ No newline at end of file
diff --git a/hooks/centos-6/35-setup-users b/hooks/centos-6/35-setup-users
new file mode 120000 (symlink)
index 0000000..d9bff4c
--- /dev/null
@@ -0,0 +1 @@
+../common/35-setup-users
\ No newline at end of file
diff --git a/hooks/centos-6/40-setup-networking b/hooks/centos-6/40-setup-networking
new file mode 120000 (symlink)
index 0000000..22ecdae
--- /dev/null
@@ -0,0 +1 @@
+../common/40-setup-networking-rpm
\ No newline at end of file
diff --git a/hooks/centos-6/50-setup-hostname b/hooks/centos-6/50-setup-hostname
new file mode 120000 (symlink)
index 0000000..8680ec6
--- /dev/null
@@ -0,0 +1 @@
+../common/50-setup-hostname-rpm
\ No newline at end of file
diff --git a/hooks/centos-6/55-create-dev b/hooks/centos-6/55-create-dev
new file mode 120000 (symlink)
index 0000000..1f725c9
--- /dev/null
@@ -0,0 +1 @@
+../common/55-create-dev
\ No newline at end of file
diff --git a/hooks/centos-6/65-copy-user-files b/hooks/centos-6/65-copy-user-files
new file mode 120000 (symlink)
index 0000000..afde6e2
--- /dev/null
@@ -0,0 +1 @@
+../common/65-copy-user-files
\ No newline at end of file
diff --git a/hooks/centos-6/70-install-ssh b/hooks/centos-6/70-install-ssh
new file mode 120000 (symlink)
index 0000000..bfbe615
--- /dev/null
@@ -0,0 +1 @@
+../common/70-install-ssh-rpm
\ No newline at end of file
diff --git a/hooks/centos-6/75-fixup-securetty b/hooks/centos-6/75-fixup-securetty
new file mode 120000 (symlink)
index 0000000..e793d9e
--- /dev/null
@@ -0,0 +1 @@
+../common/75-fixup-securetty
\ No newline at end of file
diff --git a/hooks/centos-6/80-install-modules b/hooks/centos-6/80-install-modules
new file mode 120000 (symlink)
index 0000000..12e39f0
--- /dev/null
@@ -0,0 +1 @@
+../common/80-install-modules-rpm
\ No newline at end of file
diff --git a/hooks/centos-6/90-make-fstab b/hooks/centos-6/90-make-fstab
new file mode 120000 (symlink)
index 0000000..7728b34
--- /dev/null
@@ -0,0 +1 @@
+../common/90-make-fstab
\ No newline at end of file
diff --git a/hooks/centos-6/99-clean-image b/hooks/centos-6/99-clean-image
new file mode 120000 (symlink)
index 0000000..74c22e9
--- /dev/null
@@ -0,0 +1 @@
+../common/99-clean-image-rpm
\ No newline at end of file