Thursday, June 25, 2009


Setup Xen 3.4.1 Dom0 on top of Ubuntu 9.04 Server via Marc - A. Dahlhaus's UDEV patch


Per Marc - A. Dahlhaus:-
Udev removed the udevinfo symlink from versions higher than 123 and xens build-system could not detect if udev is in place and has the required version. In particular, Ubuntu 9.04 server has udev version
141 and appears to be affected by this issue. Straight forward Xen 3.4.1 build brings up Xen Host with hotplug scripts rejecting to work.
The recent patch suggested by Marc resolves this problem.
Brief description of Xen 3.4.1 build follows bellow. First – install on Uubuntu 9.04 Server all packages required for Xen build:-

libcurl4-openssl-dev
xserver-xorg-dev
python2.6-dev
python2.5
python2.5-dev
mercurial
gitk
build-essential
libncurses5-dev
uuid-dev
gawk
gettext
texinfo
bcc

Second step :-

# cd /usr/src
# hg clone http://xenbits.xensource.com/xen-3.4-testing.hg
# cd xen-3.4-testing.hg
Set in Config.mk
PYTHON = python
PYTHON_PREFIX_ARG =

Apply patch :-

--- xen-3.4.0.orig/tools/hotplug/Linux/Makefile
+++ xen-3.4.0/tools/hotplug/Linux/Makefile
@@ -28,6 +28,12 @@ XEN_SCRIPT_DATA += vtpm-migration.sh vtp
XEN_HOTPLUG_DIR = /etc/hotplug
XEN_HOTPLUG_SCRIPTS = xen-backend.agent
+ifeq ($(shell [ -x /sbin/udevadm ] && echo 1),1)
+UDEVINFO = /sbin/udevadm
+else
+UDEVINFO = /usr/bin/udevinfo
+endif
+
UDEV_RULES_DIR = /etc/udev
UDEV_RULES = xen-backend.rules xend.rules
@@ -36,7 +43,7 @@ DE = $(if $(DESTDIR),$(shell readlink -f
ifeq ($(findstring $(DI),$(DE)),$(DI))
HOTPLUGS=install-hotplug install-udev
else
-ifeq ($(shell [ -x /usr/bin/udevinfo ] && [ `/usr/bin/udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/'` -ge 059 ] && echo 1),1)
+ifeq ($(shell [ -x $(UDEVINFO) -a `$(UDEVINFO) -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/'` -ge 059 ] && echo 1),1)
HOTPLUGS=install-udev
else
HOTPLUGS=install-hotplug
--- xen-3.4.0.orig/tools/check/check_udev
+++ xen-3.4.0/tools/check/check_udev
@@ -8,8 +8,10 @@ OpenBSD|NetBSD|FreeBSD)
has_or_fail vnconfig
;;
Linux)
- has_or_fail udevinfo
- [ "`udevinfo -V | awk '{print $NF}'`" -ge 59 ] 2>/dev/null || \
+ has /sbin/udevadm && udevver=`/sbin/udevadm -V`
+ [ -z "$udevver" ] && has_or_fail udevinfo && \
+ udevver=`udevinfo -V | awk '{print $NF}'`
+ [ "$udevver" -ge 59 ] 2>/dev/null || \
has hotplug || \
fail "udev is too old, upgrade to version 59 or later"
;;
--- xen-3.4.0.orig/install.sh
+++ xen-3.4.0/install.sh
@@ -30,6 +30,8 @@ echo "Installing Xen from '$src' to '$ds
[ -x "$(which udevinfo)" ] && \
UDEV_VERSION=$(udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
+[ -z "$UDEV_VERSION" -a -x /sbin/udevadm ] && UDEV_VERSION=$(/sbin/udevadm -V)
+
if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then
echo " - installing for udev-based system"
rm -rf "$tmp/etc/hotplug"

Now build

# make install-xen
# make install-tools

Install pvops enabled kernel from Jeremy Fitzhradinge git repository:-
Checkout the most recent branch:-

# git clone git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git linux-2.6-xen
# cd linux-2.6-xen
# git checkout origin/xen-tip/next -b xen-tip/next

Setup Xen Dom0 Support

# make menuconfig















Now build kernel

# make
# make modules_install install
# mkinitramfs -o /boot/initrd-2.6.30-rc6-tip.img 2.6.30-rc6-tip

Add entry to /boot/grub/menu.lst:-

title Xen 3.4 / Ubuntu 9.04 kernel 2.6.30-rc6-tip
uuid 34d2c0bd-fe30-47e0-990e-4921caf1e845
kernel /boot/xen-3.4.gz
module /boot/vmlinuz-2.6.30-rc6-tip root=/dev/sda14 ro console=tty0
module /boot/initrd-2.6.30-rc6-tip.img



F11 PV DomU install snapshots:-


























Remote vinagre console